0xray 2.1.2 → 2.1.3
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/.opencode/codex.codex +1 -1
- package/.opencode/commands/dependency-audit.md +3 -3
- package/.opencode/enforcer-config.json +2 -2
- package/AGENTS.md +2 -1
- package/README.md +12 -11
- package/dist/AGENTS.md +2 -1
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +12 -11
- package/dist/agents/code-reviewer.js +1 -1
- package/dist/analytics/routing-refiner.js +1 -1
- package/dist/cli/index.js +11 -1
- package/dist/cli/server.js +3 -3
- package/dist/core/activity-logger.d.ts +2 -2
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/boot-orchestrator.d.ts +1 -1
- package/dist/core/boot-orchestrator.js +13 -28
- package/dist/core/bridge.mjs +3 -3
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +0 -1
- package/dist/core/codex-injector.js +2 -3
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.js +1 -1
- package/dist/core/config-paths.d.ts +0 -2
- package/dist/core/config-paths.js +7 -8
- package/dist/core/context-loader.d.ts +1 -1
- package/dist/core/context-loader.js +1 -1
- package/dist/core/errors.d.ts +3 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/features-config.js +1 -1
- package/dist/core/framework-logger.d.ts +3 -3
- package/dist/core/framework-logger.js +17 -9
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +4 -2
- package/dist/core/logging-config.d.ts +2 -1
- package/dist/core/logging-config.js +7 -7
- package/dist/enforcement/loaders/codex-loader.js +1 -1
- package/dist/execution/opencode-cli-invoker.js +5 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/inference/inference-cycle.d.ts +1 -1
- package/dist/inference/inference-cycle.js +10 -10
- package/dist/integrations/base/Integration.js +1 -1
- package/dist/integrations/base/registry.js +19 -19
- package/dist/integrations/grok/grok-cli.js +17 -17
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/hermes-agent/bridge.mjs +1 -1
- package/dist/integrations/openclaw/api-server.d.ts +0 -1
- package/dist/integrations/openclaw/api-server.js +7 -10
- package/dist/integrations/openclaw/client.d.ts +0 -1
- package/dist/integrations/openclaw/client.js +22 -24
- package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
- package/dist/integrations/plugins/plugin-registry.js +5 -5
- package/dist/mcps/architect-tools.server.d.ts +2 -4
- package/dist/mcps/architect-tools.server.js +112 -195
- package/dist/mcps/auto-format.server.d.ts +2 -4
- package/dist/mcps/auto-format.server.js +49 -95
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
- package/dist/mcps/boot-orchestrator.server.js +73 -105
- package/dist/mcps/config/server-config-registry.js +3 -3
- package/dist/mcps/enforcer-tools.server.d.ts +2 -4
- package/dist/mcps/enforcer-tools.server.js +202 -285
- package/dist/mcps/estimation.server.d.ts +2 -4
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
- package/dist/mcps/framework-compliance-audit.server.js +53 -82
- package/dist/mcps/framework-help.server.d.ts +2 -4
- package/dist/mcps/framework-help.server.js +63 -101
- package/dist/mcps/governance.server.js +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
- package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
- package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
- package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
- package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
- package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
- package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
- package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
- package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
- package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
- package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
- package/dist/mcps/lint.server.d.ts +2 -4
- package/dist/mcps/lint.server.js +51 -92
- package/dist/mcps/mcp-client.js +2 -2
- package/dist/mcps/model-health-check.server.d.ts +2 -4
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/performance-analysis.server.d.ts +2 -4
- package/dist/mcps/performance-analysis.server.js +57 -88
- package/dist/mcps/processor-pipeline.server.d.ts +2 -4
- package/dist/mcps/processor-pipeline.server.js +69 -100
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.d.ts +3 -5
- package/dist/mcps/researcher.server.js +81 -154
- package/dist/mcps/security-scan.server.d.ts +2 -4
- package/dist/mcps/security-scan.server.js +54 -96
- package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
- package/dist/mcps/shared/knowledge-skill-base.js +45 -0
- package/dist/{security → mcps/shared}/security-scanner.js +1 -1
- package/dist/mcps/state-manager.server.d.ts +2 -4
- package/dist/mcps/state-manager.server.js +115 -160
- package/dist/orchestrator/orchestrator.d.ts +1 -1
- package/dist/orchestrator/orchestrator.js +1 -1
- package/dist/orchestrator/universal-registry-bridge.js +1 -1
- package/dist/plugin/xray-codex-injection.d.ts +1 -1
- package/dist/plugin/xray-codex-injection.js +1 -1
- package/dist/postprocessor/PostProcessor.d.ts +4 -44
- package/dist/postprocessor/PostProcessor.js +39 -553
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
- package/dist/processors/processor-manager.js +346 -314
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/security/security-hardener.d.ts +69 -2
- package/dist/security/security-hardener.js +129 -1
- package/dist/skills/registry.json +1 -1
- package/dist/state/index.d.ts +3 -5
- package/dist/state/index.js +1 -7
- package/dist/state/state-manager.d.ts +1 -1
- package/dist/state/state-manager.js +2 -3
- package/package.json +13 -10
- package/scripts/node/universal-version-manager.js +11 -11
- package/src/mcps/architect-tools.server.ts +112 -215
- package/src/mcps/auto-format.server.ts +50 -110
- package/src/mcps/boot-orchestrator.server.ts +75 -121
- package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
- package/src/mcps/config/server-config-registry.ts +3 -3
- package/src/mcps/enforcer-tools.server.ts +212 -310
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +52 -97
- package/src/mcps/framework-help.server.ts +64 -114
- package/src/mcps/governance.server.ts +2 -2
- package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
- package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
- package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
- package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
- package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
- package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
- package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
- package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
- package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
- package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
- package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
- package/src/mcps/lint.server.ts +53 -107
- package/src/mcps/mcp-client.ts +2 -2
- package/src/mcps/model-health-check.server.ts +34 -71
- package/src/mcps/performance-analysis.server.ts +60 -104
- package/src/mcps/processor-pipeline.server.ts +72 -110
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +88 -177
- package/src/mcps/security-scan.server.ts +55 -104
- package/src/mcps/shared/knowledge-skill-base.ts +62 -0
- package/src/mcps/shared/prompt-security-validator.ts +199 -0
- package/src/mcps/shared/security-scanner.ts +599 -0
- package/src/mcps/state-manager.server.ts +117 -175
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/dependency-audit.md +3 -3
- package/src/opencode/enforcer-config.json +2 -2
- package/src/skills/registry.json +1 -1
- package/xray/codex.json +1 -1
- package/xray/config.json +1 -1
- package/xray/features.json +1 -1
- package/xray/integrations.json +3 -3
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/conftest.py +0 -14
- package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
- package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
- package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
- package/dist/scripts/activate-kernel-pipeline.js +0 -101
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -72
- package/dist/security/security-agent-coordinator.js +0 -204
- package/dist/security/security-auditor.d.ts +0 -56
- package/dist/security/security-auditor.js +0 -584
- package/dist/security/security-hardening-system.d.ts +0 -239
- package/dist/security/security-hardening-system.js +0 -727
- package/dist/security/security-orchestration-layer.d.ts +0 -119
- package/dist/security/security-orchestration-layer.js +0 -496
- /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
- /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
- /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface RefactoringContext {
|
|
2
|
-
agentName: string;
|
|
3
|
-
task: {
|
|
4
|
-
id?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
operationType?: string;
|
|
7
|
-
};
|
|
8
|
-
startTime: number;
|
|
9
|
-
complexityScore?: number;
|
|
10
|
-
changes?: Array<{
|
|
11
|
-
description?: string;
|
|
12
|
-
type?: string;
|
|
13
|
-
}>;
|
|
14
|
-
files?: string[];
|
|
15
|
-
metrics?: Record<string, unknown>;
|
|
16
|
-
operationType?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface RefactoringLogResult {
|
|
19
|
-
logged: boolean;
|
|
20
|
-
success: boolean;
|
|
21
|
-
message: string;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class RefactoringLoggingProcessor {
|
|
25
|
-
private logPath;
|
|
26
|
-
constructor();
|
|
27
|
-
private ensureLogDirectory;
|
|
28
|
-
execute(context: RefactoringContext): Promise<RefactoringLogResult>;
|
|
29
|
-
private createLogEntry;
|
|
30
|
-
private appendToLog;
|
|
31
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
export class RefactoringLoggingProcessor {
|
|
5
|
-
logPath;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.logPath = path.join(process.cwd(), "logs", "agents", "refactoring-log.md");
|
|
8
|
-
this.ensureLogDirectory();
|
|
9
|
-
}
|
|
10
|
-
ensureLogDirectory() {
|
|
11
|
-
const logDir = path.dirname(this.logPath);
|
|
12
|
-
if (!fs.existsSync(logDir)) {
|
|
13
|
-
fs.mkdirSync(logDir, { recursive: true });
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
async execute(context) {
|
|
17
|
-
try {
|
|
18
|
-
if (context.agentName &&
|
|
19
|
-
context.task &&
|
|
20
|
-
typeof context.startTime === "number") {
|
|
21
|
-
const logEntry = this.createLogEntry(context);
|
|
22
|
-
await this.appendToLog(logEntry);
|
|
23
|
-
return {
|
|
24
|
-
logged: true,
|
|
25
|
-
success: true,
|
|
26
|
-
message: "Agent refactoring completion logged successfully",
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
logged: false,
|
|
31
|
-
success: true,
|
|
32
|
-
message: "Not an agent task completion context",
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
37
|
-
await frameworkLogger.log("refactoring-logging-processor", "-refactoring-logging-failed-error-instanceof-error-", "error", { message: `Refactoring logging failed: ${errorMessage}` });
|
|
38
|
-
return {
|
|
39
|
-
logged: false,
|
|
40
|
-
success: false,
|
|
41
|
-
message: `Refactoring logging failed: ${errorMessage}`,
|
|
42
|
-
error: errorMessage,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
createLogEntry(context) {
|
|
47
|
-
const timestamp = new Date().toISOString();
|
|
48
|
-
const duration = Date.now() - context.startTime;
|
|
49
|
-
let logEntry = `## Refactoring Operation - ${timestamp}\n\n`;
|
|
50
|
-
logEntry += `**Agent:** ${context.agentName}\n`;
|
|
51
|
-
logEntry += `**Task:** ${context.task.description || context.task.id || "Unknown"}\n`;
|
|
52
|
-
logEntry += `**Duration:** ${duration}ms\n`;
|
|
53
|
-
logEntry += `**Operation Type:** ${context.task.operationType || context.operationType || "refactor"}\n`;
|
|
54
|
-
if (context.complexityScore) {
|
|
55
|
-
logEntry += `**Complexity Score:** ${context.complexityScore}\n`;
|
|
56
|
-
}
|
|
57
|
-
if (context.changes && Array.isArray(context.changes)) {
|
|
58
|
-
logEntry += `\n**Changes Made:**\n`;
|
|
59
|
-
context.changes.forEach((change, index) => {
|
|
60
|
-
logEntry += `${index + 1}. ${change.description || change.type || "Unknown change"}\n`;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (context.files && Array.isArray(context.files)) {
|
|
64
|
-
logEntry += `\n**Files Modified:**\n`;
|
|
65
|
-
context.files.forEach((file) => {
|
|
66
|
-
logEntry += `- ${file}\n`;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (context.metrics) {
|
|
70
|
-
logEntry += `\n**Metrics:**\n`;
|
|
71
|
-
Object.entries(context.metrics).forEach(([key, value]) => {
|
|
72
|
-
logEntry += `- ${key}: ${value}\n`;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
logEntry += `\n---\n\n`;
|
|
76
|
-
return logEntry;
|
|
77
|
-
}
|
|
78
|
-
async appendToLog(entry) {
|
|
79
|
-
try {
|
|
80
|
-
if (!fs.existsSync(this.logPath)) {
|
|
81
|
-
let header = `# 0xRay Framework Refactoring Log\n\n`;
|
|
82
|
-
header += `This log tracks all refactoring operations performed by 0xRay agents.\n\n`;
|
|
83
|
-
header += `Generated on: ${new Date().toISOString()}\n\n`;
|
|
84
|
-
header += `---\n\n`;
|
|
85
|
-
fs.writeFileSync(this.logPath, header, "utf8");
|
|
86
|
-
}
|
|
87
|
-
fs.appendFileSync(this.logPath, entry, "utf8");
|
|
88
|
-
await frameworkLogger.log("refactoring-logging-processor", "-refactoring-operation-logged-successfully-", "info", { message: "Refactoring operation logged successfully" });
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
92
|
-
await frameworkLogger.log("refactoring-logging-processor", "-failed-to-append-to-refactoring-log-error-instanceof-", "error", { message: `Failed to append to refactoring log: ${errorMessage}` });
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Capture Processor
|
|
3
|
-
*
|
|
4
|
-
* Extracted from InferenceImprovementProcessor - handles discovery of
|
|
5
|
-
* session data sources (reflections, logs, reports) for inference workflows.
|
|
6
|
-
*
|
|
7
|
-
* @module processors/implementations
|
|
8
|
-
*/
|
|
9
|
-
export declare class SessionCapture {
|
|
10
|
-
static findReflections(directory: string, reflectionsDir: string): string[];
|
|
11
|
-
static findLogs(directory: string, logsDir: string): string[];
|
|
12
|
-
static findReports(directory: string, reportsDir: string): string[];
|
|
13
|
-
}
|
|
14
|
-
export default SessionCapture;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session Capture Processor
|
|
3
|
-
*
|
|
4
|
-
* Extracted from InferenceImprovementProcessor - handles discovery of
|
|
5
|
-
* session data sources (reflections, logs, reports) for inference workflows.
|
|
6
|
-
*
|
|
7
|
-
* @module processors/implementations
|
|
8
|
-
*/
|
|
9
|
-
import * as fs from "fs";
|
|
10
|
-
import * as path from "path";
|
|
11
|
-
export class SessionCapture {
|
|
12
|
-
static findReflections(directory, reflectionsDir) {
|
|
13
|
-
const reflectionsPath = path.join(directory, reflectionsDir);
|
|
14
|
-
if (!fs.existsSync(reflectionsPath))
|
|
15
|
-
return [];
|
|
16
|
-
return fs.readdirSync(reflectionsPath)
|
|
17
|
-
.filter(f => f.endsWith(".md"))
|
|
18
|
-
.map(f => path.join(reflectionsPath, f));
|
|
19
|
-
}
|
|
20
|
-
static findLogs(directory, logsDir) {
|
|
21
|
-
const logsPath = path.join(directory, logsDir);
|
|
22
|
-
if (!fs.existsSync(logsPath))
|
|
23
|
-
return [];
|
|
24
|
-
return fs.readdirSync(logsPath)
|
|
25
|
-
.filter(f => f.includes("routing") || f.includes("activity") || f.includes("session"))
|
|
26
|
-
.map(f => path.join(logsPath, f));
|
|
27
|
-
}
|
|
28
|
-
static findReports(directory, reportsDir) {
|
|
29
|
-
const reportsPath = path.join(directory, reportsDir);
|
|
30
|
-
if (!fs.existsSync(reportsPath))
|
|
31
|
-
return [];
|
|
32
|
-
return fs.readdirSync(reportsPath)
|
|
33
|
-
.filter(f => f.endsWith(".json") || f.endsWith(".md"))
|
|
34
|
-
.map(f => path.join(reportsPath, f));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export default SessionCapture;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kernel Pipeline Activation Script
|
|
3
|
-
*
|
|
4
|
-
* Triggers real delegations that should activate kernel patterns.
|
|
5
|
-
* Observes the full pipeline in action.
|
|
6
|
-
*/
|
|
7
|
-
import { AgentDelegator } from '../delegation/agent-delegator.js';
|
|
8
|
-
import { XrayStateManager } from '../state/state-manager.js';
|
|
9
|
-
import { strRayConfigLoader } from '../core/config-loader.js';
|
|
10
|
-
import { routingOutcomeTracker } from '../delegation/analytics/outcome-tracker.js';
|
|
11
|
-
import { patternPerformanceTracker } from '../analytics/pattern-performance-tracker.js';
|
|
12
|
-
const stateManager = new XrayStateManager();
|
|
13
|
-
const delegator = new AgentDelegator(stateManager, strRayConfigLoader);
|
|
14
|
-
console.log('=== KERNEL PIPELINE ACTIVATION TEST ===\n');
|
|
15
|
-
// Test cases designed to trigger kernel patterns
|
|
16
|
-
const testCases = [
|
|
17
|
-
{
|
|
18
|
-
operation: 'security',
|
|
19
|
-
description: 'Add new API endpoint with user authentication but skip input validation for SQL injection prevention',
|
|
20
|
-
expected: ['P6', 'A8']
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
operation: 'fix',
|
|
24
|
-
description: 'Fix infinite recursion in the calculateTotals function - it keeps calling itself',
|
|
25
|
-
expected: ['P1']
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
operation: 'test',
|
|
29
|
-
description: 'All tests pass on my machine but fail in CI - I think its an environment issue',
|
|
30
|
-
expected: ['A1', 'A9']
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
operation: 'deploy',
|
|
34
|
-
description: 'Run the deployment script but getting permission denied on execution',
|
|
35
|
-
expected: ['P8']
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
operation: 'update',
|
|
39
|
-
description: 'Upgrade all dependencies to latest version at once - we need everything current',
|
|
40
|
-
expected: ['P5']
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
operation: 'refactor',
|
|
44
|
-
description: 'The tests all pass but we still have bugs in production - I do not understand why',
|
|
45
|
-
expected: ['A2', 'A3']
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
operation: 'create',
|
|
49
|
-
description: 'Skip security for internal API - its only used internally so authentication is optional',
|
|
50
|
-
expected: ['A8']
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
operation: 'optimize',
|
|
54
|
-
description: 'Make the code 80% faster - use aggressive caching everywhere',
|
|
55
|
-
expected: ['A7']
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
let kernelEvents = 0;
|
|
59
|
-
let learningEvents = 0;
|
|
60
|
-
async function runTest(testCase) {
|
|
61
|
-
console.log(`\n--- Testing: ${testCase.operation} ---`);
|
|
62
|
-
console.log(`Description: ${testCase.description}`);
|
|
63
|
-
console.log(`Expected patterns: ${testCase.expected.join(', ')}`);
|
|
64
|
-
try {
|
|
65
|
-
const result = await delegator.analyzeDelegation({
|
|
66
|
-
operation: testCase.operation,
|
|
67
|
-
description: testCase.description,
|
|
68
|
-
sessionId: 'kernel-activation-test',
|
|
69
|
-
});
|
|
70
|
-
console.log(`Selected agents:`);
|
|
71
|
-
result.agentDetails.forEach(agent => {
|
|
72
|
-
console.log(` - ${agent.name}: ${agent.role} (confidence: ${agent.confidence})`);
|
|
73
|
-
});
|
|
74
|
-
kernelEvents++;
|
|
75
|
-
// Check outcomes tracked
|
|
76
|
-
const outcomes = routingOutcomeTracker.getOutcomes();
|
|
77
|
-
console.log(`Total outcomes tracked: ${outcomes.length}`);
|
|
78
|
-
learningEvents++;
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
console.log(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async function main() {
|
|
85
|
-
console.log('Initial state:');
|
|
86
|
-
console.log(` Outcomes: ${routingOutcomeTracker.getOutcomes().length}`);
|
|
87
|
-
for (const testCase of testCases) {
|
|
88
|
-
await runTest(testCase);
|
|
89
|
-
await new Promise(r => setTimeout(r, 100));
|
|
90
|
-
}
|
|
91
|
-
console.log('\n=== FINAL STATE ===');
|
|
92
|
-
console.log(`Delegations performed: ${kernelEvents}`);
|
|
93
|
-
console.log(`Learning events: ${learningEvents}`);
|
|
94
|
-
console.log(`Total outcomes: ${routingOutcomeTracker.getOutcomes().length}`);
|
|
95
|
-
// Check pattern metrics
|
|
96
|
-
const patternMetrics = patternPerformanceTracker.getMetrics?.() || {};
|
|
97
|
-
console.log(`Pattern types tracked: ${Object.keys(patternMetrics).length}`);
|
|
98
|
-
console.log('\n=== CHECKING ACTIVITY LOG ===');
|
|
99
|
-
// Log should show kernel-pattern-applied events
|
|
100
|
-
}
|
|
101
|
-
main().catch(console.error);
|
package/dist/security/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 0xRay AI v1.22.60 - Security Module Index
|
|
3
|
-
* Unified exports for the comprehensive security system
|
|
4
|
-
*/
|
|
5
|
-
export { SecurityScanner, securityScanner } from "./security-scanner.js";
|
|
6
|
-
export { PromptSecurityValidator, promptSecurityValidator, } from "./prompt-security-validator.js";
|
|
7
|
-
export * from "./security-headers.js";
|
|
8
|
-
export * from "./security-hardening-system.js";
|
|
9
|
-
export * from "./security-hardener.js";
|
|
10
|
-
export * from "./security-auditor.js";
|
|
11
|
-
export { ComprehensiveSecurityAuditSystem, createSecurityAuditSystem, runQuickSecurityAudit, runDeepSecurityAudit, type Vulnerability, type VulnerabilityCategory, type SeverityLevel, type RemediationStep, type RemediationPlan, type SecurityAuditConfig, type SecurityAuditReport, type WeightedVote, type ArchitecturalDecision, type ComplianceResult, type ComplianceStandard, } from "./comprehensive-security-audit.js";
|
|
12
|
-
export { SecurityOrchestrationLayer, createSecurityOrchestrationLayer, runSecurityOrchestration, type SecurityAgent, type SecurityAgentType, type AgentStatus, type SecurityTask, type SecurityTaskType, type AgentVote, type SecurityDecision, type OrchestrationConfig, type SecurityOrchestrationReport, } from "./security-orchestration-layer.js";
|
|
13
|
-
export { SecurityAgentCoordinator, createSecurityAgentCoordinator, runMultiAgentSecurityScan, type SecurityAgentConfig, type SecurityAgentContext, type AgentVotingResult, type MultiAgentSecurityResult, } from "./security-agent-coordinator.js";
|
package/dist/security/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 0xRay AI v1.22.60 - Security Module Index
|
|
3
|
-
* Unified exports for the comprehensive security system
|
|
4
|
-
*/
|
|
5
|
-
export { SecurityScanner, securityScanner } from "./security-scanner.js";
|
|
6
|
-
export { PromptSecurityValidator, promptSecurityValidator, } from "./prompt-security-validator.js";
|
|
7
|
-
export * from "./security-headers.js";
|
|
8
|
-
export * from "./security-hardening-system.js";
|
|
9
|
-
export * from "./security-hardener.js";
|
|
10
|
-
export * from "./security-auditor.js";
|
|
11
|
-
export { ComprehensiveSecurityAuditSystem, createSecurityAuditSystem, runQuickSecurityAudit, runDeepSecurityAudit, } from "./comprehensive-security-audit.js";
|
|
12
|
-
export { SecurityOrchestrationLayer, createSecurityOrchestrationLayer, runSecurityOrchestration, } from "./security-orchestration-layer.js";
|
|
13
|
-
export { SecurityAgentCoordinator, createSecurityAgentCoordinator, runMultiAgentSecurityScan, } from "./security-agent-coordinator.js";
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Agent Integration
|
|
3
|
-
*
|
|
4
|
-
* Integrates the security orchestration layer with the framework's agent system.
|
|
5
|
-
* Provides coordination between security agents using weighted voting.
|
|
6
|
-
*
|
|
7
|
-
* @version 1.22.13
|
|
8
|
-
*/
|
|
9
|
-
import { EventEmitter } from "events";
|
|
10
|
-
import { SecurityOrchestrationLayer, SecurityAgent, SecurityDecision, OrchestrationConfig } from "./security-orchestration-layer.js";
|
|
11
|
-
import { Vulnerability } from "./comprehensive-security-audit.js";
|
|
12
|
-
export interface SecurityAgentConfig {
|
|
13
|
-
agentId: string;
|
|
14
|
-
agentType: string;
|
|
15
|
-
capabilities: string[];
|
|
16
|
-
weight: number;
|
|
17
|
-
}
|
|
18
|
-
export interface SecurityAgentContext {
|
|
19
|
-
projectPath: string;
|
|
20
|
-
scanDepth: "shallow" | "medium" | "deep";
|
|
21
|
-
complianceStandards: string[];
|
|
22
|
-
enableAutoRemediation: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface AgentVotingResult {
|
|
25
|
-
agentId: string;
|
|
26
|
-
agentName: string;
|
|
27
|
-
vote: "approve" | "reject" | "abstain";
|
|
28
|
-
weight: number;
|
|
29
|
-
reasoning: string;
|
|
30
|
-
concerns: string[];
|
|
31
|
-
confidence: number;
|
|
32
|
-
}
|
|
33
|
-
export interface MultiAgentSecurityResult {
|
|
34
|
-
auditId: string;
|
|
35
|
-
timestamp: Date;
|
|
36
|
-
duration: number;
|
|
37
|
-
participatingAgents: string[];
|
|
38
|
-
vulnerabilities: Vulnerability[];
|
|
39
|
-
decisions: SecurityDecision[];
|
|
40
|
-
agentVotes: AgentVotingResult[];
|
|
41
|
-
summary: {
|
|
42
|
-
totalVulnerabilities: number;
|
|
43
|
-
critical: number;
|
|
44
|
-
high: number;
|
|
45
|
-
medium: number;
|
|
46
|
-
low: number;
|
|
47
|
-
securityScore: number;
|
|
48
|
-
complianceScore: number;
|
|
49
|
-
};
|
|
50
|
-
weightedApproval: number;
|
|
51
|
-
approved: boolean;
|
|
52
|
-
recommendations: string[];
|
|
53
|
-
}
|
|
54
|
-
export declare class SecurityAgentCoordinator extends EventEmitter {
|
|
55
|
-
private orchestration;
|
|
56
|
-
private agentRegistry;
|
|
57
|
-
private isActive;
|
|
58
|
-
constructor(config?: Partial<OrchestrationConfig>);
|
|
59
|
-
private setupEventHandlers;
|
|
60
|
-
registerAgent(config: SecurityAgentConfig): void;
|
|
61
|
-
unregisterAgent(agentId: string): boolean;
|
|
62
|
-
getRegisteredAgents(): SecurityAgentConfig[];
|
|
63
|
-
runCoordinatedSecurityScan(context: SecurityAgentContext): Promise<MultiAgentSecurityResult>;
|
|
64
|
-
private collectAgentVotes;
|
|
65
|
-
private calculateWeightedApproval;
|
|
66
|
-
getOrchestrationLayer(): SecurityOrchestrationLayer;
|
|
67
|
-
getActiveAgents(): SecurityAgent[];
|
|
68
|
-
getPendingTasks(): import("./security-orchestration-layer.js").SecurityTask[];
|
|
69
|
-
isCoordinatorActive(): boolean;
|
|
70
|
-
}
|
|
71
|
-
export declare function createSecurityAgentCoordinator(config?: Partial<OrchestrationConfig>): SecurityAgentCoordinator;
|
|
72
|
-
export declare function runMultiAgentSecurityScan(projectPath: string, context?: Partial<SecurityAgentContext>): Promise<MultiAgentSecurityResult>;
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Agent Integration
|
|
3
|
-
*
|
|
4
|
-
* Integrates the security orchestration layer with the framework's agent system.
|
|
5
|
-
* Provides coordination between security agents using weighted voting.
|
|
6
|
-
*
|
|
7
|
-
* @version 1.22.13
|
|
8
|
-
*/
|
|
9
|
-
import { EventEmitter } from "events";
|
|
10
|
-
import { frameworkLogger } from "../core/framework-logger.js";
|
|
11
|
-
import { createSecurityOrchestrationLayer, } from "./security-orchestration-layer.js";
|
|
12
|
-
export class SecurityAgentCoordinator extends EventEmitter {
|
|
13
|
-
orchestration;
|
|
14
|
-
agentRegistry = new Map();
|
|
15
|
-
isActive = false;
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super();
|
|
18
|
-
this.orchestration = createSecurityOrchestrationLayer(config);
|
|
19
|
-
this.setupEventHandlers();
|
|
20
|
-
}
|
|
21
|
-
setupEventHandlers() {
|
|
22
|
-
this.orchestration.on("orchestration:start", (data) => {
|
|
23
|
-
this.emit("coordinator:start", data);
|
|
24
|
-
frameworkLogger.log("security-agent-coordinator", "coordinator-start", "info", data);
|
|
25
|
-
});
|
|
26
|
-
this.orchestration.on("orchestration:complete", (report) => {
|
|
27
|
-
this.emit("coordinator:complete", report);
|
|
28
|
-
frameworkLogger.log("security-agent-coordinator", "coordinator-complete", "info", {
|
|
29
|
-
auditId: report.auditId,
|
|
30
|
-
duration: report.duration,
|
|
31
|
-
vulnerabilities: report.summary.totalVulnerabilities,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
this.orchestration.on("orchestration:error", (error) => {
|
|
35
|
-
this.emit("coordinator:error", error);
|
|
36
|
-
frameworkLogger.log("security-agent-coordinator", "coordinator-error", "error", error);
|
|
37
|
-
});
|
|
38
|
-
this.orchestration.on("agent:vote", ({ agentId, vote }) => {
|
|
39
|
-
this.emit("agent:vote", { agentId, vote });
|
|
40
|
-
});
|
|
41
|
-
this.orchestration.on("agent:status-change", (agent) => {
|
|
42
|
-
this.emit("agent:status-change", agent);
|
|
43
|
-
});
|
|
44
|
-
this.orchestration.on("task:complete", (task) => {
|
|
45
|
-
this.emit("task:complete", task);
|
|
46
|
-
});
|
|
47
|
-
this.orchestration.on("task:failed", (task) => {
|
|
48
|
-
this.emit("task:failed", task);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
registerAgent(config) {
|
|
52
|
-
this.agentRegistry.set(config.agentId, config);
|
|
53
|
-
frameworkLogger.log("security-agent-coordinator", "agent-registered", "info", {
|
|
54
|
-
agentId: config.agentId,
|
|
55
|
-
agentType: config.agentType,
|
|
56
|
-
weight: config.weight,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
unregisterAgent(agentId) {
|
|
60
|
-
const removed = this.agentRegistry.delete(agentId);
|
|
61
|
-
if (removed) {
|
|
62
|
-
frameworkLogger.log("security-agent-coordinator", "agent-unregistered", "info", {
|
|
63
|
-
agentId,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return removed;
|
|
67
|
-
}
|
|
68
|
-
getRegisteredAgents() {
|
|
69
|
-
return Array.from(this.agentRegistry.values());
|
|
70
|
-
}
|
|
71
|
-
async runCoordinatedSecurityScan(context) {
|
|
72
|
-
this.isActive = true;
|
|
73
|
-
const startTime = Date.now();
|
|
74
|
-
frameworkLogger.log("security-agent-coordinator", "coordinated-scan-start", "info", {
|
|
75
|
-
projectPath: context.projectPath,
|
|
76
|
-
scanDepth: context.scanDepth,
|
|
77
|
-
registeredAgents: this.agentRegistry.size,
|
|
78
|
-
});
|
|
79
|
-
try {
|
|
80
|
-
const report = await this.orchestration.runSecurityOrchestration(context.projectPath);
|
|
81
|
-
const agentVotes = this.collectAgentVotes(report);
|
|
82
|
-
const weightedApproval = this.calculateWeightedApproval(agentVotes);
|
|
83
|
-
const result = {
|
|
84
|
-
auditId: report.auditId,
|
|
85
|
-
timestamp: report.timestamp,
|
|
86
|
-
duration: report.duration,
|
|
87
|
-
participatingAgents: report.agents.map((a) => a.name),
|
|
88
|
-
vulnerabilities: report.vulnerabilities,
|
|
89
|
-
decisions: report.decisions,
|
|
90
|
-
agentVotes,
|
|
91
|
-
summary: report.summary,
|
|
92
|
-
weightedApproval,
|
|
93
|
-
approved: weightedApproval >= 0.5,
|
|
94
|
-
recommendations: report.recommendations,
|
|
95
|
-
};
|
|
96
|
-
this.emit("coordinated-scan:complete", result);
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
101
|
-
frameworkLogger.log("security-agent-coordinator", "coordinated-scan-error", "error", {
|
|
102
|
-
error: errorMessage,
|
|
103
|
-
});
|
|
104
|
-
throw error;
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
this.isActive = false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
collectAgentVotes(report) {
|
|
111
|
-
const vulnerabilities = report.vulnerabilities;
|
|
112
|
-
const agents = report.agents;
|
|
113
|
-
return agents.map((agent) => {
|
|
114
|
-
const agentVulns = vulnerabilities.filter((v) => v.severity === "critical" || v.severity === "high");
|
|
115
|
-
const concerns = [];
|
|
116
|
-
let vote = "approve";
|
|
117
|
-
let reasoning = `Security review by ${agent.name}. Found ${vulnerabilities.length} vulnerabilities.`;
|
|
118
|
-
const criticalCount = vulnerabilities.filter((v) => v.severity === "critical").length;
|
|
119
|
-
const highCount = vulnerabilities.filter((v) => v.severity === "high").length;
|
|
120
|
-
if (criticalCount > 0) {
|
|
121
|
-
concerns.push(`${criticalCount} critical vulnerabilities detected`);
|
|
122
|
-
}
|
|
123
|
-
if (highCount > 5) {
|
|
124
|
-
concerns.push(`${highCount} high-severity vulnerabilities`);
|
|
125
|
-
}
|
|
126
|
-
if (criticalCount > 5) {
|
|
127
|
-
vote = "reject";
|
|
128
|
-
reasoning = "Too many critical vulnerabilities. Security posture unacceptable.";
|
|
129
|
-
}
|
|
130
|
-
else if (criticalCount > 0 || highCount > 10) {
|
|
131
|
-
vote = "approve";
|
|
132
|
-
reasoning = "Acceptable with noted concerns. Priority fixes required.";
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
agentId: agent.id,
|
|
136
|
-
agentName: agent.name,
|
|
137
|
-
vote,
|
|
138
|
-
weight: agent.weight,
|
|
139
|
-
reasoning,
|
|
140
|
-
concerns,
|
|
141
|
-
confidence: Math.max(0.5, 1 - (criticalCount * 0.1 + highCount * 0.02)),
|
|
142
|
-
};
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
calculateWeightedApproval(votes) {
|
|
146
|
-
if (votes.length === 0)
|
|
147
|
-
return 0;
|
|
148
|
-
const totalWeight = votes.reduce((sum, v) => sum + v.weight, 0);
|
|
149
|
-
const approvalWeight = votes
|
|
150
|
-
.filter((v) => v.vote === "approve")
|
|
151
|
-
.reduce((sum, v) => sum + v.weight, 0);
|
|
152
|
-
return totalWeight > 0 ? approvalWeight / totalWeight : 0;
|
|
153
|
-
}
|
|
154
|
-
getOrchestrationLayer() {
|
|
155
|
-
return this.orchestration;
|
|
156
|
-
}
|
|
157
|
-
getActiveAgents() {
|
|
158
|
-
return this.orchestration.getActiveAgents();
|
|
159
|
-
}
|
|
160
|
-
getPendingTasks() {
|
|
161
|
-
return this.orchestration.getTasks().filter((t) => t.status === "pending");
|
|
162
|
-
}
|
|
163
|
-
isCoordinatorActive() {
|
|
164
|
-
return this.isActive;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
export function createSecurityAgentCoordinator(config) {
|
|
168
|
-
return new SecurityAgentCoordinator(config);
|
|
169
|
-
}
|
|
170
|
-
export async function runMultiAgentSecurityScan(projectPath, context) {
|
|
171
|
-
const coordinator = createSecurityAgentCoordinator();
|
|
172
|
-
const fullContext = {
|
|
173
|
-
projectPath,
|
|
174
|
-
scanDepth: context?.scanDepth || "medium",
|
|
175
|
-
complianceStandards: context?.complianceStandards || ["owasp-top-10", "cwe"],
|
|
176
|
-
enableAutoRemediation: context?.enableAutoRemediation ?? true,
|
|
177
|
-
...context,
|
|
178
|
-
};
|
|
179
|
-
coordinator.registerAgent({
|
|
180
|
-
agentId: "agent-security-auditor",
|
|
181
|
-
agentType: "security-auditor",
|
|
182
|
-
capabilities: ["vulnerability-scanning", "threat-detection", "security-auditing"],
|
|
183
|
-
weight: 0.35,
|
|
184
|
-
});
|
|
185
|
-
coordinator.registerAgent({
|
|
186
|
-
agentId: "agent-code-analyzer",
|
|
187
|
-
agentType: "code-analyzer",
|
|
188
|
-
capabilities: ["code-pattern-analysis", "static-analysis", "security-hotspot-detection"],
|
|
189
|
-
weight: 0.30,
|
|
190
|
-
});
|
|
191
|
-
coordinator.registerAgent({
|
|
192
|
-
agentId: "agent-testing-lead",
|
|
193
|
-
agentType: "testing-lead",
|
|
194
|
-
capabilities: ["security-testing", "penetration-testing", "vulnerability-validation"],
|
|
195
|
-
weight: 0.20,
|
|
196
|
-
});
|
|
197
|
-
coordinator.registerAgent({
|
|
198
|
-
agentId: "agent-architect",
|
|
199
|
-
agentType: "architect",
|
|
200
|
-
capabilities: ["security-architecture", "threat-modeling", "risk-assessment"],
|
|
201
|
-
weight: 0.15,
|
|
202
|
-
});
|
|
203
|
-
return coordinator.runCoordinatedSecurityScan(fullContext);
|
|
204
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Audit Tool
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive security auditing for the framework and its components.
|
|
5
|
-
* Identifies vulnerabilities, misconfigurations, and security weaknesses.
|
|
6
|
-
*
|
|
7
|
-
* @version 1.0.0
|
|
8
|
-
* @since 2026-01-07
|
|
9
|
-
*/
|
|
10
|
-
export interface SecurityIssue {
|
|
11
|
-
severity: "critical" | "high" | "medium" | "low" | "info";
|
|
12
|
-
category: string;
|
|
13
|
-
file: string;
|
|
14
|
-
line?: number;
|
|
15
|
-
description: string;
|
|
16
|
-
recommendation: string;
|
|
17
|
-
cwe?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SecurityAuditResult {
|
|
20
|
-
totalFiles: number;
|
|
21
|
-
issues: SecurityIssue[];
|
|
22
|
-
summary: {
|
|
23
|
-
critical: number;
|
|
24
|
-
high: number;
|
|
25
|
-
medium: number;
|
|
26
|
-
low: number;
|
|
27
|
-
info: number;
|
|
28
|
-
};
|
|
29
|
-
score: number;
|
|
30
|
-
}
|
|
31
|
-
export declare class SecurityAuditor {
|
|
32
|
-
private readonly dangerousPatterns;
|
|
33
|
-
private readonly dangerousImports;
|
|
34
|
-
/**
|
|
35
|
-
* Run comprehensive security audit
|
|
36
|
-
*/
|
|
37
|
-
auditProject(projectPath?: string): Promise<SecurityAuditResult>;
|
|
38
|
-
private getAllFiles;
|
|
39
|
-
private shouldSkipDirectory;
|
|
40
|
-
private shouldAuditFile;
|
|
41
|
-
private auditFile;
|
|
42
|
-
private isFalsePositive;
|
|
43
|
-
private auditImports;
|
|
44
|
-
private auditFilePermissions;
|
|
45
|
-
private auditPackageJson;
|
|
46
|
-
private auditConfiguration;
|
|
47
|
-
private auditDependencies;
|
|
48
|
-
private getRecommendationForCategory;
|
|
49
|
-
private generateSummary;
|
|
50
|
-
private calculateSecurityScore;
|
|
51
|
-
/**
|
|
52
|
-
* Generate security audit report
|
|
53
|
-
*/
|
|
54
|
-
generateReport(result: SecurityAuditResult): string;
|
|
55
|
-
}
|
|
56
|
-
export declare const securityAuditor: SecurityAuditor;
|