@trenchwork/erosolar 1.1.28 → 1.1.30
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 +1 -1
- package/SECURITY.md +35 -0
- package/dist/contracts/agent-schemas.json +1 -1
- package/package.json +1 -1
- package/dist/bin/cliMode.d.ts +0 -8
- package/dist/bin/cliMode.d.ts.map +0 -1
- package/dist/bin/cliMode.js +0 -20
- package/dist/bin/cliMode.js.map +0 -1
- package/dist/bin/deepseek.d.ts +0 -3
- package/dist/bin/deepseek.d.ts.map +0 -1
- package/dist/bin/deepseek.js +0 -307
- package/dist/bin/deepseek.js.map +0 -1
- package/dist/bin/erosolar.d.ts +0 -7
- package/dist/bin/erosolar.d.ts.map +0 -1
- package/dist/bin/erosolar.js +0 -7
- package/dist/bin/erosolar.js.map +0 -1
- package/dist/bin/selfTest.d.ts +0 -14
- package/dist/bin/selfTest.d.ts.map +0 -1
- package/dist/bin/selfTest.js +0 -298
- package/dist/bin/selfTest.js.map +0 -1
- package/dist/capabilities/_processRunner.d.ts +0 -17
- package/dist/capabilities/_processRunner.d.ts.map +0 -1
- package/dist/capabilities/_processRunner.js +0 -74
- package/dist/capabilities/_processRunner.js.map +0 -1
- package/dist/capabilities/aflppCapability.d.ts +0 -7
- package/dist/capabilities/aflppCapability.d.ts.map +0 -1
- package/dist/capabilities/aflppCapability.js +0 -301
- package/dist/capabilities/aflppCapability.js.map +0 -1
- package/dist/capabilities/baseCapability.d.ts +0 -72
- package/dist/capabilities/baseCapability.d.ts.map +0 -1
- package/dist/capabilities/baseCapability.js +0 -183
- package/dist/capabilities/baseCapability.js.map +0 -1
- package/dist/capabilities/bashCapability.d.ts +0 -13
- package/dist/capabilities/bashCapability.d.ts.map +0 -1
- package/dist/capabilities/bashCapability.js +0 -24
- package/dist/capabilities/bashCapability.js.map +0 -1
- package/dist/capabilities/binaryAnalysisCapability.d.ts +0 -7
- package/dist/capabilities/binaryAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/binaryAnalysisCapability.js +0 -201
- package/dist/capabilities/binaryAnalysisCapability.js.map +0 -1
- package/dist/capabilities/editCapability.d.ts +0 -17
- package/dist/capabilities/editCapability.d.ts.map +0 -1
- package/dist/capabilities/editCapability.js +0 -27
- package/dist/capabilities/editCapability.js.map +0 -1
- package/dist/capabilities/enhancedGitCapability.d.ts +0 -7
- package/dist/capabilities/enhancedGitCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedGitCapability.js +0 -220
- package/dist/capabilities/enhancedGitCapability.js.map +0 -1
- package/dist/capabilities/filesystemCapability.d.ts +0 -13
- package/dist/capabilities/filesystemCapability.d.ts.map +0 -1
- package/dist/capabilities/filesystemCapability.js +0 -24
- package/dist/capabilities/filesystemCapability.js.map +0 -1
- package/dist/capabilities/gdbCapability.d.ts +0 -7
- package/dist/capabilities/gdbCapability.d.ts.map +0 -1
- package/dist/capabilities/gdbCapability.js +0 -125
- package/dist/capabilities/gdbCapability.js.map +0 -1
- package/dist/capabilities/ghidraHeadlessCapability.d.ts +0 -25
- package/dist/capabilities/ghidraHeadlessCapability.d.ts.map +0 -1
- package/dist/capabilities/ghidraHeadlessCapability.js +0 -593
- package/dist/capabilities/ghidraHeadlessCapability.js.map +0 -1
- package/dist/capabilities/gitHistoryCapability.d.ts +0 -6
- package/dist/capabilities/gitHistoryCapability.d.ts.map +0 -1
- package/dist/capabilities/gitHistoryCapability.js +0 -184
- package/dist/capabilities/gitHistoryCapability.js.map +0 -1
- package/dist/capabilities/hitlCapability.d.ts +0 -18
- package/dist/capabilities/hitlCapability.d.ts.map +0 -1
- package/dist/capabilities/hitlCapability.js +0 -29
- package/dist/capabilities/hitlCapability.js.map +0 -1
- package/dist/capabilities/index.d.ts +0 -18
- package/dist/capabilities/index.d.ts.map +0 -1
- package/dist/capabilities/index.js +0 -23
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/kaliCapability.d.ts +0 -14
- package/dist/capabilities/kaliCapability.d.ts.map +0 -1
- package/dist/capabilities/kaliCapability.js +0 -478
- package/dist/capabilities/kaliCapability.js.map +0 -1
- package/dist/capabilities/mcpCapability.d.ts +0 -7
- package/dist/capabilities/mcpCapability.d.ts.map +0 -1
- package/dist/capabilities/mcpCapability.js +0 -80
- package/dist/capabilities/mcpCapability.js.map +0 -1
- package/dist/capabilities/memoryCapability.d.ts +0 -10
- package/dist/capabilities/memoryCapability.d.ts.map +0 -1
- package/dist/capabilities/memoryCapability.js +0 -22
- package/dist/capabilities/memoryCapability.js.map +0 -1
- package/dist/capabilities/notebookCapability.d.ts +0 -6
- package/dist/capabilities/notebookCapability.d.ts.map +0 -1
- package/dist/capabilities/notebookCapability.js +0 -17
- package/dist/capabilities/notebookCapability.js.map +0 -1
- package/dist/capabilities/pwntoolsCapability.d.ts +0 -7
- package/dist/capabilities/pwntoolsCapability.d.ts.map +0 -1
- package/dist/capabilities/pwntoolsCapability.js +0 -109
- package/dist/capabilities/pwntoolsCapability.js.map +0 -1
- package/dist/capabilities/searchCapability.d.ts +0 -19
- package/dist/capabilities/searchCapability.d.ts.map +0 -1
- package/dist/capabilities/searchCapability.js +0 -29
- package/dist/capabilities/searchCapability.js.map +0 -1
- package/dist/capabilities/skillCapability.d.ts +0 -6
- package/dist/capabilities/skillCapability.d.ts.map +0 -1
- package/dist/capabilities/skillCapability.js +0 -17
- package/dist/capabilities/skillCapability.js.map +0 -1
- package/dist/capabilities/todoCapability.d.ts +0 -11
- package/dist/capabilities/todoCapability.d.ts.map +0 -1
- package/dist/capabilities/todoCapability.js +0 -22
- package/dist/capabilities/todoCapability.js.map +0 -1
- package/dist/capabilities/toolManifest.d.ts +0 -3
- package/dist/capabilities/toolManifest.d.ts.map +0 -1
- package/dist/capabilities/toolManifest.js +0 -163
- package/dist/capabilities/toolManifest.js.map +0 -1
- package/dist/capabilities/toolRegistry.d.ts +0 -25
- package/dist/capabilities/toolRegistry.d.ts.map +0 -1
- package/dist/capabilities/toolRegistry.js +0 -150
- package/dist/capabilities/toolRegistry.js.map +0 -1
- package/dist/capabilities/unifiedCodingCapability.d.ts +0 -62
- package/dist/capabilities/unifiedCodingCapability.d.ts.map +0 -1
- package/dist/capabilities/unifiedCodingCapability.js +0 -788
- package/dist/capabilities/unifiedCodingCapability.js.map +0 -1
- package/dist/capabilities/webCapability.d.ts +0 -23
- package/dist/capabilities/webCapability.d.ts.map +0 -1
- package/dist/capabilities/webCapability.js +0 -33
- package/dist/capabilities/webCapability.js.map +0 -1
- package/dist/config.d.ts +0 -25
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -155
- package/dist/config.js.map +0 -1
- package/dist/contracts/v1/agent.d.ts +0 -179
- package/dist/contracts/v1/agent.d.ts.map +0 -1
- package/dist/contracts/v1/agent.js +0 -8
- package/dist/contracts/v1/agent.js.map +0 -1
- package/dist/contracts/v1/agentProfileManifest.d.ts +0 -60
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +0 -1
- package/dist/contracts/v1/agentProfileManifest.js +0 -9
- package/dist/contracts/v1/agentProfileManifest.js.map +0 -1
- package/dist/contracts/v1/agentRules.d.ts +0 -60
- package/dist/contracts/v1/agentRules.d.ts.map +0 -1
- package/dist/contracts/v1/agentRules.js +0 -10
- package/dist/contracts/v1/agentRules.js.map +0 -1
- package/dist/contracts/v1/provider.d.ts +0 -149
- package/dist/contracts/v1/provider.d.ts.map +0 -1
- package/dist/contracts/v1/provider.js +0 -7
- package/dist/contracts/v1/provider.js.map +0 -1
- package/dist/contracts/v1/tool.d.ts +0 -136
- package/dist/contracts/v1/tool.d.ts.map +0 -1
- package/dist/contracts/v1/tool.js +0 -7
- package/dist/contracts/v1/tool.js.map +0 -1
- package/dist/contracts/v1/toolAccess.d.ts +0 -43
- package/dist/contracts/v1/toolAccess.d.ts.map +0 -1
- package/dist/contracts/v1/toolAccess.js +0 -9
- package/dist/contracts/v1/toolAccess.js.map +0 -1
- package/dist/core/agent.d.ts +0 -320
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -1627
- package/dist/core/agent.js.map +0 -1
- package/dist/core/agentProfileManifest.d.ts +0 -3
- package/dist/core/agentProfileManifest.d.ts.map +0 -1
- package/dist/core/agentProfileManifest.js +0 -188
- package/dist/core/agentProfileManifest.js.map +0 -1
- package/dist/core/agentProfiles.d.ts +0 -22
- package/dist/core/agentProfiles.d.ts.map +0 -1
- package/dist/core/agentProfiles.js +0 -35
- package/dist/core/agentProfiles.js.map +0 -1
- package/dist/core/agentRegistry.d.ts +0 -111
- package/dist/core/agentRegistry.d.ts.map +0 -1
- package/dist/core/agentRegistry.js +0 -229
- package/dist/core/agentRegistry.js.map +0 -1
- package/dist/core/agentRulebook.d.ts +0 -11
- package/dist/core/agentRulebook.d.ts.map +0 -1
- package/dist/core/agentRulebook.js +0 -136
- package/dist/core/agentRulebook.js.map +0 -1
- package/dist/core/agentSchemaLoader.d.ts +0 -131
- package/dist/core/agentSchemaLoader.d.ts.map +0 -1
- package/dist/core/agentSchemaLoader.js +0 -235
- package/dist/core/agentSchemaLoader.js.map +0 -1
- package/dist/core/aiErrorFixer.d.ts +0 -57
- package/dist/core/aiErrorFixer.d.ts.map +0 -1
- package/dist/core/aiErrorFixer.js +0 -214
- package/dist/core/aiErrorFixer.js.map +0 -1
- package/dist/core/artifactStore.d.ts +0 -35
- package/dist/core/artifactStore.d.ts.map +0 -1
- package/dist/core/artifactStore.js +0 -105
- package/dist/core/artifactStore.js.map +0 -1
- package/dist/core/auth.d.ts +0 -15
- package/dist/core/auth.d.ts.map +0 -1
- package/dist/core/auth.js +0 -291
- package/dist/core/auth.js.map +0 -1
- package/dist/core/bashCommandGuidance.d.ts +0 -16
- package/dist/core/bashCommandGuidance.d.ts.map +0 -1
- package/dist/core/bashCommandGuidance.js +0 -40
- package/dist/core/bashCommandGuidance.js.map +0 -1
- package/dist/core/constants.d.ts +0 -31
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/constants.js +0 -62
- package/dist/core/constants.js.map +0 -1
- package/dist/core/contextManager.d.ts +0 -271
- package/dist/core/contextManager.d.ts.map +0 -1
- package/dist/core/contextManager.js +0 -1073
- package/dist/core/contextManager.js.map +0 -1
- package/dist/core/contextWindow.d.ts +0 -42
- package/dist/core/contextWindow.d.ts.map +0 -1
- package/dist/core/contextWindow.js +0 -123
- package/dist/core/contextWindow.js.map +0 -1
- package/dist/core/customCommands.d.ts +0 -19
- package/dist/core/customCommands.d.ts.map +0 -1
- package/dist/core/customCommands.js +0 -85
- package/dist/core/customCommands.js.map +0 -1
- package/dist/core/errors/apiKeyErrors.d.ts +0 -11
- package/dist/core/errors/apiKeyErrors.d.ts.map +0 -1
- package/dist/core/errors/apiKeyErrors.js +0 -159
- package/dist/core/errors/apiKeyErrors.js.map +0 -1
- package/dist/core/errors/errorTypes.d.ts +0 -111
- package/dist/core/errors/errorTypes.d.ts.map +0 -1
- package/dist/core/errors/errorTypes.js +0 -345
- package/dist/core/errors/errorTypes.js.map +0 -1
- package/dist/core/errors/index.d.ts +0 -50
- package/dist/core/errors/index.d.ts.map +0 -1
- package/dist/core/errors/index.js +0 -156
- package/dist/core/errors/index.js.map +0 -1
- package/dist/core/errors/networkErrors.d.ts +0 -14
- package/dist/core/errors/networkErrors.d.ts.map +0 -1
- package/dist/core/errors/networkErrors.js +0 -53
- package/dist/core/errors/networkErrors.js.map +0 -1
- package/dist/core/errors/safetyValidator.d.ts +0 -109
- package/dist/core/errors/safetyValidator.d.ts.map +0 -1
- package/dist/core/errors/safetyValidator.js +0 -271
- package/dist/core/errors/safetyValidator.js.map +0 -1
- package/dist/core/errors.d.ts +0 -4
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -33
- package/dist/core/errors.js.map +0 -1
- package/dist/core/finalResponseFormatter.d.ts +0 -10
- package/dist/core/finalResponseFormatter.d.ts.map +0 -1
- package/dist/core/finalResponseFormatter.js +0 -14
- package/dist/core/finalResponseFormatter.js.map +0 -1
- package/dist/core/guardrails.d.ts +0 -146
- package/dist/core/guardrails.d.ts.map +0 -1
- package/dist/core/guardrails.js +0 -361
- package/dist/core/guardrails.js.map +0 -1
- package/dist/core/hitl.d.ts +0 -119
- package/dist/core/hitl.d.ts.map +0 -1
- package/dist/core/hitl.js +0 -387
- package/dist/core/hitl.js.map +0 -1
- package/dist/core/hooks.d.ts +0 -95
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js +0 -239
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/index.d.ts +0 -7
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -7
- package/dist/core/index.js.map +0 -1
- package/dist/core/inputProtection.d.ts +0 -122
- package/dist/core/inputProtection.d.ts.map +0 -1
- package/dist/core/inputProtection.js +0 -422
- package/dist/core/inputProtection.js.map +0 -1
- package/dist/core/modelDiscovery.d.ts +0 -105
- package/dist/core/modelDiscovery.d.ts.map +0 -1
- package/dist/core/modelDiscovery.js +0 -768
- package/dist/core/modelDiscovery.js.map +0 -1
- package/dist/core/multilinePasteHandler.d.ts +0 -35
- package/dist/core/multilinePasteHandler.d.ts.map +0 -1
- package/dist/core/multilinePasteHandler.js +0 -81
- package/dist/core/multilinePasteHandler.js.map +0 -1
- package/dist/core/preferences.d.ts +0 -65
- package/dist/core/preferences.d.ts.map +0 -1
- package/dist/core/preferences.js +0 -305
- package/dist/core/preferences.js.map +0 -1
- package/dist/core/providerKeys.d.ts +0 -20
- package/dist/core/providerKeys.d.ts.map +0 -1
- package/dist/core/providerKeys.js +0 -40
- package/dist/core/providerKeys.js.map +0 -1
- package/dist/core/refusalDetection.d.ts +0 -2
- package/dist/core/refusalDetection.d.ts.map +0 -1
- package/dist/core/refusalDetection.js +0 -51
- package/dist/core/refusalDetection.js.map +0 -1
- package/dist/core/resultVerification.d.ts +0 -47
- package/dist/core/resultVerification.d.ts.map +0 -1
- package/dist/core/resultVerification.js +0 -126
- package/dist/core/resultVerification.js.map +0 -1
- package/dist/core/reviewerGuard.d.ts +0 -37
- package/dist/core/reviewerGuard.d.ts.map +0 -1
- package/dist/core/reviewerGuard.js +0 -188
- package/dist/core/reviewerGuard.js.map +0 -1
- package/dist/core/schemaValidator.d.ts +0 -49
- package/dist/core/schemaValidator.d.ts.map +0 -1
- package/dist/core/schemaValidator.js +0 -234
- package/dist/core/schemaValidator.js.map +0 -1
- package/dist/core/secretStore.d.ts +0 -48
- package/dist/core/secretStore.d.ts.map +0 -1
- package/dist/core/secretStore.js +0 -259
- package/dist/core/secretStore.js.map +0 -1
- package/dist/core/sessionStorage.d.ts +0 -10
- package/dist/core/sessionStorage.d.ts.map +0 -1
- package/dist/core/sessionStorage.js +0 -46
- package/dist/core/sessionStorage.js.map +0 -1
- package/dist/core/sessionStore.d.ts +0 -35
- package/dist/core/sessionStore.d.ts.map +0 -1
- package/dist/core/sessionStore.js +0 -191
- package/dist/core/sessionStore.js.map +0 -1
- package/dist/core/sharedSecrets.d.ts +0 -60
- package/dist/core/sharedSecrets.d.ts.map +0 -1
- package/dist/core/sharedSecrets.js +0 -111
- package/dist/core/sharedSecrets.js.map +0 -1
- package/dist/core/shutdown.d.ts +0 -34
- package/dist/core/shutdown.d.ts.map +0 -1
- package/dist/core/shutdown.js +0 -186
- package/dist/core/shutdown.js.map +0 -1
- package/dist/core/sudoPasswordManager.d.ts +0 -52
- package/dist/core/sudoPasswordManager.d.ts.map +0 -1
- package/dist/core/sudoPasswordManager.js +0 -115
- package/dist/core/sudoPasswordManager.js.map +0 -1
- package/dist/core/taskCompletionDetector.d.ts +0 -117
- package/dist/core/taskCompletionDetector.d.ts.map +0 -1
- package/dist/core/taskCompletionDetector.js +0 -532
- package/dist/core/taskCompletionDetector.js.map +0 -1
- package/dist/core/testFailureMonitor.d.ts +0 -67
- package/dist/core/testFailureMonitor.d.ts.map +0 -1
- package/dist/core/testFailureMonitor.js +0 -262
- package/dist/core/testFailureMonitor.js.map +0 -1
- package/dist/core/toolPreconditions.d.ts +0 -34
- package/dist/core/toolPreconditions.d.ts.map +0 -1
- package/dist/core/toolPreconditions.js +0 -242
- package/dist/core/toolPreconditions.js.map +0 -1
- package/dist/core/toolRuntime.d.ts +0 -192
- package/dist/core/toolRuntime.d.ts.map +0 -1
- package/dist/core/toolRuntime.js +0 -511
- package/dist/core/toolRuntime.js.map +0 -1
- package/dist/core/types/utilityTypes.d.ts +0 -183
- package/dist/core/types/utilityTypes.d.ts.map +0 -1
- package/dist/core/types/utilityTypes.js +0 -273
- package/dist/core/types/utilityTypes.js.map +0 -1
- package/dist/core/types.d.ts +0 -334
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -76
- package/dist/core/types.js.map +0 -1
- package/dist/core/updateChecker.d.ts +0 -148
- package/dist/core/updateChecker.d.ts.map +0 -1
- package/dist/core/updateChecker.js +0 -599
- package/dist/core/updateChecker.js.map +0 -1
- package/dist/core/usageTracker.d.ts +0 -11
- package/dist/core/usageTracker.d.ts.map +0 -1
- package/dist/core/usageTracker.js +0 -128
- package/dist/core/usageTracker.js.map +0 -1
- package/dist/core/userApproval.d.ts +0 -95
- package/dist/core/userApproval.d.ts.map +0 -1
- package/dist/core/userApproval.js +0 -239
- package/dist/core/userApproval.js.map +0 -1
- package/dist/headless/interactiveShell.d.ts +0 -22
- package/dist/headless/interactiveShell.d.ts.map +0 -1
- package/dist/headless/interactiveShell.js +0 -2121
- package/dist/headless/interactiveShell.js.map +0 -1
- package/dist/leanAgent.d.ts +0 -73
- package/dist/leanAgent.d.ts.map +0 -1
- package/dist/leanAgent.js +0 -177
- package/dist/leanAgent.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -49
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -104
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/providers/anthropic/index.d.ts +0 -9
- package/dist/plugins/providers/anthropic/index.d.ts.map +0 -1
- package/dist/plugins/providers/anthropic/index.js +0 -48
- package/dist/plugins/providers/anthropic/index.js.map +0 -1
- package/dist/plugins/providers/deepseek/index.d.ts +0 -11
- package/dist/plugins/providers/deepseek/index.d.ts.map +0 -1
- package/dist/plugins/providers/deepseek/index.js +0 -54
- package/dist/plugins/providers/deepseek/index.js.map +0 -1
- package/dist/plugins/providers/index.d.ts +0 -2
- package/dist/plugins/providers/index.d.ts.map +0 -1
- package/dist/plugins/providers/index.js +0 -17
- package/dist/plugins/providers/index.js.map +0 -1
- package/dist/plugins/providers/openai/index.d.ts +0 -10
- package/dist/plugins/providers/openai/index.d.ts.map +0 -1
- package/dist/plugins/providers/openai/index.js +0 -47
- package/dist/plugins/providers/openai/index.js.map +0 -1
- package/dist/plugins/providers/xai/index.d.ts +0 -10
- package/dist/plugins/providers/xai/index.d.ts.map +0 -1
- package/dist/plugins/providers/xai/index.js +0 -47
- package/dist/plugins/providers/xai/index.js.map +0 -1
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +0 -10
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -110
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +0 -1
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +0 -3
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/bash/localBashPlugin.js +0 -14
- package/dist/plugins/tools/bash/localBashPlugin.js.map +0 -1
- package/dist/plugins/tools/edit/editPlugin.d.ts +0 -9
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/edit/editPlugin.js +0 -15
- package/dist/plugins/tools/edit/editPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -9
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +0 -1
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +0 -3
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +0 -14
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +0 -1
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +0 -3
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +0 -9
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +0 -1
- package/dist/plugins/tools/index.d.ts +0 -3
- package/dist/plugins/tools/index.d.ts.map +0 -1
- package/dist/plugins/tools/index.js +0 -3
- package/dist/plugins/tools/index.js.map +0 -1
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts +0 -3
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/integrity/integrityPlugin.js +0 -31
- package/dist/plugins/tools/integrity/integrityPlugin.js.map +0 -1
- package/dist/plugins/tools/kali/kaliPlugin.d.ts +0 -3
- package/dist/plugins/tools/kali/kaliPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/kali/kaliPlugin.js +0 -10
- package/dist/plugins/tools/kali/kaliPlugin.js.map +0 -1
- package/dist/plugins/tools/mcp/mcpClient.d.ts +0 -49
- package/dist/plugins/tools/mcp/mcpClient.d.ts.map +0 -1
- package/dist/plugins/tools/mcp/mcpClient.js +0 -112
- package/dist/plugins/tools/mcp/mcpClient.js.map +0 -1
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts +0 -3
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/mcp/mcpPlugin.js +0 -10
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +0 -1
- package/dist/plugins/tools/nodeDefaults.d.ts +0 -13
- package/dist/plugins/tools/nodeDefaults.d.ts.map +0 -1
- package/dist/plugins/tools/nodeDefaults.js +0 -37
- package/dist/plugins/tools/nodeDefaults.js.map +0 -1
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +0 -3
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +0 -340
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +0 -1
- package/dist/plugins/tools/registry.d.ts +0 -22
- package/dist/plugins/tools/registry.d.ts.map +0 -1
- package/dist/plugins/tools/registry.js +0 -58
- package/dist/plugins/tools/registry.js.map +0 -1
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +0 -3
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/search/localSearchPlugin.js +0 -14
- package/dist/plugins/tools/search/localSearchPlugin.js.map +0 -1
- package/dist/plugins/tools/skills/skillPlugin.d.ts +0 -3
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/skills/skillPlugin.js +0 -27
- package/dist/plugins/tools/skills/skillPlugin.js.map +0 -1
- package/dist/plugins/tools/todo/todoPlugin.d.ts +0 -3
- package/dist/plugins/tools/todo/todoPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/todo/todoPlugin.js +0 -10
- package/dist/plugins/tools/todo/todoPlugin.js.map +0 -1
- package/dist/providers/baseProvider.d.ts +0 -148
- package/dist/providers/baseProvider.d.ts.map +0 -1
- package/dist/providers/baseProvider.js +0 -284
- package/dist/providers/baseProvider.js.map +0 -1
- package/dist/providers/openaiChatCompletionsProvider.d.ts +0 -64
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +0 -1
- package/dist/providers/openaiChatCompletionsProvider.js +0 -1018
- package/dist/providers/openaiChatCompletionsProvider.js.map +0 -1
- package/dist/providers/providerFactory.d.ts +0 -22
- package/dist/providers/providerFactory.d.ts.map +0 -1
- package/dist/providers/providerFactory.js +0 -25
- package/dist/providers/providerFactory.js.map +0 -1
- package/dist/providers/resilientProvider.d.ts +0 -103
- package/dist/providers/resilientProvider.d.ts.map +0 -1
- package/dist/providers/resilientProvider.js +0 -468
- package/dist/providers/resilientProvider.js.map +0 -1
- package/dist/runtime/agentController.d.ts +0 -121
- package/dist/runtime/agentController.d.ts.map +0 -1
- package/dist/runtime/agentController.js +0 -739
- package/dist/runtime/agentController.js.map +0 -1
- package/dist/runtime/agentHost.d.ts +0 -61
- package/dist/runtime/agentHost.d.ts.map +0 -1
- package/dist/runtime/agentHost.js +0 -158
- package/dist/runtime/agentHost.js.map +0 -1
- package/dist/runtime/agentSession.d.ts +0 -49
- package/dist/runtime/agentSession.d.ts.map +0 -1
- package/dist/runtime/agentSession.js +0 -218
- package/dist/runtime/agentSession.js.map +0 -1
- package/dist/runtime/agentSpawningWiring.d.ts +0 -23
- package/dist/runtime/agentSpawningWiring.d.ts.map +0 -1
- package/dist/runtime/agentSpawningWiring.js +0 -119
- package/dist/runtime/agentSpawningWiring.js.map +0 -1
- package/dist/runtime/agentWorkerPool.d.ts +0 -167
- package/dist/runtime/agentWorkerPool.d.ts.map +0 -1
- package/dist/runtime/agentWorkerPool.js +0 -435
- package/dist/runtime/agentWorkerPool.js.map +0 -1
- package/dist/runtime/node.d.ts +0 -7
- package/dist/runtime/node.d.ts.map +0 -1
- package/dist/runtime/node.js +0 -56
- package/dist/runtime/node.js.map +0 -1
- package/dist/runtime/universal.d.ts +0 -18
- package/dist/runtime/universal.d.ts.map +0 -1
- package/dist/runtime/universal.js +0 -21
- package/dist/runtime/universal.js.map +0 -1
- package/dist/shell/autoExecutor.d.ts +0 -70
- package/dist/shell/autoExecutor.d.ts.map +0 -1
- package/dist/shell/autoExecutor.js +0 -320
- package/dist/shell/autoExecutor.js.map +0 -1
- package/dist/shell/commandRegistry.d.ts +0 -122
- package/dist/shell/commandRegistry.d.ts.map +0 -1
- package/dist/shell/commandRegistry.js +0 -355
- package/dist/shell/commandRegistry.js.map +0 -1
- package/dist/shell/composableMessage.d.ts +0 -178
- package/dist/shell/composableMessage.d.ts.map +0 -1
- package/dist/shell/composableMessage.js +0 -384
- package/dist/shell/composableMessage.js.map +0 -1
- package/dist/shell/liveStatus.d.ts +0 -27
- package/dist/shell/liveStatus.d.ts.map +0 -1
- package/dist/shell/liveStatus.js +0 -53
- package/dist/shell/liveStatus.js.map +0 -1
- package/dist/shell/systemPrompt.d.ts +0 -12
- package/dist/shell/systemPrompt.d.ts.map +0 -1
- package/dist/shell/systemPrompt.js +0 -16
- package/dist/shell/systemPrompt.js.map +0 -1
- package/dist/shell/vimMode.d.ts +0 -66
- package/dist/shell/vimMode.d.ts.map +0 -1
- package/dist/shell/vimMode.js +0 -435
- package/dist/shell/vimMode.js.map +0 -1
- package/dist/tools/bashTools.d.ts +0 -11
- package/dist/tools/bashTools.d.ts.map +0 -1
- package/dist/tools/bashTools.js +0 -779
- package/dist/tools/bashTools.js.map +0 -1
- package/dist/tools/diffUtils.d.ts +0 -43
- package/dist/tools/diffUtils.d.ts.map +0 -1
- package/dist/tools/diffUtils.js +0 -607
- package/dist/tools/diffUtils.js.map +0 -1
- package/dist/tools/editTools.d.ts +0 -29
- package/dist/tools/editTools.d.ts.map +0 -1
- package/dist/tools/editTools.js +0 -792
- package/dist/tools/editTools.js.map +0 -1
- package/dist/tools/fileChangeTracker.d.ts +0 -47
- package/dist/tools/fileChangeTracker.d.ts.map +0 -1
- package/dist/tools/fileChangeTracker.js +0 -154
- package/dist/tools/fileChangeTracker.js.map +0 -1
- package/dist/tools/fileReadTracker.d.ts +0 -69
- package/dist/tools/fileReadTracker.d.ts.map +0 -1
- package/dist/tools/fileReadTracker.js +0 -213
- package/dist/tools/fileReadTracker.js.map +0 -1
- package/dist/tools/fileTools.d.ts +0 -3
- package/dist/tools/fileTools.d.ts.map +0 -1
- package/dist/tools/fileTools.js +0 -389
- package/dist/tools/fileTools.js.map +0 -1
- package/dist/tools/grepTools.d.ts +0 -3
- package/dist/tools/grepTools.d.ts.map +0 -1
- package/dist/tools/grepTools.js +0 -128
- package/dist/tools/grepTools.js.map +0 -1
- package/dist/tools/heliaControl.d.ts +0 -51
- package/dist/tools/heliaControl.d.ts.map +0 -1
- package/dist/tools/heliaControl.js +0 -93
- package/dist/tools/heliaControl.js.map +0 -1
- package/dist/tools/hitlTools.d.ts +0 -7
- package/dist/tools/hitlTools.d.ts.map +0 -1
- package/dist/tools/hitlTools.js +0 -185
- package/dist/tools/hitlTools.js.map +0 -1
- package/dist/tools/localExplore.d.ts +0 -38
- package/dist/tools/localExplore.d.ts.map +0 -1
- package/dist/tools/localExplore.js +0 -30
- package/dist/tools/localExplore.js.map +0 -1
- package/dist/tools/memoryTools.d.ts +0 -20
- package/dist/tools/memoryTools.d.ts.map +0 -1
- package/dist/tools/memoryTools.js +0 -180
- package/dist/tools/memoryTools.js.map +0 -1
- package/dist/tools/notebookTools.d.ts +0 -20
- package/dist/tools/notebookTools.d.ts.map +0 -1
- package/dist/tools/notebookTools.js +0 -140
- package/dist/tools/notebookTools.js.map +0 -1
- package/dist/tools/searchTools.d.ts +0 -12
- package/dist/tools/searchTools.d.ts.map +0 -1
- package/dist/tools/searchTools.js +0 -413
- package/dist/tools/searchTools.js.map +0 -1
- package/dist/tools/skillTools.d.ts +0 -24
- package/dist/tools/skillTools.d.ts.map +0 -1
- package/dist/tools/skillTools.js +0 -140
- package/dist/tools/skillTools.js.map +0 -1
- package/dist/tools/todoTools.d.ts +0 -24
- package/dist/tools/todoTools.d.ts.map +0 -1
- package/dist/tools/todoTools.js +0 -101
- package/dist/tools/todoTools.js.map +0 -1
- package/dist/tools/webTools.d.ts +0 -26
- package/dist/tools/webTools.d.ts.map +0 -1
- package/dist/tools/webTools.js +0 -332
- package/dist/tools/webTools.js.map +0 -1
- package/dist/ui/RenderGate.d.ts +0 -83
- package/dist/ui/RenderGate.d.ts.map +0 -1
- package/dist/ui/RenderGate.js +0 -138
- package/dist/ui/RenderGate.js.map +0 -1
- package/dist/ui/animatedStatus.d.ts +0 -140
- package/dist/ui/animatedStatus.d.ts.map +0 -1
- package/dist/ui/animatedStatus.js +0 -480
- package/dist/ui/animatedStatus.js.map +0 -1
- package/dist/ui/animation/AnimationScheduler.d.ts +0 -197
- package/dist/ui/animation/AnimationScheduler.d.ts.map +0 -1
- package/dist/ui/animation/AnimationScheduler.js +0 -440
- package/dist/ui/animation/AnimationScheduler.js.map +0 -1
- package/dist/ui/codeHighlighter.d.ts +0 -6
- package/dist/ui/codeHighlighter.d.ts.map +0 -1
- package/dist/ui/codeHighlighter.js +0 -855
- package/dist/ui/codeHighlighter.js.map +0 -1
- package/dist/ui/designSystem.d.ts +0 -26
- package/dist/ui/designSystem.d.ts.map +0 -1
- package/dist/ui/designSystem.js +0 -114
- package/dist/ui/designSystem.js.map +0 -1
- package/dist/ui/errorFormatter.d.ts +0 -64
- package/dist/ui/errorFormatter.d.ts.map +0 -1
- package/dist/ui/errorFormatter.js +0 -316
- package/dist/ui/errorFormatter.js.map +0 -1
- package/dist/ui/globalWriteLock.d.ts +0 -63
- package/dist/ui/globalWriteLock.d.ts.map +0 -1
- package/dist/ui/globalWriteLock.js +0 -173
- package/dist/ui/globalWriteLock.js.map +0 -1
- package/dist/ui/index.d.ts +0 -31
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -49
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/ink/App.d.ts +0 -39
- package/dist/ui/ink/App.d.ts.map +0 -1
- package/dist/ui/ink/App.js +0 -18
- package/dist/ui/ink/App.js.map +0 -1
- package/dist/ui/ink/ChatStatic.d.ts +0 -29
- package/dist/ui/ink/ChatStatic.d.ts.map +0 -1
- package/dist/ui/ink/ChatStatic.js +0 -30
- package/dist/ui/ink/ChatStatic.js.map +0 -1
- package/dist/ui/ink/InkPromptController.d.ts +0 -286
- package/dist/ui/ink/InkPromptController.d.ts.map +0 -1
- package/dist/ui/ink/InkPromptController.js +0 -558
- package/dist/ui/ink/InkPromptController.js.map +0 -1
- package/dist/ui/ink/Prompt.d.ts +0 -36
- package/dist/ui/ink/Prompt.d.ts.map +0 -1
- package/dist/ui/ink/Prompt.js +0 -296
- package/dist/ui/ink/Prompt.js.map +0 -1
- package/dist/ui/ink/StatusLine.d.ts +0 -25
- package/dist/ui/ink/StatusLine.d.ts.map +0 -1
- package/dist/ui/ink/StatusLine.js +0 -11
- package/dist/ui/ink/StatusLine.js.map +0 -1
- package/dist/ui/ink/adapter.d.ts +0 -58
- package/dist/ui/ink/adapter.d.ts.map +0 -1
- package/dist/ui/ink/adapter.js +0 -113
- package/dist/ui/ink/adapter.js.map +0 -1
- package/dist/ui/interrupts/InterruptManager.d.ts +0 -157
- package/dist/ui/interrupts/InterruptManager.d.ts.map +0 -1
- package/dist/ui/interrupts/InterruptManager.js +0 -501
- package/dist/ui/interrupts/InterruptManager.js.map +0 -1
- package/dist/ui/layout.d.ts +0 -27
- package/dist/ui/layout.d.ts.map +0 -1
- package/dist/ui/layout.js +0 -184
- package/dist/ui/layout.js.map +0 -1
- package/dist/ui/outputMode.d.ts +0 -58
- package/dist/ui/outputMode.d.ts.map +0 -1
- package/dist/ui/outputMode.js +0 -179
- package/dist/ui/outputMode.js.map +0 -1
- package/dist/ui/overlay/OverlayManager.d.ts +0 -105
- package/dist/ui/overlay/OverlayManager.d.ts.map +0 -1
- package/dist/ui/overlay/OverlayManager.js +0 -304
- package/dist/ui/overlay/OverlayManager.js.map +0 -1
- package/dist/ui/premiumComponents.d.ts +0 -54
- package/dist/ui/premiumComponents.d.ts.map +0 -1
- package/dist/ui/premiumComponents.js +0 -241
- package/dist/ui/premiumComponents.js.map +0 -1
- package/dist/ui/richText.d.ts +0 -13
- package/dist/ui/richText.d.ts.map +0 -1
- package/dist/ui/richText.js +0 -444
- package/dist/ui/richText.js.map +0 -1
- package/dist/ui/telemetry/ResponseTracker.d.ts +0 -22
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +0 -1
- package/dist/ui/telemetry/ResponseTracker.js +0 -60
- package/dist/ui/telemetry/ResponseTracker.js.map +0 -1
- package/dist/ui/telemetry/UITelemetry.d.ts +0 -181
- package/dist/ui/telemetry/UITelemetry.d.ts.map +0 -1
- package/dist/ui/telemetry/UITelemetry.js +0 -446
- package/dist/ui/telemetry/UITelemetry.js.map +0 -1
- package/dist/ui/textHighlighter.d.ts +0 -83
- package/dist/ui/textHighlighter.d.ts.map +0 -1
- package/dist/ui/textHighlighter.js +0 -267
- package/dist/ui/textHighlighter.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -351
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -434
- package/dist/ui/theme.js.map +0 -1
- package/dist/ui/toolDisplay.d.ts +0 -221
- package/dist/ui/toolDisplay.d.ts.map +0 -1
- package/dist/ui/toolDisplay.js +0 -1654
- package/dist/ui/toolDisplay.js.map +0 -1
- package/dist/ui/uiConstants.d.ts +0 -253
- package/dist/ui/uiConstants.d.ts.map +0 -1
- package/dist/ui/uiConstants.js +0 -437
- package/dist/ui/uiConstants.js.map +0 -1
- package/dist/utils/analytics.d.ts +0 -2
- package/dist/utils/analytics.d.ts.map +0 -1
- package/dist/utils/analytics.js +0 -51
- package/dist/utils/analytics.js.map +0 -1
- package/dist/utils/askUserPrompt.d.ts +0 -21
- package/dist/utils/askUserPrompt.d.ts.map +0 -1
- package/dist/utils/askUserPrompt.js +0 -87
- package/dist/utils/askUserPrompt.js.map +0 -1
- package/dist/utils/asyncUtils.d.ts +0 -95
- package/dist/utils/asyncUtils.d.ts.map +0 -1
- package/dist/utils/asyncUtils.js +0 -286
- package/dist/utils/asyncUtils.js.map +0 -1
- package/dist/utils/debugLogger.d.ts +0 -6
- package/dist/utils/debugLogger.d.ts.map +0 -1
- package/dist/utils/debugLogger.js +0 -39
- package/dist/utils/debugLogger.js.map +0 -1
- package/dist/utils/errorUtils.d.ts +0 -12
- package/dist/utils/errorUtils.d.ts.map +0 -1
- package/dist/utils/errorUtils.js +0 -83
- package/dist/utils/errorUtils.js.map +0 -1
- package/dist/utils/frontmatter.d.ts +0 -10
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -78
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/packageInfo.d.ts +0 -14
- package/dist/utils/packageInfo.d.ts.map +0 -1
- package/dist/utils/packageInfo.js +0 -45
- package/dist/utils/packageInfo.js.map +0 -1
- package/dist/utils/planFormatter.d.ts +0 -34
- package/dist/utils/planFormatter.d.ts.map +0 -1
- package/dist/utils/planFormatter.js +0 -141
- package/dist/utils/planFormatter.js.map +0 -1
- package/dist/utils/securityUtils.d.ts +0 -145
- package/dist/utils/securityUtils.d.ts.map +0 -1
- package/dist/utils/securityUtils.js +0 -507
- package/dist/utils/securityUtils.js.map +0 -1
- package/dist/utils/statusReporter.d.ts +0 -6
- package/dist/utils/statusReporter.d.ts.map +0 -1
- package/dist/utils/statusReporter.js +0 -26
- package/dist/utils/statusReporter.js.map +0 -1
- package/dist/workspace.d.ts +0 -8
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -135
- package/dist/workspace.js.map +0 -1
- package/dist/workspace.validator.d.ts +0 -49
- package/dist/workspace.validator.d.ts.map +0 -1
- package/dist/workspace.validator.js +0 -215
- package/dist/workspace.validator.js.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heuristic: did the model return a safety/policy refusal?
|
|
3
|
-
*
|
|
4
|
-
* Used by the interactive shell to short-circuit the auto-continue
|
|
5
|
-
* loop — a "no, I won't do that" response is the terminal turn rather
|
|
6
|
-
* than a stop the auto-continue logic should bulldoze through with
|
|
7
|
-
* another "continue" prompt. Extracted to a free function so it's
|
|
8
|
-
* unit-testable without standing up the whole shell.
|
|
9
|
-
*
|
|
10
|
-
* Looks at the first ~1KB of the buffered response — refusals lead
|
|
11
|
-
* with the decline, so a substring scan is enough and keeps the cost
|
|
12
|
-
* trivial.
|
|
13
|
-
*/
|
|
14
|
-
const DECLINE_PHRASES = [
|
|
15
|
-
"i can't help",
|
|
16
|
-
'i cannot help',
|
|
17
|
-
"i won't help",
|
|
18
|
-
'i will not help',
|
|
19
|
-
"i can't assist",
|
|
20
|
-
'i cannot assist',
|
|
21
|
-
"i won't assist",
|
|
22
|
-
"i'm not going to help",
|
|
23
|
-
'i am not going to help',
|
|
24
|
-
"i'm not able to help",
|
|
25
|
-
'i am not able to help',
|
|
26
|
-
"i'm unable to help",
|
|
27
|
-
"i'm not going to continue",
|
|
28
|
-
"i've declined",
|
|
29
|
-
'i have declined',
|
|
30
|
-
'i decline',
|
|
31
|
-
'i must decline',
|
|
32
|
-
'i need to decline',
|
|
33
|
-
"i'm declining",
|
|
34
|
-
"i'm not comfortable",
|
|
35
|
-
'against my guidelines',
|
|
36
|
-
'against my values',
|
|
37
|
-
'violates my',
|
|
38
|
-
];
|
|
39
|
-
export function isSafetyRefusal(text) {
|
|
40
|
-
if (!text)
|
|
41
|
-
return false;
|
|
42
|
-
const head = text.slice(0, 1024).toLowerCase();
|
|
43
|
-
if (!head.trim())
|
|
44
|
-
return false;
|
|
45
|
-
for (const phrase of DECLINE_PHRASES) {
|
|
46
|
-
if (head.includes(phrase))
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=refusalDetection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refusalDetection.js","sourceRoot":"","sources":["../../src/core/refusalDetection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAAsB;IACzC,cAAc;IACd,eAAe;IACf,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,uBAAuB;IACvB,wBAAwB;IACxB,sBAAsB;IACtB,uBAAuB;IACvB,oBAAoB;IACpB,2BAA2B;IAC3B,eAAe;IACf,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,qBAAqB;IACrB,uBAAuB;IACvB,mBAAmB;IACnB,aAAa;CACd,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,IAA+B;IAC7D,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC;IAC/B,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result Verification - Re-exported from orchestrationCapability
|
|
3
|
-
* Provides verifiedSuccess, verifiedFailure, analyzeOutput, OutputPatterns, etc.
|
|
4
|
-
*/
|
|
5
|
-
export type VerificationStatus = 'VERIFIED_SUCCESS' | 'VERIFIED_FAILURE' | 'UNVERIFIED' | 'PARTIAL_SUCCESS' | 'REQUIRES_USER_ACTION';
|
|
6
|
-
export interface VerifiedResult {
|
|
7
|
-
status: VerificationStatus;
|
|
8
|
-
summary: string;
|
|
9
|
-
details: string;
|
|
10
|
-
verificationChecks?: VerificationCheck[];
|
|
11
|
-
suggestedActions?: string[];
|
|
12
|
-
verifiedAt: string;
|
|
13
|
-
durationMs?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface VerificationCheck {
|
|
16
|
-
check: string;
|
|
17
|
-
passed: boolean;
|
|
18
|
-
details?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare const OutputPatterns: {
|
|
21
|
-
git: {
|
|
22
|
-
success: RegExp[];
|
|
23
|
-
failure: RegExp[];
|
|
24
|
-
};
|
|
25
|
-
npm: {
|
|
26
|
-
success: RegExp[];
|
|
27
|
-
failure: RegExp[];
|
|
28
|
-
};
|
|
29
|
-
command: {
|
|
30
|
-
success: RegExp[];
|
|
31
|
-
failure: RegExp[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export declare function verifiedSuccess(summary: string, details: string, checks?: VerificationCheck[], durationMs?: number): string;
|
|
35
|
-
export declare function verifiedFailure(summary: string, details: string, suggestedActions?: string[], checks?: VerificationCheck[], durationMs?: number): string;
|
|
36
|
-
export declare function analyzeOutput(output: string, patterns: {
|
|
37
|
-
success: RegExp[];
|
|
38
|
-
failure: RegExp[];
|
|
39
|
-
}, exitCode?: number): {
|
|
40
|
-
isSuccess: boolean;
|
|
41
|
-
isFailure: boolean;
|
|
42
|
-
matchedPattern?: string;
|
|
43
|
-
confidence: 'high' | 'medium' | 'low';
|
|
44
|
-
};
|
|
45
|
-
export declare function createCommandCheck(checkName: string, exitCode: number, output: string, expectedPatterns?: RegExp[]): VerificationCheck;
|
|
46
|
-
export declare function safeTruncate(content: string, maxLength: number, _label?: string): string;
|
|
47
|
-
//# sourceMappingURL=resultVerification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resultVerification.d.ts","sourceRoot":"","sources":["../../src/core/resultVerification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAa1B,CAAC;AA8BF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,iBAAiB,EAAE,EAC5B,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CASR;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,MAAM,CAAC,EAAE,iBAAiB,EAAE,EAC5B,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAUR;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,EAClD,QAAQ,CAAC,EAAE,MAAM,GAChB;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;CAAE,CAa5G;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAC1B,iBAAiB,CAWnB;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAkB,GAAG,MAAM,CAInG"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result Verification - Re-exported from orchestrationCapability
|
|
3
|
-
* Provides verifiedSuccess, verifiedFailure, analyzeOutput, OutputPatterns, etc.
|
|
4
|
-
*/
|
|
5
|
-
// ANSI color codes for enhanced terminal output
|
|
6
|
-
const ANSI_RESET = '\x1b[0m';
|
|
7
|
-
const ANSI_RED = '\x1b[31m';
|
|
8
|
-
const ANSI_GREEN = '\x1b[32m';
|
|
9
|
-
const ANSI_YELLOW = '\x1b[33m';
|
|
10
|
-
const ANSI_BLUE = '\x1b[34m';
|
|
11
|
-
const ANSI_MAGENTA = '\x1b[35m';
|
|
12
|
-
const ANSI_CYAN = '\x1b[36m';
|
|
13
|
-
const ANSI_DIM = '\x1b[2m';
|
|
14
|
-
const ANSI_BOLD = '\x1b[1m';
|
|
15
|
-
const ANSI_RED_BOLD = '\x1b[1;31m';
|
|
16
|
-
const ANSI_GREEN_BOLD = '\x1b[1;32m';
|
|
17
|
-
const ANSI_YELLOW_BOLD = '\x1b[1;33m';
|
|
18
|
-
export const OutputPatterns = {
|
|
19
|
-
git: {
|
|
20
|
-
success: [/\[.+\s+\w+\]/, /pushed/i, /merged/i, /On branch/i, /nothing to commit/i, /Already up to date/i],
|
|
21
|
-
failure: [/fatal:/i, /error:/i, /conflict/i, /rejected/i, /CONFLICT/, /Aborting/i],
|
|
22
|
-
},
|
|
23
|
-
npm: {
|
|
24
|
-
success: [/npm notice/i, /\+ .+@\d+\.\d+\.\d+/, /published/i],
|
|
25
|
-
failure: [/npm ERR!/i, /ERESOLVE/i, /E404/i, /EINTEGRITY/i],
|
|
26
|
-
},
|
|
27
|
-
command: {
|
|
28
|
-
success: [/^(success|completed|done|finished)/im, /successfully/i],
|
|
29
|
-
failure: [/^error/im, /^fatal/im, /failed/i, /command not found/i, /permission denied/i, /ENOENT/i, /EACCES/i],
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
function formatVerifiedResult(result) {
|
|
33
|
-
if (result.status === 'VERIFIED_SUCCESS')
|
|
34
|
-
return result.details || result.summary;
|
|
35
|
-
const lines = [];
|
|
36
|
-
switch (result.status) {
|
|
37
|
-
case 'VERIFIED_FAILURE':
|
|
38
|
-
lines.push(`${ANSI_RED_BOLD}═══ FAILED ═══${ANSI_RESET}`);
|
|
39
|
-
break;
|
|
40
|
-
case 'UNVERIFIED':
|
|
41
|
-
lines.push(`${ANSI_YELLOW_BOLD}═══ UNVERIFIED ═══${ANSI_RESET}`);
|
|
42
|
-
break;
|
|
43
|
-
case 'PARTIAL_SUCCESS':
|
|
44
|
-
lines.push(`${ANSI_YELLOW_BOLD}═══ PARTIAL SUCCESS ═══${ANSI_RESET}`);
|
|
45
|
-
break;
|
|
46
|
-
case 'REQUIRES_USER_ACTION':
|
|
47
|
-
lines.push(`${ANSI_CYAN}═══ ACTION REQUIRED ═══${ANSI_RESET}`);
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
lines.push('', result.summary, '');
|
|
51
|
-
if (result.verificationChecks) {
|
|
52
|
-
const failedChecks = result.verificationChecks.filter(c => !c.passed);
|
|
53
|
-
if (failedChecks.length > 0) {
|
|
54
|
-
lines.push('Failed checks:');
|
|
55
|
-
for (const check of failedChecks) {
|
|
56
|
-
lines.push(` ${ANSI_RED}✗${ANSI_RESET} ${check.check}${check.details ? `: ${check.details}` : ''}`);
|
|
57
|
-
}
|
|
58
|
-
lines.push('');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (result.details)
|
|
62
|
-
lines.push(result.details, '');
|
|
63
|
-
if (result.suggestedActions?.length) {
|
|
64
|
-
lines.push('Suggested actions:');
|
|
65
|
-
for (const action of result.suggestedActions)
|
|
66
|
-
lines.push(` ${ANSI_GREEN}→${ANSI_RESET} ${action}`);
|
|
67
|
-
}
|
|
68
|
-
return lines.join('\n');
|
|
69
|
-
}
|
|
70
|
-
export function verifiedSuccess(summary, details, checks, durationMs) {
|
|
71
|
-
return formatVerifiedResult({
|
|
72
|
-
status: 'VERIFIED_SUCCESS',
|
|
73
|
-
summary,
|
|
74
|
-
details,
|
|
75
|
-
verificationChecks: checks,
|
|
76
|
-
verifiedAt: new Date().toISOString(),
|
|
77
|
-
durationMs,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export function verifiedFailure(summary, details, suggestedActions, checks, durationMs) {
|
|
81
|
-
return formatVerifiedResult({
|
|
82
|
-
status: 'VERIFIED_FAILURE',
|
|
83
|
-
summary,
|
|
84
|
-
details,
|
|
85
|
-
verificationChecks: checks,
|
|
86
|
-
suggestedActions,
|
|
87
|
-
verifiedAt: new Date().toISOString(),
|
|
88
|
-
durationMs,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
export function analyzeOutput(output, patterns, exitCode) {
|
|
92
|
-
const normalizedOutput = output.normalize('NFC');
|
|
93
|
-
for (const pattern of patterns.failure) {
|
|
94
|
-
if (pattern.test(normalizedOutput))
|
|
95
|
-
return { isSuccess: false, isFailure: true, matchedPattern: pattern.source, confidence: 'high' };
|
|
96
|
-
}
|
|
97
|
-
for (const pattern of patterns.success) {
|
|
98
|
-
if (pattern.test(normalizedOutput))
|
|
99
|
-
return { isSuccess: true, isFailure: false, matchedPattern: pattern.source, confidence: 'high' };
|
|
100
|
-
}
|
|
101
|
-
if (exitCode !== undefined) {
|
|
102
|
-
if (exitCode !== 0)
|
|
103
|
-
return { isSuccess: false, isFailure: true, confidence: 'high' };
|
|
104
|
-
return { isSuccess: false, isFailure: false, confidence: 'low' };
|
|
105
|
-
}
|
|
106
|
-
return { isSuccess: false, isFailure: false, confidence: 'low' };
|
|
107
|
-
}
|
|
108
|
-
export function createCommandCheck(checkName, exitCode, output, expectedPatterns) {
|
|
109
|
-
let passed = exitCode === 0;
|
|
110
|
-
let details = exitCode === 0 ? 'Exit code 0' : `Exit code ${exitCode}`;
|
|
111
|
-
if (expectedPatterns && passed) {
|
|
112
|
-
const foundPattern = expectedPatterns.some((p) => p.test(output));
|
|
113
|
-
if (!foundPattern) {
|
|
114
|
-
passed = false;
|
|
115
|
-
details = 'Exit code 0 but expected output pattern not found';
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return { check: checkName, passed, details };
|
|
119
|
-
}
|
|
120
|
-
export function safeTruncate(content, maxLength, _label = 'Content') {
|
|
121
|
-
if (content.length <= maxLength)
|
|
122
|
-
return content;
|
|
123
|
-
const hiddenChars = content.length - maxLength;
|
|
124
|
-
return `${content.slice(0, maxLength)}\n\n[... ${hiddenChars} characters truncated]`;
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=resultVerification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resultVerification.js","sourceRoot":"","sources":["../../src/core/resultVerification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,gDAAgD;AAChD,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC5B,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC;AAC3B,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAyBtC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,GAAG,EAAE;QACH,OAAO,EAAE,CAAC,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,CAAC;QAC1G,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC;KACnF;IACD,GAAG,EAAE;QACH,OAAO,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,YAAY,CAAC;QAC7D,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa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AAK,CAAC,CAAC;IAC5B,IAAI,OAAO,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,QAAQ,EAAE,CAAC;IACvE,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;QAC/B,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,GAAG,KAAK,CAAC;YACf,OAAO,GAAG,mDAAmD,CAAC;QAChE,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,SAAiB,EAAE,SAAiB,SAAS;IACzF,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS;QAAE,OAAO,OAAO,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAC/C,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,YAAY,WAAW,wBAAwB,CAAC;AACvF,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constitutional reviewer-agent guard. Runs between user-configured
|
|
3
|
-
* shell hooks and the actual tool handler. Two layers:
|
|
4
|
-
*
|
|
5
|
-
* 1. **Hardcoded heuristic guard (always on)**. Catches the
|
|
6
|
-
* well-known catastrophic patterns (rm -rf /, curl-to-shell,
|
|
7
|
-
* anything that targets a path outside the workspace AND
|
|
8
|
-
* destroys data). Cheap, deterministic, no LLM call.
|
|
9
|
-
*
|
|
10
|
-
* 2. **LLM reviewer (gated by EROSOLAR_REVIEWER=1)**. Sends the
|
|
11
|
-
* proposed tool call + a brief constitution to a small, cheap
|
|
12
|
-
* reviewer model (Anthropic Haiku by default). Returns one of
|
|
13
|
-
* `approve | refine | veto` with a reason. The decision is
|
|
14
|
-
* logged to Firestore at reviewer_log/{uid}/decisions/{id} for
|
|
15
|
-
* operator review.
|
|
16
|
-
*
|
|
17
|
-
* The reviewer fails *open* on any error (network blip, unparseable
|
|
18
|
-
* model response, missing API key). Refusing-by-default would brick
|
|
19
|
-
* the CLI for users without the reviewer model configured. Instead,
|
|
20
|
-
* a failure is itself an audit-log event the operator can review.
|
|
21
|
-
*/
|
|
22
|
-
export interface ReviewDecision {
|
|
23
|
-
decision: 'approve' | 'refine' | 'veto';
|
|
24
|
-
reason: string;
|
|
25
|
-
source: 'heuristic' | 'llm' | 'disabled' | 'error';
|
|
26
|
-
}
|
|
27
|
-
export declare function buildReviewPrompt(toolName: string, args: unknown): string;
|
|
28
|
-
export declare function parseReviewDecision(text: string): ReviewDecision | null;
|
|
29
|
-
/**
|
|
30
|
-
* Review a proposed tool call. Decision flow:
|
|
31
|
-
* 1. Heuristic veto patterns — if any match, veto immediately (no LLM).
|
|
32
|
-
* 2. If EROSOLAR_REVIEWER env is on AND ANTHROPIC_API_KEY is present,
|
|
33
|
-
* call the reviewer model.
|
|
34
|
-
* 3. Otherwise, approve.
|
|
35
|
-
*/
|
|
36
|
-
export declare function reviewToolCall(toolName: string, args: unknown): Promise<ReviewDecision>;
|
|
37
|
-
//# sourceMappingURL=reviewerGuard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reviewerGuard.d.ts","sourceRoot":"","sources":["../../src/core/reviewerGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAAC;CACpD;AAwGD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAazE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAWvE;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAmC7F"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constitutional reviewer-agent guard. Runs between user-configured
|
|
3
|
-
* shell hooks and the actual tool handler. Two layers:
|
|
4
|
-
*
|
|
5
|
-
* 1. **Hardcoded heuristic guard (always on)**. Catches the
|
|
6
|
-
* well-known catastrophic patterns (rm -rf /, curl-to-shell,
|
|
7
|
-
* anything that targets a path outside the workspace AND
|
|
8
|
-
* destroys data). Cheap, deterministic, no LLM call.
|
|
9
|
-
*
|
|
10
|
-
* 2. **LLM reviewer (gated by EROSOLAR_REVIEWER=1)**. Sends the
|
|
11
|
-
* proposed tool call + a brief constitution to a small, cheap
|
|
12
|
-
* reviewer model (Anthropic Haiku by default). Returns one of
|
|
13
|
-
* `approve | refine | veto` with a reason. The decision is
|
|
14
|
-
* logged to Firestore at reviewer_log/{uid}/decisions/{id} for
|
|
15
|
-
* operator review.
|
|
16
|
-
*
|
|
17
|
-
* The reviewer fails *open* on any error (network blip, unparseable
|
|
18
|
-
* model response, missing API key). Refusing-by-default would brick
|
|
19
|
-
* the CLI for users without the reviewer model configured. Instead,
|
|
20
|
-
* a failure is itself an audit-log event the operator can review.
|
|
21
|
-
*/
|
|
22
|
-
const CONSTITUTION = `You are the constitutional reviewer for a CLI agent that holds offsec
|
|
23
|
-
tooling. Before any tool call fires, you say approve / refine / veto.
|
|
24
|
-
|
|
25
|
-
PRINCIPLES (most important first):
|
|
26
|
-
|
|
27
|
-
1. Operator authorization is the load-bearing assumption. The user has
|
|
28
|
-
pre-authorized targets via the rulebook + their own engagement
|
|
29
|
-
scope. You don't second-guess that. You DO catch drift: tools
|
|
30
|
-
targeting hosts/files/URLs that have nothing to do with the recent
|
|
31
|
-
conversation.
|
|
32
|
-
|
|
33
|
-
2. Coordinated disclosure is pinned. Any tool call whose effect is to
|
|
34
|
-
exfiltrate, sell, or silently retain a finding without sending it
|
|
35
|
-
through hackerone / vendor PSIRT / CERT-CC / published-advisory /
|
|
36
|
-
internal-writeup must be vetoed. "Broker" / "buyer" / "private
|
|
37
|
-
sale" in args means veto.
|
|
38
|
-
|
|
39
|
-
3. Destructive operations on shared infrastructure get refined. rm -rf
|
|
40
|
-
on a path the agent didn't itself create, force-push to main,
|
|
41
|
-
DROP TABLE on prod-shaped DBs — these get a refine with a tighter
|
|
42
|
-
scope suggestion, not a veto (the operator can override).
|
|
43
|
-
|
|
44
|
-
4. Scope creep beats target drift. "We were investigating X but the
|
|
45
|
-
agent now wants to scan Y" gets a veto. "We were on phase.recon
|
|
46
|
-
but the agent skipped to phase.disclose" gets a refine.
|
|
47
|
-
|
|
48
|
-
5. Fail open. If you can't decide, approve with reason="uncertain —
|
|
49
|
-
approving conservatively". Refusing every uncertain call locks the
|
|
50
|
-
CLI for no benefit.`;
|
|
51
|
-
const VETO_PATTERNS_BASH = [
|
|
52
|
-
// rm -rf where the target is the filesystem root, $HOME, or ~ as the
|
|
53
|
-
// full atom (not a path prefix). The lookahead requires a shell-
|
|
54
|
-
// separator or end-of-string immediately after, so `rm -rf /tmp/x`
|
|
55
|
-
// is allowed and `rm -rf /` / `rm -rf $HOME` are vetoed.
|
|
56
|
-
{ pattern: /\brm\s+-[a-zA-Z]*r[a-zA-Z]*f?\s+(?:\/|\$HOME|~)(?=\s|$|;|&|\|)/, reason: 'rm -rf on filesystem root, $HOME, or ~' },
|
|
57
|
-
// dd / mkfs to block devices
|
|
58
|
-
{ pattern: /\bdd\s+if=\/dev\/(?:zero|random|urandom)\s+of=\/(?:dev\/[hsv]d[a-z]|[A-Za-z])/, reason: 'dd-zero/random to a block device or filesystem root' },
|
|
59
|
-
{ pattern: /\bmkfs\b.*\/dev\/[hsv]d[a-z]/, reason: 'mkfs targeting a block device' },
|
|
60
|
-
// fork bomb
|
|
61
|
-
{ pattern: /:\(\)\s*\{\s*:\|:&\s*\}\s*;\s*:/, reason: 'fork bomb' },
|
|
62
|
-
// curl/wget piped to shell. Match wget/curl, any non-pipe/separator
|
|
63
|
-
// text up to the first |, then a shell name as the next word.
|
|
64
|
-
{ pattern: /\bcurl\b[^|;&]*\|\s*(?:bash|sh|zsh|fish)\b/i, reason: 'curl-to-shell' },
|
|
65
|
-
{ pattern: /\bwget\b[^|;&]*\|\s*(?:bash|sh|zsh|fish)\b/i, reason: 'wget-to-shell' },
|
|
66
|
-
];
|
|
67
|
-
const VETO_PATTERNS_DISCLOSURE = /\b(?:broker|brokerage|zerodium|crowdfense|silent\s+sale|private\s+buyer|sell\s+(?:exploit|0day|zero[- ]day))\b/i;
|
|
68
|
-
function heuristicReview(toolName, args) {
|
|
69
|
-
if (toolName === 'Bash' || toolName === 'kali_sqlmap' /* … other shell-shaped tools */) {
|
|
70
|
-
const cmd = args?.command || '';
|
|
71
|
-
for (const { pattern, reason } of VETO_PATTERNS_BASH) {
|
|
72
|
-
if (pattern.test(cmd)) {
|
|
73
|
-
return { decision: 'veto', reason, source: 'heuristic' };
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// Cross-tool: any args field that looks like a brokerage handoff is
|
|
78
|
-
// a hard veto regardless of the tool surface.
|
|
79
|
-
const argsJson = JSON.stringify(args ?? {});
|
|
80
|
-
if (VETO_PATTERNS_DISCLOSURE.test(argsJson)) {
|
|
81
|
-
return { decision: 'veto', reason: 'disclosure path resembles brokerage / private sale', source: 'heuristic' };
|
|
82
|
-
}
|
|
83
|
-
return null; // no heuristic verdict — defer to LLM (or approve)
|
|
84
|
-
}
|
|
85
|
-
function isLlmReviewerEnabled() {
|
|
86
|
-
const v = (process.env['EROSOLAR_REVIEWER'] || '').toLowerCase();
|
|
87
|
-
return v === '1' || v === 'true' || v === 'on';
|
|
88
|
-
}
|
|
89
|
-
let cachedReviewer = null;
|
|
90
|
-
let reviewerInitFailed = false;
|
|
91
|
-
async function getLlmReviewer() {
|
|
92
|
-
if (reviewerInitFailed)
|
|
93
|
-
return null;
|
|
94
|
-
if (cachedReviewer)
|
|
95
|
-
return cachedReviewer;
|
|
96
|
-
if (!process.env['ANTHROPIC_API_KEY']) {
|
|
97
|
-
reviewerInitFailed = true;
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
try {
|
|
101
|
-
const { createProvider, hasProvider } = await import('../providers/providerFactory.js');
|
|
102
|
-
if (!hasProvider('anthropic')) {
|
|
103
|
-
// Provider plugin not registered yet — happens when reviewerGuard
|
|
104
|
-
// runs before agent boot completes the registration. Mark as
|
|
105
|
-
// failed (we'll fail open) and let the next boot retry.
|
|
106
|
-
reviewerInitFailed = true;
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
cachedReviewer = createProvider({
|
|
110
|
-
provider: 'anthropic',
|
|
111
|
-
model: process.env['EROSOLAR_REVIEWER_MODEL'] || 'claude-haiku-4-5-20251001',
|
|
112
|
-
});
|
|
113
|
-
return cachedReviewer;
|
|
114
|
-
}
|
|
115
|
-
catch {
|
|
116
|
-
reviewerInitFailed = true;
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
export function buildReviewPrompt(toolName, args) {
|
|
121
|
-
return [
|
|
122
|
-
CONSTITUTION,
|
|
123
|
-
'',
|
|
124
|
-
'## Proposed tool call',
|
|
125
|
-
`tool: ${toolName}`,
|
|
126
|
-
`args: ${JSON.stringify(args, null, 2).slice(0, 4000)}`,
|
|
127
|
-
'',
|
|
128
|
-
'## Output',
|
|
129
|
-
'Reply with ONLY a JSON object on a single line:',
|
|
130
|
-
'{"decision": "approve" | "refine" | "veto", "reason": "≤200 chars"}',
|
|
131
|
-
'No preamble, no markdown fences, no commentary.',
|
|
132
|
-
].join('\n');
|
|
133
|
-
}
|
|
134
|
-
export function parseReviewDecision(text) {
|
|
135
|
-
const match = text.match(/\{[\s\S]*?\}/);
|
|
136
|
-
if (!match)
|
|
137
|
-
return null;
|
|
138
|
-
try {
|
|
139
|
-
const obj = JSON.parse(match[0]);
|
|
140
|
-
const d = String(obj.decision || '').toLowerCase();
|
|
141
|
-
if (d === 'approve' || d === 'refine' || d === 'veto') {
|
|
142
|
-
return { decision: d, reason: String(obj.reason || '').slice(0, 200), source: 'llm' };
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
catch { /* fall through */ }
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Review a proposed tool call. Decision flow:
|
|
150
|
-
* 1. Heuristic veto patterns — if any match, veto immediately (no LLM).
|
|
151
|
-
* 2. If EROSOLAR_REVIEWER env is on AND ANTHROPIC_API_KEY is present,
|
|
152
|
-
* call the reviewer model.
|
|
153
|
-
* 3. Otherwise, approve.
|
|
154
|
-
*/
|
|
155
|
-
export async function reviewToolCall(toolName, args) {
|
|
156
|
-
const heuristic = heuristicReview(toolName, args);
|
|
157
|
-
if (heuristic)
|
|
158
|
-
return heuristic;
|
|
159
|
-
if (!isLlmReviewerEnabled()) {
|
|
160
|
-
return { decision: 'approve', reason: 'reviewer disabled', source: 'disabled' };
|
|
161
|
-
}
|
|
162
|
-
const reviewer = await getLlmReviewer();
|
|
163
|
-
if (!reviewer) {
|
|
164
|
-
return { decision: 'approve', reason: 'no LLM reviewer configured', source: 'disabled' };
|
|
165
|
-
}
|
|
166
|
-
try {
|
|
167
|
-
const prompt = buildReviewPrompt(toolName, args);
|
|
168
|
-
const res = await reviewer.generate([{ role: 'user', content: prompt }], []);
|
|
169
|
-
const text = res.type === 'message' ? res.content : (res.content ?? '');
|
|
170
|
-
const parsed = parseReviewDecision(text);
|
|
171
|
-
if (!parsed) {
|
|
172
|
-
return {
|
|
173
|
-
decision: 'approve',
|
|
174
|
-
reason: 'unparseable reviewer response — failing open',
|
|
175
|
-
source: 'error',
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
return parsed;
|
|
179
|
-
}
|
|
180
|
-
catch (err) {
|
|
181
|
-
return {
|
|
182
|
-
decision: 'approve',
|
|
183
|
-
reason: `reviewer error: ${err.message.slice(0, 100)} — failing open`,
|
|
184
|
-
source: 'error',
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=reviewerGuard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reviewerGuard.js","sourceRoot":"","sources":["../../src/core/reviewerGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA4BE,CAAC;AAExB,MAAM,kBAAkB,GAA0C;IAChE,qEAAqE;IACrE,iEAAiE;IACjE,mEAAmE;IACnE,yDAAyD;IACzD,EAAE,OAAO,EAAE,gEAAgE,EAAE,MAAM,EAAE,wCAAwC,EAAE;IAC/H,6BAA6B;IAC7B,EAAE,OAAO,EAAE,+EAA+E,EAAE,MAAM,EAAE,qDAAqD,EAAE;IAC3J,EAAE,OAAO,EAAE,8BAA8B,EAAE,MAAM,EAAE,+BAA+B,EAAE;IACpF,YAAY;IACZ,EAAE,OAAO,EAAE,iCAAiC,EAAE,MAAM,EAAE,WAAW,EAAE;IACnE,oEAAoE;IACpE,8DAA8D;IAC9D,EAAE,OAAO,EAAE,6CAA6C,EAAE,MAAM,EAAE,eAAe,EAAE;IACnF,EAAE,OAAO,EAAE,6CAA6C,EAAE,MAAM,EAAE,eAAe,EAAE;CACpF,CAAC;AAEF,MAAM,wBAAwB,GAAG,iHAAiH,CAAC;AAEnJ,SAAS,eAAe,CAAC,QAAgB,EAAE,IAAa;IACtD,IAAI,QAAQ,KAAK,MAAM,IAAI,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G,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;gBACL,QAAQ,EAAE,SAAS;gBACnB,MAAM,EAAE,8CAA8C;gBACtD,MAAM,EAAE,OAAO;aAChB,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,mBAAoB,GAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,iBAAiB;YAChF,MAAM,EAAE,OAAO;SAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { JSONSchemaObject } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Enhanced validation error with structured error information
|
|
4
|
-
*/
|
|
5
|
-
export declare class ToolArgumentValidationError extends Error {
|
|
6
|
-
readonly issues: readonly string[];
|
|
7
|
-
readonly toolName: string;
|
|
8
|
-
constructor(toolName: string, issues: string[]);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Runtime type guards for tool argument validation
|
|
12
|
-
*/
|
|
13
|
-
export declare namespace TypeGuards {
|
|
14
|
-
/**
|
|
15
|
-
* Type guard for string values
|
|
16
|
-
*/
|
|
17
|
-
function isString(value: unknown): value is string;
|
|
18
|
-
/**
|
|
19
|
-
* Type guard for number values
|
|
20
|
-
*/
|
|
21
|
-
function isNumber(value: unknown): value is number;
|
|
22
|
-
/**
|
|
23
|
-
* Type guard for boolean values
|
|
24
|
-
*/
|
|
25
|
-
function isBoolean(value: unknown): value is boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Type guard for array values
|
|
28
|
-
*/
|
|
29
|
-
function isArray(value: unknown): value is unknown[];
|
|
30
|
-
/**
|
|
31
|
-
* Type guard for object values
|
|
32
|
-
*/
|
|
33
|
-
function isObject(value: unknown): value is Record<string, unknown>;
|
|
34
|
-
/**
|
|
35
|
-
* Type guard for non-null values
|
|
36
|
-
*/
|
|
37
|
-
function isNotNull(value: unknown): value is NonNullable<unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* Type guard for enum values
|
|
40
|
-
*/
|
|
41
|
-
function isEnum<T extends string>(value: unknown, enumValues: readonly T[]): value is T;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Coerce loosely-typed tool arguments into their declared schema types.
|
|
45
|
-
* This makes tools resilient to providers that emit boolean/number values as strings.
|
|
46
|
-
*/
|
|
47
|
-
export declare function coerceToolArguments(schema: JSONSchemaObject | undefined, args: Record<string, unknown>): Record<string, unknown>;
|
|
48
|
-
export declare function validateToolArguments(toolName: string, schema: JSONSchemaObject | undefined, args: Record<string, unknown>): void;
|
|
49
|
-
//# sourceMappingURL=schemaValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaValidator.d.ts","sourceRoot":"","sources":["../../src/core/schemaValidator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,gBAAgB,EAAsB,MAAM,YAAY,CAAC;AAExF;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;CAM/C;AAED;;GAEG;AACH,yBAAiB,UAAU,CAAC;IAC1B;;OAEG;IACH,SAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;IAED;;OAEG;IACH,SAAgB,QAAQ,CAA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