erosolar-cli 1.7.195 → 1.7.196
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,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Tool Runtime
|
|
3
|
+
*
|
|
4
|
+
* Core tool execution engine with caching, validation, and lifecycle management.
|
|
5
|
+
* Combines the best features from both TypeScript and Python implementations.
|
|
6
|
+
*
|
|
7
|
+
* Principal Investigator: Bo Shang
|
|
8
|
+
* Framework: erosolar-cli
|
|
9
|
+
*/
|
|
10
|
+
import type { ToolDefinition, ToolSuite, ToolRecord, ToolCallRequest, ToolCallResult, ProviderToolDefinition } from './types.js';
|
|
11
|
+
import { ToolArgumentValidationError } from './schema.js';
|
|
12
|
+
import { validateToolPreconditions, type PreflightWarning } from '../toolPreconditions.js';
|
|
13
|
+
/**
|
|
14
|
+
* Tools that can be safely cached based on their arguments
|
|
15
|
+
*/
|
|
16
|
+
export declare const CACHEABLE_TOOLS: Set<string>;
|
|
17
|
+
export interface ToolRuntimeConfig {
|
|
18
|
+
enableCache: boolean;
|
|
19
|
+
cacheTtlMs: number;
|
|
20
|
+
maxCacheSize: number;
|
|
21
|
+
defaultTimeoutMs: number;
|
|
22
|
+
networkTimeoutMs: number;
|
|
23
|
+
maxOutputLength: number;
|
|
24
|
+
verbose: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface CacheEntry {
|
|
27
|
+
output: string;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
ttl: number;
|
|
30
|
+
hitCount: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Observer interface for tool lifecycle events
|
|
34
|
+
*/
|
|
35
|
+
export interface ToolRuntimeObserver {
|
|
36
|
+
onToolStart?(call: ToolCallRequest): void;
|
|
37
|
+
onToolResult?(call: ToolCallRequest, result: ToolCallResult): void;
|
|
38
|
+
onToolError?(call: ToolCallRequest, error: Error): void;
|
|
39
|
+
onToolWarning?(call: ToolCallRequest, warning: PreflightWarning | string): void;
|
|
40
|
+
onCacheHit?(call: ToolCallRequest, entry: CacheEntry): void;
|
|
41
|
+
onCacheMiss?(call: ToolCallRequest): void;
|
|
42
|
+
onValidationError?(call: ToolCallRequest, error: ToolArgumentValidationError): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Unified Tool Runtime
|
|
46
|
+
*
|
|
47
|
+
* Manages tool registration, execution, caching, and validation.
|
|
48
|
+
*/
|
|
49
|
+
export declare class ToolRuntime {
|
|
50
|
+
private registry;
|
|
51
|
+
private cache;
|
|
52
|
+
private config;
|
|
53
|
+
private observers;
|
|
54
|
+
private executionStats;
|
|
55
|
+
constructor(config?: Partial<ToolRuntimeConfig>);
|
|
56
|
+
/**
|
|
57
|
+
* Register a tool suite
|
|
58
|
+
*/
|
|
59
|
+
registerSuite(suite: ToolSuite): void;
|
|
60
|
+
/**
|
|
61
|
+
* Register a single tool
|
|
62
|
+
*/
|
|
63
|
+
registerTool(tool: ToolDefinition, suiteName?: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Unregister a tool
|
|
66
|
+
*/
|
|
67
|
+
unregisterTool(name: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get a tool by name
|
|
70
|
+
*/
|
|
71
|
+
getTool(name: string): ToolRecord | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Check if a tool exists
|
|
74
|
+
*/
|
|
75
|
+
hasTool(name: string): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Enable or disable a tool
|
|
78
|
+
*/
|
|
79
|
+
setToolEnabled(name: string, enabled: boolean): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Execute a tool call
|
|
82
|
+
*/
|
|
83
|
+
execute(call: ToolCallRequest): Promise<ToolCallResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Execute with timeout
|
|
86
|
+
*/
|
|
87
|
+
private executeWithTimeout;
|
|
88
|
+
/**
|
|
89
|
+
* Create an error result
|
|
90
|
+
*/
|
|
91
|
+
private createErrorResult;
|
|
92
|
+
/**
|
|
93
|
+
* Check if a tool's results can be cached
|
|
94
|
+
*/
|
|
95
|
+
private isCacheable;
|
|
96
|
+
/**
|
|
97
|
+
* Generate cache key for a tool call
|
|
98
|
+
*/
|
|
99
|
+
private getCacheKey;
|
|
100
|
+
/**
|
|
101
|
+
* Check if a cache entry has expired
|
|
102
|
+
*/
|
|
103
|
+
private isCacheExpired;
|
|
104
|
+
/**
|
|
105
|
+
* Cache a result
|
|
106
|
+
*/
|
|
107
|
+
private cacheResult;
|
|
108
|
+
/**
|
|
109
|
+
* Evict oldest cache entries
|
|
110
|
+
*/
|
|
111
|
+
private evictOldestCacheEntries;
|
|
112
|
+
/**
|
|
113
|
+
* Clear all cache entries
|
|
114
|
+
*/
|
|
115
|
+
clearCache(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Clear expired cache entries
|
|
118
|
+
*/
|
|
119
|
+
clearExpiredCache(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Truncate output if too long
|
|
122
|
+
*
|
|
123
|
+
* PERF: Uses efficient slicing - O(1) for length check, O(n) for truncation only when needed.
|
|
124
|
+
* Binary search not applicable here as we need character boundaries, not search.
|
|
125
|
+
*/
|
|
126
|
+
private truncateOutput;
|
|
127
|
+
/**
|
|
128
|
+
* Add an observer
|
|
129
|
+
*/
|
|
130
|
+
addObserver(observer: ToolRuntimeObserver): void;
|
|
131
|
+
/**
|
|
132
|
+
* Remove an observer
|
|
133
|
+
*/
|
|
134
|
+
removeObserver(observer: ToolRuntimeObserver): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Notify observers of an event
|
|
137
|
+
*/
|
|
138
|
+
private notifyObservers;
|
|
139
|
+
/**
|
|
140
|
+
* Get tools in provider format
|
|
141
|
+
*/
|
|
142
|
+
listProviderTools(): ProviderToolDefinition[];
|
|
143
|
+
/**
|
|
144
|
+
* Get tools for a specific category
|
|
145
|
+
*/
|
|
146
|
+
getToolsByCategory(category: string): ToolRecord[];
|
|
147
|
+
/**
|
|
148
|
+
* Get execution statistics
|
|
149
|
+
*/
|
|
150
|
+
getStats(): {
|
|
151
|
+
totalCalls: number;
|
|
152
|
+
cacheHits: number;
|
|
153
|
+
cacheHitRate: number;
|
|
154
|
+
errors: number;
|
|
155
|
+
errorRate: number;
|
|
156
|
+
avgExecutionTimeMs: number;
|
|
157
|
+
registeredTools: number;
|
|
158
|
+
cacheSize: number;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Reset statistics
|
|
162
|
+
*/
|
|
163
|
+
resetStats(): void;
|
|
164
|
+
/**
|
|
165
|
+
* Get tool execution counts
|
|
166
|
+
*/
|
|
167
|
+
getToolExecutionCounts(): Map<string, number>;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create a tool runtime with default configuration
|
|
171
|
+
*/
|
|
172
|
+
export declare function createToolRuntime(config?: Partial<ToolRuntimeConfig>): ToolRuntime;
|
|
173
|
+
/**
|
|
174
|
+
* Create a tool suite from definitions
|
|
175
|
+
*/
|
|
176
|
+
export declare function createToolSuite(name: string, version: string, tools: ToolDefinition[], description?: string): ToolSuite;
|
|
177
|
+
export { validateToolPreconditions };
|
|
178
|
+
export type { PreflightWarning };
|
|
179
|
+
//# sourceMappingURL=toolRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRuntime.d.ts","sourceRoot":"","sources":["../../../src/core/unified/toolRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,eAAe,EACf,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAyB,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAM3F;;GAEG;AACH,eAAO,MAAM,eAAe,aAkB1B,CAAC;AAmBH,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC1C,YAAY,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACnE,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACxD,aAAa,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;IAChF,UAAU,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAC5D,WAAW,CAAC,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC1C,iBAAiB,CAAC,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,2BAA2B,GAAG,IAAI,CAAC;CACrF;AAMD;;;;GAIG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,cAAc,CAKpB;gBAEU,MAAM,GAAE,OAAO,CAAC,iBAAiB,CAAM;IAQnD;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAUrC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,SAAY,GAAG,IAAI;IAgB/D;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IASrC;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI7C;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO;IAWvD;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IA4F7D;;OAEG;YACW,kBAAkB;IAwBhC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,CAAC,WAAW;IAenB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAY/B;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAe3B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IA+CtB;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAIhD;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,mBAAmB,GAAG,OAAO;IAOtD;;OAEG;IACH,OAAO,CAAC,eAAe;IAmBvB;;OAEG;IACH,iBAAiB,IAAI,sBAAsB,EAAE;IAwB7C;;OAEG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE;IAsBlD;;OAEG;IACH,QAAQ,IAAI;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;KACnB;IAeD;;OAEG;IACH,UAAU,IAAI,IAAI;IASlB;;OAEG;IACH,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAa9C;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,WAAW,CAElF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,EAAE,EACvB,WAAW,CAAC,EAAE,MAAM,GACnB,SAAS,CAOX;AAMD,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Tool Runtime
|
|
3
|
+
*
|
|
4
|
+
* Core tool execution engine with caching, validation, and lifecycle management.
|
|
5
|
+
* Combines the best features from both TypeScript and Python implementations.
|
|
6
|
+
*
|
|
7
|
+
* Principal Investigator: Bo Shang
|
|
8
|
+
* Framework: erosolar-cli
|
|
9
|
+
*/
|
|
10
|
+
import { validateToolArguments, ToolArgumentValidationError } from './schema.js';
|
|
11
|
+
import { validateToolPreconditions } from '../toolPreconditions.js';
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Constants
|
|
14
|
+
// ============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Tools that can be safely cached based on their arguments
|
|
17
|
+
*/
|
|
18
|
+
export const CACHEABLE_TOOLS = new Set([
|
|
19
|
+
'Read',
|
|
20
|
+
'read',
|
|
21
|
+
'read_file',
|
|
22
|
+
'Glob',
|
|
23
|
+
'glob',
|
|
24
|
+
'glob_search',
|
|
25
|
+
'Grep',
|
|
26
|
+
'grep',
|
|
27
|
+
'grep_search',
|
|
28
|
+
'WebSearch',
|
|
29
|
+
'web_search',
|
|
30
|
+
'WebFetch',
|
|
31
|
+
'web_fetch',
|
|
32
|
+
'find_definition',
|
|
33
|
+
'analyze_code_quality',
|
|
34
|
+
'analyze_complexity',
|
|
35
|
+
'find_dependencies',
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* Default configuration
|
|
39
|
+
*/
|
|
40
|
+
const DEFAULT_CONFIG = {
|
|
41
|
+
enableCache: true,
|
|
42
|
+
cacheTtlMs: 5 * 60 * 1000, // 5 minutes
|
|
43
|
+
maxCacheSize: 1000,
|
|
44
|
+
defaultTimeoutMs: 120_000, // 2 minutes
|
|
45
|
+
networkTimeoutMs: 30_000, // 30 seconds
|
|
46
|
+
maxOutputLength: 100_000, // 100k chars
|
|
47
|
+
verbose: false,
|
|
48
|
+
};
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Tool Runtime
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Unified Tool Runtime
|
|
54
|
+
*
|
|
55
|
+
* Manages tool registration, execution, caching, and validation.
|
|
56
|
+
*/
|
|
57
|
+
export class ToolRuntime {
|
|
58
|
+
registry = new Map();
|
|
59
|
+
cache = new Map();
|
|
60
|
+
config;
|
|
61
|
+
observers = [];
|
|
62
|
+
executionStats = {
|
|
63
|
+
totalCalls: 0,
|
|
64
|
+
cacheHits: 0,
|
|
65
|
+
errors: 0,
|
|
66
|
+
totalTimeMs: 0,
|
|
67
|
+
};
|
|
68
|
+
constructor(config = {}) {
|
|
69
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
70
|
+
}
|
|
71
|
+
// ==========================================================================
|
|
72
|
+
// Registration
|
|
73
|
+
// ==========================================================================
|
|
74
|
+
/**
|
|
75
|
+
* Register a tool suite
|
|
76
|
+
*/
|
|
77
|
+
registerSuite(suite) {
|
|
78
|
+
for (const tool of suite.tools) {
|
|
79
|
+
this.registerTool(tool, suite.name);
|
|
80
|
+
}
|
|
81
|
+
if (this.config.verbose) {
|
|
82
|
+
console.log(`[ToolRuntime] Registered suite: ${suite.name} (${suite.tools.length} tools)`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Register a single tool
|
|
87
|
+
*/
|
|
88
|
+
registerTool(tool, suiteName = 'default') {
|
|
89
|
+
const record = {
|
|
90
|
+
definition: tool,
|
|
91
|
+
suite: suiteName,
|
|
92
|
+
enabled: true,
|
|
93
|
+
executionCount: 0,
|
|
94
|
+
};
|
|
95
|
+
this.registry.set(tool.name, record);
|
|
96
|
+
// Also register lowercase version for case-insensitive lookup
|
|
97
|
+
if (tool.name !== tool.name.toLowerCase()) {
|
|
98
|
+
this.registry.set(tool.name.toLowerCase(), record);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Unregister a tool
|
|
103
|
+
*/
|
|
104
|
+
unregisterTool(name) {
|
|
105
|
+
const record = this.registry.get(name);
|
|
106
|
+
if (!record)
|
|
107
|
+
return false;
|
|
108
|
+
this.registry.delete(name);
|
|
109
|
+
this.registry.delete(name.toLowerCase());
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get a tool by name
|
|
114
|
+
*/
|
|
115
|
+
getTool(name) {
|
|
116
|
+
return this.registry.get(name) || this.registry.get(name.toLowerCase());
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Check if a tool exists
|
|
120
|
+
*/
|
|
121
|
+
hasTool(name) {
|
|
122
|
+
return this.registry.has(name) || this.registry.has(name.toLowerCase());
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Enable or disable a tool
|
|
126
|
+
*/
|
|
127
|
+
setToolEnabled(name, enabled) {
|
|
128
|
+
const record = this.getTool(name);
|
|
129
|
+
if (!record)
|
|
130
|
+
return false;
|
|
131
|
+
record.enabled = enabled;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
// ==========================================================================
|
|
135
|
+
// Execution
|
|
136
|
+
// ==========================================================================
|
|
137
|
+
/**
|
|
138
|
+
* Execute a tool call
|
|
139
|
+
*/
|
|
140
|
+
async execute(call) {
|
|
141
|
+
const startTime = Date.now();
|
|
142
|
+
this.executionStats.totalCalls++;
|
|
143
|
+
// Look up tool
|
|
144
|
+
const record = this.getTool(call.name);
|
|
145
|
+
if (!record) {
|
|
146
|
+
return this.createErrorResult(call, startTime, `Unknown tool: ${call.name}`);
|
|
147
|
+
}
|
|
148
|
+
if (!record.enabled) {
|
|
149
|
+
return this.createErrorResult(call, startTime, `Tool is disabled: ${call.name}`);
|
|
150
|
+
}
|
|
151
|
+
const tool = record.definition;
|
|
152
|
+
// Notify observers
|
|
153
|
+
this.notifyObservers('onToolStart', call);
|
|
154
|
+
// Check cache
|
|
155
|
+
if (this.config.enableCache && this.isCacheable(tool)) {
|
|
156
|
+
const cacheKey = this.getCacheKey(call);
|
|
157
|
+
const cached = this.cache.get(cacheKey);
|
|
158
|
+
if (cached && !this.isCacheExpired(cached)) {
|
|
159
|
+
cached.hitCount++;
|
|
160
|
+
this.executionStats.cacheHits++;
|
|
161
|
+
this.notifyObservers('onCacheHit', call, cached);
|
|
162
|
+
return {
|
|
163
|
+
toolCallId: call.id,
|
|
164
|
+
output: cached.output,
|
|
165
|
+
success: true,
|
|
166
|
+
cached: true,
|
|
167
|
+
durationMs: Date.now() - startTime,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
this.notifyObservers('onCacheMiss', call);
|
|
171
|
+
}
|
|
172
|
+
// Validate arguments
|
|
173
|
+
try {
|
|
174
|
+
validateToolArguments(call.name, tool.parameters, call.arguments);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
if (error instanceof ToolArgumentValidationError) {
|
|
178
|
+
this.notifyObservers('onValidationError', call, error);
|
|
179
|
+
return this.createErrorResult(call, startTime, error.message);
|
|
180
|
+
}
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
// Pre-flight AI flow validation - catch common tool usage failures
|
|
184
|
+
const preflightWarnings = validateToolPreconditions(call.name, call.arguments);
|
|
185
|
+
for (const warning of preflightWarnings) {
|
|
186
|
+
this.notifyObservers('onToolWarning', call, warning);
|
|
187
|
+
}
|
|
188
|
+
// Execute tool
|
|
189
|
+
try {
|
|
190
|
+
const output = await this.executeWithTimeout(tool, call.arguments);
|
|
191
|
+
const truncatedOutput = this.truncateOutput(output, call.name);
|
|
192
|
+
const durationMs = Date.now() - startTime;
|
|
193
|
+
// Update stats
|
|
194
|
+
record.executionCount++;
|
|
195
|
+
record.lastExecuted = Date.now();
|
|
196
|
+
this.executionStats.totalTimeMs += durationMs;
|
|
197
|
+
// Cache result if cacheable
|
|
198
|
+
if (this.config.enableCache && this.isCacheable(tool)) {
|
|
199
|
+
this.cacheResult(call, truncatedOutput);
|
|
200
|
+
}
|
|
201
|
+
const result = {
|
|
202
|
+
toolCallId: call.id,
|
|
203
|
+
output: truncatedOutput,
|
|
204
|
+
success: true,
|
|
205
|
+
cached: false,
|
|
206
|
+
durationMs,
|
|
207
|
+
};
|
|
208
|
+
this.notifyObservers('onToolResult', call, result);
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
this.executionStats.errors++;
|
|
213
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
214
|
+
this.notifyObservers('onToolError', call, error);
|
|
215
|
+
return this.createErrorResult(call, startTime, errorMessage);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Execute with timeout
|
|
220
|
+
*/
|
|
221
|
+
async executeWithTimeout(tool, args) {
|
|
222
|
+
const timeoutMs = this.config.defaultTimeoutMs;
|
|
223
|
+
return new Promise((resolve, reject) => {
|
|
224
|
+
const timer = setTimeout(() => {
|
|
225
|
+
reject(new Error(`Tool execution timed out after ${timeoutMs}ms`));
|
|
226
|
+
}, timeoutMs);
|
|
227
|
+
tool
|
|
228
|
+
.execute(args)
|
|
229
|
+
.then((result) => {
|
|
230
|
+
clearTimeout(timer);
|
|
231
|
+
resolve(result);
|
|
232
|
+
})
|
|
233
|
+
.catch((error) => {
|
|
234
|
+
clearTimeout(timer);
|
|
235
|
+
reject(error);
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Create an error result
|
|
241
|
+
*/
|
|
242
|
+
createErrorResult(call, startTime, error) {
|
|
243
|
+
return {
|
|
244
|
+
toolCallId: call.id,
|
|
245
|
+
output: `Error: ${error}`,
|
|
246
|
+
success: false,
|
|
247
|
+
cached: false,
|
|
248
|
+
durationMs: Date.now() - startTime,
|
|
249
|
+
error,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// ==========================================================================
|
|
253
|
+
// Caching
|
|
254
|
+
// ==========================================================================
|
|
255
|
+
/**
|
|
256
|
+
* Check if a tool's results can be cached
|
|
257
|
+
*/
|
|
258
|
+
isCacheable(tool) {
|
|
259
|
+
if (tool.cacheable !== undefined) {
|
|
260
|
+
return tool.cacheable;
|
|
261
|
+
}
|
|
262
|
+
return CACHEABLE_TOOLS.has(tool.name);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Generate cache key for a tool call
|
|
266
|
+
*/
|
|
267
|
+
getCacheKey(call) {
|
|
268
|
+
const argsStr = JSON.stringify(call.arguments, Object.keys(call.arguments).sort());
|
|
269
|
+
return `${call.name}:${argsStr}`;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Check if a cache entry has expired
|
|
273
|
+
*/
|
|
274
|
+
isCacheExpired(entry) {
|
|
275
|
+
return Date.now() - entry.timestamp > entry.ttl;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Cache a result
|
|
279
|
+
*/
|
|
280
|
+
cacheResult(call, output) {
|
|
281
|
+
// Enforce max cache size
|
|
282
|
+
if (this.cache.size >= this.config.maxCacheSize) {
|
|
283
|
+
this.evictOldestCacheEntries(Math.floor(this.config.maxCacheSize * 0.2));
|
|
284
|
+
}
|
|
285
|
+
const cacheKey = this.getCacheKey(call);
|
|
286
|
+
this.cache.set(cacheKey, {
|
|
287
|
+
output,
|
|
288
|
+
timestamp: Date.now(),
|
|
289
|
+
ttl: this.config.cacheTtlMs,
|
|
290
|
+
hitCount: 0,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Evict oldest cache entries
|
|
295
|
+
*/
|
|
296
|
+
evictOldestCacheEntries(count) {
|
|
297
|
+
const entries = Array.from(this.cache.entries());
|
|
298
|
+
entries.sort(([, a], [, b]) => a.timestamp - b.timestamp);
|
|
299
|
+
for (let i = 0; i < Math.min(count, entries.length); i++) {
|
|
300
|
+
const entry = entries[i];
|
|
301
|
+
if (entry) {
|
|
302
|
+
this.cache.delete(entry[0]);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Clear all cache entries
|
|
308
|
+
*/
|
|
309
|
+
clearCache() {
|
|
310
|
+
this.cache.clear();
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Clear expired cache entries
|
|
314
|
+
*/
|
|
315
|
+
clearExpiredCache() {
|
|
316
|
+
let cleared = 0;
|
|
317
|
+
for (const [key, entry] of Array.from(this.cache.entries())) {
|
|
318
|
+
if (this.isCacheExpired(entry)) {
|
|
319
|
+
this.cache.delete(key);
|
|
320
|
+
cleared++;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return cleared;
|
|
324
|
+
}
|
|
325
|
+
// ==========================================================================
|
|
326
|
+
// Output Handling
|
|
327
|
+
// ==========================================================================
|
|
328
|
+
/**
|
|
329
|
+
* Truncate output if too long
|
|
330
|
+
*
|
|
331
|
+
* PERF: Uses efficient slicing - O(1) for length check, O(n) for truncation only when needed.
|
|
332
|
+
* Binary search not applicable here as we need character boundaries, not search.
|
|
333
|
+
*/
|
|
334
|
+
truncateOutput(output, toolName) {
|
|
335
|
+
const maxLength = this.config.maxOutputLength;
|
|
336
|
+
const len = output.length;
|
|
337
|
+
// Fast path: no truncation needed
|
|
338
|
+
if (len <= maxLength) {
|
|
339
|
+
return output;
|
|
340
|
+
}
|
|
341
|
+
const truncatedCount = len - maxLength;
|
|
342
|
+
const toolLower = toolName.toLowerCase();
|
|
343
|
+
// For file reads, keep head and tail for better context
|
|
344
|
+
if (toolLower.includes('read') || toolLower === 'glob' || toolLower === 'grep') {
|
|
345
|
+
// Keep 70% head, 30% tail (minus notice overhead)
|
|
346
|
+
const noticeLen = 50;
|
|
347
|
+
const usableLen = maxLength - noticeLen;
|
|
348
|
+
const headSize = Math.floor(usableLen * 0.7);
|
|
349
|
+
const tailSize = usableLen - headSize;
|
|
350
|
+
return (output.slice(0, headSize) +
|
|
351
|
+
`\n\n... [truncated ${truncatedCount} characters] ...\n\n` +
|
|
352
|
+
output.slice(-tailSize));
|
|
353
|
+
}
|
|
354
|
+
// For bash/command output, keep more of the tail (errors usually at end)
|
|
355
|
+
if (toolLower.includes('bash') || toolLower === 'execute') {
|
|
356
|
+
const noticeLen = 50;
|
|
357
|
+
const usableLen = maxLength - noticeLen;
|
|
358
|
+
const tailSize = Math.floor(usableLen * 0.8);
|
|
359
|
+
const headSize = usableLen - tailSize;
|
|
360
|
+
return (output.slice(0, headSize) +
|
|
361
|
+
`\n\n... [truncated ${truncatedCount} characters] ...\n\n` +
|
|
362
|
+
output.slice(-tailSize));
|
|
363
|
+
}
|
|
364
|
+
// Default: keep head only (fastest)
|
|
365
|
+
return output.slice(0, maxLength - 50) + `\n... [truncated ${truncatedCount} characters]`;
|
|
366
|
+
}
|
|
367
|
+
// ==========================================================================
|
|
368
|
+
// Observers
|
|
369
|
+
// ==========================================================================
|
|
370
|
+
/**
|
|
371
|
+
* Add an observer
|
|
372
|
+
*/
|
|
373
|
+
addObserver(observer) {
|
|
374
|
+
this.observers.push(observer);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Remove an observer
|
|
378
|
+
*/
|
|
379
|
+
removeObserver(observer) {
|
|
380
|
+
const index = this.observers.indexOf(observer);
|
|
381
|
+
if (index === -1)
|
|
382
|
+
return false;
|
|
383
|
+
this.observers.splice(index, 1);
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Notify observers of an event
|
|
388
|
+
*/
|
|
389
|
+
notifyObservers(event, ...args) {
|
|
390
|
+
for (const observer of this.observers) {
|
|
391
|
+
const handler = observer[event];
|
|
392
|
+
if (handler) {
|
|
393
|
+
try {
|
|
394
|
+
handler.apply(observer, args);
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
if (this.config.verbose) {
|
|
398
|
+
console.error(`[ToolRuntime] Observer error:`, error);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
// ==========================================================================
|
|
405
|
+
// Provider Integration
|
|
406
|
+
// ==========================================================================
|
|
407
|
+
/**
|
|
408
|
+
* Get tools in provider format
|
|
409
|
+
*/
|
|
410
|
+
listProviderTools() {
|
|
411
|
+
const tools = [];
|
|
412
|
+
const seen = new Set();
|
|
413
|
+
for (const [, record] of Array.from(this.registry.entries())) {
|
|
414
|
+
if (!record.enabled || seen.has(record.definition.name)) {
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
seen.add(record.definition.name);
|
|
418
|
+
const tool = record.definition;
|
|
419
|
+
tools.push({
|
|
420
|
+
type: 'function',
|
|
421
|
+
function: {
|
|
422
|
+
name: tool.name,
|
|
423
|
+
description: tool.description,
|
|
424
|
+
parameters: tool.parameters,
|
|
425
|
+
},
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
return tools;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Get tools for a specific category
|
|
432
|
+
*/
|
|
433
|
+
getToolsByCategory(category) {
|
|
434
|
+
const tools = [];
|
|
435
|
+
const seen = new Set();
|
|
436
|
+
for (const record of Array.from(this.registry.values())) {
|
|
437
|
+
if (record.definition.category === category &&
|
|
438
|
+
record.enabled &&
|
|
439
|
+
!seen.has(record.definition.name)) {
|
|
440
|
+
seen.add(record.definition.name);
|
|
441
|
+
tools.push(record);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return tools;
|
|
445
|
+
}
|
|
446
|
+
// ==========================================================================
|
|
447
|
+
// Statistics
|
|
448
|
+
// ==========================================================================
|
|
449
|
+
/**
|
|
450
|
+
* Get execution statistics
|
|
451
|
+
*/
|
|
452
|
+
getStats() {
|
|
453
|
+
const totalCalls = this.executionStats.totalCalls;
|
|
454
|
+
return {
|
|
455
|
+
totalCalls,
|
|
456
|
+
cacheHits: this.executionStats.cacheHits,
|
|
457
|
+
cacheHitRate: totalCalls > 0 ? this.executionStats.cacheHits / totalCalls : 0,
|
|
458
|
+
errors: this.executionStats.errors,
|
|
459
|
+
errorRate: totalCalls > 0 ? this.executionStats.errors / totalCalls : 0,
|
|
460
|
+
avgExecutionTimeMs: totalCalls > 0 ? this.executionStats.totalTimeMs / totalCalls : 0,
|
|
461
|
+
registeredTools: new Set(Array.from(this.registry.values()).map((r) => r.definition.name))
|
|
462
|
+
.size,
|
|
463
|
+
cacheSize: this.cache.size,
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Reset statistics
|
|
468
|
+
*/
|
|
469
|
+
resetStats() {
|
|
470
|
+
this.executionStats = {
|
|
471
|
+
totalCalls: 0,
|
|
472
|
+
cacheHits: 0,
|
|
473
|
+
errors: 0,
|
|
474
|
+
totalTimeMs: 0,
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Get tool execution counts
|
|
479
|
+
*/
|
|
480
|
+
getToolExecutionCounts() {
|
|
481
|
+
const counts = new Map();
|
|
482
|
+
const seen = new Set();
|
|
483
|
+
for (const record of Array.from(this.registry.values())) {
|
|
484
|
+
if (!seen.has(record.definition.name)) {
|
|
485
|
+
seen.add(record.definition.name);
|
|
486
|
+
counts.set(record.definition.name, record.executionCount);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
return counts;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// ============================================================================
|
|
493
|
+
// Factory Functions
|
|
494
|
+
// ============================================================================
|
|
495
|
+
/**
|
|
496
|
+
* Create a tool runtime with default configuration
|
|
497
|
+
*/
|
|
498
|
+
export function createToolRuntime(config) {
|
|
499
|
+
return new ToolRuntime(config);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Create a tool suite from definitions
|
|
503
|
+
*/
|
|
504
|
+
export function createToolSuite(name, version, tools, description) {
|
|
505
|
+
return {
|
|
506
|
+
name,
|
|
507
|
+
version,
|
|
508
|
+
description,
|
|
509
|
+
tools,
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
// ============================================================================
|
|
513
|
+
// AI Flow Pre-Flight Validation
|
|
514
|
+
// ============================================================================
|
|
515
|
+
// Re-export shared preflight validation to maintain unified runtime parity.
|
|
516
|
+
export { validateToolPreconditions };
|
|
517
|
+
//# sourceMappingURL=toolRuntime.js.map
|