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
|
@@ -5,15 +5,8 @@
|
|
|
5
5
|
* test coverage optimization, and automated testing workflows
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
10
9
|
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
11
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
12
|
-
import {
|
|
13
|
-
CallToolRequestSchema,
|
|
14
|
-
ListToolsRequestSchema,
|
|
15
|
-
type CallToolResult,
|
|
16
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
17
10
|
|
|
18
11
|
interface TestStrategy {
|
|
19
12
|
type:
|
|
@@ -203,197 +196,165 @@ interface McpToolResponse {
|
|
|
203
196
|
data?: Record<string, unknown>;
|
|
204
197
|
}
|
|
205
198
|
|
|
206
|
-
class XrayTestingBestPracticesServer {
|
|
207
|
-
private server: Server;
|
|
208
|
-
|
|
199
|
+
class XrayTestingBestPracticesServer extends XrayKnowledgeSkillBase {
|
|
209
200
|
constructor() {
|
|
210
|
-
|
|
201
|
+
super("testing-best-practices", "2.0.1");
|
|
202
|
+
this.tools = [
|
|
211
203
|
{
|
|
212
|
-
name: "
|
|
204
|
+
name: "analyze_test_coverage",
|
|
205
|
+
description: "Analyze current test coverage and identify gaps",
|
|
206
|
+
inputSchema: {
|
|
207
|
+
type: "object",
|
|
208
|
+
properties: {
|
|
209
|
+
codePath: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Path to codebase to analyze",
|
|
212
|
+
},
|
|
213
|
+
testFramework: {
|
|
214
|
+
type: "string",
|
|
215
|
+
description:
|
|
216
|
+
"Testing framework used (jest, vitest, mocha, etc.)",
|
|
217
|
+
default: "auto-detect",
|
|
218
|
+
},
|
|
219
|
+
coverageThreshold: {
|
|
220
|
+
type: "number",
|
|
221
|
+
description: "Minimum coverage threshold (0-100)",
|
|
222
|
+
default: 80,
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
required: ["codePath"],
|
|
226
|
+
},
|
|
213
227
|
},
|
|
214
228
|
{
|
|
215
|
-
|
|
216
|
-
|
|
229
|
+
name: "design_test_strategy",
|
|
230
|
+
description: "Design comprehensive testing strategy for a project",
|
|
231
|
+
inputSchema: {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
projectType: {
|
|
235
|
+
type: "string",
|
|
236
|
+
enum: ["web-app", "api", "library", "mobile", "desktop"],
|
|
237
|
+
description: "Type of project",
|
|
238
|
+
},
|
|
239
|
+
techStack: {
|
|
240
|
+
type: "array",
|
|
241
|
+
items: { type: "string" },
|
|
242
|
+
description:
|
|
243
|
+
"Technologies used (react, node, typescript, etc.)",
|
|
244
|
+
},
|
|
245
|
+
teamSize: {
|
|
246
|
+
type: "string",
|
|
247
|
+
enum: ["solo", "small", "medium", "large"],
|
|
248
|
+
description: "Development team size",
|
|
249
|
+
},
|
|
250
|
+
timeline: {
|
|
251
|
+
type: "string",
|
|
252
|
+
enum: ["rapid", "balanced", "thorough"],
|
|
253
|
+
description: "Development timeline priority",
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
required: ["projectType"],
|
|
217
257
|
},
|
|
218
258
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
name: "analyze_test_coverage",
|
|
231
|
-
description: "Analyze current test coverage and identify gaps",
|
|
232
|
-
inputSchema: {
|
|
233
|
-
type: "object",
|
|
234
|
-
properties: {
|
|
235
|
-
codePath: {
|
|
236
|
-
type: "string",
|
|
237
|
-
description: "Path to codebase to analyze",
|
|
238
|
-
},
|
|
239
|
-
testFramework: {
|
|
240
|
-
type: "string",
|
|
241
|
-
description:
|
|
242
|
-
"Testing framework used (jest, vitest, mocha, etc.)",
|
|
243
|
-
default: "auto-detect",
|
|
244
|
-
},
|
|
245
|
-
coverageThreshold: {
|
|
246
|
-
type: "number",
|
|
247
|
-
description: "Minimum coverage threshold (0-100)",
|
|
248
|
-
default: 80,
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
required: ["codePath"],
|
|
259
|
+
{
|
|
260
|
+
name: "implement_tdd_workflow",
|
|
261
|
+
description:
|
|
262
|
+
"Implement Test-Driven Development workflow and practices",
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: "object",
|
|
265
|
+
properties: {
|
|
266
|
+
language: {
|
|
267
|
+
type: "string",
|
|
268
|
+
description: "Programming language",
|
|
269
|
+
default: "typescript",
|
|
252
270
|
},
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
inputSchema: {
|
|
258
|
-
type: "object",
|
|
259
|
-
properties: {
|
|
260
|
-
projectType: {
|
|
261
|
-
type: "string",
|
|
262
|
-
enum: ["web-app", "api", "library", "mobile", "desktop"],
|
|
263
|
-
description: "Type of project",
|
|
264
|
-
},
|
|
265
|
-
techStack: {
|
|
266
|
-
type: "array",
|
|
267
|
-
items: { type: "string" },
|
|
268
|
-
description:
|
|
269
|
-
"Technologies used (react, node, typescript, etc.)",
|
|
270
|
-
},
|
|
271
|
-
teamSize: {
|
|
272
|
-
type: "string",
|
|
273
|
-
enum: ["solo", "small", "medium", "large"],
|
|
274
|
-
description: "Development team size",
|
|
275
|
-
},
|
|
276
|
-
timeline: {
|
|
277
|
-
type: "string",
|
|
278
|
-
enum: ["rapid", "balanced", "thorough"],
|
|
279
|
-
description: "Development timeline priority",
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
required: ["projectType"],
|
|
271
|
+
framework: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "Preferred testing framework",
|
|
274
|
+
default: "jest",
|
|
283
275
|
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
"Implement Test-Driven Development workflow and practices",
|
|
289
|
-
inputSchema: {
|
|
290
|
-
type: "object",
|
|
291
|
-
properties: {
|
|
292
|
-
language: {
|
|
293
|
-
type: "string",
|
|
294
|
-
description: "Programming language",
|
|
295
|
-
default: "typescript",
|
|
296
|
-
},
|
|
297
|
-
framework: {
|
|
298
|
-
type: "string",
|
|
299
|
-
description: "Preferred testing framework",
|
|
300
|
-
default: "jest",
|
|
301
|
-
},
|
|
302
|
-
existingTests: {
|
|
303
|
-
type: "boolean",
|
|
304
|
-
description: "Whether tests already exist",
|
|
305
|
-
default: false,
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
required: [],
|
|
276
|
+
existingTests: {
|
|
277
|
+
type: "boolean",
|
|
278
|
+
description: "Whether tests already exist",
|
|
279
|
+
default: false,
|
|
309
280
|
},
|
|
310
281
|
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
282
|
+
required: [],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "optimize_test_performance",
|
|
287
|
+
description: "Analyze and optimize test execution performance",
|
|
288
|
+
inputSchema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
testResults: {
|
|
292
|
+
type: "string",
|
|
293
|
+
description: "Path to test results or current execution time",
|
|
294
|
+
},
|
|
295
|
+
targetRuntime: {
|
|
296
|
+
type: "number",
|
|
297
|
+
description: "Target test execution time in seconds",
|
|
298
|
+
default: 300,
|
|
299
|
+
},
|
|
300
|
+
parallelExecution: {
|
|
301
|
+
type: "boolean",
|
|
302
|
+
description: "Whether parallel execution is supported",
|
|
303
|
+
default: true,
|
|
333
304
|
},
|
|
334
305
|
},
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
coverageReporting: {
|
|
367
|
-
type: "boolean",
|
|
368
|
-
description: "Enable coverage reporting",
|
|
369
|
-
default: true,
|
|
370
|
-
},
|
|
306
|
+
required: ["testResults"],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "setup_ci_cd_testing",
|
|
311
|
+
description: "Set up comprehensive CI/CD testing pipeline",
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: "object",
|
|
314
|
+
properties: {
|
|
315
|
+
ciPlatform: {
|
|
316
|
+
type: "string",
|
|
317
|
+
enum: [
|
|
318
|
+
"github-actions",
|
|
319
|
+
"gitlab-ci",
|
|
320
|
+
"jenkins",
|
|
321
|
+
"circle-ci",
|
|
322
|
+
"travis-ci",
|
|
323
|
+
],
|
|
324
|
+
description: "CI/CD platform",
|
|
325
|
+
},
|
|
326
|
+
testTypes: {
|
|
327
|
+
type: "array",
|
|
328
|
+
items: {
|
|
329
|
+
type: "string",
|
|
330
|
+
enum: [
|
|
331
|
+
"unit",
|
|
332
|
+
"integration",
|
|
333
|
+
"e2e",
|
|
334
|
+
"performance",
|
|
335
|
+
"security",
|
|
336
|
+
],
|
|
371
337
|
},
|
|
372
|
-
|
|
338
|
+
description: "Types of tests to include",
|
|
339
|
+
},
|
|
340
|
+
coverageReporting: {
|
|
341
|
+
type: "boolean",
|
|
342
|
+
description: "Enable coverage reporting",
|
|
343
|
+
default: true,
|
|
373
344
|
},
|
|
374
345
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
case "implement_tdd_workflow":
|
|
388
|
-
return await this.implementTDDWorkflow(args as unknown as ImplementTDDWorkflowArgs) as CallToolResult;
|
|
389
|
-
case "optimize_test_performance":
|
|
390
|
-
return await this.optimizeTestPerformance(args as unknown as OptimizeTestPerformanceArgs) as CallToolResult;
|
|
391
|
-
case "setup_ci_cd_testing":
|
|
392
|
-
return await this.setupCICDTesting(args as unknown as SetupCICDTestingArgs) as CallToolResult;
|
|
393
|
-
default:
|
|
394
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
395
|
-
}
|
|
396
|
-
});
|
|
346
|
+
required: ["ciPlatform", "testTypes"],
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
];
|
|
350
|
+
this.handlers = {
|
|
351
|
+
"analyze_test_coverage": async (args) => this.analyzeTestCoverage(args as unknown as AnalyzeTestCoverageArgs),
|
|
352
|
+
"design_test_strategy": async (args) => this.designTestStrategy(args as unknown as DesignTestStrategyArgs),
|
|
353
|
+
"implement_tdd_workflow": async (args) => this.implementTDDWorkflow(args as unknown as ImplementTDDWorkflowArgs),
|
|
354
|
+
"optimize_test_performance": async (args) => this.optimizeTestPerformance(args as unknown as OptimizeTestPerformanceArgs),
|
|
355
|
+
"setup_ci_cd_testing": async (args) => this.setupCICDTesting(args as unknown as SetupCICDTestingArgs),
|
|
356
|
+
};
|
|
357
|
+
this.setupToolHandlers();
|
|
397
358
|
}
|
|
398
359
|
|
|
399
360
|
private async analyzeTestCoverage(args: AnalyzeTestCoverageArgs): Promise<McpToolResponse> {
|
|
@@ -1211,22 +1172,12 @@ class XrayTestingBestPracticesServer {
|
|
|
1211
1172
|
return icons[type as keyof typeof icons] || "🧪";
|
|
1212
1173
|
}
|
|
1213
1174
|
|
|
1214
|
-
async run(): Promise<void> {
|
|
1215
|
-
const transport = new StdioServerTransport();
|
|
1216
|
-
await this.server.connect(transport);
|
|
1217
|
-
|
|
1218
|
-
// Use centralized shutdown handler
|
|
1219
|
-
createGracefulShutdown({
|
|
1220
|
-
serverName: "testing-best-practices.server",
|
|
1221
|
-
server: this.server,
|
|
1222
|
-
});
|
|
1223
|
-
}
|
|
1224
1175
|
}
|
|
1225
1176
|
|
|
1226
1177
|
// Run the server if this file is executed directly
|
|
1227
1178
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1228
1179
|
const server = new XrayTestingBestPracticesServer();
|
|
1229
|
-
server.run().catch(() => {});
|
|
1180
|
+
server.run("testing-best-practices").catch((err) => { frameworkLogger.log("testing-best-practices", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1230
1181
|
}
|
|
1231
1182
|
|
|
1232
1183
|
export { XrayTestingBestPracticesServer };
|
|
@@ -5,16 +5,10 @@
|
|
|
5
5
|
* and testing methodology recommendations
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
-
import {
|
|
11
|
-
CallToolRequestSchema,
|
|
12
|
-
ListToolsRequestSchema,
|
|
13
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
14
9
|
import * as fs from "fs";
|
|
15
10
|
import * as path from "path";
|
|
16
11
|
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
17
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
18
12
|
import {
|
|
19
13
|
detectProjectLanguage,
|
|
20
14
|
LANGUAGE_CONFIGS,
|
|
@@ -129,159 +123,89 @@ interface BaseTestCounts {
|
|
|
129
123
|
security: number;
|
|
130
124
|
}
|
|
131
125
|
|
|
132
|
-
class XrayTestingStrategyServer {
|
|
133
|
-
private server: Server;
|
|
126
|
+
class XrayTestingStrategyServer extends XrayKnowledgeSkillBase {
|
|
134
127
|
|
|
135
128
|
constructor() {
|
|
136
|
-
|
|
129
|
+
super("testing-strategy", "2.0.1");
|
|
130
|
+
this.tools = [
|
|
137
131
|
{
|
|
138
|
-
name: "
|
|
132
|
+
name: "analyze-test-coverage",
|
|
133
|
+
description: "Analyze current test coverage and identify gaps",
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: {
|
|
137
|
+
projectRoot: { type: "string" },
|
|
138
|
+
includeBreakdown: { type: "boolean", default: true },
|
|
139
|
+
coverageThreshold: { type: "number", default: 80 },
|
|
140
|
+
},
|
|
141
|
+
required: ["projectRoot"],
|
|
142
|
+
},
|
|
139
143
|
},
|
|
140
144
|
{
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
name: "design-test-strategy",
|
|
146
|
+
description: "Design comprehensive testing strategy for the project",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
projectRoot: { type: "string" },
|
|
151
|
+
projectType: { type: "string", enum: ["web", "api", "mobile", "desktop"] },
|
|
152
|
+
complexity: { type: "string", enum: ["simple", "medium", "complex"] },
|
|
153
|
+
timeline: { type: "string", enum: ["agile", "waterfall", "continuous"] },
|
|
154
|
+
},
|
|
155
|
+
required: ["projectRoot"],
|
|
143
156
|
},
|
|
144
157
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
tools: [
|
|
155
|
-
{
|
|
156
|
-
name: "analyze-test-coverage",
|
|
157
|
-
description: "Analyze current test coverage and identify gaps",
|
|
158
|
-
inputSchema: {
|
|
159
|
-
type: "object",
|
|
160
|
-
properties: {
|
|
161
|
-
projectRoot: { type: "string" },
|
|
162
|
-
includeBreakdown: { type: "boolean", default: true },
|
|
163
|
-
coverageThreshold: { type: "number", default: 80 },
|
|
164
|
-
},
|
|
165
|
-
required: ["projectRoot"],
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: "design-test-strategy",
|
|
170
|
-
description:
|
|
171
|
-
"Design comprehensive testing strategy for the project",
|
|
172
|
-
inputSchema: {
|
|
173
|
-
type: "object",
|
|
174
|
-
properties: {
|
|
175
|
-
projectRoot: { type: "string" },
|
|
176
|
-
projectType: {
|
|
177
|
-
type: "string",
|
|
178
|
-
enum: ["web", "api", "mobile", "desktop"],
|
|
179
|
-
},
|
|
180
|
-
complexity: {
|
|
181
|
-
type: "string",
|
|
182
|
-
enum: ["simple", "medium", "complex"],
|
|
183
|
-
},
|
|
184
|
-
timeline: {
|
|
185
|
-
type: "string",
|
|
186
|
-
enum: ["agile", "waterfall", "continuous"],
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
required: ["projectRoot"],
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
name: "identify-test-gaps",
|
|
194
|
-
description: "Identify untested code and recommend test cases",
|
|
195
|
-
inputSchema: {
|
|
196
|
-
type: "object",
|
|
197
|
-
properties: {
|
|
198
|
-
projectRoot: { type: "string" },
|
|
199
|
-
sourceFiles: { type: "array", items: { type: "string" } },
|
|
200
|
-
existingTests: { type: "array", items: { type: "string" } },
|
|
201
|
-
},
|
|
202
|
-
required: ["projectRoot"],
|
|
203
|
-
},
|
|
158
|
+
{
|
|
159
|
+
name: "identify-test-gaps",
|
|
160
|
+
description: "Identify untested code and recommend test cases",
|
|
161
|
+
inputSchema: {
|
|
162
|
+
type: "object",
|
|
163
|
+
properties: {
|
|
164
|
+
projectRoot: { type: "string" },
|
|
165
|
+
sourceFiles: { type: "array", items: { type: "string" } },
|
|
166
|
+
existingTests: { type: "array", items: { type: "string" } },
|
|
204
167
|
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
},
|
|
168
|
+
required: ["projectRoot"],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "optimize-test-coverage",
|
|
173
|
+
description: "Analyze and optimize test coverage patterns",
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
projectRoot: { type: "string" },
|
|
178
|
+
currentCoverage: { type: "number" },
|
|
179
|
+
targetCoverage: { type: "number", default: 85 },
|
|
180
|
+
focusAreas: { type: "array", items: { type: "string" } },
|
|
218
181
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
exports: {
|
|
234
|
-
type: "array",
|
|
235
|
-
items: {
|
|
236
|
-
type: "object",
|
|
237
|
-
properties: {
|
|
238
|
-
name: { type: "string" },
|
|
239
|
-
type: { type: "string" },
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
description: "Exported functions/classes to test",
|
|
243
|
-
},
|
|
244
|
-
testFilePath: {
|
|
245
|
-
type: "string",
|
|
246
|
-
description: "Path for generated test file",
|
|
247
|
-
},
|
|
248
|
-
directory: { type: "string", description: "Project directory" },
|
|
249
|
-
},
|
|
250
|
-
required: [
|
|
251
|
-
"sourceFile",
|
|
252
|
-
"sourceContent",
|
|
253
|
-
"exports",
|
|
254
|
-
"testFilePath",
|
|
255
|
-
],
|
|
256
|
-
},
|
|
182
|
+
required: ["projectRoot"],
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "generate-test-file",
|
|
187
|
+
description: "Generate test file for a source file with exports",
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: "object",
|
|
190
|
+
properties: {
|
|
191
|
+
sourceFile: { type: "string", description: "Path to source file" },
|
|
192
|
+
sourceContent: { type: "string", description: "Source file content" },
|
|
193
|
+
exports: { type: "array", items: { type: "object", properties: { name: { type: "string" }, type: { type: "string" } } }, description: "Exported functions/classes to test" },
|
|
194
|
+
testFilePath: { type: "string", description: "Path for generated test file" },
|
|
195
|
+
directory: { type: "string", description: "Project directory" },
|
|
257
196
|
},
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
this.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return await this.designTestStrategy(args as unknown as DesignTestStrategyArgs);
|
|
271
|
-
case "identify-test-gaps":
|
|
272
|
-
return await this.identifyTestGaps(args as unknown as IdentifyTestGapsArgs);
|
|
273
|
-
case "optimize-test-coverage":
|
|
274
|
-
return await this.optimizeTestCoverage(args as unknown as OptimizeTestCoverageArgs);
|
|
275
|
-
case "generate-test-file":
|
|
276
|
-
return await this.generateTestFile(args as unknown as GenerateTestFileArgs);
|
|
277
|
-
default:
|
|
278
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
279
|
-
}
|
|
280
|
-
} catch (error) {
|
|
281
|
-
frameworkLogger.log("mcps/testing-strategy", "tool", "error", { tool: name, error: String(error) });
|
|
282
|
-
throw error;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
197
|
+
required: ["sourceFile", "sourceContent", "exports", "testFilePath"],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
this.handlers = {
|
|
202
|
+
"analyze-test-coverage": async (args) => this.analyzeTestCoverage(args as unknown as AnalyzeTestCoverageArgs),
|
|
203
|
+
"design-test-strategy": async (args) => this.designTestStrategy(args as unknown as DesignTestStrategyArgs),
|
|
204
|
+
"identify-test-gaps": async (args) => this.identifyTestGaps(args as unknown as IdentifyTestGapsArgs),
|
|
205
|
+
"optimize-test-coverage": async (args) => this.optimizeTestCoverage(args as unknown as OptimizeTestCoverageArgs),
|
|
206
|
+
"generate-test-file": async (args) => this.generateTestFile(args as unknown as GenerateTestFileArgs),
|
|
207
|
+
};
|
|
208
|
+
this.setupToolHandlers();
|
|
285
209
|
}
|
|
286
210
|
|
|
287
211
|
private async analyzeTestCoverage(args: AnalyzeTestCoverageArgs) {
|
|
@@ -1151,22 +1075,12 @@ describe("${pathModule.basename(sourceFile, ".ts")}", () => {${testCases}
|
|
|
1151
1075
|
return ignorePatterns.some((pattern) => pattern.test(filePath));
|
|
1152
1076
|
}
|
|
1153
1077
|
|
|
1154
|
-
async run(): Promise<void> {
|
|
1155
|
-
const transport = new StdioServerTransport();
|
|
1156
|
-
await this.server.connect(transport);
|
|
1157
|
-
|
|
1158
|
-
// Use centralized shutdown handler
|
|
1159
|
-
createGracefulShutdown({
|
|
1160
|
-
serverName: "testing-strategy.server",
|
|
1161
|
-
server: this.server,
|
|
1162
|
-
});
|
|
1163
|
-
}
|
|
1164
1078
|
}
|
|
1165
1079
|
|
|
1166
1080
|
// Start the server if run directly
|
|
1167
1081
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1168
1082
|
const server = new XrayTestingStrategyServer();
|
|
1169
|
-
server.run().catch(() => {});
|
|
1083
|
+
server.run("testing-strategy").catch((err) => { frameworkLogger.log("testing-strategy", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1170
1084
|
}
|
|
1171
1085
|
|
|
1172
1086
|
export default XrayTestingStrategyServer;
|