0xray 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/.opencode/codex.codex +1 -1
  2. package/.opencode/commands/dependency-audit.md +3 -3
  3. package/.opencode/enforcer-config.json +2 -2
  4. package/AGENTS.md +2 -1
  5. package/README.md +12 -11
  6. package/dist/AGENTS.md +2 -1
  7. package/dist/CHANGELOG.md +38 -0
  8. package/dist/README.md +12 -11
  9. package/dist/agents/code-reviewer.js +1 -1
  10. package/dist/analytics/routing-refiner.js +1 -1
  11. package/dist/cli/index.js +11 -1
  12. package/dist/cli/server.js +3 -3
  13. package/dist/core/activity-logger.d.ts +2 -2
  14. package/dist/core/activity-logger.js +4 -4
  15. package/dist/core/boot-orchestrator.d.ts +1 -1
  16. package/dist/core/boot-orchestrator.js +13 -28
  17. package/dist/core/bridge.mjs +3 -3
  18. package/dist/core/codex-formatter.js +2 -2
  19. package/dist/core/codex-injector.d.ts +0 -1
  20. package/dist/core/codex-injector.js +2 -3
  21. package/dist/core/config-loader.d.ts +1 -1
  22. package/dist/core/config-loader.js +1 -1
  23. package/dist/core/config-paths.d.ts +0 -2
  24. package/dist/core/config-paths.js +7 -8
  25. package/dist/core/context-loader.d.ts +1 -1
  26. package/dist/core/context-loader.js +1 -1
  27. package/dist/core/errors.d.ts +3 -0
  28. package/dist/core/errors.js +10 -0
  29. package/dist/core/features-config.js +1 -1
  30. package/dist/core/framework-logger.d.ts +3 -3
  31. package/dist/core/framework-logger.js +17 -9
  32. package/dist/core/index.d.ts +2 -2
  33. package/dist/core/index.js +4 -2
  34. package/dist/core/logging-config.d.ts +2 -1
  35. package/dist/core/logging-config.js +7 -7
  36. package/dist/enforcement/loaders/codex-loader.js +1 -1
  37. package/dist/execution/opencode-cli-invoker.js +5 -5
  38. package/dist/governance/governance-service.js +1 -1
  39. package/dist/index.d.ts +3 -3
  40. package/dist/index.js +3 -3
  41. package/dist/inference/inference-cycle.d.ts +1 -1
  42. package/dist/inference/inference-cycle.js +10 -10
  43. package/dist/integrations/base/Integration.js +1 -1
  44. package/dist/integrations/base/registry.js +19 -19
  45. package/dist/integrations/grok/grok-cli.js +17 -17
  46. package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
  47. package/dist/integrations/hermes-agent/bridge.mjs +1 -1
  48. package/dist/integrations/openclaw/api-server.d.ts +0 -1
  49. package/dist/integrations/openclaw/api-server.js +7 -10
  50. package/dist/integrations/openclaw/client.d.ts +0 -1
  51. package/dist/integrations/openclaw/client.js +22 -24
  52. package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
  53. package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
  54. package/dist/integrations/plugins/plugin-registry.js +5 -5
  55. package/dist/mcps/architect-tools.server.d.ts +2 -4
  56. package/dist/mcps/architect-tools.server.js +112 -195
  57. package/dist/mcps/auto-format.server.d.ts +2 -4
  58. package/dist/mcps/auto-format.server.js +49 -95
  59. package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
  60. package/dist/mcps/boot-orchestrator.server.js +73 -105
  61. package/dist/mcps/config/server-config-registry.js +3 -3
  62. package/dist/mcps/enforcer-tools.server.d.ts +2 -4
  63. package/dist/mcps/enforcer-tools.server.js +202 -285
  64. package/dist/mcps/estimation.server.d.ts +2 -4
  65. package/dist/mcps/estimation.server.js +63 -107
  66. package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
  67. package/dist/mcps/framework-compliance-audit.server.js +53 -82
  68. package/dist/mcps/framework-help.server.d.ts +2 -4
  69. package/dist/mcps/framework-help.server.js +63 -101
  70. package/dist/mcps/governance.server.js +2 -2
  71. package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
  72. package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
  73. package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
  74. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
  75. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
  76. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
  77. package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
  78. package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
  79. package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
  80. package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
  81. package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
  82. package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
  83. package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
  84. package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
  85. package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
  86. package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
  87. package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
  88. package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
  89. package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
  90. package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
  91. package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
  92. package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
  93. package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
  94. package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
  95. package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
  96. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
  97. package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
  98. package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
  99. package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
  100. package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
  101. package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
  102. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
  103. package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
  104. package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
  105. package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
  106. package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
  107. package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
  108. package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
  109. package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
  110. package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
  111. package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
  112. package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
  113. package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
  114. package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
  115. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
  117. package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
  118. package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
  119. package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
  120. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
  121. package/dist/mcps/lint.server.d.ts +2 -4
  122. package/dist/mcps/lint.server.js +51 -92
  123. package/dist/mcps/mcp-client.js +2 -2
  124. package/dist/mcps/model-health-check.server.d.ts +2 -4
  125. package/dist/mcps/model-health-check.server.js +32 -60
  126. package/dist/mcps/performance-analysis.server.d.ts +2 -4
  127. package/dist/mcps/performance-analysis.server.js +57 -88
  128. package/dist/mcps/processor-pipeline.server.d.ts +2 -4
  129. package/dist/mcps/processor-pipeline.server.js +69 -100
  130. package/dist/mcps/registry.json +1 -1
  131. package/dist/mcps/researcher.server.d.ts +3 -5
  132. package/dist/mcps/researcher.server.js +81 -154
  133. package/dist/mcps/security-scan.server.d.ts +2 -4
  134. package/dist/mcps/security-scan.server.js +54 -96
  135. package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
  136. package/dist/mcps/shared/knowledge-skill-base.js +45 -0
  137. package/dist/{security → mcps/shared}/security-scanner.js +1 -1
  138. package/dist/mcps/state-manager.server.d.ts +2 -4
  139. package/dist/mcps/state-manager.server.js +115 -160
  140. package/dist/orchestrator/orchestrator.d.ts +1 -1
  141. package/dist/orchestrator/orchestrator.js +1 -1
  142. package/dist/orchestrator/universal-registry-bridge.js +1 -1
  143. package/dist/plugin/xray-codex-injection.d.ts +1 -1
  144. package/dist/plugin/xray-codex-injection.js +1 -1
  145. package/dist/postprocessor/PostProcessor.d.ts +4 -44
  146. package/dist/postprocessor/PostProcessor.js +39 -553
  147. package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
  148. package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
  149. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
  150. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
  151. package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
  152. package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
  153. package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
  154. package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
  155. package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
  156. package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
  157. package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
  158. package/dist/processors/processor-manager.js +346 -314
  159. package/dist/reporting/report-formatter.js +1 -1
  160. package/dist/security/security-hardener.d.ts +69 -2
  161. package/dist/security/security-hardener.js +129 -1
  162. package/dist/skills/registry.json +1 -1
  163. package/dist/state/index.d.ts +3 -5
  164. package/dist/state/index.js +1 -7
  165. package/dist/state/state-manager.d.ts +1 -1
  166. package/dist/state/state-manager.js +2 -3
  167. package/package.json +13 -10
  168. package/scripts/node/universal-version-manager.js +11 -11
  169. package/src/mcps/architect-tools.server.ts +112 -215
  170. package/src/mcps/auto-format.server.ts +50 -110
  171. package/src/mcps/boot-orchestrator.server.ts +75 -121
  172. package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
  173. package/src/mcps/config/server-config-registry.ts +3 -3
  174. package/src/mcps/enforcer-tools.server.ts +212 -310
  175. package/src/mcps/estimation.server.ts +62 -122
  176. package/src/mcps/framework-compliance-audit.server.ts +52 -97
  177. package/src/mcps/framework-help.server.ts +64 -114
  178. package/src/mcps/governance.server.ts +2 -2
  179. package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
  180. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
  181. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
  182. package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
  183. package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
  184. package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
  185. package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
  186. package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
  187. package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
  188. package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
  189. package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
  190. package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
  191. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
  192. package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
  193. package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
  194. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
  195. package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
  196. package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
  197. package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
  198. package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
  199. package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
  200. package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
  201. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
  202. package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
  203. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
  204. package/src/mcps/lint.server.ts +53 -107
  205. package/src/mcps/mcp-client.ts +2 -2
  206. package/src/mcps/model-health-check.server.ts +34 -71
  207. package/src/mcps/performance-analysis.server.ts +60 -104
  208. package/src/mcps/processor-pipeline.server.ts +72 -110
  209. package/src/mcps/registry.json +1 -1
  210. package/src/mcps/researcher.server.ts +88 -177
  211. package/src/mcps/security-scan.server.ts +55 -104
  212. package/src/mcps/shared/knowledge-skill-base.ts +62 -0
  213. package/src/mcps/shared/prompt-security-validator.ts +199 -0
  214. package/src/mcps/shared/security-scanner.ts +599 -0
  215. package/src/mcps/state-manager.server.ts +117 -175
  216. package/src/opencode/codex.codex +1 -1
  217. package/src/opencode/commands/dependency-audit.md +3 -3
  218. package/src/opencode/enforcer-config.json +2 -2
  219. package/src/skills/registry.json +1 -1
  220. package/xray/codex.json +1 -1
  221. package/xray/config.json +1 -1
  222. package/xray/features.json +1 -1
  223. package/xray/integrations.json +3 -3
  224. package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
  225. package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  226. package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
  227. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
  228. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
  229. package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
  230. package/dist/integrations/hermes-agent/conftest.py +0 -14
  231. package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
  232. package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
  233. package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
  234. package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
  235. package/dist/processors/implementations/session-capture-processor.js +0 -37
  236. package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
  237. package/dist/scripts/activate-kernel-pipeline.js +0 -101
  238. package/dist/security/index.d.ts +0 -13
  239. package/dist/security/index.js +0 -13
  240. package/dist/security/security-agent-coordinator.d.ts +0 -72
  241. package/dist/security/security-agent-coordinator.js +0 -204
  242. package/dist/security/security-auditor.d.ts +0 -56
  243. package/dist/security/security-auditor.js +0 -584
  244. package/dist/security/security-hardening-system.d.ts +0 -239
  245. package/dist/security/security-hardening-system.js +0 -727
  246. package/dist/security/security-orchestration-layer.d.ts +0 -119
  247. package/dist/security/security-orchestration-layer.js +0 -496
  248. /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
  249. /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
  250. /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
@@ -4,134 +4,83 @@
4
4
  * Provides tools for tracking and validating estimates
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 { getEstimationValidator } from "../validation/estimation-validator.js";
9
+ import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
15
10
 
16
11
  /**
17
12
  * Estimation MCP Server
18
13
  * Tracks estimates vs actuals and provides calibrated predictions
19
14
  */
20
- class EstimationServer {
21
- private server: Server;
15
+ class EstimationServer extends XrayKnowledgeSkillBase {
22
16
  private validator = getEstimationValidator();
23
17
 
24
18
  constructor() {
25
- this.server = new Server(
19
+ super("estimation-validator", "2.0.1");
20
+ this.tools = [
26
21
  {
27
- name: "estimation-validator", version: "2.0.1",
28
- },
29
- {
30
- capabilities: { tools: {} },
31
- }
32
- );
33
-
34
- this.setupToolHandlers();
35
- }
36
-
37
- private setupToolHandlers(): void {
38
- // List available tools
39
- this.server.setRequestHandler(ListToolsRequestSchema, async () => {
40
- return {
41
- tools: [
42
- {
43
- name: "validate-estimate",
44
- description: "Validate an estimate against historical data",
45
- inputSchema: {
46
- type: "object",
47
- properties: {
48
- category: {
49
- type: "string",
50
- description: "Task category (e.g., 'refactoring', 'testing', 'documentation')",
51
- },
52
- estimate: {
53
- type: "number",
54
- description: "Estimated time in minutes",
55
- },
56
- description: {
57
- type: "string",
58
- description: "Brief description of the task",
59
- },
60
- },
61
- required: ["category", "estimate"],
22
+ name: "validate-estimate",
23
+ description: "Validate an estimate against historical data",
24
+ inputSchema: {
25
+ type: "object",
26
+ properties: {
27
+ category: {
28
+ type: "string",
29
+ description: "Task category (e.g., 'refactoring', 'testing', 'documentation')",
62
30
  },
63
- },
64
- {
65
- name: "start-tracking",
66
- description: "Start tracking time for a task",
67
- inputSchema: {
68
- type: "object",
69
- properties: {
70
- taskId: { type: "string" },
71
- category: { type: "string" },
72
- estimate: { type: "number" },
73
- description: { type: "string" },
74
- },
75
- required: ["taskId", "category", "estimate"],
31
+ estimate: {
32
+ type: "number",
33
+ description: "Estimated time in minutes",
76
34
  },
77
- },
78
- {
79
- name: "complete-tracking",
80
- description: "Complete tracking for a task",
81
- inputSchema: {
82
- type: "object",
83
- properties: {
84
- taskId: { type: "string" },
85
- },
86
- required: ["taskId"],
35
+ description: {
36
+ type: "string",
37
+ description: "Brief description of the task",
87
38
  },
88
39
  },
89
- {
90
- name: "get-accuracy-report",
91
- description: "Get estimation accuracy report",
92
- inputSchema: {
93
- type: "object",
94
- properties: {},
95
- },
40
+ required: ["category", "estimate"],
41
+ },
42
+ },
43
+ {
44
+ name: "start-tracking",
45
+ description: "Start tracking time for a task",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {
49
+ taskId: { type: "string" },
50
+ category: { type: "string" },
51
+ estimate: { type: "number" },
52
+ description: { type: "string" },
96
53
  },
97
- ],
98
- };
99
- });
100
-
101
- // Handle tool calls
102
- this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
103
- try {
104
- const { name, arguments: args } = request.params;
105
-
106
- if (args == null) {
107
- throw new Error(`Tool '${name}' called with no arguments`);
108
- }
109
-
110
- switch (name) {
111
- case "validate-estimate":
112
- return this.handleValidateEstimate(args as { category: string; estimate: number; description?: string });
113
-
114
- case "start-tracking":
115
- return this.handleStartTracking(args as { taskId: string; category: string; estimate: number; description?: string });
116
-
117
- case "complete-tracking":
118
- return this.handleCompleteTracking(args as { taskId: string });
119
-
120
- case "get-accuracy-report":
121
- return this.handleGetReport();
122
-
123
- default:
124
- throw new Error(`Unknown tool: ${name}`);
125
- }
126
- } catch (error) {
127
- return {
128
- content: [{
129
- type: "text" as const,
130
- text: `Error handling tool '${request.params.name}': ${error instanceof Error ? error.message : String(error)}`,
131
- }],
132
- };
133
- }
134
- });
54
+ required: ["taskId", "category", "estimate"],
55
+ },
56
+ },
57
+ {
58
+ name: "complete-tracking",
59
+ description: "Complete tracking for a task",
60
+ inputSchema: {
61
+ type: "object",
62
+ properties: {
63
+ taskId: { type: "string" },
64
+ },
65
+ required: ["taskId"],
66
+ },
67
+ },
68
+ {
69
+ name: "get-accuracy-report",
70
+ description: "Get estimation accuracy report",
71
+ inputSchema: {
72
+ type: "object",
73
+ properties: {},
74
+ },
75
+ },
76
+ ];
77
+ this.handlers = {
78
+ "validate-estimate": async (args) => this.handleValidateEstimate(args as { category: string; estimate: number; description?: string }),
79
+ "start-tracking": async (args) => this.handleStartTracking(args as { taskId: string; category: string; estimate: number; description?: string }),
80
+ "complete-tracking": async (args) => this.handleCompleteTracking(args as { taskId: string }),
81
+ "get-accuracy-report": async (args) => this.handleGetReport(),
82
+ };
83
+ this.setupToolHandlers();
135
84
  }
136
85
 
137
86
  private handleValidateEstimate(args: { category: string; estimate: number; description?: string }): { content: Array<{ type: string; text: string }> } {
@@ -209,21 +158,12 @@ class EstimationServer {
209
158
 
210
159
  return { content: [{ type: "text", text: response }] };
211
160
  }
212
-
213
- async start(): Promise<void> {
214
- const transport = new StdioServerTransport();
215
- await this.server.connect(transport);
216
-
217
- frameworkLogger.log("estimation-server", "start", "info", {
218
- message: "Estimation Validator Server started",
219
- });
220
- }
221
161
  }
222
162
 
223
163
  // Run if called directly
224
164
  if (import.meta.url === `file://${process.argv[1]}`) {
225
165
  const server = new EstimationServer();
226
- server.start().catch((error) => frameworkLogger.log("mcps/estimation", "run", "error", { error: String(error) }));
166
+ server.run("estimation-validator").catch((error) => frameworkLogger.log("mcps/estimation", "run", "error", { error: String(error) }));
227
167
  }
228
168
 
229
169
  export { EstimationServer };
@@ -4,15 +4,10 @@
4
4
  * Comprehensive validation of all framework components and Universal Development Codex compliance
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 fs from "fs";
14
8
  import path from "path";
15
9
  import { frameworkLogger } from "../core/framework-logger.js";
10
+ import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
16
11
 
17
12
  interface FrameworkComplianceAuditArgs {
18
13
  scope?: string;
@@ -33,21 +28,63 @@ interface AuditResults {
33
28
  summary: string;
34
29
  }
35
30
 
36
- class XrayFrameworkComplianceAuditServer {
37
- private server: Server;
31
+ class XrayFrameworkComplianceAuditServer extends XrayKnowledgeSkillBase {
38
32
 
39
33
  constructor() {
40
- this.server = new Server(
34
+ super("framework-compliance-audit", "2.0.1");
35
+ this.tools = [
41
36
  {
42
- name: "framework-compliance-audit", version: "2.0.1",
37
+ name: "framework-compliance-audit",
38
+ description:
39
+ "Comprehensive validation of all framework components and Universal Development Codex compliance",
40
+ inputSchema: {
41
+ type: "object",
42
+ properties: {
43
+ scope: {
44
+ type: "string",
45
+ enum: [
46
+ "full",
47
+ "codex",
48
+ "configuration",
49
+ "agents",
50
+ "performance",
51
+ ],
52
+ default: "full",
53
+ description: "Scope of compliance audit",
54
+ },
55
+ detailed: {
56
+ type: "boolean",
57
+ default: false,
58
+ description: "Include detailed findings and recommendations",
59
+ },
60
+ },
61
+ },
43
62
  },
44
63
  {
45
- capabilities: {
46
- tools: {},
64
+ name: "codex-validation",
65
+ description:
66
+ "Validate compliance with Universal Development Codex v1.2.0",
67
+ inputSchema: {
68
+ type: "object",
69
+ properties: {
70
+ terms: {
71
+ type: "array",
72
+ items: { type: "number", minimum: 1, maximum: 43 },
73
+ description: "Specific codex terms to validate (1-43)",
74
+ },
75
+ strict: {
76
+ type: "boolean",
77
+ default: true,
78
+ description: "Enforce strict compliance",
79
+ },
80
+ },
47
81
  },
48
82
  },
49
- );
50
-
83
+ ];
84
+ this.handlers = {
85
+ "framework-compliance-audit": async (args) => this.handleFrameworkComplianceAudit(args as unknown as FrameworkComplianceAuditArgs),
86
+ "codex-validation": async (args) => this.handleCodexValidation(args as unknown as CodexValidationArgs),
87
+ };
51
88
  this.setupToolHandlers();
52
89
  void frameworkLogger.log(
53
90
  "framework-compliance-audit.server",
@@ -57,77 +94,6 @@ class XrayFrameworkComplianceAuditServer {
57
94
  );
58
95
  }
59
96
 
60
- private setupToolHandlers() {
61
- // List available tools
62
- this.server.setRequestHandler(ListToolsRequestSchema, async () => {
63
- return {
64
- tools: [
65
- {
66
- name: "framework-compliance-audit",
67
- description:
68
- "Comprehensive validation of all framework components and Universal Development Codex compliance",
69
- inputSchema: {
70
- type: "object",
71
- properties: {
72
- scope: {
73
- type: "string",
74
- enum: [
75
- "full",
76
- "codex",
77
- "configuration",
78
- "agents",
79
- "performance",
80
- ],
81
- default: "full",
82
- description: "Scope of compliance audit",
83
- },
84
- detailed: {
85
- type: "boolean",
86
- default: false,
87
- description: "Include detailed findings and recommendations",
88
- },
89
- },
90
- },
91
- },
92
- {
93
- name: "codex-validation",
94
- description:
95
- "Validate compliance with Universal Development Codex v1.2.0",
96
- inputSchema: {
97
- type: "object",
98
- properties: {
99
- terms: {
100
- type: "array",
101
- items: { type: "number", minimum: 1, maximum: 43 },
102
- description: "Specific codex terms to validate (1-43)",
103
- },
104
- strict: {
105
- type: "boolean",
106
- default: true,
107
- description: "Enforce strict compliance",
108
- },
109
- },
110
- },
111
- },
112
- ],
113
- };
114
- });
115
-
116
- // Handle tool calls
117
- this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
118
- const { name, arguments: args } = request.params;
119
-
120
- switch (name) {
121
- case "framework-compliance-audit":
122
- return await this.handleFrameworkComplianceAudit(args as unknown as FrameworkComplianceAuditArgs);
123
- case "codex-validation":
124
- return await this.handleCodexValidation(args as unknown as CodexValidationArgs);
125
- default:
126
- throw new Error(`Unknown tool: ${name}`);
127
- }
128
- });
129
- }
130
-
131
97
  private async handleFrameworkComplianceAudit(args: FrameworkComplianceAuditArgs) {
132
98
  const scope = args.scope || "full";
133
99
  const detailed = args.detailed || false;
@@ -613,23 +579,12 @@ ${results.recommendations.map((r) => `• 💡 ${r}`).join("\n")}
613
579
 
614
580
  return details;
615
581
  }
616
-
617
- async run() {
618
- const transport = new StdioServerTransport();
619
- await this.server.connect(transport);
620
- void frameworkLogger.log(
621
- "framework-compliance-audit.server",
622
- "compliance-audit-startup",
623
- "info",
624
- { message: "0xRay Framework Compliance Audit MCP Server started" },
625
- );
626
- }
627
582
  }
628
583
 
629
584
  // Start the server if run directly
630
585
  if (import.meta.url === `file://${process.argv[1]}`) {
631
586
  const server = new XrayFrameworkComplianceAuditServer();
632
- server.run().catch((error) => frameworkLogger.log("mcps/framework-compliance-audit", "run", "error", { error: String(error) }));
587
+ server.run("framework-compliance-audit").catch((error) => frameworkLogger.log("mcps/framework-compliance-audit", "run", "error", { error: String(error) }));
633
588
  }
634
589
 
635
590
  export { XrayFrameworkComplianceAuditServer };
@@ -1,13 +1,10 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
1
  import {
4
- CallToolRequestSchema,
5
2
  ErrorCode,
6
- ListToolsRequestSchema,
7
3
  McpError,
8
4
  } from "@modelcontextprotocol/sdk/types.js";
9
5
  import { frameworkLogger } from "../core/framework-logger.js";
10
6
  import { AGENT_REGISTRY, getActiveAgents } from "../agents/registry.js";
7
+ import { XrayKnowledgeSkillBase } from "./shared/knowledge-skill-base.js";
11
8
 
12
9
  interface CapabilitiesMap {
13
10
  agents: { [key: string]: string };
@@ -16,118 +13,77 @@ interface CapabilitiesMap {
16
13
  reporting: { [key: string]: string };
17
14
  }
18
15
 
19
- class FrameworkHelpServer {
20
- private server: Server;
16
+ class FrameworkHelpServer extends XrayKnowledgeSkillBase {
21
17
 
22
18
  constructor() {
23
- this.server = new Server(
19
+ super("xray/framework-help", "2.0.1");
20
+ this.tools = [
24
21
  {
25
- name: "xray/framework-help", version: "2.0.1",
26
- },
27
- {
28
- capabilities: {
29
- tools: {},
30
- },
31
- },
32
- );
33
-
34
- this.setupToolHandlers();
35
- }
36
-
37
- private setupToolHandlers() {
38
- // List available tools - required MCP protocol handler for tool discovery
39
- this.server.setRequestHandler(ListToolsRequestSchema, async () => {
40
- return {
41
- tools: [
42
- {
43
- name: "xray_get_capabilities",
44
- description:
45
- "Get comprehensive list of all 0xRay framework capabilities, commands, and available tools",
46
- inputSchema: {
47
- type: "object",
48
- properties: {
49
- category: {
50
- type: "string",
51
- enum: ["all", "agents", "skills", "commands", "reporting"],
52
- description: "Filter capabilities by category",
53
- default: "all",
54
- },
55
- format: {
56
- type: "string",
57
- enum: ["summary", "detailed", "commands"],
58
- description: "Output format",
59
- default: "summary",
60
- },
61
- },
62
- required: [],
22
+ name: "xray_get_capabilities",
23
+ description:
24
+ "Get comprehensive list of all 0xRay framework capabilities, commands, and available tools",
25
+ inputSchema: {
26
+ type: "object",
27
+ properties: {
28
+ category: {
29
+ type: "string",
30
+ enum: ["all", "agents", "skills", "commands", "reporting"],
31
+ description: "Filter capabilities by category",
32
+ default: "all",
33
+ },
34
+ format: {
35
+ type: "string",
36
+ enum: ["summary", "detailed", "commands"],
37
+ description: "Output format",
38
+ default: "summary",
63
39
  },
64
40
  },
65
- {
66
- name: "xray_get_commands",
67
- description:
68
- "Get list of available 0xRay commands and their usage",
69
- inputSchema: {
70
- type: "object",
71
- properties: {
72
- type: {
73
- type: "string",
74
- enum: [
75
- "agent-commands",
76
- "system-commands",
77
- "reporting-commands",
78
- ],
79
- description: "Type of commands to list",
80
- default: "agent-commands",
81
- },
82
- },
83
- required: [],
41
+ required: [],
42
+ },
43
+ },
44
+ {
45
+ name: "xray_get_commands",
46
+ description:
47
+ "Get list of available 0xRay commands and their usage",
48
+ inputSchema: {
49
+ type: "object",
50
+ properties: {
51
+ type: {
52
+ type: "string",
53
+ enum: [
54
+ "agent-commands",
55
+ "system-commands",
56
+ "reporting-commands",
57
+ ],
58
+ description: "Type of commands to list",
59
+ default: "agent-commands",
84
60
  },
85
61
  },
86
- {
87
- name: "xray_explain_capability",
88
- description:
89
- "Get detailed explanation of a specific 0xRay capability",
90
- inputSchema: {
91
- type: "object",
92
- properties: {
93
- capability: {
94
- type: "string",
95
- description: "Name of the capability to explain",
96
- },
97
- },
98
- required: ["capability"],
62
+ required: [],
63
+ },
64
+ },
65
+ {
66
+ name: "xray_explain_capability",
67
+ description:
68
+ "Get detailed explanation of a specific 0xRay capability",
69
+ inputSchema: {
70
+ type: "object",
71
+ properties: {
72
+ capability: {
73
+ type: "string",
74
+ description: "Name of the capability to explain",
99
75
  },
100
76
  },
101
- ],
102
- };
103
- });
104
-
105
- // Handle tool calls - required MCP protocol handler for tool execution
106
- this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
107
- const { name, arguments: args } = request.params;
108
-
109
- try {
110
- switch (name) {
111
- case "xray_get_capabilities":
112
- return this.handleGetCapabilities(args);
113
- case "xray_get_commands":
114
- return this.handleGetCommands(args);
115
- case "xray_explain_capability":
116
- return this.handleExplainCapability(args);
117
- default:
118
- throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
119
- }
120
- } catch (error) {
121
- if (error instanceof McpError) {
122
- throw error;
123
- }
124
- frameworkLogger.log("mcps/framework-help", "tool-call", "error", { tool: name, error: String(error) });
125
- throw new McpError(
126
- ErrorCode.InternalError,
127
- `Tool "${name}" execution failed: ${error instanceof Error ? error.message : String(error)}`,
128
- );
129
- }
130
- });
77
+ required: ["capability"],
78
+ },
79
+ },
80
+ ];
81
+ this.handlers = {
82
+ "xray_get_capabilities": async (args) => this.handleGetCapabilities(args as Record<string, unknown> | undefined),
83
+ "xray_get_commands": async (args) => this.handleGetCommands(args as Record<string, unknown> | undefined),
84
+ "xray_explain_capability": async (args) => this.handleExplainCapability(args as Record<string, unknown> | undefined),
85
+ };
86
+ this.setupToolHandlers();
131
87
  }
132
88
 
133
89
  private getActiveAgentEntries() {
@@ -450,18 +406,12 @@ ${items.map(([name, desc]) => `- **${name}**: ${desc}`).join("\n")}
450
406
  **Total:** ${items.length} ${category}
451
407
  `.trim();
452
408
  }
453
-
454
- async start() {
455
- const transport = new StdioServerTransport();
456
- await this.server.connect(transport);
457
- frameworkLogger.log("mcps/framework-help", "start", "info", { message: "0xRay Framework Help Server started" });
458
- }
459
409
  }
460
410
 
461
411
  // Auto-start if this file is run directly - conditional server initialization for development/testing
462
412
  if (import.meta.url === `file://${process.argv[1]}`) {
463
413
  const server = new FrameworkHelpServer();
464
- server.start().catch((error) => frameworkLogger.log("mcps/framework-help", "run", "error", { error: String(error) }));
414
+ server.run("xray/framework-help").catch((error) => frameworkLogger.log("mcps/framework-help", "run", "error", { error: String(error) }));
465
415
  }
466
416
 
467
417
  export { FrameworkHelpServer };
@@ -68,7 +68,7 @@ class GovernanceServer {
68
68
  constructor() {
69
69
  this.server = new Server(
70
70
  {
71
- name: "governance", version: "2.0.1",
71
+ name: "governance", version: "2.1.3",
72
72
  },
73
73
  {
74
74
  capabilities: {
@@ -257,7 +257,7 @@ class GovernanceServer {
257
257
  })),
258
258
  context: args.context || {},
259
259
  options: {
260
- requireExternalDynamo: args.options?.require_external ?? true,
260
+ requireExternalDynamo: args.options?.require_external ?? !process.env.XRAY_LOCAL_MODE,
261
261
  },
262
262
  };
263
263