@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
package/dist/core/hooks.js
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks — Claude-Code-style shell-command hooks that fire around
|
|
3
|
-
* tool execution. Lets users customize agent behavior without
|
|
4
|
-
* editing source: run a linter after every Edit, log Bash commands,
|
|
5
|
-
* block dangerous tools, etc.
|
|
6
|
-
*
|
|
7
|
-
* Settings file (per Claude Code convention):
|
|
8
|
-
* {
|
|
9
|
-
* "hooks": {
|
|
10
|
-
* "PreToolUse": [
|
|
11
|
-
* { "matcher": "Bash", "hooks": [{ "type": "command", "command": "/path/to/script.sh" }] }
|
|
12
|
-
* ],
|
|
13
|
-
* "PostToolUse": [ ... ]
|
|
14
|
-
* }
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* Loaded from (in priority order):
|
|
18
|
-
* 1. <workingDir>/.erosolar/settings.json (project-local)
|
|
19
|
-
* 2. ~/.erosolar/settings.json (user-global)
|
|
20
|
-
*
|
|
21
|
-
* Both load — project-local extends user-global; matchers from both
|
|
22
|
-
* files fire if applicable.
|
|
23
|
-
*
|
|
24
|
-
* Hook contract: the command receives a JSON envelope on stdin,
|
|
25
|
-
* shape:
|
|
26
|
-
* { event: 'PreToolUse'|'PostToolUse', toolName, toolArgs, toolResult? }
|
|
27
|
-
* The command exits 0 + writes a JSON response on stdout to either
|
|
28
|
-
* pass through or shape the result:
|
|
29
|
-
* {} — pass through
|
|
30
|
-
* { "decision": "block",
|
|
31
|
-
* "reason": "string" } — PreToolUse: block the tool call
|
|
32
|
-
* { "appendToResult": "..." } — PostToolUse: append text to the
|
|
33
|
-
* model-visible tool result
|
|
34
|
-
*
|
|
35
|
-
* Hooks are best-effort: a hook that times out, errors, or returns
|
|
36
|
-
* malformed JSON is logged and skipped — never crashes the agent.
|
|
37
|
-
*/
|
|
38
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
39
|
-
import { homedir } from 'node:os';
|
|
40
|
-
import { join } from 'node:path';
|
|
41
|
-
import { exec, execFile } from 'node:child_process';
|
|
42
|
-
/**
|
|
43
|
-
* Read + merge settings from project-local + user-global locations.
|
|
44
|
-
* Returns an empty config if neither file exists. Malformed JSON is
|
|
45
|
-
* silently skipped (with a console.warn).
|
|
46
|
-
*/
|
|
47
|
-
export function loadHooksConfig(workingDir) {
|
|
48
|
-
const candidates = [
|
|
49
|
-
join(workingDir, '.erosolar', 'settings.json'),
|
|
50
|
-
join(homedir(), '.erosolar', 'settings.json'),
|
|
51
|
-
];
|
|
52
|
-
const merged = { hooks: {} };
|
|
53
|
-
for (const path of candidates) {
|
|
54
|
-
if (!existsSync(path))
|
|
55
|
-
continue;
|
|
56
|
-
let parsed = null;
|
|
57
|
-
try {
|
|
58
|
-
const raw = readFileSync(path, 'utf-8');
|
|
59
|
-
parsed = JSON.parse(raw);
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
console.warn(`[hooks] Skipping malformed settings: ${path}: ${err.message}`);
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (!parsed?.hooks)
|
|
66
|
-
continue;
|
|
67
|
-
for (const ev of Object.keys(parsed.hooks)) {
|
|
68
|
-
const list = parsed.hooks[ev];
|
|
69
|
-
if (!Array.isArray(list))
|
|
70
|
-
continue;
|
|
71
|
-
const existing = merged.hooks[ev] ?? [];
|
|
72
|
-
// Shallow-validate each entry before merging so the executor
|
|
73
|
-
// never has to re-check shape.
|
|
74
|
-
const safe = list.filter((m) => m && typeof m === 'object' && Array.isArray(m.hooks));
|
|
75
|
-
merged.hooks[ev] = [...existing, ...safe];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return merged;
|
|
79
|
-
}
|
|
80
|
-
function matchesMatcher(matcher, toolName) {
|
|
81
|
-
if (!matcher || matcher === '*' || matcher === '.*')
|
|
82
|
-
return true;
|
|
83
|
-
try {
|
|
84
|
-
return new RegExp(`^${matcher}$`).test(toolName);
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
return matcher === toolName;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Run a single hook command with structured input. Returns the
|
|
92
|
-
* parsed JSON response, or null if the hook errored / timed out /
|
|
93
|
-
* returned malformed output. Never throws — non-fatal on purpose.
|
|
94
|
-
*/
|
|
95
|
-
async function runHookCommand(cmd, input) {
|
|
96
|
-
const timeoutMs = Math.min(30_000, Math.max(500, cmd.timeoutMs ?? 5000));
|
|
97
|
-
return new Promise((resolve) => {
|
|
98
|
-
let settled = false;
|
|
99
|
-
const finish = (val) => {
|
|
100
|
-
if (settled)
|
|
101
|
-
return;
|
|
102
|
-
settled = true;
|
|
103
|
-
resolve(val);
|
|
104
|
-
};
|
|
105
|
-
// Use exec (not spawn) so the command string is interpreted by
|
|
106
|
-
// the platform's default shell with its native quoting rules.
|
|
107
|
-
// spawn('cmd.exe', ['/c', '<cmd with quotes>']) on Windows
|
|
108
|
-
// mishandles inner double-quotes; exec handles that internally.
|
|
109
|
-
// We do NOT pass exec's `timeout` option — on Windows it sends
|
|
110
|
-
// SIGTERM which doesn't always reliably kill child processes
|
|
111
|
-
// that aren't blocked on I/O (e.g. a node child sitting on a
|
|
112
|
-
// setTimeout). Instead we own the timeout: fire our own timer,
|
|
113
|
-
// resolve the promise immediately, and force-kill the process
|
|
114
|
-
// tree. The exec callback may still fire later but `settled`
|
|
115
|
-
// makes it a no-op.
|
|
116
|
-
const child = exec(cmd.command, { maxBuffer: 1024 * 1024, encoding: 'utf-8' }, (err, stdout, stderr) => {
|
|
117
|
-
if (settled)
|
|
118
|
-
return;
|
|
119
|
-
if (err && err.code) {
|
|
120
|
-
if (typeof stderr === 'string' && stderr.trim()) {
|
|
121
|
-
console.warn(`[hooks] ${cmd.command} exit ${err.code}: ${stderr.slice(0, 400)}`);
|
|
122
|
-
}
|
|
123
|
-
return finish(null);
|
|
124
|
-
}
|
|
125
|
-
const out = (typeof stdout === 'string' ? stdout : '').trim();
|
|
126
|
-
if (!out)
|
|
127
|
-
return finish({});
|
|
128
|
-
try {
|
|
129
|
-
const parsed = JSON.parse(out);
|
|
130
|
-
if (parsed && typeof parsed === 'object')
|
|
131
|
-
return finish(parsed);
|
|
132
|
-
return finish({});
|
|
133
|
-
}
|
|
134
|
-
catch {
|
|
135
|
-
// A hook that prints non-JSON is treated as pass-through.
|
|
136
|
-
return finish({});
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
// Owned timeout — kill the process tree on expiry. On Windows
|
|
140
|
-
// we use taskkill /T /F to clean up children of the shell wrapper;
|
|
141
|
-
// on POSIX, killing the negative pid of the process group does it.
|
|
142
|
-
const timeout = setTimeout(() => {
|
|
143
|
-
if (settled)
|
|
144
|
-
return;
|
|
145
|
-
console.warn(`[hooks] ${cmd.command}: timed out after ${timeoutMs}ms`);
|
|
146
|
-
try {
|
|
147
|
-
if (process.platform === 'win32' && child.pid) {
|
|
148
|
-
// /T = terminate child tree, /F = force. Use execFile with an
|
|
149
|
-
// arg array so the PID can never be interpreted as taskkill
|
|
150
|
-
// flags (defense-in-depth — child.pid is a number from Node so
|
|
151
|
-
// injection isn't reachable today, but the safer pattern is
|
|
152
|
-
// free here).
|
|
153
|
-
execFile('taskkill', ['/pid', String(child.pid), '/T', '/F'], () => { });
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
child.kill('SIGKILL');
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
catch (_) { /* best effort */ }
|
|
160
|
-
finish(null);
|
|
161
|
-
}, timeoutMs);
|
|
162
|
-
timeout.unref?.();
|
|
163
|
-
child.on('exit', () => clearTimeout(timeout));
|
|
164
|
-
// EPIPE on stdin is normal — many hook commands (echo, exit 1)
|
|
165
|
-
// don't consume stdin, so the child closes the pipe before we
|
|
166
|
-
// finish writing. The error fires asynchronously on the stream,
|
|
167
|
-
// not as a sync throw, so the try/catch alone wouldn't catch it.
|
|
168
|
-
child.stdin?.on('error', (err) => {
|
|
169
|
-
if (err.code !== 'EPIPE') {
|
|
170
|
-
console.warn(`[hooks] stdin error: ${err.message}`);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
try {
|
|
174
|
-
child.stdin?.write(JSON.stringify(input));
|
|
175
|
-
child.stdin?.end();
|
|
176
|
-
}
|
|
177
|
-
catch (err) {
|
|
178
|
-
console.warn(`[hooks] stdin write failed: ${err.message}`);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Run all PreToolUse hooks matching `toolName`. Returns the FIRST
|
|
184
|
-
* blocking decision encountered, or null if no hook blocks.
|
|
185
|
-
*/
|
|
186
|
-
export async function runPreToolUseHooks(config, toolName, toolArgs) {
|
|
187
|
-
const matchers = config.hooks?.PreToolUse ?? [];
|
|
188
|
-
for (const m of matchers) {
|
|
189
|
-
if (!matchesMatcher(m.matcher, toolName))
|
|
190
|
-
continue;
|
|
191
|
-
for (const cmd of m.hooks) {
|
|
192
|
-
const result = await runHookCommand(cmd, {
|
|
193
|
-
event: 'PreToolUse',
|
|
194
|
-
toolName,
|
|
195
|
-
toolArgs,
|
|
196
|
-
});
|
|
197
|
-
if (!result)
|
|
198
|
-
continue;
|
|
199
|
-
if (result['decision'] === 'block') {
|
|
200
|
-
return {
|
|
201
|
-
decision: 'block',
|
|
202
|
-
reason: typeof result['reason'] === 'string' ? result['reason'] : 'Blocked by hook',
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return null;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Run all PostToolUse hooks matching `toolName`. Concatenates any
|
|
211
|
-
* appendToResult strings (in matcher order) so multiple hooks can
|
|
212
|
-
* each contribute a note.
|
|
213
|
-
*/
|
|
214
|
-
export async function runPostToolUseHooks(config, toolName, toolArgs, toolResult) {
|
|
215
|
-
const matchers = config.hooks?.PostToolUse ?? [];
|
|
216
|
-
const appended = [];
|
|
217
|
-
for (const m of matchers) {
|
|
218
|
-
if (!matchesMatcher(m.matcher, toolName))
|
|
219
|
-
continue;
|
|
220
|
-
for (const cmd of m.hooks) {
|
|
221
|
-
const result = await runHookCommand(cmd, {
|
|
222
|
-
event: 'PostToolUse',
|
|
223
|
-
toolName,
|
|
224
|
-
toolArgs,
|
|
225
|
-
toolResult,
|
|
226
|
-
});
|
|
227
|
-
if (!result)
|
|
228
|
-
continue;
|
|
229
|
-
const append = result['appendToResult'];
|
|
230
|
-
if (typeof append === 'string' && append.trim()) {
|
|
231
|
-
appended.push(append.trim());
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if (appended.length === 0)
|
|
236
|
-
return null;
|
|
237
|
-
return { appendToResult: appended.join('\n\n') };
|
|
238
|
-
}
|
|
239
|
-
//# sourceMappingURL=hooks.js.map
|
package/dist/core/hooks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAgDpD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,eAAe,CAAC;QAC9C,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,eAAe,CAAC;KAC9C,CAAC;IACF,MAAM,MAAM,GAA0B,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACpD,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAAS;QAChC,IAAI,MAAM,GAAuB,IAAI,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,wCAAwC,IAAI,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YACxF,SAAS;QACX,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,KAAK;YAAE,SAAS;QAC7B,KAAK,MAAM,EAAE,IAAI,MAA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* Core Layer - Erosolar CLI Core Systems
|
|
3
|
-
*/
|
|
4
|
-
export { checkForUpdates, maybeAutoUpdate, formatUpdateNotification, formatUpdateBanner, getUpdateDecision, shouldShowUpdateNotification, readAutoUpdateState, performBackgroundUpdate, performUpdate, updateAndContinue, installPackageVersion, runNpmInstall, saveSessionState, loadSessionState, clearSessionState, hasPendingSession, type UpdateInfo, type AutoUpdateResult, type AutoUpdateState, type SessionState, } from './updateChecker.js';
|
|
5
|
-
export { loadModelPreference, saveModelPreference, loadSessionPreferences, saveSessionPreferences, loadFeatureFlags, saveFeatureFlags, type SessionPreferences, type FeatureFlags, } from './preferences.js';
|
|
6
|
-
export { InputProtection, initializeInputProtection, getInputProtection, validateChatInput, validatePromptSubmit, type InputValidation, type InputAnomalyType, type InputProtectionConfig, } from './inputProtection.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC"}
|
package/dist/core/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core Layer - Erosolar CLI Core Systems
|
|
3
|
-
*/
|
|
4
|
-
export { checkForUpdates, maybeAutoUpdate, formatUpdateNotification, formatUpdateBanner, getUpdateDecision, shouldShowUpdateNotification, readAutoUpdateState, performBackgroundUpdate, performUpdate, updateAndContinue, installPackageVersion, runNpmInstall, saveSessionState, loadSessionState, clearSessionState, hasPendingSession, } from './updateChecker.js';
|
|
5
|
-
export { loadModelPreference, saveModelPreference, loadSessionPreferences, saveSessionPreferences, loadFeatureFlags, saveFeatureFlags, } from './preferences.js';
|
|
6
|
-
export { InputProtection, initializeInputProtection, getInputProtection, validateChatInput, validatePromptSubmit, } from './inputProtection.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAKlB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Input Protection System - Guards against remote anomalys on chat input
|
|
3
|
-
*
|
|
4
|
-
* Protects against:
|
|
5
|
-
* 1. Remote stdin injection anomalys
|
|
6
|
-
* 2. Automated paste anomalys (superhuman typing speed)
|
|
7
|
-
* 3. Escape sequence injection via clipboard
|
|
8
|
-
* 4. Buffer overflow attempts (massive pastes)
|
|
9
|
-
* 5. Control character injection
|
|
10
|
-
* 6. Unicode-based anomalys (homoglyphs, RTL override)
|
|
11
|
-
* 7. Timing-based anomalys (burst injection)
|
|
12
|
-
*
|
|
13
|
-
* @module inputProtection
|
|
14
|
-
*/
|
|
15
|
-
import { EventEmitter } from 'events';
|
|
16
|
-
/** Input validation result */
|
|
17
|
-
export interface InputValidation {
|
|
18
|
-
allowed: boolean;
|
|
19
|
-
sanitized: string;
|
|
20
|
-
blocked: boolean;
|
|
21
|
-
reason?: string;
|
|
22
|
-
anomalyType?: InputAnomalyType;
|
|
23
|
-
riskScore: number;
|
|
24
|
-
}
|
|
25
|
-
/** Types of input anomalys */
|
|
26
|
-
export type InputAnomalyType = 'automated_injection' | 'escape_injection' | 'control_injection' | 'overflow_attempt' | 'unicode_anomaly' | 'timing_burst' | 'remote_paste' | 'stdin_hijack';
|
|
27
|
-
/** Input protection configuration */
|
|
28
|
-
export interface InputProtectionConfig {
|
|
29
|
-
/** Maximum characters per second (human ~12 CPS, paste unlimited) */
|
|
30
|
-
maxCharactersPerSecond?: number;
|
|
31
|
-
/** Maximum paste size in characters */
|
|
32
|
-
maxPasteSize?: number;
|
|
33
|
-
/** Maximum total buffer size */
|
|
34
|
-
maxBufferSize?: number;
|
|
35
|
-
/** Enable timing-based anomaly detection */
|
|
36
|
-
detectTimingAnomalys?: boolean;
|
|
37
|
-
/** Minimum interval between keystrokes in ms (human ~50ms+) */
|
|
38
|
-
minKeystrokeInterval?: number;
|
|
39
|
-
/** Maximum burst size before suspicion */
|
|
40
|
-
maxBurstSize?: number;
|
|
41
|
-
/** Enable strict mode (blocks suspicious input instead of sanitizing) */
|
|
42
|
-
strictMode?: boolean;
|
|
43
|
-
/** Verbose logging */
|
|
44
|
-
verbose?: boolean;
|
|
45
|
-
/** Callback on anomaly detection */
|
|
46
|
-
onAnomalyDetected?: (type: InputAnomalyType, details: string) => void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Input Protection System
|
|
50
|
-
*/
|
|
51
|
-
export declare class InputProtection extends EventEmitter {
|
|
52
|
-
private config;
|
|
53
|
-
private inputTimings;
|
|
54
|
-
private lastKeystroke;
|
|
55
|
-
private burstCounter;
|
|
56
|
-
private suspicionScore;
|
|
57
|
-
private blockedAnomalys;
|
|
58
|
-
private sanitizedInputs;
|
|
59
|
-
private isInPasteMode;
|
|
60
|
-
private pasteStartTime;
|
|
61
|
-
private readonly dangerousEscapes;
|
|
62
|
-
private readonly dangerousControls;
|
|
63
|
-
private readonly unicodeAnomalys;
|
|
64
|
-
constructor(config?: InputProtectionConfig);
|
|
65
|
-
/**
|
|
66
|
-
* Validate and sanitize input before it enters the chat buffer
|
|
67
|
-
*/
|
|
68
|
-
validateInput(input: string, isPaste?: boolean): InputValidation;
|
|
69
|
-
/**
|
|
70
|
-
* Enter paste mode (more lenient validation)
|
|
71
|
-
*/
|
|
72
|
-
enterPasteMode(): void;
|
|
73
|
-
/**
|
|
74
|
-
* Exit paste mode
|
|
75
|
-
*/
|
|
76
|
-
exitPasteMode(): void;
|
|
77
|
-
/**
|
|
78
|
-
* Check if currently in paste mode
|
|
79
|
-
*/
|
|
80
|
-
isPasting(): boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Validate a complete prompt before submission
|
|
83
|
-
*/
|
|
84
|
-
validatePromptSubmission(prompt: string): InputValidation;
|
|
85
|
-
/**
|
|
86
|
-
* Reset protection state (e.g., after idle period)
|
|
87
|
-
*/
|
|
88
|
-
reset(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Get protection statistics
|
|
91
|
-
*/
|
|
92
|
-
getStats(): {
|
|
93
|
-
blockedAnomalys: number;
|
|
94
|
-
sanitizedInputs: number;
|
|
95
|
-
currentSuspicion: number;
|
|
96
|
-
currentCPS: number;
|
|
97
|
-
};
|
|
98
|
-
private checkEscapeSequences;
|
|
99
|
-
private checkControlCharacters;
|
|
100
|
-
private checkUnicodeAnomalys;
|
|
101
|
-
private cleanOldTimings;
|
|
102
|
-
private getRecentCharCount;
|
|
103
|
-
private calculateCPS;
|
|
104
|
-
private log;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Initialize global input protection (singleton)
|
|
108
|
-
*/
|
|
109
|
-
export declare function initializeInputProtection(config?: InputProtectionConfig): InputProtection;
|
|
110
|
-
/**
|
|
111
|
-
* Get input protection instance
|
|
112
|
-
*/
|
|
113
|
-
export declare function getInputProtection(): InputProtection | null;
|
|
114
|
-
/**
|
|
115
|
-
* Quick validate function for input
|
|
116
|
-
*/
|
|
117
|
-
export declare function validateChatInput(input: string, isPaste?: boolean): InputValidation;
|
|
118
|
-
/**
|
|
119
|
-
* Validate final prompt before submission
|
|
120
|
-
*/
|
|
121
|
-
export declare function validatePromptSubmit(prompt: string): InputValidation;
|
|
122
|
-
//# sourceMappingURL=inputProtection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputProtection.d.ts","sourceRoot":"","sources":["../../src/core/inputProtection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;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