@trenchwork/erosolar 1.1.30 → 1.1.32
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.
Potentially problematic release.
This version of @trenchwork/erosolar might be problematic. Click here for more details.
- package/README.md +6 -6
- package/SECURITY.md +4 -4
- package/dist/bin/cliMode.d.ts +8 -0
- package/dist/bin/cliMode.d.ts.map +1 -0
- package/dist/bin/cliMode.js +20 -0
- package/dist/bin/cliMode.js.map +1 -0
- package/dist/bin/deepseek.d.ts +3 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +345 -0
- package/dist/bin/deepseek.js.map +1 -0
- package/dist/bin/erosolar.d.ts +7 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +7 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/bin/selfTest.d.ts +14 -0
- package/dist/bin/selfTest.d.ts.map +1 -0
- package/dist/bin/selfTest.js +298 -0
- package/dist/bin/selfTest.js.map +1 -0
- package/dist/capabilities/_binaryRequirements.d.ts +101 -0
- package/dist/capabilities/_binaryRequirements.d.ts.map +1 -0
- package/dist/capabilities/_binaryRequirements.js +288 -0
- package/dist/capabilities/_binaryRequirements.js.map +1 -0
- package/dist/capabilities/_opsContext.d.ts +129 -0
- package/dist/capabilities/_opsContext.d.ts.map +1 -0
- package/dist/capabilities/_opsContext.js +274 -0
- package/dist/capabilities/_opsContext.js.map +1 -0
- package/dist/capabilities/_processRunner.d.ts +49 -0
- package/dist/capabilities/_processRunner.d.ts.map +1 -0
- package/dist/capabilities/_processRunner.js +200 -0
- package/dist/capabilities/_processRunner.js.map +1 -0
- package/dist/capabilities/aflppCapability.d.ts +7 -0
- package/dist/capabilities/aflppCapability.d.ts.map +1 -0
- package/dist/capabilities/aflppCapability.js +301 -0
- package/dist/capabilities/aflppCapability.js.map +1 -0
- package/dist/capabilities/baseCapability.d.ts +72 -0
- package/dist/capabilities/baseCapability.d.ts.map +1 -0
- package/dist/capabilities/baseCapability.js +183 -0
- package/dist/capabilities/baseCapability.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +24 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/binaryAnalysisCapability.d.ts +7 -0
- package/dist/capabilities/binaryAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/binaryAnalysisCapability.js +201 -0
- package/dist/capabilities/binaryAnalysisCapability.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/engagementCapability.d.ts +15 -0
- package/dist/capabilities/engagementCapability.d.ts.map +1 -0
- package/dist/capabilities/engagementCapability.js +40 -0
- package/dist/capabilities/engagementCapability.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/gdbCapability.d.ts +7 -0
- package/dist/capabilities/gdbCapability.d.ts.map +1 -0
- package/dist/capabilities/gdbCapability.js +125 -0
- package/dist/capabilities/gdbCapability.js.map +1 -0
- package/dist/capabilities/ghidraHeadlessCapability.d.ts +25 -0
- package/dist/capabilities/ghidraHeadlessCapability.d.ts.map +1 -0
- package/dist/capabilities/ghidraHeadlessCapability.js +593 -0
- package/dist/capabilities/ghidraHeadlessCapability.js.map +1 -0
- package/dist/capabilities/gitHistoryCapability.d.ts +6 -0
- package/dist/capabilities/gitHistoryCapability.d.ts.map +1 -0
- package/dist/capabilities/gitHistoryCapability.js +184 -0
- package/dist/capabilities/gitHistoryCapability.js.map +1 -0
- package/dist/capabilities/hitlCapability.d.ts +18 -0
- package/dist/capabilities/hitlCapability.d.ts.map +1 -0
- package/dist/capabilities/hitlCapability.js +29 -0
- package/dist/capabilities/hitlCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +26 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +31 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/interactionCapability.d.ts +6 -0
- package/dist/capabilities/interactionCapability.d.ts.map +1 -0
- package/dist/capabilities/interactionCapability.js +17 -0
- package/dist/capabilities/interactionCapability.js.map +1 -0
- package/dist/capabilities/kaliCapability.d.ts +14 -0
- package/dist/capabilities/kaliCapability.d.ts.map +1 -0
- package/dist/capabilities/kaliCapability.js +478 -0
- package/dist/capabilities/kaliCapability.js.map +1 -0
- package/dist/capabilities/llmRedteamCapability.d.ts +38 -0
- package/dist/capabilities/llmRedteamCapability.d.ts.map +1 -0
- package/dist/capabilities/llmRedteamCapability.js +340 -0
- package/dist/capabilities/llmRedteamCapability.js.map +1 -0
- package/dist/capabilities/mcpCapability.d.ts +7 -0
- package/dist/capabilities/mcpCapability.d.ts.map +1 -0
- package/dist/capabilities/mcpCapability.js +82 -0
- package/dist/capabilities/mcpCapability.js.map +1 -0
- package/dist/capabilities/memoryCapability.d.ts +10 -0
- package/dist/capabilities/memoryCapability.d.ts.map +1 -0
- package/dist/capabilities/memoryCapability.js +22 -0
- package/dist/capabilities/memoryCapability.js.map +1 -0
- package/dist/capabilities/monitorCapability.d.ts +6 -0
- package/dist/capabilities/monitorCapability.d.ts.map +1 -0
- package/dist/capabilities/monitorCapability.js +19 -0
- package/dist/capabilities/monitorCapability.js.map +1 -0
- package/dist/capabilities/notebookCapability.d.ts +6 -0
- package/dist/capabilities/notebookCapability.d.ts.map +1 -0
- package/dist/capabilities/notebookCapability.js +17 -0
- package/dist/capabilities/notebookCapability.js.map +1 -0
- package/dist/capabilities/planModeCapability.d.ts +6 -0
- package/dist/capabilities/planModeCapability.d.ts.map +1 -0
- package/dist/capabilities/planModeCapability.js +16 -0
- package/dist/capabilities/planModeCapability.js.map +1 -0
- package/dist/capabilities/pwntoolsCapability.d.ts +7 -0
- package/dist/capabilities/pwntoolsCapability.d.ts.map +1 -0
- package/dist/capabilities/pwntoolsCapability.js +109 -0
- package/dist/capabilities/pwntoolsCapability.js.map +1 -0
- package/dist/capabilities/scheduleCapability.d.ts +6 -0
- package/dist/capabilities/scheduleCapability.d.ts.map +1 -0
- package/dist/capabilities/scheduleCapability.js +16 -0
- package/dist/capabilities/scheduleCapability.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +19 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +29 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/skillCapability.d.ts +6 -0
- package/dist/capabilities/skillCapability.d.ts.map +1 -0
- package/dist/capabilities/skillCapability.js +17 -0
- package/dist/capabilities/skillCapability.js.map +1 -0
- package/dist/capabilities/todoCapability.d.ts +11 -0
- package/dist/capabilities/todoCapability.d.ts.map +1 -0
- package/dist/capabilities/todoCapability.js +22 -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 +163 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +25 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +150 -0
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/capabilities/triggerCapability.d.ts +6 -0
- package/dist/capabilities/triggerCapability.d.ts.map +1 -0
- package/dist/capabilities/triggerCapability.js +16 -0
- package/dist/capabilities/triggerCapability.js.map +1 -0
- package/dist/capabilities/unifiedCodingCapability.d.ts +62 -0
- package/dist/capabilities/unifiedCodingCapability.d.ts.map +1 -0
- package/dist/capabilities/unifiedCodingCapability.js +788 -0
- package/dist/capabilities/unifiedCodingCapability.js.map +1 -0
- package/dist/capabilities/webCapability.d.ts +23 -0
- package/dist/capabilities/webCapability.d.ts.map +1 -0
- package/dist/capabilities/webCapability.js +33 -0
- package/dist/capabilities/webCapability.js.map +1 -0
- package/dist/capabilities/worktreeCapability.d.ts +6 -0
- package/dist/capabilities/worktreeCapability.d.ts.map +1 -0
- package/dist/capabilities/worktreeCapability.js +16 -0
- package/dist/capabilities/worktreeCapability.js.map +1 -0
- package/dist/cli/offsecInstall.d.ts +43 -0
- package/dist/cli/offsecInstall.d.ts.map +1 -0
- package/dist/cli/offsecInstall.js +258 -0
- package/dist/cli/offsecInstall.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +155 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/v1/agent.d.ts +179 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +8 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +7 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +7 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/agent.d.ts +320 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1627 -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/agentRegistry.d.ts +111 -0
- package/dist/core/agentRegistry.d.ts.map +1 -0
- package/dist/core/agentRegistry.js +229 -0
- package/dist/core/agentRegistry.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +11 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +136 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaLoader.d.ts +131 -0
- package/dist/core/agentSchemaLoader.d.ts.map +1 -0
- package/dist/core/agentSchemaLoader.js +235 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/aiErrorFixer.d.ts +57 -0
- package/dist/core/aiErrorFixer.d.ts.map +1 -0
- package/dist/core/aiErrorFixer.js +214 -0
- package/dist/core/aiErrorFixer.js.map +1 -0
- package/dist/core/artifactStore.d.ts +35 -0
- package/dist/core/artifactStore.d.ts.map +1 -0
- package/dist/core/artifactStore.js +105 -0
- package/dist/core/artifactStore.js.map +1 -0
- package/dist/core/auth.d.ts +15 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +345 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/bashCommandGuidance.d.ts +16 -0
- package/dist/core/bashCommandGuidance.d.ts.map +1 -0
- package/dist/core/bashCommandGuidance.js +40 -0
- package/dist/core/bashCommandGuidance.js.map +1 -0
- package/dist/core/constants.d.ts +31 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +62 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/contextManager.d.ts +271 -0
- package/dist/core/contextManager.d.ts.map +1 -0
- package/dist/core/contextManager.js +1073 -0
- package/dist/core/contextManager.js.map +1 -0
- package/dist/core/contextWindow.d.ts +42 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +123 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/customCommands.d.ts +19 -0
- package/dist/core/customCommands.d.ts.map +1 -0
- package/dist/core/customCommands.js +85 -0
- package/dist/core/customCommands.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +159 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +111 -0
- package/dist/core/errors/errorTypes.d.ts.map +1 -0
- package/dist/core/errors/errorTypes.js +345 -0
- package/dist/core/errors/errorTypes.js.map +1 -0
- package/dist/core/errors/index.d.ts +50 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +156 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/networkErrors.d.ts +14 -0
- package/dist/core/errors/networkErrors.d.ts.map +1 -0
- package/dist/core/errors/networkErrors.js +53 -0
- package/dist/core/errors/networkErrors.js.map +1 -0
- package/dist/core/errors/safetyValidator.d.ts +109 -0
- package/dist/core/errors/safetyValidator.d.ts.map +1 -0
- package/dist/core/errors/safetyValidator.js +271 -0
- package/dist/core/errors/safetyValidator.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/finalResponseFormatter.d.ts +10 -0
- package/dist/core/finalResponseFormatter.d.ts.map +1 -0
- package/dist/core/finalResponseFormatter.js +14 -0
- package/dist/core/finalResponseFormatter.js.map +1 -0
- package/dist/core/guardrails.d.ts +146 -0
- package/dist/core/guardrails.d.ts.map +1 -0
- package/dist/core/guardrails.js +361 -0
- package/dist/core/guardrails.js.map +1 -0
- package/dist/core/hitl.d.ts +119 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js +387 -0
- package/dist/core/hitl.js.map +1 -0
- package/dist/core/hooks.d.ts +95 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +239 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/inputProtection.d.ts +122 -0
- package/dist/core/inputProtection.d.ts.map +1 -0
- package/dist/core/inputProtection.js +422 -0
- package/dist/core/inputProtection.js.map +1 -0
- package/dist/core/modelDiscovery.d.ts +105 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +768 -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 +81 -0
- package/dist/core/multilinePasteHandler.js.map +1 -0
- package/dist/core/preferences.d.ts +65 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +305 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/projectTracker.d.ts +96 -0
- package/dist/core/projectTracker.d.ts.map +1 -0
- package/dist/core/projectTracker.js +275 -0
- package/dist/core/projectTracker.js.map +1 -0
- package/dist/core/providerKeys.d.ts +20 -0
- package/dist/core/providerKeys.d.ts.map +1 -0
- package/dist/core/providerKeys.js +40 -0
- package/dist/core/providerKeys.js.map +1 -0
- package/dist/core/refusalDetection.d.ts +2 -0
- package/dist/core/refusalDetection.d.ts.map +1 -0
- package/dist/core/refusalDetection.js +51 -0
- package/dist/core/refusalDetection.js.map +1 -0
- package/dist/core/resultVerification.d.ts +47 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +126 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/reviewerGuard.d.ts +37 -0
- package/dist/core/reviewerGuard.d.ts.map +1 -0
- package/dist/core/reviewerGuard.js +188 -0
- package/dist/core/reviewerGuard.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +49 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +234 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +48 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +259 -0
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/sessionStorage.d.ts +10 -0
- package/dist/core/sessionStorage.d.ts.map +1 -0
- package/dist/core/sessionStorage.js +46 -0
- package/dist/core/sessionStorage.js.map +1 -0
- package/dist/core/sessionStore.d.ts +35 -0
- package/dist/core/sessionStore.d.ts.map +1 -0
- package/dist/core/sessionStore.js +191 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/sharedSecrets.d.ts +60 -0
- package/dist/core/sharedSecrets.d.ts.map +1 -0
- package/dist/core/sharedSecrets.js +111 -0
- package/dist/core/sharedSecrets.js.map +1 -0
- package/dist/core/shutdown.d.ts +34 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +186 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/sudoPasswordManager.d.ts +52 -0
- package/dist/core/sudoPasswordManager.d.ts.map +1 -0
- package/dist/core/sudoPasswordManager.js +115 -0
- package/dist/core/sudoPasswordManager.js.map +1 -0
- package/dist/core/taskCompletionDetector.d.ts +117 -0
- package/dist/core/taskCompletionDetector.d.ts.map +1 -0
- package/dist/core/taskCompletionDetector.js +532 -0
- package/dist/core/taskCompletionDetector.js.map +1 -0
- package/dist/core/testFailureMonitor.d.ts +67 -0
- package/dist/core/testFailureMonitor.d.ts.map +1 -0
- package/dist/core/testFailureMonitor.js +262 -0
- package/dist/core/testFailureMonitor.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +34 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -0
- package/dist/core/toolPreconditions.js +242 -0
- package/dist/core/toolPreconditions.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +192 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +511 -0
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/types/utilityTypes.d.ts +183 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +273 -0
- package/dist/core/types/utilityTypes.js.map +1 -0
- package/dist/core/types.d.ts +334 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +76 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/updateChecker.d.ts +148 -0
- package/dist/core/updateChecker.d.ts.map +1 -0
- package/dist/core/updateChecker.js +599 -0
- package/dist/core/updateChecker.js.map +1 -0
- package/dist/core/usageTracker.d.ts +11 -0
- package/dist/core/usageTracker.d.ts.map +1 -0
- package/dist/core/usageTracker.js +128 -0
- package/dist/core/usageTracker.js.map +1 -0
- package/dist/core/userApproval.d.ts +95 -0
- package/dist/core/userApproval.d.ts.map +1 -0
- package/dist/core/userApproval.js +239 -0
- package/dist/core/userApproval.js.map +1 -0
- package/dist/headless/interactiveShell.d.ts +22 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +2181 -0
- package/dist/headless/interactiveShell.js.map +1 -0
- package/dist/leanAgent.d.ts +73 -0
- package/dist/leanAgent.d.ts.map +1 -0
- package/dist/leanAgent.js +177 -0
- package/dist/leanAgent.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 +104 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +9 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +48 -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 +54 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +17 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +10 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +47 -0
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +10 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +47 -0
- package/dist/plugins/providers/xai/index.js.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +10 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +110 -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/edit/editPlugin.d.ts +9 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.js +15 -0
- package/dist/plugins/tools/edit/editPlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +9 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +14 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +3 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +9 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +3 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts +3 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js +31 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js.map +1 -0
- package/dist/plugins/tools/kali/kaliPlugin.d.ts +3 -0
- package/dist/plugins/tools/kali/kaliPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/kali/kaliPlugin.js +10 -0
- package/dist/plugins/tools/kali/kaliPlugin.js.map +1 -0
- package/dist/plugins/tools/mcp/mcpClient.d.ts +59 -0
- package/dist/plugins/tools/mcp/mcpClient.d.ts.map +1 -0
- package/dist/plugins/tools/mcp/mcpClient.js +118 -0
- package/dist/plugins/tools/mcp/mcpClient.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 +10 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +13 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +37 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +3 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +340 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +58 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +14 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts +3 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.js +27 -0
- package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
- package/dist/plugins/tools/todo/todoPlugin.d.ts +3 -0
- package/dist/plugins/tools/todo/todoPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/todo/todoPlugin.js +10 -0
- package/dist/plugins/tools/todo/todoPlugin.js.map +1 -0
- package/dist/providers/baseProvider.d.ts +148 -0
- package/dist/providers/baseProvider.d.ts.map +1 -0
- package/dist/providers/baseProvider.js +284 -0
- package/dist/providers/baseProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +64 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1018 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +22 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +25 -0
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/providers/resilientProvider.d.ts +103 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +468 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +121 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +739 -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 +158 -0
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +49 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +218 -0
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/agentSpawningWiring.d.ts +23 -0
- package/dist/runtime/agentSpawningWiring.d.ts.map +1 -0
- package/dist/runtime/agentSpawningWiring.js +119 -0
- package/dist/runtime/agentSpawningWiring.js.map +1 -0
- package/dist/runtime/agentWorkerPool.d.ts +167 -0
- package/dist/runtime/agentWorkerPool.d.ts.map +1 -0
- package/dist/runtime/agentWorkerPool.js +435 -0
- package/dist/runtime/agentWorkerPool.js.map +1 -0
- package/dist/runtime/node.d.ts +9 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +112 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/phaseEmitter.d.ts +63 -0
- package/dist/runtime/phaseEmitter.d.ts.map +1 -0
- package/dist/runtime/phaseEmitter.js +207 -0
- package/dist/runtime/phaseEmitter.js.map +1 -0
- package/dist/runtime/profileGates.d.ts +19 -0
- package/dist/runtime/profileGates.d.ts.map +1 -0
- package/dist/runtime/profileGates.js +23 -0
- package/dist/runtime/profileGates.js.map +1 -0
- package/dist/runtime/universal.d.ts +18 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +31 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/autoExecutor.d.ts +70 -0
- package/dist/shell/autoExecutor.d.ts.map +1 -0
- package/dist/shell/autoExecutor.js +320 -0
- package/dist/shell/autoExecutor.js.map +1 -0
- package/dist/shell/commandRegistry.d.ts +122 -0
- package/dist/shell/commandRegistry.d.ts.map +1 -0
- package/dist/shell/commandRegistry.js +355 -0
- package/dist/shell/commandRegistry.js.map +1 -0
- package/dist/shell/composableMessage.d.ts +178 -0
- package/dist/shell/composableMessage.d.ts.map +1 -0
- package/dist/shell/composableMessage.js +384 -0
- package/dist/shell/composableMessage.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +27 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +53 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +12 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +16 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/vimMode.d.ts +66 -0
- package/dist/shell/vimMode.d.ts.map +1 -0
- package/dist/shell/vimMode.js +435 -0
- package/dist/shell/vimMode.js.map +1 -0
- package/dist/tools/bashTools.d.ts +11 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +779 -0
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +43 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +607 -0
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/editTools.d.ts +29 -0
- package/dist/tools/editTools.d.ts.map +1 -0
- package/dist/tools/editTools.js +792 -0
- package/dist/tools/editTools.js.map +1 -0
- package/dist/tools/engagementTools.d.ts +45 -0
- package/dist/tools/engagementTools.d.ts.map +1 -0
- package/dist/tools/engagementTools.js +384 -0
- package/dist/tools/engagementTools.js.map +1 -0
- package/dist/tools/fileChangeTracker.d.ts +47 -0
- package/dist/tools/fileChangeTracker.d.ts.map +1 -0
- package/dist/tools/fileChangeTracker.js +154 -0
- package/dist/tools/fileChangeTracker.js.map +1 -0
- package/dist/tools/fileReadTracker.d.ts +69 -0
- package/dist/tools/fileReadTracker.d.ts.map +1 -0
- package/dist/tools/fileReadTracker.js +213 -0
- package/dist/tools/fileReadTracker.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +389 -0
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/grepTools.d.ts +3 -0
- package/dist/tools/grepTools.d.ts.map +1 -0
- package/dist/tools/grepTools.js +128 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/heliaControl.d.ts +51 -0
- package/dist/tools/heliaControl.d.ts.map +1 -0
- package/dist/tools/heliaControl.js +93 -0
- package/dist/tools/heliaControl.js.map +1 -0
- package/dist/tools/hitlTools.d.ts +7 -0
- package/dist/tools/hitlTools.d.ts.map +1 -0
- package/dist/tools/hitlTools.js +185 -0
- package/dist/tools/hitlTools.js.map +1 -0
- package/dist/tools/interactionTools.d.ts +16 -0
- package/dist/tools/interactionTools.d.ts.map +1 -0
- package/dist/tools/interactionTools.js +207 -0
- package/dist/tools/interactionTools.js.map +1 -0
- package/dist/tools/localExplore.d.ts +38 -0
- package/dist/tools/localExplore.d.ts.map +1 -0
- package/dist/tools/localExplore.js +30 -0
- package/dist/tools/localExplore.js.map +1 -0
- package/dist/tools/memoryTools.d.ts +20 -0
- package/dist/tools/memoryTools.d.ts.map +1 -0
- package/dist/tools/memoryTools.js +180 -0
- package/dist/tools/memoryTools.js.map +1 -0
- package/dist/tools/monitorTools.d.ts +16 -0
- package/dist/tools/monitorTools.d.ts.map +1 -0
- package/dist/tools/monitorTools.js +178 -0
- package/dist/tools/monitorTools.js.map +1 -0
- package/dist/tools/notebookTools.d.ts +20 -0
- package/dist/tools/notebookTools.d.ts.map +1 -0
- package/dist/tools/notebookTools.js +140 -0
- package/dist/tools/notebookTools.js.map +1 -0
- package/dist/tools/planModeTools.d.ts +32 -0
- package/dist/tools/planModeTools.d.ts.map +1 -0
- package/dist/tools/planModeTools.js +200 -0
- package/dist/tools/planModeTools.js.map +1 -0
- package/dist/tools/scheduleTools.d.ts +39 -0
- package/dist/tools/scheduleTools.d.ts.map +1 -0
- package/dist/tools/scheduleTools.js +182 -0
- package/dist/tools/scheduleTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +12 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +413 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/skillTools.d.ts +24 -0
- package/dist/tools/skillTools.d.ts.map +1 -0
- package/dist/tools/skillTools.js +140 -0
- package/dist/tools/skillTools.js.map +1 -0
- package/dist/tools/todoTools.d.ts +24 -0
- package/dist/tools/todoTools.d.ts.map +1 -0
- package/dist/tools/todoTools.js +115 -0
- package/dist/tools/todoTools.js.map +1 -0
- package/dist/tools/triggerTools.d.ts +28 -0
- package/dist/tools/triggerTools.d.ts.map +1 -0
- package/dist/tools/triggerTools.js +210 -0
- package/dist/tools/triggerTools.js.map +1 -0
- package/dist/tools/webTools.d.ts +26 -0
- package/dist/tools/webTools.d.ts.map +1 -0
- package/dist/tools/webTools.js +332 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/tools/worktreeTools.d.ts +21 -0
- package/dist/tools/worktreeTools.d.ts.map +1 -0
- package/dist/tools/worktreeTools.js +158 -0
- package/dist/tools/worktreeTools.js.map +1 -0
- package/dist/ui/RenderGate.d.ts +83 -0
- package/dist/ui/RenderGate.d.ts.map +1 -0
- package/dist/ui/RenderGate.js +138 -0
- package/dist/ui/RenderGate.js.map +1 -0
- package/dist/ui/animatedStatus.d.ts +140 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -0
- package/dist/ui/animatedStatus.js +480 -0
- package/dist/ui/animatedStatus.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +197 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +440 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +855 -0
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +114 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/errorFormatter.d.ts +64 -0
- package/dist/ui/errorFormatter.d.ts.map +1 -0
- package/dist/ui/errorFormatter.js +316 -0
- package/dist/ui/errorFormatter.js.map +1 -0
- package/dist/ui/globalWriteLock.d.ts +63 -0
- package/dist/ui/globalWriteLock.d.ts.map +1 -0
- package/dist/ui/globalWriteLock.js +173 -0
- package/dist/ui/globalWriteLock.js.map +1 -0
- package/dist/ui/index.d.ts +31 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +49 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink/App.d.ts +39 -0
- package/dist/ui/ink/App.d.ts.map +1 -0
- package/dist/ui/ink/App.js +19 -0
- package/dist/ui/ink/App.js.map +1 -0
- package/dist/ui/ink/ChatStatic.d.ts +29 -0
- package/dist/ui/ink/ChatStatic.d.ts.map +1 -0
- package/dist/ui/ink/ChatStatic.js +31 -0
- package/dist/ui/ink/ChatStatic.js.map +1 -0
- package/dist/ui/ink/InkPromptController.d.ts +286 -0
- package/dist/ui/ink/InkPromptController.d.ts.map +1 -0
- package/dist/ui/ink/InkPromptController.js +558 -0
- package/dist/ui/ink/InkPromptController.js.map +1 -0
- package/dist/ui/ink/Prompt.d.ts +36 -0
- package/dist/ui/ink/Prompt.d.ts.map +1 -0
- package/dist/ui/ink/Prompt.js +296 -0
- package/dist/ui/ink/Prompt.js.map +1 -0
- package/dist/ui/ink/StatusLine.d.ts +25 -0
- package/dist/ui/ink/StatusLine.d.ts.map +1 -0
- package/dist/ui/ink/StatusLine.js +12 -0
- package/dist/ui/ink/StatusLine.js.map +1 -0
- package/dist/ui/ink/adapter.d.ts +58 -0
- package/dist/ui/ink/adapter.d.ts.map +1 -0
- package/dist/ui/ink/adapter.js +113 -0
- package/dist/ui/ink/adapter.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +157 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +501 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +27 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +184 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/outputMode.d.ts +58 -0
- package/dist/ui/outputMode.d.ts.map +1 -0
- package/dist/ui/outputMode.js +179 -0
- package/dist/ui/outputMode.js.map +1 -0
- package/dist/ui/overlay/OverlayManager.d.ts +105 -0
- package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
- package/dist/ui/overlay/OverlayManager.js +304 -0
- package/dist/ui/overlay/OverlayManager.js.map +1 -0
- package/dist/ui/premiumComponents.d.ts +54 -0
- package/dist/ui/premiumComponents.d.ts.map +1 -0
- package/dist/ui/premiumComponents.js +241 -0
- package/dist/ui/premiumComponents.js.map +1 -0
- package/dist/ui/richText.d.ts +13 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +444 -0
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.js +60 -0
- package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/textHighlighter.d.ts +83 -0
- package/dist/ui/textHighlighter.d.ts.map +1 -0
- package/dist/ui/textHighlighter.js +267 -0
- package/dist/ui/textHighlighter.js.map +1 -0
- package/dist/ui/theme.d.ts +351 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +436 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/toolDisplay.d.ts +221 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -0
- package/dist/ui/toolDisplay.js +1654 -0
- package/dist/ui/toolDisplay.js.map +1 -0
- package/dist/ui/uiConstants.d.ts +253 -0
- package/dist/ui/uiConstants.d.ts.map +1 -0
- package/dist/ui/uiConstants.js +437 -0
- package/dist/ui/uiConstants.js.map +1 -0
- package/dist/utils/analytics.d.ts +2 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +51 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/askUserPrompt.d.ts +21 -0
- package/dist/utils/askUserPrompt.d.ts.map +1 -0
- package/dist/utils/askUserPrompt.js +87 -0
- package/dist/utils/askUserPrompt.js.map +1 -0
- package/dist/utils/asyncUtils.d.ts +95 -0
- package/dist/utils/asyncUtils.d.ts.map +1 -0
- package/dist/utils/asyncUtils.js +286 -0
- package/dist/utils/asyncUtils.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +6 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +39 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +12 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +83 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +10 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +78 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/lambdaClient.d.ts +35 -0
- package/dist/utils/lambdaClient.d.ts.map +1 -0
- package/dist/utils/lambdaClient.js +81 -0
- package/dist/utils/lambdaClient.js.map +1 -0
- package/dist/utils/packageInfo.d.ts +14 -0
- package/dist/utils/packageInfo.d.ts.map +1 -0
- package/dist/utils/packageInfo.js +45 -0
- package/dist/utils/packageInfo.js.map +1 -0
- package/dist/utils/planFormatter.d.ts +34 -0
- package/dist/utils/planFormatter.d.ts.map +1 -0
- package/dist/utils/planFormatter.js +141 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/dist/utils/projectRegistration.d.ts +61 -0
- package/dist/utils/projectRegistration.d.ts.map +1 -0
- package/dist/utils/projectRegistration.js +212 -0
- package/dist/utils/projectRegistration.js.map +1 -0
- package/dist/utils/securityUtils.d.ts +145 -0
- package/dist/utils/securityUtils.d.ts.map +1 -0
- package/dist/utils/securityUtils.js +507 -0
- package/dist/utils/securityUtils.js.map +1 -0
- package/dist/utils/statusReporter.d.ts +6 -0
- package/dist/utils/statusReporter.d.ts.map +1 -0
- package/dist/utils/statusReporter.js +26 -0
- package/dist/utils/statusReporter.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +135 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace.validator.d.ts +49 -0
- package/dist/workspace.validator.d.ts.map +1 -0
- package/dist/workspace.validator.js +215 -0
- package/dist/workspace.validator.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
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gB,CACpC,UAAkB,EAClB,OAAoB,EACpB,SAAwB,EAAE,EAC1B,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,QAAQ,GAAG,oBAAoB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAChE,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IACzD,OAAO,iBAAiB,CAAC,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Utilities for AGI Core
|
|
3
|
+
* Comprehensive security validation, sanitization, and safe execution utilities
|
|
4
|
+
*/
|
|
5
|
+
import { SpawnSyncOptions } from 'node:child_process';
|
|
6
|
+
/**
|
|
7
|
+
* Validate target hostname, IP address, or domain
|
|
8
|
+
* Prevents command injection and path traversal
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateTarget(target: string): {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
reason?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Validate port numbers and ranges
|
|
16
|
+
*/
|
|
17
|
+
export declare function validatePorts(ports: string): {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
reason?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Validate and sanitize URL
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateUrl(url: string): {
|
|
25
|
+
valid: boolean;
|
|
26
|
+
reason?: string;
|
|
27
|
+
sanitized?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Safe command execution wrapper
|
|
31
|
+
* Uses spawnSync with array arguments, never shell mode
|
|
32
|
+
*/
|
|
33
|
+
export declare function safeExecSync(command: string, args?: string[], options?: SpawnSyncOptions): {
|
|
34
|
+
success: boolean;
|
|
35
|
+
stdout: string;
|
|
36
|
+
stderr: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Sanitize user input for shell commands
|
|
41
|
+
* Escapes shell metacharacters
|
|
42
|
+
*/
|
|
43
|
+
export declare function sanitizeShellInput(input: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Validate and sanitize file path
|
|
46
|
+
* Prevents directory traversal anomalys
|
|
47
|
+
*/
|
|
48
|
+
export declare function sanitizeFilePath(path: string): {
|
|
49
|
+
valid: boolean;
|
|
50
|
+
sanitized?: string;
|
|
51
|
+
reason?: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Rate limiting and request throttling
|
|
55
|
+
*/
|
|
56
|
+
export declare class RateLimiter {
|
|
57
|
+
private maxRequests;
|
|
58
|
+
private timeWindowMs;
|
|
59
|
+
private requests;
|
|
60
|
+
constructor(maxRequests?: number, timeWindowMs?: number);
|
|
61
|
+
/**
|
|
62
|
+
* Check if request is allowed
|
|
63
|
+
*/
|
|
64
|
+
isAllowed(key: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Clean up old request records
|
|
67
|
+
*/
|
|
68
|
+
private cleanup;
|
|
69
|
+
/**
|
|
70
|
+
* Get wait time if rate limited
|
|
71
|
+
*/
|
|
72
|
+
getWaitTime(key: string): number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Secure HTTP request utilities
|
|
76
|
+
*/
|
|
77
|
+
export declare class SecureHttpClient {
|
|
78
|
+
private rateLimiter;
|
|
79
|
+
get(url: string, options?: {
|
|
80
|
+
timeout?: number;
|
|
81
|
+
headers?: Record<string, string>;
|
|
82
|
+
}): Promise<{
|
|
83
|
+
success: boolean;
|
|
84
|
+
statusCode?: number;
|
|
85
|
+
data?: string;
|
|
86
|
+
error?: string;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Security context for tool execution
|
|
91
|
+
*/
|
|
92
|
+
export interface SecurityContext {
|
|
93
|
+
userId?: string;
|
|
94
|
+
permissions: string[];
|
|
95
|
+
maxExecutionTime: number;
|
|
96
|
+
allowedCommands: string[];
|
|
97
|
+
allowedHosts: string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Security policy validator
|
|
101
|
+
*/
|
|
102
|
+
export declare class SecurityPolicyValidator {
|
|
103
|
+
private defaultContext;
|
|
104
|
+
validateCommand(command: string, args: string[], context?: Partial<SecurityContext>): {
|
|
105
|
+
allowed: boolean;
|
|
106
|
+
reason?: string;
|
|
107
|
+
};
|
|
108
|
+
private validateNmapArgs;
|
|
109
|
+
private validateCurlArgs;
|
|
110
|
+
private rejectShellMeta;
|
|
111
|
+
private validateSqlmapArgs;
|
|
112
|
+
private validateGobusterArgs;
|
|
113
|
+
private validateFfufArgs;
|
|
114
|
+
private validateFeroxbusterArgs;
|
|
115
|
+
private validateNiktoArgs;
|
|
116
|
+
private validateWpscanArgs;
|
|
117
|
+
private validateHydraArgs;
|
|
118
|
+
private validateJohnArgs;
|
|
119
|
+
private validateHashcatArgs;
|
|
120
|
+
private validateMasscanArgs;
|
|
121
|
+
private validateAmassArgs;
|
|
122
|
+
private validateSubfinderArgs;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Security logger for audit trail
|
|
126
|
+
*/
|
|
127
|
+
export declare class SecurityLogger {
|
|
128
|
+
private logFile?;
|
|
129
|
+
constructor(logFile?: string);
|
|
130
|
+
logSecurityEvent(event: {
|
|
131
|
+
type: string;
|
|
132
|
+
userId?: string;
|
|
133
|
+
command?: string;
|
|
134
|
+
args?: string[];
|
|
135
|
+
target?: string;
|
|
136
|
+
success: boolean;
|
|
137
|
+
timestamp: Date;
|
|
138
|
+
details?: Record<string, any>;
|
|
139
|
+
}): void;
|
|
140
|
+
private getClientIp;
|
|
141
|
+
}
|
|
142
|
+
export declare const securityValidator: SecurityPolicyValidator;
|
|
143
|
+
export declare const securityLogger: SecurityLogger;
|
|
144
|
+
export declare const globalRateLimiter: RateLimiter;
|
|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0BxB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,qBAAqB;CAW9B;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAC,CAAS;gBAEb,OAAO,CAAC,EAAE,MAAM;IAI5B,gBAAgB,CAAC,KAAK,EAAE;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,GAAG,IAAI;IAWR,OAAO,CAAC,WAAW;CAIpB;AAGD,eAAO,MAAM,iBAAiB,yBAAgC,CAAC;AAC/D,eAAO,MAAM,cAAc,gBAAuB,CAAC;AACnD,eAAO,MAAM,iBAAiB,aAA8B,CAAC"}
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Utilities for AGI Core
|
|
3
|
+
* Comprehensive security validation, sanitization, and safe execution utilities
|
|
4
|
+
*/
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { URL } from 'node:url';
|
|
7
|
+
import { logDebug } from './debugLogger.js';
|
|
8
|
+
/**
|
|
9
|
+
* Validate target hostname, IP address, or domain
|
|
10
|
+
* Prevents command injection and path traversal
|
|
11
|
+
*/
|
|
12
|
+
export function validateTarget(target) {
|
|
13
|
+
if (typeof target !== 'string') {
|
|
14
|
+
return { valid: false, reason: 'Target must be a string' };
|
|
15
|
+
}
|
|
16
|
+
if (target.length > 253) {
|
|
17
|
+
return { valid: false, reason: 'Target too long (max 253 characters)' };
|
|
18
|
+
}
|
|
19
|
+
// Allow IP addresses (IPv4 and IPv6), hostnames, but no shell metacharacters
|
|
20
|
+
const validTargetRegex = /^[a-zA-Z0-9.\-:_[\]]+$/;
|
|
21
|
+
if (!validTargetRegex.test(target)) {
|
|
22
|
+
return { valid: false, reason: 'Target contains invalid characters' };
|
|
23
|
+
}
|
|
24
|
+
// Disallow localhost/private IPs unless explicitly allowed (add config flag if needed)
|
|
25
|
+
const privateIPRegex = /^(127\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|::1|localhost)/;
|
|
26
|
+
if (privateIPRegex.test(target.toLowerCase())) {
|
|
27
|
+
console.warn(`Security warning: Scanning private/localhost target ${target}`);
|
|
28
|
+
}
|
|
29
|
+
return { valid: true };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate port numbers and ranges
|
|
33
|
+
*/
|
|
34
|
+
export function validatePorts(ports) {
|
|
35
|
+
if (typeof ports !== 'string') {
|
|
36
|
+
return { valid: false, reason: 'Ports must be a string' };
|
|
37
|
+
}
|
|
38
|
+
const portList = ports.split(',');
|
|
39
|
+
for (const port of portList) {
|
|
40
|
+
if (port.includes('-')) {
|
|
41
|
+
// Handle port ranges like "1-1000"
|
|
42
|
+
const [start, end] = port.split('-').map(p => parseInt(p.trim(), 10));
|
|
43
|
+
if (isNaN(start) || isNaN(end) || start < 1 || end > 65535 || start > end) {
|
|
44
|
+
return { valid: false, reason: `Invalid port range: ${port}` };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const portNum = parseInt(port.trim(), 10);
|
|
49
|
+
if (isNaN(portNum) || portNum < 1 || portNum > 65535) {
|
|
50
|
+
return { valid: false, reason: `Invalid port: ${port}` };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { valid: true };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validate and sanitize URL
|
|
58
|
+
*/
|
|
59
|
+
export function validateUrl(url) {
|
|
60
|
+
try {
|
|
61
|
+
const parsed = new URL(url);
|
|
62
|
+
// Validate protocol
|
|
63
|
+
if (!['http:', 'https:'].includes(parsed.protocol)) {
|
|
64
|
+
return { valid: false, reason: `Unsupported protocol: ${parsed.protocol}` };
|
|
65
|
+
}
|
|
66
|
+
// Validate hostname
|
|
67
|
+
const hostnameValidation = validateTarget(parsed.hostname);
|
|
68
|
+
if (!hostnameValidation.valid) {
|
|
69
|
+
return { valid: false, reason: hostnameValidation.reason };
|
|
70
|
+
}
|
|
71
|
+
// Sanitize path (basic prevention of directory traversal in URL)
|
|
72
|
+
const sanitizedPath = parsed.pathname.replace(/\.\.\//g, '').replace(/\/\/+/g, '/');
|
|
73
|
+
return {
|
|
74
|
+
valid: true,
|
|
75
|
+
sanitized: `${parsed.protocol}//${parsed.hostname}${sanitizedPath}${parsed.search}${parsed.hash}`
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
return { valid: false, reason: 'Invalid URL format' };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Safe command execution wrapper
|
|
84
|
+
* Uses spawnSync with array arguments, never shell mode
|
|
85
|
+
*/
|
|
86
|
+
export function safeExecSync(command, args = [], options = {}) {
|
|
87
|
+
try {
|
|
88
|
+
const defaultOptions = {
|
|
89
|
+
encoding: 'utf-8',
|
|
90
|
+
timeout: 30000,
|
|
91
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
92
|
+
shell: false, // CRITICAL: Never use shell mode
|
|
93
|
+
};
|
|
94
|
+
const mergedOptions = { ...defaultOptions, ...options };
|
|
95
|
+
const result = spawnSync(command, args, mergedOptions);
|
|
96
|
+
if (result.error) {
|
|
97
|
+
return {
|
|
98
|
+
success: false,
|
|
99
|
+
stdout: '',
|
|
100
|
+
stderr: '',
|
|
101
|
+
error: `Command execution failed: ${result.error.message}`
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
success: result.status === 0,
|
|
106
|
+
stdout: result.stdout?.toString() || '',
|
|
107
|
+
stderr: result.stderr?.toString() || '',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return {
|
|
112
|
+
success: false,
|
|
113
|
+
stdout: '',
|
|
114
|
+
stderr: '',
|
|
115
|
+
error: `Execution error: ${error.message}`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Sanitize user input for shell commands
|
|
121
|
+
* Escapes shell metacharacters
|
|
122
|
+
*/
|
|
123
|
+
export function sanitizeShellInput(input) {
|
|
124
|
+
if (typeof input !== 'string')
|
|
125
|
+
return '';
|
|
126
|
+
// Escape shell metacharacters
|
|
127
|
+
return input.replace(/[;&|`$\\'"\n\r]/g, '\\$&');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Validate and sanitize file path
|
|
131
|
+
* Prevents directory traversal anomalys
|
|
132
|
+
*/
|
|
133
|
+
export function sanitizeFilePath(path) {
|
|
134
|
+
if (typeof path !== 'string') {
|
|
135
|
+
return { valid: false, reason: 'Path must be a string' };
|
|
136
|
+
}
|
|
137
|
+
// Prevent directory traversal
|
|
138
|
+
if (path.includes('..') || path.includes('//')) {
|
|
139
|
+
return { valid: false, reason: 'Path contains directory traversal attempts' };
|
|
140
|
+
}
|
|
141
|
+
// Prevent absolute paths to sensitive locations (basic check)
|
|
142
|
+
const sensitivePaths = ['/etc/', '/var/', '/usr/', '/bin/', '/sbin/', '/root/', '/home/'];
|
|
143
|
+
const normalizedPath = path.toLowerCase();
|
|
144
|
+
if (sensitivePaths.some(sp => normalizedPath.startsWith(sp))) {
|
|
145
|
+
return { valid: false, reason: 'Path points to sensitive system location' };
|
|
146
|
+
}
|
|
147
|
+
return { valid: true, sanitized: path };
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Rate limiting and request throttling
|
|
151
|
+
*/
|
|
152
|
+
export class RateLimiter {
|
|
153
|
+
maxRequests;
|
|
154
|
+
timeWindowMs;
|
|
155
|
+
requests = new Map();
|
|
156
|
+
constructor(maxRequests = 10, timeWindowMs = 60000) {
|
|
157
|
+
this.maxRequests = maxRequests;
|
|
158
|
+
this.timeWindowMs = timeWindowMs;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Check if request is allowed
|
|
162
|
+
*/
|
|
163
|
+
isAllowed(key) {
|
|
164
|
+
const now = Date.now();
|
|
165
|
+
const windowStart = now - this.timeWindowMs;
|
|
166
|
+
let requests = this.requests.get(key) || [];
|
|
167
|
+
// Clean old requests
|
|
168
|
+
requests = requests.filter(time => time > windowStart);
|
|
169
|
+
if (requests.length >= this.maxRequests) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
requests.push(now);
|
|
173
|
+
this.requests.set(key, requests);
|
|
174
|
+
// Cleanup old entries periodically
|
|
175
|
+
if (Math.random() < 0.01) { // 1% chance to cleanup
|
|
176
|
+
this.cleanup();
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Clean up old request records
|
|
182
|
+
*/
|
|
183
|
+
cleanup() {
|
|
184
|
+
const now = Date.now();
|
|
185
|
+
const windowStart = now - this.timeWindowMs;
|
|
186
|
+
for (const [key, requests] of this.requests.entries()) {
|
|
187
|
+
const filtered = requests.filter(time => time > windowStart);
|
|
188
|
+
if (filtered.length === 0) {
|
|
189
|
+
this.requests.delete(key);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
this.requests.set(key, filtered);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get wait time if rate limited
|
|
198
|
+
*/
|
|
199
|
+
getWaitTime(key) {
|
|
200
|
+
const requests = this.requests.get(key) || [];
|
|
201
|
+
if (requests.length < this.maxRequests) {
|
|
202
|
+
return 0;
|
|
203
|
+
}
|
|
204
|
+
const oldest = Math.min(...requests);
|
|
205
|
+
return Math.max(0, oldest + this.timeWindowMs - Date.now());
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Secure HTTP request utilities
|
|
210
|
+
*/
|
|
211
|
+
export class SecureHttpClient {
|
|
212
|
+
rateLimiter = new RateLimiter(50, 60000); // 50 requests per minute
|
|
213
|
+
async get(url, options = {}) {
|
|
214
|
+
// Validate URL
|
|
215
|
+
const urlValidation = validateUrl(url);
|
|
216
|
+
if (!urlValidation.valid) {
|
|
217
|
+
return { success: false, error: urlValidation.reason };
|
|
218
|
+
}
|
|
219
|
+
// Rate limiting
|
|
220
|
+
const hostname = new URL(url).hostname;
|
|
221
|
+
if (!this.rateLimiter.isAllowed(hostname)) {
|
|
222
|
+
return {
|
|
223
|
+
success: false,
|
|
224
|
+
error: `Rate limit exceeded for ${hostname}. Wait ${this.rateLimiter.getWaitTime(hostname)}ms`
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
// Use native HTTP/HTTPS modules (implementation would go here)
|
|
228
|
+
// This is a placeholder for actual HTTP implementation
|
|
229
|
+
return { success: false, error: 'HTTP client not implemented' };
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Security policy validator
|
|
234
|
+
*/
|
|
235
|
+
export class SecurityPolicyValidator {
|
|
236
|
+
defaultContext = {
|
|
237
|
+
permissions: ['read', 'write', 'execute'],
|
|
238
|
+
maxExecutionTime: 30000,
|
|
239
|
+
allowedCommands: [
|
|
240
|
+
'nmap', 'curl', 'dig', 'sshpass', 'openssl',
|
|
241
|
+
// Kali offsec wrappers (each goes through a per-tool validator below)
|
|
242
|
+
'sqlmap', 'gobuster', 'ffuf', 'feroxbuster', 'nikto', 'wpscan',
|
|
243
|
+
'hydra', 'john', 'hashcat', 'masscan', 'amass', 'subfinder',
|
|
244
|
+
],
|
|
245
|
+
allowedHosts: []
|
|
246
|
+
};
|
|
247
|
+
validateCommand(command, args, context = {}) {
|
|
248
|
+
const mergedContext = { ...this.defaultContext, ...context };
|
|
249
|
+
if (!mergedContext.allowedCommands.includes(command)) {
|
|
250
|
+
return { allowed: false, reason: `Command ${command} not allowed` };
|
|
251
|
+
}
|
|
252
|
+
switch (command) {
|
|
253
|
+
case 'nmap': return this.validateNmapArgs(args);
|
|
254
|
+
case 'curl': return this.validateCurlArgs(args);
|
|
255
|
+
case 'sqlmap': return this.validateSqlmapArgs(args);
|
|
256
|
+
case 'gobuster': return this.validateGobusterArgs(args);
|
|
257
|
+
case 'ffuf': return this.validateFfufArgs(args);
|
|
258
|
+
case 'feroxbuster': return this.validateFeroxbusterArgs(args);
|
|
259
|
+
case 'nikto': return this.validateNiktoArgs(args);
|
|
260
|
+
case 'wpscan': return this.validateWpscanArgs(args);
|
|
261
|
+
case 'hydra': return this.validateHydraArgs(args);
|
|
262
|
+
case 'john': return this.validateJohnArgs(args);
|
|
263
|
+
case 'hashcat': return this.validateHashcatArgs(args);
|
|
264
|
+
case 'masscan': return this.validateMasscanArgs(args);
|
|
265
|
+
case 'amass': return this.validateAmassArgs(args);
|
|
266
|
+
case 'subfinder': return this.validateSubfinderArgs(args);
|
|
267
|
+
default: return { allowed: true };
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
validateNmapArgs(args) {
|
|
271
|
+
const allowedOptions = [
|
|
272
|
+
'-sS', '-sT', '-sV', '-sC', '-O', '-T4', '-T5', '-p', '-p-',
|
|
273
|
+
'-Pn', '-A', '--script=vuln', '--script=safe', '--open',
|
|
274
|
+
'--host-timeout', '--max-retries'
|
|
275
|
+
];
|
|
276
|
+
for (const arg of args) {
|
|
277
|
+
if (arg.startsWith('-p') && !['-p', '-p-'].includes(arg)) {
|
|
278
|
+
// Validate port specification
|
|
279
|
+
const ports = arg.substring(2);
|
|
280
|
+
const portValidation = validatePorts(ports);
|
|
281
|
+
if (!portValidation.valid) {
|
|
282
|
+
return { allowed: false, reason: portValidation.reason };
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
else if (!allowedOptions.includes(arg) && !arg.startsWith('--script')) {
|
|
286
|
+
return { allowed: false, reason: `Disallowed nmap option: ${arg}` };
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return { allowed: true };
|
|
290
|
+
}
|
|
291
|
+
validateCurlArgs(args) {
|
|
292
|
+
for (let i = 0; i < args.length; i++) {
|
|
293
|
+
const arg = args[i];
|
|
294
|
+
if (arg === '-X' || arg === '--request') {
|
|
295
|
+
const method = args[i + 1];
|
|
296
|
+
if (!['GET', 'POST', 'HEAD', 'OPTIONS'].includes(method?.toUpperCase())) {
|
|
297
|
+
return { allowed: false, reason: `Disallowed HTTP method: ${method}` };
|
|
298
|
+
}
|
|
299
|
+
i++; // Skip next arg
|
|
300
|
+
}
|
|
301
|
+
if (arg.startsWith('http://') || arg.startsWith('https://')) {
|
|
302
|
+
const urlValidation = validateUrl(arg);
|
|
303
|
+
if (!urlValidation.valid) {
|
|
304
|
+
return { allowed: false, reason: urlValidation.reason };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return { allowed: true };
|
|
309
|
+
}
|
|
310
|
+
// Reject shell metacharacters and the like in any argv entry. The Kali plugin
|
|
311
|
+
// never passes user input as a shell string, but defense-in-depth: if a wrapper
|
|
312
|
+
// is misused or extended, this catches the obvious injection shapes.
|
|
313
|
+
rejectShellMeta(args) {
|
|
314
|
+
const meta = /[;&|`$<>\n\r\\]/;
|
|
315
|
+
for (const arg of args) {
|
|
316
|
+
if (meta.test(arg)) {
|
|
317
|
+
return { allowed: false, reason: `Argument contains shell metacharacter: ${arg}` };
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return { allowed: true };
|
|
321
|
+
}
|
|
322
|
+
validateSqlmapArgs(args) {
|
|
323
|
+
const meta = this.rejectShellMeta(args);
|
|
324
|
+
if (!meta.allowed)
|
|
325
|
+
return meta;
|
|
326
|
+
const allowed = new Set([
|
|
327
|
+
'-u', '--url', '--data', '--cookie', '--batch', '--random-agent',
|
|
328
|
+
'--level', '--risk', '--threads', '--dbs', '--tables', '--columns',
|
|
329
|
+
'--dump', '--current-user', '--current-db', '--is-dba',
|
|
330
|
+
'--technique', '--dbms', '--proxy', '--output-dir', '-r',
|
|
331
|
+
]);
|
|
332
|
+
for (const arg of args) {
|
|
333
|
+
if (arg.startsWith('-') && !allowed.has(arg) && !arg.startsWith('--level=') && !arg.startsWith('--risk=') && !arg.startsWith('--threads=')) {
|
|
334
|
+
return { allowed: false, reason: `Disallowed sqlmap option: ${arg}` };
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return { allowed: true };
|
|
338
|
+
}
|
|
339
|
+
validateGobusterArgs(args) {
|
|
340
|
+
const meta = this.rejectShellMeta(args);
|
|
341
|
+
if (!meta.allowed)
|
|
342
|
+
return meta;
|
|
343
|
+
const allowedFirst = new Set(['dir', 'dns', 'fuzz', 'vhost', 's3', 'gcs']);
|
|
344
|
+
if (args.length === 0 || !allowedFirst.has(args[0])) {
|
|
345
|
+
return { allowed: false, reason: `gobuster requires mode (dir/dns/fuzz/vhost), got: ${args[0]}` };
|
|
346
|
+
}
|
|
347
|
+
const allowed = new Set(['-u', '--url', '-w', '--wordlist', '-t', '--threads', '-o', '--output', '-x', '--extensions', '-s', '--status-codes', '-k', '--no-tls-validation', '-d', '--domain', '--no-color', '-q', '--quiet']);
|
|
348
|
+
for (let i = 1; i < args.length; i++) {
|
|
349
|
+
const arg = args[i];
|
|
350
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
351
|
+
return { allowed: false, reason: `Disallowed gobuster option: ${arg}` };
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return { allowed: true };
|
|
355
|
+
}
|
|
356
|
+
validateFfufArgs(args) {
|
|
357
|
+
const meta = this.rejectShellMeta(args);
|
|
358
|
+
if (!meta.allowed)
|
|
359
|
+
return meta;
|
|
360
|
+
const allowed = new Set(['-u', '-w', '-t', '-o', '-of', '-mc', '-fc', '-fs', '-ms', '-X', '-H', '-d', '-recursion', '-p', '-c', '-v', '-s']);
|
|
361
|
+
for (const arg of args) {
|
|
362
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
363
|
+
return { allowed: false, reason: `Disallowed ffuf option: ${arg}` };
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return { allowed: true };
|
|
367
|
+
}
|
|
368
|
+
validateFeroxbusterArgs(args) {
|
|
369
|
+
const meta = this.rejectShellMeta(args);
|
|
370
|
+
if (!meta.allowed)
|
|
371
|
+
return meta;
|
|
372
|
+
const allowed = new Set(['-u', '--url', '-w', '--wordlist', '-t', '--threads', '-o', '--output', '-x', '--extensions', '-s', '--status-codes', '-k', '--insecure', '-d', '--depth', '-q', '--quiet', '-n', '--no-recursion']);
|
|
373
|
+
for (const arg of args) {
|
|
374
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
375
|
+
return { allowed: false, reason: `Disallowed feroxbuster option: ${arg}` };
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return { allowed: true };
|
|
379
|
+
}
|
|
380
|
+
validateNiktoArgs(args) {
|
|
381
|
+
const meta = this.rejectShellMeta(args);
|
|
382
|
+
if (!meta.allowed)
|
|
383
|
+
return meta;
|
|
384
|
+
const allowed = new Set(['-h', '-host', '-port', '-p', '-output', '-o', '-Format', '-Tuning', '-ssl', '-nossl', '-Plugins']);
|
|
385
|
+
for (const arg of args) {
|
|
386
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
387
|
+
return { allowed: false, reason: `Disallowed nikto option: ${arg}` };
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return { allowed: true };
|
|
391
|
+
}
|
|
392
|
+
validateWpscanArgs(args) {
|
|
393
|
+
const meta = this.rejectShellMeta(args);
|
|
394
|
+
if (!meta.allowed)
|
|
395
|
+
return meta;
|
|
396
|
+
const allowed = new Set(['--url', '-u', '--enumerate', '-e', '--api-token', '--random-user-agent', '--disable-tls-checks', '-o', '--output', '--format', '--plugins-detection', '--users-detection']);
|
|
397
|
+
for (const arg of args) {
|
|
398
|
+
if (arg.startsWith('-') && !allowed.has(arg) && !arg.startsWith('--enumerate=')) {
|
|
399
|
+
return { allowed: false, reason: `Disallowed wpscan option: ${arg}` };
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return { allowed: true };
|
|
403
|
+
}
|
|
404
|
+
validateHydraArgs(args) {
|
|
405
|
+
const meta = this.rejectShellMeta(args);
|
|
406
|
+
if (!meta.allowed)
|
|
407
|
+
return meta;
|
|
408
|
+
const allowed = new Set(['-l', '-L', '-p', '-P', '-t', '-s', '-S', '-f', '-V', '-v', '-o', '-e', '-u', '-C', '-M']);
|
|
409
|
+
for (const arg of args) {
|
|
410
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
411
|
+
return { allowed: false, reason: `Disallowed hydra option: ${arg}` };
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return { allowed: true };
|
|
415
|
+
}
|
|
416
|
+
validateJohnArgs(args) {
|
|
417
|
+
const meta = this.rejectShellMeta(args);
|
|
418
|
+
if (!meta.allowed)
|
|
419
|
+
return meta;
|
|
420
|
+
for (const arg of args) {
|
|
421
|
+
if (arg.startsWith('--') && !/^--(wordlist|format|rules|incremental|show|status|fork|session|pot)(=.+)?$/.test(arg)) {
|
|
422
|
+
return { allowed: false, reason: `Disallowed john option: ${arg}` };
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return { allowed: true };
|
|
426
|
+
}
|
|
427
|
+
validateHashcatArgs(args) {
|
|
428
|
+
const meta = this.rejectShellMeta(args);
|
|
429
|
+
if (!meta.allowed)
|
|
430
|
+
return meta;
|
|
431
|
+
const allowed = new Set(['-m', '-a', '-o', '--show', '--status', '-w', '-r', '--force', '-O', '--quiet', '--potfile-path']);
|
|
432
|
+
for (const arg of args) {
|
|
433
|
+
if (arg.startsWith('-') && !allowed.has(arg) && !/^-(m|a|w|O)\d+$/.test(arg)) {
|
|
434
|
+
return { allowed: false, reason: `Disallowed hashcat option: ${arg}` };
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return { allowed: true };
|
|
438
|
+
}
|
|
439
|
+
validateMasscanArgs(args) {
|
|
440
|
+
const meta = this.rejectShellMeta(args);
|
|
441
|
+
if (!meta.allowed)
|
|
442
|
+
return meta;
|
|
443
|
+
const allowed = new Set(['-p', '--ports', '--rate', '-oG', '-oJ', '-oX', '--banners', '-e', '--source-ip', '--exclude', '--excludefile']);
|
|
444
|
+
for (const arg of args) {
|
|
445
|
+
if (arg.startsWith('-') && !allowed.has(arg) && !arg.startsWith('--rate=')) {
|
|
446
|
+
return { allowed: false, reason: `Disallowed masscan option: ${arg}` };
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return { allowed: true };
|
|
450
|
+
}
|
|
451
|
+
validateAmassArgs(args) {
|
|
452
|
+
const meta = this.rejectShellMeta(args);
|
|
453
|
+
if (!meta.allowed)
|
|
454
|
+
return meta;
|
|
455
|
+
const allowedFirst = new Set(['enum', 'intel', 'viz', 'track', 'db']);
|
|
456
|
+
if (args.length === 0 || !allowedFirst.has(args[0])) {
|
|
457
|
+
return { allowed: false, reason: `amass requires subcommand (enum/intel/viz/track/db)` };
|
|
458
|
+
}
|
|
459
|
+
const allowed = new Set(['-d', '-passive', '-active', '-brute', '-w', '-o', '-json', '-config', '-src', '-ip', '-cidr', '-asn']);
|
|
460
|
+
for (let i = 1; i < args.length; i++) {
|
|
461
|
+
const arg = args[i];
|
|
462
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
463
|
+
return { allowed: false, reason: `Disallowed amass option: ${arg}` };
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return { allowed: true };
|
|
467
|
+
}
|
|
468
|
+
validateSubfinderArgs(args) {
|
|
469
|
+
const meta = this.rejectShellMeta(args);
|
|
470
|
+
if (!meta.allowed)
|
|
471
|
+
return meta;
|
|
472
|
+
const allowed = new Set(['-d', '-domain', '-o', '-output', '-silent', '-all', '-recursive', '-t', '-timeout', '-nW', '-active']);
|
|
473
|
+
for (const arg of args) {
|
|
474
|
+
if (arg.startsWith('-') && !allowed.has(arg)) {
|
|
475
|
+
return { allowed: false, reason: `Disallowed subfinder option: ${arg}` };
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return { allowed: true };
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Security logger for audit trail
|
|
483
|
+
*/
|
|
484
|
+
export class SecurityLogger {
|
|
485
|
+
logFile;
|
|
486
|
+
constructor(logFile) {
|
|
487
|
+
this.logFile = logFile;
|
|
488
|
+
}
|
|
489
|
+
logSecurityEvent(event) {
|
|
490
|
+
const logEntry = {
|
|
491
|
+
...event,
|
|
492
|
+
timestamp: event.timestamp.toISOString(),
|
|
493
|
+
ip: this.getClientIp()
|
|
494
|
+
};
|
|
495
|
+
// Keep security logging off the main console; emit via debug logger
|
|
496
|
+
logDebug(`[SECURITY] ${JSON.stringify(logEntry)}`);
|
|
497
|
+
}
|
|
498
|
+
getClientIp() {
|
|
499
|
+
// Placeholder for actual IP detection
|
|
500
|
+
return '127.0.0.1';
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Export singleton instances
|
|
504
|
+
export const securityValidator = new SecurityPolicyValidator();
|
|
505
|
+
export const securityLogger = new SecurityLogger();
|
|
506
|
+
export const globalRateLimiter = new RateLimiter(100, 60000); // 100 requests per minute globally
|
|
507
|
+
//# sourceMappingURL=securityUtils.js.map
|