erosolar-cli 1.7.55 → 1.7.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shell/unifiedInputProcessor.d.ts +15 -12
- package/dist/shell/unifiedInputProcessor.d.ts.map +1 -1
- package/dist/shell/unifiedInputProcessor.js +45 -72
- package/dist/shell/unifiedInputProcessor.js.map +1 -1
- package/package.json +4 -4
- package/dist/active-stack-security.d.ts +0 -110
- package/dist/active-stack-security.js +0 -313
- package/dist/active-stack-security.js.map +0 -1
- package/dist/advanced-targeting.d.ts +0 -113
- package/dist/advanced-targeting.js +0 -252
- package/dist/advanced-targeting.js.map +0 -1
- package/dist/bin/adapters/node/index.js +0 -33
- package/dist/bin/adapters/types.js +0 -1
- package/dist/bin/alpha-zero/agentWrapper.js +0 -165
- package/dist/bin/alpha-zero/codeEvaluator.js +0 -272
- package/dist/bin/alpha-zero/competitiveRunner.js +0 -219
- package/dist/bin/alpha-zero/index.js +0 -98
- package/dist/bin/alpha-zero/introspection.js +0 -298
- package/dist/bin/alpha-zero/metricsTracker.js +0 -207
- package/dist/bin/alpha-zero/security/core.js +0 -269
- package/dist/bin/alpha-zero/security/google.js +0 -308
- package/dist/bin/alpha-zero/security/googleLoader.js +0 -40
- package/dist/bin/alpha-zero/security/index.js +0 -31
- package/dist/bin/alpha-zero/security/simulation.js +0 -274
- package/dist/bin/alpha-zero/selfModification.js +0 -231
- package/dist/bin/alpha-zero/types.js +0 -30
- package/dist/bin/bin/erosolar-optimized.js +0 -205
- package/dist/bin/capabilities/agentSpawningCapability.js +0 -116
- package/dist/bin/capabilities/bashCapability.js +0 -22
- package/dist/bin/capabilities/cloudCapability.js +0 -36
- package/dist/bin/capabilities/codeAnalysisCapability.js +0 -22
- package/dist/bin/capabilities/codeQualityCapability.js +0 -23
- package/dist/bin/capabilities/dependencySecurityCapability.js +0 -22
- package/dist/bin/capabilities/devCapability.js +0 -22
- package/dist/bin/capabilities/editCapability.js +0 -28
- package/dist/bin/capabilities/emailCapability.js +0 -20
- package/dist/bin/capabilities/enhancedGitCapability.js +0 -221
- package/dist/bin/capabilities/filesystemCapability.js +0 -22
- package/dist/bin/capabilities/globCapability.js +0 -28
- package/dist/bin/capabilities/interactionCapability.js +0 -20
- package/dist/bin/capabilities/learnCapability.js +0 -22
- package/dist/bin/capabilities/mcpCapability.js +0 -20
- package/dist/bin/capabilities/notebookCapability.js +0 -28
- package/dist/bin/capabilities/planningCapability.js +0 -27
- package/dist/bin/capabilities/refactoringCapability.js +0 -23
- package/dist/bin/capabilities/repoChecksCapability.js +0 -22
- package/dist/bin/capabilities/searchCapability.js +0 -22
- package/dist/bin/capabilities/skillCapability.js +0 -76
- package/dist/bin/capabilities/taskManagementCapability.js +0 -20
- package/dist/bin/capabilities/testingCapability.js +0 -23
- package/dist/bin/capabilities/toolManifest.js +0 -159
- package/dist/bin/capabilities/toolRegistry.js +0 -114
- package/dist/bin/capabilities/webCapability.js +0 -20
- package/dist/bin/config.js +0 -139
- package/dist/bin/contracts/v1/agent.js +0 -7
- package/dist/bin/contracts/v1/agentProfileManifest.js +0 -8
- package/dist/bin/contracts/v1/agentRules.js +0 -9
- package/dist/bin/contracts/v1/toolAccess.js +0 -8
- package/dist/bin/erosolar-optimized.d.ts +0 -12
- package/dist/bin/erosolar-optimized.d.ts.map +0 -1
- package/dist/bin/erosolar-optimized.js +0 -239
- package/dist/bin/erosolar-optimized.js.map +0 -1
- package/dist/bin/headless/headlessApp.js +0 -172
- package/dist/bin/mcp/config.js +0 -202
- package/dist/bin/mcp/stdioClient.js +0 -172
- package/dist/bin/mcp/toolBridge.js +0 -104
- package/dist/bin/mcp/types.js +0 -1
- package/dist/bin/plugins/index.js +0 -113
- package/dist/bin/plugins/providers/anthropic/index.js +0 -25
- package/dist/bin/plugins/providers/deepseek/index.js +0 -24
- package/dist/bin/plugins/providers/google/index.js +0 -26
- package/dist/bin/plugins/providers/index.js +0 -19
- package/dist/bin/plugins/providers/ollama/index.js +0 -59
- package/dist/bin/plugins/providers/openai/index.js +0 -26
- package/dist/bin/plugins/providers/xai/index.js +0 -24
- package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -8
- package/dist/bin/plugins/tools/bash/localBashPlugin.js +0 -13
- package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +0 -13
- package/dist/bin/plugins/tools/cloud/cloudPlugin.js +0 -13
- package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -13
- package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +0 -13
- package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +0 -11
- package/dist/bin/plugins/tools/development/devPlugin.js +0 -13
- package/dist/bin/plugins/tools/edit/editPlugin.js +0 -14
- package/dist/bin/plugins/tools/email/emailPlugin.js +0 -11
- package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -8
- package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +0 -13
- package/dist/bin/plugins/tools/glob/globPlugin.js +0 -14
- package/dist/bin/plugins/tools/index.js +0 -2
- package/dist/bin/plugins/tools/interaction/interactionPlugin.js +0 -11
- package/dist/bin/plugins/tools/learn/learnPlugin.js +0 -13
- package/dist/bin/plugins/tools/mcp/mcpPlugin.js +0 -8
- package/dist/bin/plugins/tools/nodeDefaults.js +0 -56
- package/dist/bin/plugins/tools/notebook/notebookPlugin.js +0 -14
- package/dist/bin/plugins/tools/planning/planningPlugin.js +0 -14
- package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +0 -11
- package/dist/bin/plugins/tools/registry.js +0 -57
- package/dist/bin/plugins/tools/search/localSearchPlugin.js +0 -13
- package/dist/bin/plugins/tools/skills/skillPlugin.js +0 -8
- package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +0 -11
- package/dist/bin/plugins/tools/testing/testingPlugin.js +0 -11
- package/dist/bin/plugins/tools/web/webPlugin.js +0 -11
- package/dist/bin/providers/anthropicProvider.js +0 -329
- package/dist/bin/providers/googleProvider.js +0 -203
- package/dist/bin/providers/openaiChatCompletionsProvider.js +0 -208
- package/dist/bin/providers/openaiResponsesProvider.js +0 -249
- package/dist/bin/providers/providerFactory.js +0 -24
- package/dist/bin/runtime/agentController.js +0 -321
- package/dist/bin/runtime/agentHost.js +0 -153
- package/dist/bin/runtime/agentSession.js +0 -195
- package/dist/bin/runtime/node.js +0 -10
- package/dist/bin/runtime/universal.js +0 -28
- package/dist/bin/skills/skillRepository.js +0 -236
- package/dist/bin/skills/types.js +0 -1
- package/dist/bin/subagents/taskRunner.js +0 -269
- package/dist/bin/tools/backgroundBashTools.js +0 -211
- package/dist/bin/tools/bashTools.js +0 -159
- package/dist/bin/tools/cloudTools.js +0 -864
- package/dist/bin/tools/codeAnalysisTools.js +0 -641
- package/dist/bin/tools/codeQualityTools.js +0 -294
- package/dist/bin/tools/dependencyTools.js +0 -282
- package/dist/bin/tools/devTools.js +0 -238
- package/dist/bin/tools/diffUtils.js +0 -137
- package/dist/bin/tools/editTools.js +0 -134
- package/dist/bin/tools/emailTools.js +0 -448
- package/dist/bin/tools/fileTools.js +0 -282
- package/dist/bin/tools/globTools.js +0 -173
- package/dist/bin/tools/grepTools.js +0 -332
- package/dist/bin/tools/interactionTools.js +0 -170
- package/dist/bin/tools/learnTools.js +0 -1818
- package/dist/bin/tools/notebookEditTools.js +0 -196
- package/dist/bin/tools/planningTools.js +0 -46
- package/dist/bin/tools/refactoringTools.js +0 -293
- package/dist/bin/tools/repoChecksTools.js +0 -160
- package/dist/bin/tools/searchTools.js +0 -206
- package/dist/bin/tools/skillTools.js +0 -177
- package/dist/bin/tools/taskManagementTools.js +0 -156
- package/dist/bin/tools/testingTools.js +0 -232
- package/dist/bin/tools/webTools.js +0 -480
- package/dist/bin/workspace.js +0 -106
- package/dist/bin/workspace.validator.js +0 -213
- package/dist/capabilities/offensiveSecurityCapability.d.ts +0 -26
- package/dist/capabilities/offensiveSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/offensiveSecurityCapability.js +0 -58
- package/dist/capabilities/offensiveSecurityCapability.js.map +0 -1
- package/dist/capabilities/realSecurityCapability.d.ts +0 -26
- package/dist/capabilities/realSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/realSecurityCapability.js +0 -53
- package/dist/capabilities/realSecurityCapability.js.map +0 -1
- package/dist/capabilities/securityCapability.d.ts +0 -32
- package/dist/capabilities/securityCapability.d.ts.map +0 -1
- package/dist/capabilities/securityCapability.js +0 -57
- package/dist/capabilities/securityCapability.js.map +0 -1
- package/dist/capabilities/ultimateSecurityCapability.d.ts +0 -42
- package/dist/capabilities/ultimateSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/ultimateSecurityCapability.js +0 -96
- package/dist/capabilities/ultimateSecurityCapability.js.map +0 -1
- package/dist/core/designThoughtCheck.d.ts +0 -196
- package/dist/core/designThoughtCheck.d.ts.map +0 -1
- package/dist/core/designThoughtCheck.js +0 -287
- package/dist/core/designThoughtCheck.js.map +0 -1
- package/dist/core/designThoughtCheckEngine.d.ts +0 -58
- package/dist/core/designThoughtCheckEngine.d.ts.map +0 -1
- package/dist/core/designThoughtCheckEngine.js +0 -358
- package/dist/core/designThoughtCheckEngine.js.map +0 -1
- package/dist/core/designThoughtCheckIntegration.d.ts +0 -103
- package/dist/core/designThoughtCheckIntegration.d.ts.map +0 -1
- package/dist/core/designThoughtCheckIntegration.js +0 -207
- package/dist/core/designThoughtCheckIntegration.js.map +0 -1
- package/dist/core/intelligenceTools.d.ts +0 -19
- package/dist/core/intelligenceTools.d.ts.map +0 -1
- package/dist/core/intelligenceTools.js +0 -453
- package/dist/core/intelligenceTools.js.map +0 -1
- package/dist/core/operationalTools.d.ts +0 -19
- package/dist/core/operationalTools.d.ts.map +0 -1
- package/dist/core/operationalTools.js +0 -467
- package/dist/core/operationalTools.js.map +0 -1
- package/dist/offensive/core/offensive-engine.d.ts +0 -171
- package/dist/offensive/core/offensive-engine.d.ts.map +0 -1
- package/dist/offensive/core/offensive-engine.js +0 -345
- package/dist/offensive/core/offensive-engine.js.map +0 -1
- package/dist/offensive/core/offensive-integration.d.ts +0 -129
- package/dist/offensive/core/offensive-integration.d.ts.map +0 -1
- package/dist/offensive/core/offensive-integration.js +0 -364
- package/dist/offensive/core/offensive-integration.js.map +0 -1
- package/dist/offensive/core/offensive-tools.d.ts +0 -55
- package/dist/offensive/core/offensive-tools.d.ts.map +0 -1
- package/dist/offensive/core/offensive-tools.js +0 -438
- package/dist/offensive/core/offensive-tools.js.map +0 -1
- package/dist/offensive/offensive-cli.d.ts +0 -48
- package/dist/offensive/offensive-cli.d.ts.map +0 -1
- package/dist/offensive/offensive-cli.js +0 -233
- package/dist/offensive/offensive-cli.js.map +0 -1
- package/dist/security/apt-simulation-cli.d.ts +0 -57
- package/dist/security/apt-simulation-cli.d.ts.map +0 -1
- package/dist/security/apt-simulation-cli.js +0 -278
- package/dist/security/apt-simulation-cli.js.map +0 -1
- package/dist/security/apt-simulation-engine-complete.d.ts +0 -97
- package/dist/security/apt-simulation-engine-complete.d.ts.map +0 -1
- package/dist/security/apt-simulation-engine-complete.js +0 -441
- package/dist/security/apt-simulation-engine-complete.js.map +0 -1
- package/dist/security/apt-simulation-engine.d.ts +0 -97
- package/dist/security/apt-simulation-engine.d.ts.map +0 -1
- package/dist/security/apt-simulation-engine.js +0 -441
- package/dist/security/apt-simulation-engine.js.map +0 -1
- package/dist/security/authorization.d.ts +0 -45
- package/dist/security/authorization.d.ts.map +0 -1
- package/dist/security/authorization.js +0 -128
- package/dist/security/authorization.js.map +0 -1
- package/dist/security/comprehensive-security-research.d.ts +0 -84
- package/dist/security/comprehensive-security-research.d.ts.map +0 -1
- package/dist/security/comprehensive-security-research.js +0 -211
- package/dist/security/comprehensive-security-research.js.map +0 -1
- package/dist/security/offensive/exploitationEngine.d.ts +0 -54
- package/dist/security/offensive/exploitationEngine.d.ts.map +0 -1
- package/dist/security/offensive/exploitationEngine.js +0 -263
- package/dist/security/offensive/exploitationEngine.js.map +0 -1
- package/dist/security/real/networkExploitation.d.ts +0 -92
- package/dist/security/real/networkExploitation.d.ts.map +0 -1
- package/dist/security/real/networkExploitation.js +0 -316
- package/dist/security/real/networkExploitation.js.map +0 -1
- package/dist/security/real/persistenceImplementation.d.ts +0 -62
- package/dist/security/real/persistenceImplementation.d.ts.map +0 -1
- package/dist/security/real/persistenceImplementation.js +0 -323
- package/dist/security/real/persistenceImplementation.js.map +0 -1
- package/dist/security/real/vulnerabilityScanner.d.ts +0 -73
- package/dist/security/real/vulnerabilityScanner.d.ts.map +0 -1
- package/dist/security/real/vulnerabilityScanner.js +0 -341
- package/dist/security/real/vulnerabilityScanner.js.map +0 -1
- package/dist/shell/capturePastePatch.d.ts +0 -9
- package/dist/shell/capturePastePatch.d.ts.map +0 -1
- package/dist/shell/capturePastePatch.js +0 -98
- package/dist/shell/capturePastePatch.js.map +0 -1
- package/dist/shell/enhancedInteractiveShell.d.ts +0 -90
- package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
- package/dist/shell/enhancedInteractiveShell.js +0 -248
- package/dist/shell/enhancedInteractiveShell.js.map +0 -1
- package/dist/shell/inputProcessor.d.ts +0 -56
- package/dist/shell/inputProcessor.d.ts.map +0 -1
- package/dist/shell/inputProcessor.js +0 -172
- package/dist/shell/inputProcessor.js.map +0 -1
- package/dist/shell/interactiveShell-patch.d.ts +0 -27
- package/dist/shell/interactiveShell-patch.d.ts.map +0 -1
- package/dist/shell/interactiveShell-patch.js +0 -38
- package/dist/shell/interactiveShell-patch.js.map +0 -1
- package/dist/shell/interactiveShell-robust.d.ts +0 -26
- package/dist/shell/interactiveShell-robust.d.ts.map +0 -1
- package/dist/shell/interactiveShell-robust.js +0 -34
- package/dist/shell/interactiveShell-robust.js.map +0 -1
- package/dist/shell/multiLinePasteManager.d.ts +0 -106
- package/dist/shell/multiLinePasteManager.d.ts.map +0 -1
- package/dist/shell/multiLinePasteManager.js +0 -308
- package/dist/shell/multiLinePasteManager.js.map +0 -1
- package/dist/shell/processInputBlockPatch.d.ts +0 -8
- package/dist/shell/processInputBlockPatch.d.ts.map +0 -1
- package/dist/shell/processInputBlockPatch.js +0 -133
- package/dist/shell/processInputBlockPatch.js.map +0 -1
- package/dist/tools/enhancedSecurityTools.d.ts +0 -19
- package/dist/tools/enhancedSecurityTools.d.ts.map +0 -1
- package/dist/tools/enhancedSecurityTools.js +0 -215
- package/dist/tools/enhancedSecurityTools.js.map +0 -1
- package/dist/tools/offensiveSecurityTools.d.ts +0 -16
- package/dist/tools/offensiveSecurityTools.d.ts.map +0 -1
- package/dist/tools/offensiveSecurityTools.js +0 -285
- package/dist/tools/offensiveSecurityTools.js.map +0 -1
- package/dist/tools/realSecurityTools.d.ts +0 -18
- package/dist/tools/realSecurityTools.d.ts.map +0 -1
- package/dist/tools/realSecurityTools.js +0 -468
- package/dist/tools/realSecurityTools.js.map +0 -1
- package/dist/tools/securityTools.d.ts +0 -20
- package/dist/tools/securityTools.d.ts.map +0 -1
- package/dist/tools/securityTools.js +0 -449
- package/dist/tools/securityTools.js.map +0 -1
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace Context Validator - Enforces strict safety limits
|
|
3
|
-
*
|
|
4
|
-
* CRITICAL: Prevents context explosion by validating all workspace context
|
|
5
|
-
* before it's sent to the LLM. Multiple safety layers ensure we never
|
|
6
|
-
* exceed token limits.
|
|
7
|
-
*/
|
|
8
|
-
import { ContextOverflowError, ResourceLimitError } from './core/errors/errorTypes.js';
|
|
9
|
-
// ABSOLUTE MAXIMUM LIMITS - Never exceed these under any circumstances
|
|
10
|
-
const ABSOLUTE_MAX_CHARS = 5000; // ~1,250 tokens (4 chars per token)
|
|
11
|
-
const ABSOLUTE_MAX_LINES = 100; // Maximum lines in any context
|
|
12
|
-
const ABSOLUTE_MAX_FILE_ENTRIES = 50; // Maximum files in tree
|
|
13
|
-
const ABSOLUTE_MAX_DOC_CHARS = 300; // Maximum chars per priority doc
|
|
14
|
-
const WARNING_THRESHOLD = 0.7; // Warn at 70% of max
|
|
15
|
-
/**
|
|
16
|
-
* Estimate token count (rough: 1 token ≈ 4 characters)
|
|
17
|
-
*/
|
|
18
|
-
function estimateTokens(text) {
|
|
19
|
-
return Math.ceil(text.length / 4);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Validate workspace context options BEFORE building context
|
|
23
|
-
*/
|
|
24
|
-
export function validateWorkspaceOptions(options) {
|
|
25
|
-
const errors = [];
|
|
26
|
-
const warnings = [];
|
|
27
|
-
// Validate tree depth
|
|
28
|
-
if (options.treeDepth !== undefined) {
|
|
29
|
-
if (options.treeDepth < 0) {
|
|
30
|
-
errors.push('treeDepth cannot be negative');
|
|
31
|
-
}
|
|
32
|
-
if (options.treeDepth > 2) {
|
|
33
|
-
errors.push(`treeDepth ${options.treeDepth} exceeds maximum of 2`);
|
|
34
|
-
}
|
|
35
|
-
if (options.treeDepth > 1) {
|
|
36
|
-
warnings.push('treeDepth > 1 can significantly increase context size');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// Validate max entries
|
|
40
|
-
if (options.maxEntries !== undefined) {
|
|
41
|
-
if (options.maxEntries < 0) {
|
|
42
|
-
errors.push('maxEntries cannot be negative');
|
|
43
|
-
}
|
|
44
|
-
if (options.maxEntries > ABSOLUTE_MAX_FILE_ENTRIES) {
|
|
45
|
-
errors.push(`maxEntries ${options.maxEntries} exceeds maximum of ${ABSOLUTE_MAX_FILE_ENTRIES}`);
|
|
46
|
-
}
|
|
47
|
-
if (options.maxEntries > 40) {
|
|
48
|
-
warnings.push('maxEntries > 40 may use significant context');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Validate doc excerpt limit
|
|
52
|
-
if (options.docExcerptLimit !== undefined) {
|
|
53
|
-
if (options.docExcerptLimit < 0) {
|
|
54
|
-
errors.push('docExcerptLimit cannot be negative');
|
|
55
|
-
}
|
|
56
|
-
if (options.docExcerptLimit > ABSOLUTE_MAX_DOC_CHARS) {
|
|
57
|
-
errors.push(`docExcerptLimit ${options.docExcerptLimit} exceeds maximum of ${ABSOLUTE_MAX_DOC_CHARS}`);
|
|
58
|
-
}
|
|
59
|
-
if (options.docExcerptLimit > 250) {
|
|
60
|
-
warnings.push('docExcerptLimit > 250 may use significant context');
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
valid: errors.length === 0,
|
|
65
|
-
errors,
|
|
66
|
-
warnings,
|
|
67
|
-
stats: {
|
|
68
|
-
totalChars: 0,
|
|
69
|
-
totalLines: 0,
|
|
70
|
-
estimatedTokens: 0,
|
|
71
|
-
fileEntries: options.maxEntries ?? 0,
|
|
72
|
-
docChars: options.docExcerptLimit ?? 0,
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Validate workspace context AFTER building - CRITICAL SAFETY CHECK
|
|
78
|
-
* This is the final line of defense against context explosion
|
|
79
|
-
*/
|
|
80
|
-
export function validateWorkspaceContext(content) {
|
|
81
|
-
const errors = [];
|
|
82
|
-
const warnings = [];
|
|
83
|
-
// Count basic metrics
|
|
84
|
-
const totalChars = content.length;
|
|
85
|
-
const lines = content.split('\n');
|
|
86
|
-
const totalLines = lines.length;
|
|
87
|
-
const estimatedTokens = estimateTokens(content);
|
|
88
|
-
// Count file entries (lines that look like file paths)
|
|
89
|
-
const fileEntries = lines.filter(line => line.trim() && !line.startsWith('---') && !line.startsWith('cwd:')).length;
|
|
90
|
-
// Count chars in priority docs section
|
|
91
|
-
const docMatch = content.match(/--- .* ---[\s\S]*?(?=\n\n|$)/g);
|
|
92
|
-
const docChars = docMatch ? docMatch.join('').length : 0;
|
|
93
|
-
const stats = {
|
|
94
|
-
totalChars,
|
|
95
|
-
totalLines,
|
|
96
|
-
estimatedTokens,
|
|
97
|
-
fileEntries,
|
|
98
|
-
docChars,
|
|
99
|
-
};
|
|
100
|
-
// CRITICAL: Check absolute maximum character limit
|
|
101
|
-
if (totalChars > ABSOLUTE_MAX_CHARS) {
|
|
102
|
-
const error = new ContextOverflowError(totalChars, ABSOLUTE_MAX_CHARS, 'chars', true);
|
|
103
|
-
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
104
|
-
}
|
|
105
|
-
// CRITICAL: Check absolute maximum line limit
|
|
106
|
-
if (totalLines > ABSOLUTE_MAX_LINES) {
|
|
107
|
-
const error = new ContextOverflowError(totalLines, ABSOLUTE_MAX_LINES, 'lines', true);
|
|
108
|
-
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
109
|
-
}
|
|
110
|
-
// CRITICAL: Check absolute maximum file entries
|
|
111
|
-
if (fileEntries > ABSOLUTE_MAX_FILE_ENTRIES) {
|
|
112
|
-
const error = new ResourceLimitError('file entries', fileEntries, ABSOLUTE_MAX_FILE_ENTRIES, false);
|
|
113
|
-
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
114
|
-
}
|
|
115
|
-
// WARNING: Approaching limits
|
|
116
|
-
if (totalChars > ABSOLUTE_MAX_CHARS * WARNING_THRESHOLD) {
|
|
117
|
-
warnings.push(`Context size ${totalChars} chars is ${Math.round(totalChars / ABSOLUTE_MAX_CHARS * 100)}% of maximum. ` +
|
|
118
|
-
`Consider reducing treeDepth, maxEntries, or docExcerptLimit.`);
|
|
119
|
-
}
|
|
120
|
-
if (estimatedTokens > 1000) {
|
|
121
|
-
warnings.push(`Estimated ${estimatedTokens} tokens in workspace context. This is high and may impact performance.`);
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
valid: errors.length === 0,
|
|
125
|
-
errors,
|
|
126
|
-
warnings,
|
|
127
|
-
stats,
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Safe truncation - if content exceeds limits, truncate intelligently
|
|
132
|
-
*/
|
|
133
|
-
export function truncateWorkspaceContext(content) {
|
|
134
|
-
const validation = validateWorkspaceContext(content);
|
|
135
|
-
// If valid, return as-is
|
|
136
|
-
if (validation.valid) {
|
|
137
|
-
return {
|
|
138
|
-
content,
|
|
139
|
-
stats: validation.stats,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
// CRITICAL: Content exceeds limits, must truncate
|
|
143
|
-
const lines = content.split('\n');
|
|
144
|
-
const truncatedLines = [];
|
|
145
|
-
let charCount = 0;
|
|
146
|
-
// Keep up to absolute maximums
|
|
147
|
-
for (const line of lines) {
|
|
148
|
-
if (truncatedLines.length >= ABSOLUTE_MAX_LINES) {
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
if (charCount + line.length > ABSOLUTE_MAX_CHARS) {
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
truncatedLines.push(line);
|
|
155
|
-
charCount += line.length + 1; // +1 for newline
|
|
156
|
-
}
|
|
157
|
-
// Add truncation notice
|
|
158
|
-
if (truncatedLines.length < lines.length) {
|
|
159
|
-
truncatedLines.push('');
|
|
160
|
-
truncatedLines.push('[Workspace context truncated to prevent context overflow]');
|
|
161
|
-
truncatedLines.push(`[Showing ${truncatedLines.length} of ${lines.length} lines]`);
|
|
162
|
-
}
|
|
163
|
-
const truncatedContent = truncatedLines.join('\n');
|
|
164
|
-
const stats = validateWorkspaceContext(truncatedContent).stats;
|
|
165
|
-
return {
|
|
166
|
-
content: truncatedContent,
|
|
167
|
-
stats,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Validate and enforce limits in a single call - RECOMMENDED USAGE
|
|
172
|
-
*/
|
|
173
|
-
export function safeWorkspaceContext(content, options) {
|
|
174
|
-
const { truncate = true, throwOnError = false } = options ?? {};
|
|
175
|
-
if (!content) {
|
|
176
|
-
return {
|
|
177
|
-
content: '',
|
|
178
|
-
stats: {
|
|
179
|
-
totalChars: 0,
|
|
180
|
-
totalLines: 0,
|
|
181
|
-
estimatedTokens: 0,
|
|
182
|
-
fileEntries: 0,
|
|
183
|
-
docChars: 0,
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
const validation = validateWorkspaceContext(content);
|
|
188
|
-
// Log warnings to console
|
|
189
|
-
if (validation.warnings.length > 0) {
|
|
190
|
-
console.warn('[Workspace Context Validator] Warnings:');
|
|
191
|
-
for (const warning of validation.warnings) {
|
|
192
|
-
console.warn(` - ${warning}`);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
// Handle errors
|
|
196
|
-
if (!validation.valid) {
|
|
197
|
-
console.error('[Workspace Context Validator] CRITICAL ERRORS:');
|
|
198
|
-
for (const error of validation.errors) {
|
|
199
|
-
console.error(` - ${error}`);
|
|
200
|
-
}
|
|
201
|
-
if (throwOnError) {
|
|
202
|
-
throw new Error(`Workspace context validation failed:\n${validation.errors.join('\n')}`);
|
|
203
|
-
}
|
|
204
|
-
if (truncate) {
|
|
205
|
-
console.warn('[Workspace Context Validator] Auto-truncating to safe limits...');
|
|
206
|
-
return truncateWorkspaceContext(content);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return {
|
|
210
|
-
content,
|
|
211
|
-
stats: validation.stats,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Offensive Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides advanced offensive security capabilities for authorized testing.
|
|
5
|
-
* These tools include reverse shells, fileless persistence, web shells, and more.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All offensive security tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, red team exercises, and authorized penetration testing only.
|
|
10
|
-
*/
|
|
11
|
-
import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
|
|
12
|
-
export interface OffensiveSecurityCapabilityOptions {
|
|
13
|
-
workingDir?: string;
|
|
14
|
-
id?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
enableAdvancedExploitation?: boolean;
|
|
17
|
-
requireAuthorization?: boolean;
|
|
18
|
-
enablePayloadGeneration?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare class OffensiveSecurityCapabilityModule implements CapabilityModule {
|
|
21
|
-
readonly id = "capability.offensive.security";
|
|
22
|
-
private readonly options;
|
|
23
|
-
constructor(options?: OffensiveSecurityCapabilityOptions);
|
|
24
|
-
create(context: CapabilityContext): Promise<CapabilityContribution>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=offensiveSecurityCapability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offensiveSecurityCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/offensiveSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,MAAM,WAAW,kCAAkC;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,qBAAa,iCAAkC,YAAW,gBAAgB;IACxE,QAAQ,CAAC,EAAE,mCAAmC;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;gBAEjD,OAAO,GAAE,kCAAuC;IAStD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAoC1E"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Offensive Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides advanced offensive security capabilities for authorized testing.
|
|
5
|
-
* These tools include reverse shells, fileless persistence, web shells, and more.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All offensive security tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, red team exercises, and authorized penetration testing only.
|
|
10
|
-
*/
|
|
11
|
-
import { createOffensiveSecurityTools } from '../tools/offensiveSecurityTools.js';
|
|
12
|
-
export class OffensiveSecurityCapabilityModule {
|
|
13
|
-
id = 'capability.offensive.security';
|
|
14
|
-
options;
|
|
15
|
-
constructor(options = {}) {
|
|
16
|
-
this.options = {
|
|
17
|
-
requireAuthorization: true,
|
|
18
|
-
enableAdvancedExploitation: false,
|
|
19
|
-
enablePayloadGeneration: false,
|
|
20
|
-
...options
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
async create(context) {
|
|
24
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
25
|
-
return {
|
|
26
|
-
id: this.options.id ?? 'offensive.security.research.tools',
|
|
27
|
-
description: this.options.description ??
|
|
28
|
-
'Advanced offensive security testing tools with reverse shells, fileless persistence, web shells, and exploitation capabilities.',
|
|
29
|
-
toolSuite: {
|
|
30
|
-
id: 'offensive.security',
|
|
31
|
-
description: 'Advanced offensive security testing tools',
|
|
32
|
-
tools: createOffensiveSecurityTools(workingDir, {
|
|
33
|
-
enableAdvancedExploitation: this.options.enableAdvancedExploitation,
|
|
34
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
35
|
-
enablePayloadGeneration: this.options.enablePayloadGeneration
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
metadata: {
|
|
39
|
-
workingDir,
|
|
40
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
41
|
-
enableAdvancedExploitation: this.options.enableAdvancedExploitation,
|
|
42
|
-
enablePayloadGeneration: this.options.enablePayloadGeneration,
|
|
43
|
-
supportedOperations: [
|
|
44
|
-
'reverse_shell_generation',
|
|
45
|
-
'fileless_persistence',
|
|
46
|
-
'web_shell_deployment',
|
|
47
|
-
'scheduled_persistence',
|
|
48
|
-
'obfuscated_payloads',
|
|
49
|
-
'dns_tunneling',
|
|
50
|
-
'phishing_templates',
|
|
51
|
-
'backdoor_user_creation'
|
|
52
|
-
],
|
|
53
|
-
legalNotice: 'For authorized security research and testing only. All activities must be properly authorized and scoped. Unauthorized use is illegal.'
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=offensiveSecurityCapability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offensiveSecurityCapability.js","sourceRoot":"","sources":["../../src/capabilities/offensiveSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAWlF,MAAM,OAAO,iCAAiC;IACnC,EAAE,GAAG,+BAA+B,CAAC;IAC7B,OAAO,CAAqC;IAE7D,YAAY,UAA8C,EAAE;QAC1D,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,IAAI;YAC1B,0BAA0B,EAAE,KAAK;YACjC,uBAAuB,EAAE,KAAK;YAC9B,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QAEjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,mCAAmC;YAC1D,WAAW,EACT,IAAI,CAAC,OAAO,CAAC,WAAW;gBACxB,iIAAiI;YACnI,SAAS,EAAE;gBACT,EAAE,EAAE,oBAAoB;gBACxB,WAAW,EAAE,2CAA2C;gBACxD,KAAK,EAAE,4BAA4B,CAAC,UAAU,EAAE;oBAC9C,0BAA0B,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B;oBACnE,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;oBACvD,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,uBAAuB;iBAC9D,CAAC;aACH;YACD,QAAQ,EAAE;gBACR,UAAU;gBACV,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;gBACvD,0BAA0B,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B;gBACnE,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,uBAAuB;gBAC7D,mBAAmB,EAAE;oBACnB,0BAA0B;oBAC1B,sBAAsB;oBACtB,sBAAsB;oBACtB,uBAAuB;oBACvB,qBAAqB;oBACrB,eAAe;oBACf,oBAAoB;oBACpB,wBAAwB;iBACzB;gBACD,WAAW,EAAE,wIAAwI;aACtJ;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Real Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides actual security testing capabilities with real implementations.
|
|
5
|
-
* These tools perform real persistence, scanning, and exploitation.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All security testing tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, bug bounty programs, and red team exercises only.
|
|
10
|
-
*/
|
|
11
|
-
import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
|
|
12
|
-
export interface RealSecurityCapabilityOptions {
|
|
13
|
-
workingDir?: string;
|
|
14
|
-
id?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
enableExploitation?: boolean;
|
|
17
|
-
requireAuthorization?: boolean;
|
|
18
|
-
enableAdvancedTechniques?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare class RealSecurityCapabilityModule implements CapabilityModule {
|
|
21
|
-
readonly id = "capability.real.security";
|
|
22
|
-
private readonly options;
|
|
23
|
-
constructor(options?: RealSecurityCapabilityOptions);
|
|
24
|
-
create(context: CapabilityContext): Promise<CapabilityContribution>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=realSecurityCapability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realSecurityCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/realSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,qBAAa,4BAA6B,YAAW,gBAAgB;IACnE,QAAQ,CAAC,EAAE,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgC;gBAE5C,OAAO,GAAE,6BAAkC;IASjD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA+B1E"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Real Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides actual security testing capabilities with real implementations.
|
|
5
|
-
* These tools perform real persistence, scanning, and exploitation.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All security testing tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, bug bounty programs, and red team exercises only.
|
|
10
|
-
*/
|
|
11
|
-
import { createRealSecurityTools } from '../tools/realSecurityTools.js';
|
|
12
|
-
export class RealSecurityCapabilityModule {
|
|
13
|
-
id = 'capability.real.security';
|
|
14
|
-
options;
|
|
15
|
-
constructor(options = {}) {
|
|
16
|
-
this.options = {
|
|
17
|
-
requireAuthorization: true,
|
|
18
|
-
enableExploitation: false,
|
|
19
|
-
enableAdvancedTechniques: false,
|
|
20
|
-
...options
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
async create(context) {
|
|
24
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
25
|
-
return {
|
|
26
|
-
id: this.options.id ?? 'real.security.research.tools',
|
|
27
|
-
description: this.options.description ??
|
|
28
|
-
'Real security testing tools with actual implementations for persistence, scanning, and exploitation.',
|
|
29
|
-
toolSuite: {
|
|
30
|
-
id: 'real.security',
|
|
31
|
-
description: 'Real security testing and research tools',
|
|
32
|
-
tools: createRealSecurityTools(workingDir, {
|
|
33
|
-
enableExploitation: this.options.enableExploitation,
|
|
34
|
-
requireAuthorization: this.options.requireAuthorization
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
metadata: {
|
|
38
|
-
workingDir,
|
|
39
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
40
|
-
enableExploitation: this.options.enableExploitation,
|
|
41
|
-
enableAdvancedTechniques: this.options.enableAdvancedTechniques,
|
|
42
|
-
supportedOperations: [
|
|
43
|
-
'real_persistence_implementation',
|
|
44
|
-
'real_vulnerability_scanning',
|
|
45
|
-
'real_network_exploitation',
|
|
46
|
-
'real_security_reporting'
|
|
47
|
-
],
|
|
48
|
-
legalNotice: 'For authorized security research and testing only. All activities must be properly authorized and scoped.'
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=realSecurityCapability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realSecurityCapability.js","sourceRoot":"","sources":["../../src/capabilities/realSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAWxE,MAAM,OAAO,4BAA4B;IAC9B,EAAE,GAAG,0BAA0B,CAAC;IACxB,OAAO,CAAgC;IAExD,YAAY,UAAyC,EAAE;QACrD,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,IAAI;YAC1B,kBAAkB,EAAE,KAAK;YACzB,wBAAwB,EAAE,KAAK;YAC/B,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QAEjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,8BAA8B;YACrD,WAAW,EACT,IAAI,CAAC,OAAO,CAAC,WAAW;gBACxB,sGAAsG;YACxG,SAAS,EAAE;gBACT,EAAE,EAAE,eAAe;gBACnB,WAAW,EAAE,0CAA0C;gBACvD,KAAK,EAAE,uBAAuB,CAAC,UAAU,EAAE;oBACzC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;oBACnD,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;iBACxD,CAAC;aACH;YACD,QAAQ,EAAE;gBACR,UAAU;gBACV,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;gBACvD,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACnD,wBAAwB,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB;gBAC/D,mBAAmB,EAAE;oBACnB,iCAAiC;oBACjC,6BAA6B;oBAC7B,2BAA2B;oBAC3B,yBAAyB;iBAC1B;gBACD,WAAW,EAAE,2GAA2G;aACzH;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Research Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides comprehensive security research tools for authorized penetration testing,
|
|
5
|
-
* vulnerability assessment, and persistence mechanism analysis.
|
|
6
|
-
*
|
|
7
|
-
* This module integrates with the core capability system and provides:
|
|
8
|
-
* - Authorization framework for security testing
|
|
9
|
-
* - Persistence research tools
|
|
10
|
-
* - Vulnerability assessment capabilities
|
|
11
|
-
* - Attack simulation framework
|
|
12
|
-
* - Security reporting and analysis
|
|
13
|
-
*
|
|
14
|
-
* LEGAL NOTICE:
|
|
15
|
-
* All security research tools require explicit authorization and scope definition.
|
|
16
|
-
* Intended for legitimate security testing, bug bounty programs, and red team exercises only.
|
|
17
|
-
*/
|
|
18
|
-
import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
|
|
19
|
-
export interface SecurityCapabilityOptions {
|
|
20
|
-
workingDir?: string;
|
|
21
|
-
id?: string;
|
|
22
|
-
description?: string;
|
|
23
|
-
enableAdvancedResearch?: boolean;
|
|
24
|
-
requireAuthorization?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare class SecurityCapabilityModule implements CapabilityModule {
|
|
27
|
-
readonly id = "capability.security";
|
|
28
|
-
private readonly options;
|
|
29
|
-
constructor(options?: SecurityCapabilityOptions);
|
|
30
|
-
create(context: CapabilityContext): Promise<CapabilityContribution>;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=securityCapability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"securityCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/securityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3G,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,qBAAa,wBAAyB,YAAW,gBAAgB;IAC/D,QAAQ,CAAC,EAAE,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;gBAExC,OAAO,GAAE,yBAA8B;IAQ7C,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA6B1E"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Research Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides comprehensive security research tools for authorized penetration testing,
|
|
5
|
-
* vulnerability assessment, and persistence mechanism analysis.
|
|
6
|
-
*
|
|
7
|
-
* This module integrates with the core capability system and provides:
|
|
8
|
-
* - Authorization framework for security testing
|
|
9
|
-
* - Persistence research tools
|
|
10
|
-
* - Vulnerability assessment capabilities
|
|
11
|
-
* - Attack simulation framework
|
|
12
|
-
* - Security reporting and analysis
|
|
13
|
-
*
|
|
14
|
-
* LEGAL NOTICE:
|
|
15
|
-
* All security research tools require explicit authorization and scope definition.
|
|
16
|
-
* Intended for legitimate security testing, bug bounty programs, and red team exercises only.
|
|
17
|
-
*/
|
|
18
|
-
import { createSecurityTools } from '../tools/securityTools.js';
|
|
19
|
-
export class SecurityCapabilityModule {
|
|
20
|
-
id = 'capability.security';
|
|
21
|
-
options;
|
|
22
|
-
constructor(options = {}) {
|
|
23
|
-
this.options = {
|
|
24
|
-
requireAuthorization: true,
|
|
25
|
-
enableAdvancedResearch: false,
|
|
26
|
-
...options
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
async create(context) {
|
|
30
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
31
|
-
return {
|
|
32
|
-
id: this.options.id ?? 'security.research.tools',
|
|
33
|
-
description: this.options.description ??
|
|
34
|
-
'Comprehensive security research tools for authorized penetration testing, vulnerability assessment, and persistence mechanism analysis.',
|
|
35
|
-
toolSuite: {
|
|
36
|
-
id: 'security',
|
|
37
|
-
description: 'Security research and testing tools',
|
|
38
|
-
tools: createSecurityTools(workingDir, {
|
|
39
|
-
enableAdvancedResearch: this.options.enableAdvancedResearch,
|
|
40
|
-
requireAuthorization: this.options.requireAuthorization
|
|
41
|
-
}),
|
|
42
|
-
},
|
|
43
|
-
metadata: {
|
|
44
|
-
workingDir,
|
|
45
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
46
|
-
enableAdvancedResearch: this.options.enableAdvancedResearch,
|
|
47
|
-
supportedResearchAreas: [
|
|
48
|
-
'persistence_analysis',
|
|
49
|
-
'vulnerability_assessment',
|
|
50
|
-
'attack_simulation',
|
|
51
|
-
'security_reporting'
|
|
52
|
-
]
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=securityCapability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"securityCapability.js","sourceRoot":"","sources":["../../src/capabilities/securityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAUhE,MAAM,OAAO,wBAAwB;IAC1B,EAAE,GAAG,qBAAqB,CAAC;IACnB,OAAO,CAA4B;IAEpD,YAAY,UAAqC,EAAE;QACjD,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,IAAI;YAC1B,sBAAsB,EAAE,KAAK;YAC7B,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QAEjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,yBAAyB;YAChD,WAAW,EACT,IAAI,CAAC,OAAO,CAAC,WAAW;gBACxB,yIAAyI;YAC3I,SAAS,EAAE;gBACT,EAAE,EAAE,UAAU;gBACd,WAAW,EAAE,qCAAqC;gBAClD,KAAK,EAAE,mBAAmB,CAAC,UAAU,EAAE;oBACrC,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,sBAAsB;oBAC3D,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;iBACxD,CAAC;aACH;YACD,QAAQ,EAAE;gBACR,UAAU;gBACV,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;gBACvD,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,sBAAsB;gBAC3D,sBAAsB,EAAE;oBACtB,sBAAsB;oBACtB,0BAA0B;oBAC1B,mBAAmB;oBACnB,oBAAoB;iBACrB;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ultimate Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides complete security testing capabilities with authorization framework.
|
|
5
|
-
* Combines real security testing, offensive security, and authorization management.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All security testing tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, red team exercises, and authorized penetration testing only.
|
|
10
|
-
*/
|
|
11
|
-
import type { CapabilityContribution, CapabilityContext, CapabilityModule } from '../runtime/agentHost.js';
|
|
12
|
-
import { AuthorizationManager } from '../security/authorization.js';
|
|
13
|
-
export interface UltimateSecurityCapabilityOptions {
|
|
14
|
-
workingDir?: string;
|
|
15
|
-
id?: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
enableExploitation?: boolean;
|
|
18
|
-
enableAdvancedExploitation?: boolean;
|
|
19
|
-
enablePayloadGeneration?: boolean;
|
|
20
|
-
requireAuthorization?: boolean;
|
|
21
|
-
authorizationManager?: AuthorizationManager;
|
|
22
|
-
}
|
|
23
|
-
export declare class UltimateSecurityCapabilityModule implements CapabilityModule {
|
|
24
|
-
readonly id = "capability.ultimate.security";
|
|
25
|
-
private readonly options;
|
|
26
|
-
private readonly authorizationManager;
|
|
27
|
-
constructor(options?: UltimateSecurityCapabilityOptions);
|
|
28
|
-
create(context: CapabilityContext): Promise<CapabilityContribution>;
|
|
29
|
-
/**
|
|
30
|
-
* Get the authorization manager instance
|
|
31
|
-
*/
|
|
32
|
-
getAuthorizationManager(): AuthorizationManager;
|
|
33
|
-
/**
|
|
34
|
-
* Get current authorization status
|
|
35
|
-
*/
|
|
36
|
-
getAuthorizationStatus(): any;
|
|
37
|
-
/**
|
|
38
|
-
* Generate authorization report
|
|
39
|
-
*/
|
|
40
|
-
generateAuthorizationReport(): string;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ultimateSecurityCapability.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ultimateSecurityCapability.d.ts","sourceRoot":"","sources":["../../src/capabilities/ultimateSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE,MAAM,WAAW,iCAAiC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,qBAAa,gCAAiC,YAAW,gBAAgB;IACvE,QAAQ,CAAC,EAAE,kCAAkC;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;gBAEhD,OAAO,GAAE,iCAAsC;IAYrD,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAqDzE;;OAEG;IACH,uBAAuB,IAAI,oBAAoB;IAI/C;;OAEG;IACH,sBAAsB;IAItB;;OAEG;IACH,2BAA2B,IAAI,MAAM;CAGtC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ultimate Security Capability Module
|
|
3
|
-
*
|
|
4
|
-
* Provides complete security testing capabilities with authorization framework.
|
|
5
|
-
* Combines real security testing, offensive security, and authorization management.
|
|
6
|
-
*
|
|
7
|
-
* LEGAL NOTICE:
|
|
8
|
-
* All security testing tools require explicit authorization and scope definition.
|
|
9
|
-
* Intended for legitimate security testing, red team exercises, and authorized penetration testing only.
|
|
10
|
-
*/
|
|
11
|
-
import { AuthorizationManager } from '../security/authorization.js';
|
|
12
|
-
import { createEnhancedSecurityTools } from '../tools/enhancedSecurityTools.js';
|
|
13
|
-
export class UltimateSecurityCapabilityModule {
|
|
14
|
-
id = 'capability.ultimate.security';
|
|
15
|
-
options;
|
|
16
|
-
authorizationManager;
|
|
17
|
-
constructor(options = {}) {
|
|
18
|
-
this.options = {
|
|
19
|
-
requireAuthorization: true,
|
|
20
|
-
enableExploitation: false,
|
|
21
|
-
enableAdvancedExploitation: false,
|
|
22
|
-
enablePayloadGeneration: false,
|
|
23
|
-
...options
|
|
24
|
-
};
|
|
25
|
-
this.authorizationManager = options.authorizationManager || new AuthorizationManager();
|
|
26
|
-
}
|
|
27
|
-
async create(context) {
|
|
28
|
-
const workingDir = this.options.workingDir ?? context.workingDir;
|
|
29
|
-
return {
|
|
30
|
-
id: this.options.id ?? 'ultimate.security.research.tools',
|
|
31
|
-
description: this.options.description ??
|
|
32
|
-
'Complete security testing capabilities with authorization framework, real security testing, offensive security, and advanced exploitation tools.',
|
|
33
|
-
toolSuite: {
|
|
34
|
-
id: 'ultimate.security',
|
|
35
|
-
description: 'Complete security testing and research tools with authorization',
|
|
36
|
-
tools: createEnhancedSecurityTools(workingDir, {
|
|
37
|
-
enableExploitation: this.options.enableExploitation,
|
|
38
|
-
enableAdvancedExploitation: this.options.enableAdvancedExploitation,
|
|
39
|
-
enablePayloadGeneration: this.options.enablePayloadGeneration,
|
|
40
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
41
|
-
authorizationManager: this.authorizationManager
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
metadata: {
|
|
45
|
-
workingDir,
|
|
46
|
-
requireAuthorization: this.options.requireAuthorization,
|
|
47
|
-
enableExploitation: this.options.enableExploitation,
|
|
48
|
-
enableAdvancedExploitation: this.options.enableAdvancedExploitation,
|
|
49
|
-
enablePayloadGeneration: this.options.enablePayloadGeneration,
|
|
50
|
-
authorizationManager: this.authorizationManager ? 'custom' : 'default',
|
|
51
|
-
supportedOperations: [
|
|
52
|
-
'authorization_management',
|
|
53
|
-
'real_persistence_implementation',
|
|
54
|
-
'real_vulnerability_scanning',
|
|
55
|
-
'real_network_exploitation',
|
|
56
|
-
'real_security_reporting',
|
|
57
|
-
'reverse_shell_generation',
|
|
58
|
-
'fileless_persistence',
|
|
59
|
-
'web_shell_deployment',
|
|
60
|
-
'scheduled_persistence',
|
|
61
|
-
'obfuscated_payloads',
|
|
62
|
-
'dns_tunneling',
|
|
63
|
-
'phishing_templates',
|
|
64
|
-
'backdoor_user_creation'
|
|
65
|
-
],
|
|
66
|
-
totalTools: 22, // 3 auth tools + 10 real security + 8 offensive security + 1 report
|
|
67
|
-
legalNotice: 'For authorized security research and testing only. All activities must be properly authorized and scoped. Unauthorized use is illegal.',
|
|
68
|
-
version: '1.0.0',
|
|
69
|
-
capabilities: {
|
|
70
|
-
authorization: ['request', 'status', 'report'],
|
|
71
|
-
realSecurity: ['persistence', 'vulnerability', 'network', 'reporting'],
|
|
72
|
-
offensiveSecurity: ['payloads', 'persistence', 'exploitation', 'evasion']
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get the authorization manager instance
|
|
79
|
-
*/
|
|
80
|
-
getAuthorizationManager() {
|
|
81
|
-
return this.authorizationManager;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Get current authorization status
|
|
85
|
-
*/
|
|
86
|
-
getAuthorizationStatus() {
|
|
87
|
-
return this.authorizationManager.getAuthorizationStatus();
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Generate authorization report
|
|
91
|
-
*/
|
|
92
|
-
generateAuthorizationReport() {
|
|
93
|
-
return this.authorizationManager.generateAuthorizationReport();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=ultimateSecurityCapability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ultimateSecurityCapability.js","sourceRoot":"","sources":["../../src/capabilities/ultimateSecurityCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAahF,MAAM,OAAO,gCAAgC;IAClC,EAAE,GAAG,8BAA8B,CAAC;IAC5B,OAAO,CAAoC;IAC3C,oBAAoB,CAAuB;IAE5D,YAAY,UAA6C,EAAE;QACzD,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,IAAI;YAC1B,kBAAkB,EAAE,KAAK;YACzB,0BAA0B,EAAE,KAAK;YACjC,uBAAuB,EAAE,KAAK;YAC9B,GAAG,OAAO;SACX,CAAC;QAEF,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,IAAI,oBAAoB,EAAE,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC;QAEjE,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,kCAAkC;YACzD,WAAW,EACT,IAAI,CAAC,OAAO,CAAC,WAAW;gBACxB,kJAAkJ;YACpJ,SAAS,EAAE;gBACT,EAAE,EAAE,mBAAmB;gBACvB,WAAW,EAAE,iEAAiE;gBAC9E,KAAK,EAAE,2BAA2B,CAAC,UAAU,EAAE;oBAC7C,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;oBACnD,0BAA0B,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B;oBACnE,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,uBAAuB;oBAC7D,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;oBACvD,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;iBAChD,CAAC;aACH;YACD,QAAQ,EAAE;gBACR,UAAU;gBACV,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;gBACvD,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB;gBACnD,0BAA0B,EAAE,IAAI,CAAC,OAAO,CAAC,0BAA0B;gBACnE,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,uBAAuB;gBAC7D,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;gBACtE,mBAAmB,EAAE;oBACnB,0BAA0B;oBAC1B,iCAAiC;oBACjC,6BAA6B;oBAC7B,2BAA2B;oBAC3B,yBAAyB;oBACzB,0BAA0B;oBAC1B,sBAAsB;oBACtB,sBAAsB;oBACtB,uBAAuB;oBACvB,qBAAqB;oBACrB,eAAe;oBACf,oBAAoB;oBACpB,wBAAwB;iBACzB;gBACD,UAAU,EAAE,EAAE,EAAE,oEAAoE;gBACpF,WAAW,EAAE,wIAAwI;gBACrJ,OAAO,EAAE,OAAO;gBAChB,YAAY,EAAE;oBACZ,aAAa,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;oBAC9C,YAAY,EAAE,CAAC,aAAa,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,CAAC;oBACtE,iBAAiB,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC;iBAC1E;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,uBAAuB;QACrB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,OAAO,IAAI,CAAC,oBAAoB,CAAC,sBAAsB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,2BAA2B;QACzB,OAAO,IAAI,CAAC,oBAAoB,CAAC,2BAA2B,EAAE,CAAC;IACjE,CAAC;CACF"}
|