0xray 2.1.2 → 2.1.4
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 +38 -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
|
@@ -5,16 +5,10 @@
|
|
|
5
5
|
* and compliance validation - ensures production-ready security posture
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
CallToolRequestSchema,
|
|
12
|
-
ListToolsRequestSchema,
|
|
13
|
-
type CallToolResult,
|
|
14
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
9
|
+
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
15
10
|
import * as fs from "fs";
|
|
16
11
|
import * as path from "path";
|
|
17
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
18
12
|
|
|
19
13
|
interface SecurityVulnerability {
|
|
20
14
|
id: string;
|
|
@@ -84,150 +78,119 @@ interface AnalyzeProposalArgs {
|
|
|
84
78
|
proposalType?: string;
|
|
85
79
|
}
|
|
86
80
|
|
|
87
|
-
class XraySecurityAuditServer {
|
|
88
|
-
private server: Server;
|
|
89
|
-
|
|
81
|
+
class XraySecurityAuditServer extends XrayKnowledgeSkillBase {
|
|
90
82
|
constructor() {
|
|
91
|
-
|
|
83
|
+
super("security-audit", "2.0.1");
|
|
84
|
+
this.tools = [
|
|
92
85
|
{
|
|
93
|
-
name: "
|
|
86
|
+
name: "audit_security",
|
|
87
|
+
description:
|
|
88
|
+
"Perform comprehensive security audit on codebase files",
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: "object",
|
|
91
|
+
properties: {
|
|
92
|
+
files: {
|
|
93
|
+
type: "array",
|
|
94
|
+
items: { type: "string" },
|
|
95
|
+
description: "List of file paths to audit",
|
|
96
|
+
},
|
|
97
|
+
includeDependencies: {
|
|
98
|
+
type: "boolean",
|
|
99
|
+
description: "Include dependency vulnerability analysis",
|
|
100
|
+
default: true,
|
|
101
|
+
},
|
|
102
|
+
complianceFrameworks: {
|
|
103
|
+
type: "array",
|
|
104
|
+
items: {
|
|
105
|
+
type: "string",
|
|
106
|
+
enum: ["owasp-top-10", "nist", "iso-27001", "pci-dss"],
|
|
107
|
+
},
|
|
108
|
+
description: "Compliance frameworks to check against",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
required: ["files"],
|
|
112
|
+
},
|
|
94
113
|
},
|
|
95
114
|
{
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
name: "check_vulnerability",
|
|
116
|
+
description:
|
|
117
|
+
"Check specific security vulnerability patterns in a file",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
filePath: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Path to the file to check",
|
|
124
|
+
},
|
|
125
|
+
vulnerabilityType: {
|
|
126
|
+
type: "string",
|
|
127
|
+
enum: [
|
|
128
|
+
"injection",
|
|
129
|
+
"authentication",
|
|
130
|
+
"authorization",
|
|
131
|
+
"cryptography",
|
|
132
|
+
"xss",
|
|
133
|
+
"csrf",
|
|
134
|
+
"secrets",
|
|
135
|
+
"configuration",
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
severity: {
|
|
139
|
+
type: "string",
|
|
140
|
+
enum: ["critical", "high", "medium", "low", "info"],
|
|
141
|
+
description: "Minimum severity level to report",
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
required: ["filePath", "vulnerabilityType"],
|
|
98
145
|
},
|
|
99
146
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return {
|
|
109
|
-
tools: [
|
|
110
|
-
{
|
|
111
|
-
name: "audit_security",
|
|
112
|
-
description:
|
|
113
|
-
"Perform comprehensive security audit on codebase files",
|
|
114
|
-
inputSchema: {
|
|
147
|
+
{
|
|
148
|
+
name: "generate_security_report",
|
|
149
|
+
description:
|
|
150
|
+
"Generate comprehensive security report with remediation steps",
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: "object",
|
|
153
|
+
properties: {
|
|
154
|
+
auditResults: {
|
|
115
155
|
type: "object",
|
|
116
|
-
|
|
117
|
-
files: {
|
|
118
|
-
type: "array",
|
|
119
|
-
items: { type: "string" },
|
|
120
|
-
description: "List of file paths to audit",
|
|
121
|
-
},
|
|
122
|
-
includeDependencies: {
|
|
123
|
-
type: "boolean",
|
|
124
|
-
description: "Include dependency vulnerability analysis",
|
|
125
|
-
default: true,
|
|
126
|
-
},
|
|
127
|
-
complianceFrameworks: {
|
|
128
|
-
type: "array",
|
|
129
|
-
items: {
|
|
130
|
-
type: "string",
|
|
131
|
-
enum: ["owasp-top-10", "nist", "iso-27001", "pci-dss"],
|
|
132
|
-
},
|
|
133
|
-
description: "Compliance frameworks to check against",
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
required: ["files"],
|
|
156
|
+
description: "Results from audit_security tool",
|
|
137
157
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"Check specific security vulnerability patterns in a file",
|
|
143
|
-
inputSchema: {
|
|
144
|
-
type: "object",
|
|
145
|
-
properties: {
|
|
146
|
-
filePath: {
|
|
147
|
-
type: "string",
|
|
148
|
-
description: "Path to the file to check",
|
|
149
|
-
},
|
|
150
|
-
vulnerabilityType: {
|
|
151
|
-
type: "string",
|
|
152
|
-
enum: [
|
|
153
|
-
"injection",
|
|
154
|
-
"authentication",
|
|
155
|
-
"authorization",
|
|
156
|
-
"cryptography",
|
|
157
|
-
"xss",
|
|
158
|
-
"csrf",
|
|
159
|
-
"secrets",
|
|
160
|
-
"configuration",
|
|
161
|
-
],
|
|
162
|
-
},
|
|
163
|
-
severity: {
|
|
164
|
-
type: "string",
|
|
165
|
-
enum: ["critical", "high", "medium", "low", "info"],
|
|
166
|
-
description: "Minimum severity level to report",
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
required: ["filePath", "vulnerabilityType"],
|
|
158
|
+
format: {
|
|
159
|
+
type: "string",
|
|
160
|
+
enum: ["markdown", "json", "html"],
|
|
161
|
+
default: "markdown",
|
|
170
162
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
description:
|
|
175
|
-
"Generate comprehensive security report with remediation steps",
|
|
176
|
-
inputSchema: {
|
|
177
|
-
type: "object",
|
|
178
|
-
properties: {
|
|
179
|
-
auditResults: {
|
|
180
|
-
type: "object",
|
|
181
|
-
description: "Results from audit_security tool",
|
|
182
|
-
},
|
|
183
|
-
format: {
|
|
184
|
-
type: "string",
|
|
185
|
-
enum: ["markdown", "json", "html"],
|
|
186
|
-
default: "markdown",
|
|
187
|
-
},
|
|
188
|
-
includeRemediation: {
|
|
189
|
-
type: "boolean",
|
|
190
|
-
default: true,
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
required: ["auditResults"],
|
|
163
|
+
includeRemediation: {
|
|
164
|
+
type: "boolean",
|
|
165
|
+
default: true,
|
|
194
166
|
},
|
|
195
167
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
168
|
+
required: ["auditResults"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "analyze_proposal",
|
|
173
|
+
description:
|
|
174
|
+
"Analyze an inference proposal (pattern/bug/refactor) from a security perspective and return a structured governance decision",
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
proposalTitle: { type: "string" },
|
|
179
|
+
proposalDescription: { type: "string" },
|
|
180
|
+
evidence: { type: "array", items: { type: "string" } },
|
|
181
|
+
proposalType: { type: "string" },
|
|
210
182
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
this.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return await this.checkVulnerability(args as unknown as CheckVulnerabilityArgs);
|
|
223
|
-
case "generate_security_report":
|
|
224
|
-
return await this.generateSecurityReport(args as unknown as GenerateSecurityReportArgs);
|
|
225
|
-
case "analyze_proposal":
|
|
226
|
-
return await this.analyzeProposal(args as AnalyzeProposalArgs) as CallToolResult;
|
|
227
|
-
default:
|
|
228
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
183
|
+
required: ["proposalTitle", "proposalDescription"],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
this.handlers = {
|
|
188
|
+
"audit_security": async (args) => this.auditSecurity(args as unknown as AuditSecurityArgs),
|
|
189
|
+
"check_vulnerability": async (args) => this.checkVulnerability(args as unknown as CheckVulnerabilityArgs),
|
|
190
|
+
"generate_security_report": async (args) => this.generateSecurityReport(args as unknown as GenerateSecurityReportArgs),
|
|
191
|
+
"analyze_proposal": async (args) => this.analyzeProposal(args as AnalyzeProposalArgs),
|
|
192
|
+
};
|
|
193
|
+
this.setupToolHandlers();
|
|
231
194
|
}
|
|
232
195
|
|
|
233
196
|
private async auditSecurity(args: AuditSecurityArgs) {
|
|
@@ -1172,22 +1135,12 @@ class XraySecurityAuditServer {
|
|
|
1172
1135
|
};
|
|
1173
1136
|
}
|
|
1174
1137
|
|
|
1175
|
-
async run(): Promise<void> {
|
|
1176
|
-
const transport = new StdioServerTransport();
|
|
1177
|
-
await this.server.connect(transport);
|
|
1178
|
-
|
|
1179
|
-
// Use centralized shutdown handler
|
|
1180
|
-
createGracefulShutdown({
|
|
1181
|
-
serverName: "security-audit.server",
|
|
1182
|
-
server: this.server,
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
1138
|
}
|
|
1186
1139
|
|
|
1187
1140
|
// Run the server if this file is executed directly
|
|
1188
1141
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1189
1142
|
const server = new XraySecurityAuditServer();
|
|
1190
|
-
server.run().catch(() => {});
|
|
1143
|
+
server.run("security-audit").catch((err) => { frameworkLogger.log("security-audit", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1191
1144
|
}
|
|
1192
1145
|
|
|
1193
1146
|
export { XraySecurityAuditServer };
|
|
@@ -6,13 +6,8 @@
|
|
|
6
6
|
* sitemap generation, and deep technical SEO audits.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
CallToolRequestSchema,
|
|
13
|
-
ListToolsRequestSchema,
|
|
14
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
15
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
9
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
10
|
+
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
16
11
|
|
|
17
12
|
interface SEOIssue {
|
|
18
13
|
priority: "critical" | "high" | "medium" | "low";
|
|
@@ -64,222 +59,96 @@ interface RobotsConfig {
|
|
|
64
59
|
|
|
65
60
|
type ToolInputSchema = Record<string, unknown>;
|
|
66
61
|
|
|
67
|
-
class SEOSpecialistServer {
|
|
68
|
-
private server: Server;
|
|
69
|
-
|
|
62
|
+
class SEOSpecialistServer extends XrayKnowledgeSkillBase {
|
|
70
63
|
constructor() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
tools: [
|
|
82
|
-
{
|
|
83
|
-
name: "audit-technical-seo",
|
|
84
|
-
description:
|
|
85
|
-
"Perform deep technical SEO audit: schema markup, meta tags, heading structure, internal linking, performance, accessibility, mobile-friendliness",
|
|
86
|
-
inputSchema: {
|
|
87
|
-
type: "object",
|
|
88
|
-
properties: {
|
|
89
|
-
targetUrl: { type: "string", description: "Target URL to audit" },
|
|
90
|
-
focusAreas: {
|
|
91
|
-
type: "array",
|
|
92
|
-
items: { type: "string" },
|
|
93
|
-
description: "Areas to focus on (schema, performance, structure, links, accessibility)",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
64
|
+
super("seo-consultant", "2.0.1");
|
|
65
|
+
this.tools = [
|
|
66
|
+
{
|
|
67
|
+
name: "audit-technical-seo",
|
|
68
|
+
description: "Perform deep technical SEO audit: schema markup, meta tags, heading structure, internal linking, performance, accessibility, mobile-friendliness",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
targetUrl: { type: "string", description: "Target URL to audit" },
|
|
73
|
+
focusAreas: { type: "array", items: { type: "string" }, description: "Areas to focus on (schema, performance, structure, links, accessibility)" },
|
|
96
74
|
},
|
|
97
75
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"Organization",
|
|
109
|
-
"Product",
|
|
110
|
-
"Article",
|
|
111
|
-
"FAQPage",
|
|
112
|
-
"BreadcrumbList",
|
|
113
|
-
"LocalBusiness",
|
|
114
|
-
"WebSite",
|
|
115
|
-
"HowTo",
|
|
116
|
-
"Recipe",
|
|
117
|
-
"VideoObject",
|
|
118
|
-
"AudioObject",
|
|
119
|
-
"Course",
|
|
120
|
-
"Event",
|
|
121
|
-
"Person",
|
|
122
|
-
"Book",
|
|
123
|
-
"SoftwareApplication",
|
|
124
|
-
],
|
|
125
|
-
},
|
|
126
|
-
data: {
|
|
127
|
-
type: "object",
|
|
128
|
-
description: "Data to populate schema (varies by type)",
|
|
129
|
-
},
|
|
130
|
-
includeMicrodata: {
|
|
131
|
-
type: "boolean",
|
|
132
|
-
description: "Also generate HTML microdata format",
|
|
133
|
-
default: false,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
required: ["schemaType", "data"],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "generate-schema-markup",
|
|
79
|
+
description: "Generate JSON-LD schema markup for: Organization, Product, Article, FAQPage, BreadcrumbList, LocalBusiness, WebSite, HowTo, Recipe, Video, Audio, Course, Event, Person, Book, SoftwareApplication",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
schemaType: { type: "string", enum: ["Organization", "Product", "Article", "FAQPage", "BreadcrumbList", "LocalBusiness", "WebSite", "HowTo", "Recipe", "VideoObject", "AudioObject", "Course", "Event", "Person", "Book", "SoftwareApplication"] },
|
|
84
|
+
data: { type: "object", description: "Data to populate schema (varies by type)" },
|
|
85
|
+
includeMicrodata: { type: "boolean", description: "Also generate HTML microdata format", default: false },
|
|
137
86
|
},
|
|
87
|
+
required: ["schemaType", "data"],
|
|
138
88
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
enum: ["homepage", "article", "product", "category", "landing"],
|
|
150
|
-
description: "Type of page for context-specific recommendations",
|
|
151
|
-
},
|
|
152
|
-
currentMetrics: {
|
|
153
|
-
type: "object",
|
|
154
|
-
description: "Current Core Web Vitals values if known",
|
|
155
|
-
properties: {
|
|
156
|
-
LCP: { type: "number" },
|
|
157
|
-
INP: { type: "number" },
|
|
158
|
-
CLS: { type: "number" },
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
required: ["url"],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "optimize-core-web-vitals",
|
|
92
|
+
description: "Analyze and provide optimization recommendations for LCP (Largest Contentful Paint), INP (Interaction to Next Paint), CLS (Cumulative Layout Shift)",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
url: { type: "string", description: "URL to analyze" },
|
|
97
|
+
pageType: { type: "string", enum: ["homepage", "article", "product", "category", "landing"], description: "Type of page for context-specific recommendations" },
|
|
98
|
+
currentMetrics: { type: "object", description: "Current Core Web Vitals values if known", properties: { LCP: { type: "number" }, INP: { type: "number" }, CLS: { type: "number" } } },
|
|
163
99
|
},
|
|
100
|
+
required: ["url"],
|
|
164
101
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
items: { type: "string" },
|
|
176
|
-
description: "Target AI engines (chatgpt, perplexity, grok, gemini, claude)",
|
|
177
|
-
},
|
|
178
|
-
pageContext: {
|
|
179
|
-
type: "string",
|
|
180
|
-
description: "Page context (documentation, blog, product, api)",
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
required: ["content"],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "analyze-ai-search",
|
|
105
|
+
description: "Optimize content for AI search engines (ChatGPT, Perplexity, Grok, Gemini, Claude). Analyze E-E-A-T signals, structure content for citation",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
content: { type: "string", description: "Content to optimize" },
|
|
110
|
+
targetAI: { type: "array", items: { type: "string" }, description: "Target AI engines (chatgpt, perplexity, grok, gemini, claude)" },
|
|
111
|
+
pageContext: { type: "string", description: "Page context (documentation, blog, product, api)" },
|
|
184
112
|
},
|
|
113
|
+
required: ["content"],
|
|
185
114
|
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
type: "object",
|
|
198
|
-
properties: {
|
|
199
|
-
path: { type: "string" },
|
|
200
|
-
lastmod: { type: "string" },
|
|
201
|
-
changefreq: {
|
|
202
|
-
type: "string",
|
|
203
|
-
enum: [
|
|
204
|
-
"always",
|
|
205
|
-
"hourly",
|
|
206
|
-
"daily",
|
|
207
|
-
"weekly",
|
|
208
|
-
"monthly",
|
|
209
|
-
"yearly",
|
|
210
|
-
"never",
|
|
211
|
-
],
|
|
212
|
-
},
|
|
213
|
-
priority: { type: "number", minimum: 0, maximum: 1 },
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
includeImages: { type: "boolean", default: false },
|
|
218
|
-
includeVideos: { type: "boolean", default: false },
|
|
219
|
-
},
|
|
220
|
-
required: ["baseUrl", "pages"],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "generate-sitemap",
|
|
118
|
+
description: "Generate XML sitemap for SEO with proper structure, priorities, and changefreq",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
baseUrl: { type: "string", description: "Base URL for sitemap" },
|
|
123
|
+
pages: { type: "array", items: { type: "object", properties: { path: { type: "string" }, lastmod: { type: "string" }, changefreq: { type: "string", enum: ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"] }, priority: { type: "number", minimum: 0, maximum: 1 } } } },
|
|
124
|
+
includeImages: { type: "boolean", default: false },
|
|
125
|
+
includeVideos: { type: "boolean", default: false },
|
|
221
126
|
},
|
|
127
|
+
required: ["baseUrl", "pages"],
|
|
222
128
|
},
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
type: "object",
|
|
233
|
-
properties: {
|
|
234
|
-
allowAI: { type: "boolean", description: "Allow AI crawlers", default: true },
|
|
235
|
-
allowSearchBots: {
|
|
236
|
-
type: "boolean",
|
|
237
|
-
description: "Allow standard search bots",
|
|
238
|
-
default: true,
|
|
239
|
-
},
|
|
240
|
-
blockPaths: {
|
|
241
|
-
type: "array",
|
|
242
|
-
items: { type: "string" },
|
|
243
|
-
description: "Paths to disallow",
|
|
244
|
-
},
|
|
245
|
-
crawlDelay: { type: "number", description: "Crawl delay in seconds" },
|
|
246
|
-
generateSitemapDirective: { type: "boolean", default: true },
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
required: ["baseUrl"],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "optimize-robots-txt",
|
|
132
|
+
description: "Optimize robots.txt for SEO best practices, AI crawler optimization, and proper directive structure",
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
baseUrl: { type: "string", description: "Site base URL" },
|
|
137
|
+
options: { type: "object", properties: { allowAI: { type: "boolean", description: "Allow AI crawlers", default: true }, allowSearchBots: { type: "boolean", description: "Allow standard search bots", default: true }, blockPaths: { type: "array", items: { type: "string" }, description: "Paths to disallow" }, crawlDelay: { type: "number", description: "Crawl delay in seconds" }, generateSitemapDirective: { type: "boolean", default: true } } },
|
|
251
138
|
},
|
|
139
|
+
required: ["baseUrl"],
|
|
252
140
|
},
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return this.generateSchemaMarkup(args);
|
|
265
|
-
case "optimize-core-web-vitals":
|
|
266
|
-
return this.optimizeCoreWebVitals(args);
|
|
267
|
-
case "analyze-ai-search":
|
|
268
|
-
return this.analyzeAISearch(args);
|
|
269
|
-
case "generate-sitemap":
|
|
270
|
-
return this.generateSitemap(args);
|
|
271
|
-
case "optimize-robots-txt":
|
|
272
|
-
return this.optimizeRobotsTxt(args);
|
|
273
|
-
default:
|
|
274
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
275
|
-
}
|
|
276
|
-
} catch (error) {
|
|
277
|
-
return {
|
|
278
|
-
content: [{ type: "text", text: `Error: ${error}` }],
|
|
279
|
-
isError: true,
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
});
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
this.handlers = {
|
|
144
|
+
"audit-technical-seo": async (args) => this.auditTechnicalSEO(args as ToolInputSchema),
|
|
145
|
+
"generate-schema-markup": async (args) => this.generateSchemaMarkup(args as ToolInputSchema),
|
|
146
|
+
"optimize-core-web-vitals": async (args) => this.optimizeCoreWebVitals(args as ToolInputSchema),
|
|
147
|
+
"analyze-ai-search": async (args) => this.analyzeAISearch(args as ToolInputSchema),
|
|
148
|
+
"generate-sitemap": async (args) => this.generateSitemap(args as ToolInputSchema),
|
|
149
|
+
"optimize-robots-txt": async (args) => this.optimizeRobotsTxt(args as ToolInputSchema),
|
|
150
|
+
};
|
|
151
|
+
this.setupToolHandlers();
|
|
283
152
|
}
|
|
284
153
|
|
|
285
154
|
private auditTechnicalSEO(args: ToolInputSchema): {
|
|
@@ -1141,20 +1010,11 @@ Sitemap: ${baseUrl}/sitemap.xml`;
|
|
|
1141
1010
|
return issues.join("\n");
|
|
1142
1011
|
}
|
|
1143
1012
|
|
|
1144
|
-
async run(): Promise<void> {
|
|
1145
|
-
const transport = new StdioServerTransport();
|
|
1146
|
-
await this.server.connect(transport);
|
|
1147
|
-
|
|
1148
|
-
createGracefulShutdown({
|
|
1149
|
-
serverName: "seo-consultant.server",
|
|
1150
|
-
server: this.server,
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
1013
|
}
|
|
1154
1014
|
|
|
1155
1015
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1156
1016
|
const server = new SEOSpecialistServer();
|
|
1157
|
-
server.run().catch(() => {});
|
|
1017
|
+
server.run("seo-consultant.server").catch((err) => { frameworkLogger.log("seo-consultant", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1158
1018
|
}
|
|
1159
1019
|
|
|
1160
1020
|
export { SEOSpecialistServer };
|