0xray 2.1.1 → 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 +3 -2
- package/README.md +12 -11
- package/dist/AGENTS.md +3 -2
- 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 +14 -10
- package/scripts/node/setup.cjs +32 -0
- 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/agents_template.md +109 -0
- package/xray/codex.json +598 -0
- package/xray/config.json +26 -0
- package/xray/features.json +132 -0
- package/xray/integrations.json +23 -0
- package/xray/routing-mappings.json +752 -0
- package/xray/workflow_state.json +28 -0
- 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
|
@@ -3,13 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Advanced processor pipeline with codex validation, compliance monitoring, and framework enforcement
|
|
5
5
|
*/
|
|
6
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
9
6
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
10
7
|
import { CodexLoader } from "../enforcement/loaders/codex-loader.js";
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
9
|
+
class XrayProcessorPipelineServer extends XrayKnowledgeSkillBase {
|
|
13
10
|
codexLoader;
|
|
14
11
|
codexRules = [];
|
|
15
12
|
codexTerms = [
|
|
@@ -24,14 +21,74 @@ class XrayProcessorPipelineServer {
|
|
|
24
21
|
"Test Coverage >85%",
|
|
25
22
|
];
|
|
26
23
|
constructor() {
|
|
24
|
+
super("processor-pipeline", "2.0.1");
|
|
27
25
|
this.codexLoader = new CodexLoader();
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
this.tools = [
|
|
27
|
+
{
|
|
28
|
+
name: "execute-pre-processors",
|
|
29
|
+
description: "Run pre-execution processors on content with codex validation",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
content: { type: "string" },
|
|
34
|
+
context: { type: "object" },
|
|
35
|
+
validateCodex: { type: "boolean", default: true },
|
|
36
|
+
strictMode: { type: "boolean", default: false },
|
|
37
|
+
},
|
|
38
|
+
required: ["content"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "execute-post-processors",
|
|
43
|
+
description: "Run post-execution processors on results with compliance monitoring",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
properties: {
|
|
47
|
+
content: { type: "string" },
|
|
48
|
+
results: { type: "object" },
|
|
49
|
+
enforceCompliance: { type: "boolean", default: true },
|
|
50
|
+
auditTrail: { type: "boolean", default: true },
|
|
51
|
+
},
|
|
52
|
+
required: ["content"],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "codex-validation",
|
|
57
|
+
description: "Validate content against Universal Development Codex terms",
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
content: { type: "string" },
|
|
62
|
+
terms: {
|
|
63
|
+
type: "array",
|
|
64
|
+
items: { type: "string" },
|
|
65
|
+
default: ["all"],
|
|
66
|
+
},
|
|
67
|
+
strict: { type: "boolean", default: false },
|
|
68
|
+
},
|
|
69
|
+
required: ["content"],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "framework-compliance-check",
|
|
74
|
+
description: "Check framework compliance and generate enforcement actions",
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: "object",
|
|
77
|
+
properties: {
|
|
78
|
+
content: { type: "string" },
|
|
79
|
+
operation: { type: "string" },
|
|
80
|
+
context: { type: "object" },
|
|
81
|
+
},
|
|
82
|
+
required: ["content", "operation"],
|
|
83
|
+
},
|
|
33
84
|
},
|
|
34
|
-
|
|
85
|
+
];
|
|
86
|
+
this.handlers = {
|
|
87
|
+
"execute-pre-processors": async (args) => this.handlePreProcessors(args),
|
|
88
|
+
"execute-post-processors": async (args) => this.handlePostProcessors(args),
|
|
89
|
+
"codex-validation": async (args) => this.handleCodexValidation(args),
|
|
90
|
+
"framework-compliance-check": async (args) => this.handleComplianceCheck(args),
|
|
91
|
+
};
|
|
35
92
|
this.setupToolHandlers();
|
|
36
93
|
this.loadCodexRules();
|
|
37
94
|
// Server initialized silently - use frameworkLogger for important events
|
|
@@ -47,89 +104,6 @@ class XrayProcessorPipelineServer {
|
|
|
47
104
|
await frameworkLogger.log("mcps/processor-pipeline", "codex-rules-load-failed", "warning", { message: `Failed to load codex rules: ${error instanceof Error ? error.message : String(error)}` });
|
|
48
105
|
}
|
|
49
106
|
}
|
|
50
|
-
setupToolHandlers() {
|
|
51
|
-
// List available tools
|
|
52
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
53
|
-
return {
|
|
54
|
-
tools: [
|
|
55
|
-
{
|
|
56
|
-
name: "execute-pre-processors",
|
|
57
|
-
description: "Run pre-execution processors on content with codex validation",
|
|
58
|
-
inputSchema: {
|
|
59
|
-
type: "object",
|
|
60
|
-
properties: {
|
|
61
|
-
content: { type: "string" },
|
|
62
|
-
context: { type: "object" },
|
|
63
|
-
validateCodex: { type: "boolean", default: true },
|
|
64
|
-
strictMode: { type: "boolean", default: false },
|
|
65
|
-
},
|
|
66
|
-
required: ["content"],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "execute-post-processors",
|
|
71
|
-
description: "Run post-execution processors on results with compliance monitoring",
|
|
72
|
-
inputSchema: {
|
|
73
|
-
type: "object",
|
|
74
|
-
properties: {
|
|
75
|
-
content: { type: "string" },
|
|
76
|
-
results: { type: "object" },
|
|
77
|
-
enforceCompliance: { type: "boolean", default: true },
|
|
78
|
-
auditTrail: { type: "boolean", default: true },
|
|
79
|
-
},
|
|
80
|
-
required: ["content"],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "codex-validation",
|
|
85
|
-
description: "Validate content against Universal Development Codex terms",
|
|
86
|
-
inputSchema: {
|
|
87
|
-
type: "object",
|
|
88
|
-
properties: {
|
|
89
|
-
content: { type: "string" },
|
|
90
|
-
terms: {
|
|
91
|
-
type: "array",
|
|
92
|
-
items: { type: "string" },
|
|
93
|
-
default: ["all"],
|
|
94
|
-
},
|
|
95
|
-
strict: { type: "boolean", default: false },
|
|
96
|
-
},
|
|
97
|
-
required: ["content"],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "framework-compliance-check",
|
|
102
|
-
description: "Check framework compliance and generate enforcement actions",
|
|
103
|
-
inputSchema: {
|
|
104
|
-
type: "object",
|
|
105
|
-
properties: {
|
|
106
|
-
content: { type: "string" },
|
|
107
|
-
operation: { type: "string" },
|
|
108
|
-
context: { type: "object" },
|
|
109
|
-
},
|
|
110
|
-
required: ["content", "operation"],
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
// Handle tool calls
|
|
117
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
118
|
-
const { name, arguments: args } = request.params;
|
|
119
|
-
switch (name) {
|
|
120
|
-
case "execute-pre-processors":
|
|
121
|
-
return await this.handlePreProcessors(args);
|
|
122
|
-
case "execute-post-processors":
|
|
123
|
-
return await this.handlePostProcessors(args);
|
|
124
|
-
case "codex-validation":
|
|
125
|
-
return await this.handleCodexValidation(args);
|
|
126
|
-
case "framework-compliance-check":
|
|
127
|
-
return await this.handleComplianceCheck(args);
|
|
128
|
-
default:
|
|
129
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
107
|
async handlePreProcessors(args) {
|
|
134
108
|
const content = args.content;
|
|
135
109
|
const context = args.context || {};
|
|
@@ -547,15 +521,10 @@ ${complianceResults.actions.map((a) => `• 🔧 ${a}`).join("\n") || "None requ
|
|
|
547
521
|
}
|
|
548
522
|
return results;
|
|
549
523
|
}
|
|
550
|
-
async run() {
|
|
551
|
-
const transport = new StdioServerTransport();
|
|
552
|
-
await this.server.connect(transport);
|
|
553
|
-
// Silent start - no console output
|
|
554
|
-
}
|
|
555
524
|
}
|
|
556
525
|
// Start the server if run directly
|
|
557
526
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
558
527
|
const server = new XrayProcessorPipelineServer();
|
|
559
|
-
server.run().catch((error) => frameworkLogger.log("mcps/processor-pipeline", "run", "error", { error: String(error) }));
|
|
528
|
+
server.run("processor-pipeline").catch((error) => frameworkLogger.log("mcps/processor-pipeline", "run", "error", { error: String(error) }));
|
|
560
529
|
}
|
|
561
530
|
export { XrayProcessorPipelineServer };
|
package/dist/mcps/registry.json
CHANGED
|
@@ -7,17 +7,16 @@
|
|
|
7
7
|
* NOTE: Class is named XrayLibrarianServer but the MCP server name is
|
|
8
8
|
* "researcher" for backwards compatibility with existing tool references.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
11
12
|
interface AnalyzeProposalArgs {
|
|
12
13
|
proposalTitle?: string;
|
|
13
14
|
proposalDescription?: string;
|
|
14
15
|
evidence?: string[];
|
|
15
16
|
proposalType?: string;
|
|
16
17
|
}
|
|
17
|
-
declare class XrayLibrarianServer {
|
|
18
|
-
private server;
|
|
18
|
+
declare class XrayLibrarianServer extends XrayKnowledgeSkillBase {
|
|
19
19
|
constructor();
|
|
20
|
-
private setupToolHandlers;
|
|
21
20
|
private searchCodebase;
|
|
22
21
|
private findImplementation;
|
|
23
22
|
private getDocumentation;
|
|
@@ -26,6 +25,5 @@ declare class XrayLibrarianServer {
|
|
|
26
25
|
* Uses corpus patterns, historical recurrence, and architecture knowledge.
|
|
27
26
|
*/
|
|
28
27
|
analyzeProposal(args: AnalyzeProposalArgs): Promise<CallToolResult>;
|
|
29
|
-
run(): Promise<void>;
|
|
30
28
|
}
|
|
31
29
|
export { XrayLibrarianServer };
|
|
@@ -7,121 +7,97 @@
|
|
|
7
7
|
* NOTE: Class is named XrayLibrarianServer but the MCP server name is
|
|
8
8
|
* "researcher" for backwards compatibility with existing tool references.
|
|
9
9
|
*/
|
|
10
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
11
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
13
10
|
import * as fs from "fs";
|
|
14
11
|
import * as path from "path";
|
|
15
12
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
14
|
+
class XrayLibrarianServer extends XrayKnowledgeSkillBase {
|
|
18
15
|
constructor() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
tools: [
|
|
32
|
-
{
|
|
33
|
-
name: "search_codebase",
|
|
34
|
-
description: "Search the codebase for specific patterns, functions, or implementations",
|
|
35
|
-
inputSchema: {
|
|
36
|
-
type: "object",
|
|
37
|
-
properties: {
|
|
38
|
-
query: {
|
|
39
|
-
type: "string",
|
|
40
|
-
description: "Search query (function name, pattern, keyword)",
|
|
41
|
-
},
|
|
42
|
-
fileExtension: {
|
|
43
|
-
type: "string",
|
|
44
|
-
description: "File extension to search (e.g., '.ts', '.js')",
|
|
45
|
-
default: ".ts",
|
|
46
|
-
},
|
|
47
|
-
maxResults: {
|
|
48
|
-
type: "number",
|
|
49
|
-
description: "Maximum number of results to return",
|
|
50
|
-
default: 10,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
required: ["query"],
|
|
16
|
+
super("researcher", "2.0.1");
|
|
17
|
+
this.tools = [
|
|
18
|
+
{
|
|
19
|
+
name: "search_codebase",
|
|
20
|
+
description: "Search the codebase for specific patterns, functions, or implementations",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
query: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Search query (function name, pattern, keyword)",
|
|
54
27
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
description: "Feature name to find implementations for",
|
|
65
|
-
},
|
|
66
|
-
context: {
|
|
67
|
-
type: "string",
|
|
68
|
-
description: "Additional context (e.g., 'MCP', 'testing', 'agent')",
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
required: ["feature"],
|
|
28
|
+
fileExtension: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "File extension to search (e.g., '.ts', '.js')",
|
|
31
|
+
default: ".ts",
|
|
32
|
+
},
|
|
33
|
+
maxResults: {
|
|
34
|
+
type: "number",
|
|
35
|
+
description: "Maximum number of results to return",
|
|
36
|
+
default: 10,
|
|
72
37
|
},
|
|
73
38
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
required: ["target"],
|
|
39
|
+
required: ["query"],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "find_implementation",
|
|
44
|
+
description: "Find implementation examples for a specific pattern or feature",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
feature: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Feature name to find implementations for",
|
|
51
|
+
},
|
|
52
|
+
context: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Additional context (e.g., 'MCP', 'testing', 'agent')",
|
|
91
55
|
},
|
|
92
56
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
57
|
+
required: ["feature"],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "get_documentation",
|
|
62
|
+
description: "Get documentation for a specific module, class, or function",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
target: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Module, class, or function name",
|
|
69
|
+
},
|
|
70
|
+
includeExamples: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Include usage examples",
|
|
73
|
+
default: true,
|
|
105
74
|
},
|
|
106
75
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
76
|
+
required: ["target"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "analyze_proposal",
|
|
81
|
+
description: "Analyze an inference proposal from a researcher / project-librarian perspective using corpus patterns, historical evidence, and architecture knowledge",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
proposalTitle: { type: "string" },
|
|
86
|
+
proposalDescription: { type: "string" },
|
|
87
|
+
evidence: { type: "array", items: { type: "string" } },
|
|
88
|
+
proposalType: { type: "string" },
|
|
89
|
+
},
|
|
90
|
+
required: ["proposalTitle", "proposalDescription"],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
this.handlers = {
|
|
95
|
+
"search_codebase": async (args) => this.searchCodebase(args),
|
|
96
|
+
"find_implementation": async (args) => this.findImplementation(args),
|
|
97
|
+
"get_documentation": async (args) => this.getDocumentation(args),
|
|
98
|
+
"analyze_proposal": async (args) => this.analyzeProposal(args),
|
|
99
|
+
};
|
|
100
|
+
this.setupToolHandlers();
|
|
125
101
|
}
|
|
126
102
|
async searchCodebase(args) {
|
|
127
103
|
const { query, fileExtension = ".ts", maxResults = 10 } = args;
|
|
@@ -446,59 +422,10 @@ class XrayLibrarianServer {
|
|
|
446
422
|
],
|
|
447
423
|
};
|
|
448
424
|
}
|
|
449
|
-
async run() {
|
|
450
|
-
const transport = new StdioServerTransport();
|
|
451
|
-
await this.server.connect(transport);
|
|
452
|
-
let parentCheckTimer = null;
|
|
453
|
-
const cleanup = async (signal) => {
|
|
454
|
-
if (parentCheckTimer !== null) {
|
|
455
|
-
clearTimeout(parentCheckTimer);
|
|
456
|
-
parentCheckTimer = null;
|
|
457
|
-
}
|
|
458
|
-
const timeout = setTimeout(() => {
|
|
459
|
-
frameworkLogger.log("mcps/researcher", "shutdown", "error", { message: "Graceful shutdown timeout, forcing exit..." });
|
|
460
|
-
process.exit(1);
|
|
461
|
-
}, 5000);
|
|
462
|
-
try {
|
|
463
|
-
if (this.server && typeof this.server.close === "function") {
|
|
464
|
-
await this.server.close();
|
|
465
|
-
}
|
|
466
|
-
clearTimeout(timeout);
|
|
467
|
-
process.exit(0);
|
|
468
|
-
}
|
|
469
|
-
catch (error) {
|
|
470
|
-
clearTimeout(timeout);
|
|
471
|
-
frameworkLogger.log("mcps/researcher", "shutdown", "error", { message: `Error during server shutdown: ${String(error)}` });
|
|
472
|
-
process.exit(1);
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
process.on("SIGINT", () => cleanup("SIGINT"));
|
|
476
|
-
process.on("SIGTERM", () => cleanup("SIGTERM"));
|
|
477
|
-
process.on("SIGHUP", () => cleanup("SIGHUP"));
|
|
478
|
-
const checkParent = () => {
|
|
479
|
-
try {
|
|
480
|
-
process.kill(process.ppid, 0);
|
|
481
|
-
parentCheckTimer = setTimeout(checkParent, 1000);
|
|
482
|
-
}
|
|
483
|
-
catch (error) {
|
|
484
|
-
parentCheckTimer = null;
|
|
485
|
-
cleanup("parent-process-death");
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
parentCheckTimer = setTimeout(checkParent, 2000);
|
|
489
|
-
process.on("uncaughtException", (error) => {
|
|
490
|
-
frameworkLogger.log("mcps/researcher", "uncaughtException", "error", { message: `Uncaught Exception: ${String(error)}` });
|
|
491
|
-
cleanup("uncaughtException");
|
|
492
|
-
});
|
|
493
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
494
|
-
frameworkLogger.log("mcps/researcher", "unhandledRejection", "error", { message: `Unhandled Rejection: ${String(reason)}` });
|
|
495
|
-
cleanup("unhandledRejection");
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
425
|
}
|
|
499
426
|
// Run the server if this file is executed directly
|
|
500
427
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
501
428
|
const server = new XrayLibrarianServer();
|
|
502
|
-
server.run().catch((error) => frameworkLogger.log("mcps/researcher", "run", "error", { error: String(error) }));
|
|
429
|
+
server.run("researcher").catch((error) => frameworkLogger.log("mcps/researcher", "run", "error", { error: String(error) }));
|
|
503
430
|
}
|
|
504
431
|
export { XrayLibrarianServer };
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Automated security vulnerability scanning with dependency and code analysis
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
7
|
+
declare class XraySecurityScanServer extends XrayKnowledgeSkillBase {
|
|
8
8
|
constructor();
|
|
9
|
-
private setupToolHandlers;
|
|
10
9
|
private handleSecurityScan;
|
|
11
10
|
private handleDependencyAudit;
|
|
12
11
|
private detectPackageManager;
|
|
@@ -15,6 +14,5 @@ declare class XraySecurityScanServer {
|
|
|
15
14
|
private findCodeFiles;
|
|
16
15
|
private analyzeFileForSecurity;
|
|
17
16
|
private generateSecuritySummary;
|
|
18
|
-
run(): Promise<void>;
|
|
19
17
|
}
|
|
20
18
|
export { XraySecurityScanServer };
|