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
|
@@ -4,15 +4,10 @@
|
|
|
4
4
|
* Advanced processor pipeline with codex validation, compliance monitoring, and framework enforcement
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
-
import {
|
|
10
|
-
CallToolRequestSchema,
|
|
11
|
-
ListToolsRequestSchema,
|
|
12
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
7
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
14
8
|
import { CodexLoader } from "../enforcement/loaders/codex-loader.js";
|
|
15
9
|
import type { RuleDefinition, RuleValidationContext } from "../enforcement/types.js";
|
|
10
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
16
11
|
|
|
17
12
|
interface PreProcessorArgs {
|
|
18
13
|
content: string;
|
|
@@ -87,8 +82,7 @@ interface FrameworkComplianceResult {
|
|
|
87
82
|
approved: boolean;
|
|
88
83
|
}
|
|
89
84
|
|
|
90
|
-
class XrayProcessorPipelineServer {
|
|
91
|
-
private server: Server;
|
|
85
|
+
class XrayProcessorPipelineServer extends XrayKnowledgeSkillBase {
|
|
92
86
|
private codexLoader: CodexLoader;
|
|
93
87
|
private codexRules: RuleDefinition[] = [];
|
|
94
88
|
private codexTerms: string[] = [
|
|
@@ -104,17 +98,81 @@ class XrayProcessorPipelineServer {
|
|
|
104
98
|
];
|
|
105
99
|
|
|
106
100
|
constructor() {
|
|
101
|
+
super("processor-pipeline", "2.0.1");
|
|
102
|
+
|
|
107
103
|
this.codexLoader = new CodexLoader();
|
|
108
|
-
|
|
104
|
+
|
|
105
|
+
this.tools = [
|
|
106
|
+
{
|
|
107
|
+
name: "execute-pre-processors",
|
|
108
|
+
description:
|
|
109
|
+
"Run pre-execution processors on content with codex validation",
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: "object",
|
|
112
|
+
properties: {
|
|
113
|
+
content: { type: "string" },
|
|
114
|
+
context: { type: "object" },
|
|
115
|
+
validateCodex: { type: "boolean", default: true },
|
|
116
|
+
strictMode: { type: "boolean", default: false },
|
|
117
|
+
},
|
|
118
|
+
required: ["content"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
109
121
|
{
|
|
110
|
-
name: "
|
|
122
|
+
name: "execute-post-processors",
|
|
123
|
+
description:
|
|
124
|
+
"Run post-execution processors on results with compliance monitoring",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
content: { type: "string" },
|
|
129
|
+
results: { type: "object" },
|
|
130
|
+
enforceCompliance: { type: "boolean", default: true },
|
|
131
|
+
auditTrail: { type: "boolean", default: true },
|
|
132
|
+
},
|
|
133
|
+
required: ["content"],
|
|
134
|
+
},
|
|
111
135
|
},
|
|
112
136
|
{
|
|
113
|
-
|
|
114
|
-
|
|
137
|
+
name: "codex-validation",
|
|
138
|
+
description:
|
|
139
|
+
"Validate content against Universal Development Codex terms",
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
content: { type: "string" },
|
|
144
|
+
terms: {
|
|
145
|
+
type: "array",
|
|
146
|
+
items: { type: "string" },
|
|
147
|
+
default: ["all"],
|
|
148
|
+
},
|
|
149
|
+
strict: { type: "boolean", default: false },
|
|
150
|
+
},
|
|
151
|
+
required: ["content"],
|
|
115
152
|
},
|
|
116
153
|
},
|
|
117
|
-
|
|
154
|
+
{
|
|
155
|
+
name: "framework-compliance-check",
|
|
156
|
+
description:
|
|
157
|
+
"Check framework compliance and generate enforcement actions",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
content: { type: "string" },
|
|
162
|
+
operation: { type: "string" },
|
|
163
|
+
context: { type: "object" },
|
|
164
|
+
},
|
|
165
|
+
required: ["content", "operation"],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
this.handlers = {
|
|
171
|
+
"execute-pre-processors": async (args) => this.handlePreProcessors(args as unknown as PreProcessorArgs),
|
|
172
|
+
"execute-post-processors": async (args) => this.handlePostProcessors(args as unknown as PostProcessorArgs),
|
|
173
|
+
"codex-validation": async (args) => this.handleCodexValidation(args as unknown as CodexValidationArgs),
|
|
174
|
+
"framework-compliance-check": async (args) => this.handleComplianceCheck(args as unknown as ComplianceCheckArgs),
|
|
175
|
+
};
|
|
118
176
|
|
|
119
177
|
this.setupToolHandlers();
|
|
120
178
|
this.loadCodexRules();
|
|
@@ -142,96 +200,6 @@ class XrayProcessorPipelineServer {
|
|
|
142
200
|
}
|
|
143
201
|
}
|
|
144
202
|
|
|
145
|
-
private setupToolHandlers() {
|
|
146
|
-
// List available tools
|
|
147
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
148
|
-
return {
|
|
149
|
-
tools: [
|
|
150
|
-
{
|
|
151
|
-
name: "execute-pre-processors",
|
|
152
|
-
description:
|
|
153
|
-
"Run pre-execution processors on content with codex validation",
|
|
154
|
-
inputSchema: {
|
|
155
|
-
type: "object",
|
|
156
|
-
properties: {
|
|
157
|
-
content: { type: "string" },
|
|
158
|
-
context: { type: "object" },
|
|
159
|
-
validateCodex: { type: "boolean", default: true },
|
|
160
|
-
strictMode: { type: "boolean", default: false },
|
|
161
|
-
},
|
|
162
|
-
required: ["content"],
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: "execute-post-processors",
|
|
167
|
-
description:
|
|
168
|
-
"Run post-execution processors on results with compliance monitoring",
|
|
169
|
-
inputSchema: {
|
|
170
|
-
type: "object",
|
|
171
|
-
properties: {
|
|
172
|
-
content: { type: "string" },
|
|
173
|
-
results: { type: "object" },
|
|
174
|
-
enforceCompliance: { type: "boolean", default: true },
|
|
175
|
-
auditTrail: { type: "boolean", default: true },
|
|
176
|
-
},
|
|
177
|
-
required: ["content"],
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
name: "codex-validation",
|
|
182
|
-
description:
|
|
183
|
-
"Validate content against Universal Development Codex terms",
|
|
184
|
-
inputSchema: {
|
|
185
|
-
type: "object",
|
|
186
|
-
properties: {
|
|
187
|
-
content: { type: "string" },
|
|
188
|
-
terms: {
|
|
189
|
-
type: "array",
|
|
190
|
-
items: { type: "string" },
|
|
191
|
-
default: ["all"],
|
|
192
|
-
},
|
|
193
|
-
strict: { type: "boolean", default: false },
|
|
194
|
-
},
|
|
195
|
-
required: ["content"],
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
name: "framework-compliance-check",
|
|
200
|
-
description:
|
|
201
|
-
"Check framework compliance and generate enforcement actions",
|
|
202
|
-
inputSchema: {
|
|
203
|
-
type: "object",
|
|
204
|
-
properties: {
|
|
205
|
-
content: { type: "string" },
|
|
206
|
-
operation: { type: "string" },
|
|
207
|
-
context: { type: "object" },
|
|
208
|
-
},
|
|
209
|
-
required: ["content", "operation"],
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
],
|
|
213
|
-
};
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
// Handle tool calls
|
|
217
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
218
|
-
const { name, arguments: args } = request.params;
|
|
219
|
-
|
|
220
|
-
switch (name) {
|
|
221
|
-
case "execute-pre-processors":
|
|
222
|
-
return await this.handlePreProcessors(args as unknown as PreProcessorArgs);
|
|
223
|
-
case "execute-post-processors":
|
|
224
|
-
return await this.handlePostProcessors(args as unknown as PostProcessorArgs);
|
|
225
|
-
case "codex-validation":
|
|
226
|
-
return await this.handleCodexValidation(args as unknown as CodexValidationArgs);
|
|
227
|
-
case "framework-compliance-check":
|
|
228
|
-
return await this.handleComplianceCheck(args as unknown as ComplianceCheckArgs);
|
|
229
|
-
default:
|
|
230
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
|
|
235
203
|
private async handlePreProcessors(args: PreProcessorArgs) {
|
|
236
204
|
const content = args.content;
|
|
237
205
|
const context = args.context || {};
|
|
@@ -761,18 +729,12 @@ ${complianceResults.actions.map((a: string) => `• 🔧 ${a}`).join("\n") || "N
|
|
|
761
729
|
|
|
762
730
|
return results;
|
|
763
731
|
}
|
|
764
|
-
|
|
765
|
-
async run() {
|
|
766
|
-
const transport = new StdioServerTransport();
|
|
767
|
-
await this.server.connect(transport);
|
|
768
|
-
// Silent start - no console output
|
|
769
|
-
}
|
|
770
732
|
}
|
|
771
733
|
|
|
772
734
|
// Start the server if run directly
|
|
773
735
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
774
736
|
const server = new XrayProcessorPipelineServer();
|
|
775
|
-
server.run().catch((error) => frameworkLogger.log("mcps/processor-pipeline", "run", "error", { error: String(error) }));
|
|
737
|
+
server.run("processor-pipeline").catch((error) => frameworkLogger.log("mcps/processor-pipeline", "run", "error", { error: String(error) }));
|
|
776
738
|
}
|
|
777
739
|
|
|
778
740
|
export { XrayProcessorPipelineServer };
|
package/src/mcps/registry.json
CHANGED
|
@@ -8,16 +8,11 @@
|
|
|
8
8
|
* "researcher" for backwards compatibility with existing tool references.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
-
import {
|
|
14
|
-
CallToolRequestSchema,
|
|
15
|
-
ListToolsRequestSchema,
|
|
16
|
-
type CallToolResult,
|
|
17
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
18
12
|
import * as fs from "fs";
|
|
19
13
|
import * as path from "path";
|
|
20
14
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
15
|
+
import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
|
|
21
16
|
|
|
22
17
|
interface SearchResult {
|
|
23
18
|
file: string;
|
|
@@ -48,128 +43,101 @@ interface AnalyzeProposalArgs {
|
|
|
48
43
|
proposalType?: string;
|
|
49
44
|
}
|
|
50
45
|
|
|
51
|
-
class XrayLibrarianServer {
|
|
52
|
-
private server: Server;
|
|
53
|
-
|
|
46
|
+
class XrayLibrarianServer extends XrayKnowledgeSkillBase {
|
|
54
47
|
constructor() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
48
|
+
super("researcher", "2.0.1");
|
|
49
|
+
|
|
50
|
+
this.tools = [
|
|
59
51
|
{
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
name: "search_codebase",
|
|
53
|
+
description:
|
|
54
|
+
"Search the codebase for specific patterns, functions, or implementations",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
query: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Search query (function name, pattern, keyword)",
|
|
61
|
+
},
|
|
62
|
+
fileExtension: {
|
|
63
|
+
type: "string",
|
|
64
|
+
description: "File extension to search (e.g., '.ts', '.js')",
|
|
65
|
+
default: ".ts",
|
|
66
|
+
},
|
|
67
|
+
maxResults: {
|
|
68
|
+
type: "number",
|
|
69
|
+
description: "Maximum number of results to return",
|
|
70
|
+
default: 10,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
required: ["query"],
|
|
62
74
|
},
|
|
63
75
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
name: "search_codebase",
|
|
75
|
-
description:
|
|
76
|
-
"Search the codebase for specific patterns, functions, or implementations",
|
|
77
|
-
inputSchema: {
|
|
78
|
-
type: "object",
|
|
79
|
-
properties: {
|
|
80
|
-
query: {
|
|
81
|
-
type: "string",
|
|
82
|
-
description: "Search query (function name, pattern, keyword)",
|
|
83
|
-
},
|
|
84
|
-
fileExtension: {
|
|
85
|
-
type: "string",
|
|
86
|
-
description: "File extension to search (e.g., '.ts', '.js')",
|
|
87
|
-
default: ".ts",
|
|
88
|
-
},
|
|
89
|
-
maxResults: {
|
|
90
|
-
type: "number",
|
|
91
|
-
description: "Maximum number of results to return",
|
|
92
|
-
default: 10,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
required: ["query"],
|
|
76
|
+
{
|
|
77
|
+
name: "find_implementation",
|
|
78
|
+
description:
|
|
79
|
+
"Find implementation examples for a specific pattern or feature",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
feature: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Feature name to find implementations for",
|
|
96
86
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"Find implementation examples for a specific pattern or feature",
|
|
102
|
-
inputSchema: {
|
|
103
|
-
type: "object",
|
|
104
|
-
properties: {
|
|
105
|
-
feature: {
|
|
106
|
-
type: "string",
|
|
107
|
-
description: "Feature name to find implementations for",
|
|
108
|
-
},
|
|
109
|
-
context: {
|
|
110
|
-
type: "string",
|
|
111
|
-
description:
|
|
112
|
-
"Additional context (e.g., 'MCP', 'testing', 'agent')",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
required: ["feature"],
|
|
87
|
+
context: {
|
|
88
|
+
type: "string",
|
|
89
|
+
description:
|
|
90
|
+
"Additional context (e.g., 'MCP', 'testing', 'agent')",
|
|
116
91
|
},
|
|
117
92
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
description: "Include usage examples",
|
|
132
|
-
default: true,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
required: ["target"],
|
|
93
|
+
required: ["feature"],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "get_documentation",
|
|
98
|
+
description:
|
|
99
|
+
"Get documentation for a specific module, class, or function",
|
|
100
|
+
inputSchema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
target: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Module, class, or function name",
|
|
136
106
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"Analyze an inference proposal from a researcher / project-librarian perspective using corpus patterns, historical evidence, and architecture knowledge",
|
|
142
|
-
inputSchema: {
|
|
143
|
-
type: "object",
|
|
144
|
-
properties: {
|
|
145
|
-
proposalTitle: { type: "string" },
|
|
146
|
-
proposalDescription: { type: "string" },
|
|
147
|
-
evidence: { type: "array", items: { type: "string" } },
|
|
148
|
-
proposalType: { type: "string" },
|
|
149
|
-
},
|
|
150
|
-
required: ["proposalTitle", "proposalDescription"],
|
|
107
|
+
includeExamples: {
|
|
108
|
+
type: "boolean",
|
|
109
|
+
description: "Include usage examples",
|
|
110
|
+
default: true,
|
|
151
111
|
},
|
|
152
112
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
113
|
+
required: ["target"],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "analyze_proposal",
|
|
118
|
+
description:
|
|
119
|
+
"Analyze an inference proposal from a researcher / project-librarian perspective using corpus patterns, historical evidence, and architecture knowledge",
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: "object",
|
|
122
|
+
properties: {
|
|
123
|
+
proposalTitle: { type: "string" },
|
|
124
|
+
proposalDescription: { type: "string" },
|
|
125
|
+
evidence: { type: "array", items: { type: "string" } },
|
|
126
|
+
proposalType: { type: "string" },
|
|
127
|
+
},
|
|
128
|
+
required: ["proposalTitle", "proposalDescription"],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
this.handlers = {
|
|
134
|
+
"search_codebase": async (args) => this.searchCodebase(args as unknown as SearchCodebaseArgs),
|
|
135
|
+
"find_implementation": async (args) => this.findImplementation(args as unknown as FindImplementationArgs),
|
|
136
|
+
"get_documentation": async (args) => this.getDocumentation(args as unknown as GetDocumentationArgs),
|
|
137
|
+
"analyze_proposal": async (args) => this.analyzeProposal(args as unknown as AnalyzeProposalArgs),
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
this.setupToolHandlers();
|
|
173
141
|
}
|
|
174
142
|
|
|
175
143
|
private async searchCodebase(args: SearchCodebaseArgs) {
|
|
@@ -527,69 +495,12 @@ class XrayLibrarianServer {
|
|
|
527
495
|
],
|
|
528
496
|
};
|
|
529
497
|
}
|
|
530
|
-
|
|
531
|
-
async run(): Promise<void> {
|
|
532
|
-
const transport = new StdioServerTransport();
|
|
533
|
-
await this.server.connect(transport);
|
|
534
|
-
|
|
535
|
-
let parentCheckTimer: ReturnType<typeof setTimeout> | null = null;
|
|
536
|
-
|
|
537
|
-
const cleanup = async (signal: string) => {
|
|
538
|
-
if (parentCheckTimer !== null) {
|
|
539
|
-
clearTimeout(parentCheckTimer);
|
|
540
|
-
parentCheckTimer = null;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
const timeout = setTimeout(() => {
|
|
544
|
-
frameworkLogger.log("mcps/researcher", "shutdown", "error", { message: "Graceful shutdown timeout, forcing exit..." });
|
|
545
|
-
process.exit(1);
|
|
546
|
-
}, 5000);
|
|
547
|
-
|
|
548
|
-
try {
|
|
549
|
-
if (this.server && typeof this.server.close === "function") {
|
|
550
|
-
await this.server.close();
|
|
551
|
-
}
|
|
552
|
-
clearTimeout(timeout);
|
|
553
|
-
process.exit(0);
|
|
554
|
-
} catch (error) {
|
|
555
|
-
clearTimeout(timeout);
|
|
556
|
-
frameworkLogger.log("mcps/researcher", "shutdown", "error", { message: `Error during server shutdown: ${String(error)}` });
|
|
557
|
-
process.exit(1);
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
process.on("SIGINT", () => cleanup("SIGINT"));
|
|
562
|
-
process.on("SIGTERM", () => cleanup("SIGTERM"));
|
|
563
|
-
process.on("SIGHUP", () => cleanup("SIGHUP"));
|
|
564
|
-
|
|
565
|
-
const checkParent = () => {
|
|
566
|
-
try {
|
|
567
|
-
process.kill(process.ppid, 0);
|
|
568
|
-
parentCheckTimer = setTimeout(checkParent, 1000);
|
|
569
|
-
} catch (error) {
|
|
570
|
-
parentCheckTimer = null;
|
|
571
|
-
cleanup("parent-process-death");
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
parentCheckTimer = setTimeout(checkParent, 2000);
|
|
576
|
-
|
|
577
|
-
process.on("uncaughtException", (error) => {
|
|
578
|
-
frameworkLogger.log("mcps/researcher", "uncaughtException", "error", { message: `Uncaught Exception: ${String(error)}` });
|
|
579
|
-
cleanup("uncaughtException");
|
|
580
|
-
});
|
|
581
|
-
|
|
582
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
583
|
-
frameworkLogger.log("mcps/researcher", "unhandledRejection", "error", { message: `Unhandled Rejection: ${String(reason)}` });
|
|
584
|
-
cleanup("unhandledRejection");
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
498
|
}
|
|
588
499
|
|
|
589
500
|
// Run the server if this file is executed directly
|
|
590
501
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
591
502
|
const server = new XrayLibrarianServer();
|
|
592
|
-
server.run().catch((error) => frameworkLogger.log("mcps/researcher", "run", "error", { error: String(error) }));
|
|
503
|
+
server.run("researcher").catch((error) => frameworkLogger.log("mcps/researcher", "run", "error", { error: String(error) }));
|
|
593
504
|
}
|
|
594
505
|
|
|
595
506
|
export { XrayLibrarianServer };
|