0xray 3.0.14 → 3.1.1

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 (296) hide show
  1. package/.gitignore.default +59 -0
  2. package/.mcp.json +35 -0
  3. package/.opencode/codex.codex +1 -1
  4. package/.opencode/commands/dependency-audit.md +3 -3
  5. package/.opencode/commands/summary-logger.md +4 -4
  6. package/.opencode/enforcer-config.json +2 -2
  7. package/.opencode/hooks/post-commit +1 -1
  8. package/.opencode/init.sh +10 -4
  9. package/.plugin/plugin.json +11 -0
  10. package/AGENTS-consumer.md +46 -0
  11. package/AGENTS.md +10 -10
  12. package/LICENSE +1 -1
  13. package/README.md +8 -8
  14. package/SKILLS.md +140 -0
  15. package/dist/.gitignore.default +59 -0
  16. package/dist/AGENTS.md +10 -10
  17. package/dist/CHANGELOG.md +34 -0
  18. package/dist/LICENSE +1 -1
  19. package/dist/README.md +8 -8
  20. package/dist/SKILLS.md +140 -0
  21. package/dist/agents/index.js +3 -1
  22. package/dist/agents/registry.js +13 -0
  23. package/dist/analytics/routing-refiner.js +1 -1
  24. package/dist/architect/architectural-integrity.js +3 -3
  25. package/dist/benchmark/performance-benchmark.js +4 -3
  26. package/dist/cli/commands/antigravity-status.js +23 -23
  27. package/dist/cli/commands/credible-init.js +1 -1
  28. package/dist/cli/commands/hermes-install.js +12 -4
  29. package/dist/cli/commands/mcp-install.js +1 -1
  30. package/dist/cli/commands/openclaw-install.js +10 -1
  31. package/dist/cli/commands/opencode-install.js +22 -0
  32. package/dist/cli/commands/plugin-commands.js +2 -2
  33. package/dist/cli/commands/publish-agent.js +5 -5
  34. package/dist/cli/commands/skill-install.js +39 -2
  35. package/dist/cli/commands/status.js +8 -3
  36. package/dist/cli/commands/storyteller.js +2 -2
  37. package/dist/cli/index.js +17 -11
  38. package/dist/cli/server.js +4 -4
  39. package/dist/core/activity-logger.js +4 -4
  40. package/dist/core/agent-spawn-gate.js +1 -1
  41. package/dist/core/boot-orchestrator.js +30 -31
  42. package/dist/core/bridge.mjs +26 -26
  43. package/dist/core/codex-formatter.js +2 -3
  44. package/dist/core/codex-injector.js +7 -7
  45. package/dist/core/config-loader.js +3 -2
  46. package/dist/core/config-paths.js +38 -31
  47. package/dist/core/context-loader.js +5 -5
  48. package/dist/core/features-config.js +1 -1
  49. package/dist/core/index.js +2 -2
  50. package/dist/core/logging-config.js +7 -7
  51. package/dist/core/orchestrator.js +2 -2
  52. package/dist/core/system-prompt-generator.js +2 -2
  53. package/dist/core/xray-activation.js +42 -41
  54. package/dist/delegation/agent-delegator.js +3 -3
  55. package/dist/enforcement/enforcer-tools.js +4 -4
  56. package/dist/enforcement/loaders/codex-loader.js +2 -2
  57. package/dist/execution/opencode-cli-invoker.js +1 -1
  58. package/dist/governance/governance-service.js +1 -1
  59. package/dist/governance/llm-governance-provider.js +223 -0
  60. package/dist/index.js +6 -6
  61. package/dist/inference/deploy-verifier.js +1 -1
  62. package/dist/inference/inference-cycle.js +16 -16
  63. package/dist/integrations/base/README.md +1 -1
  64. package/dist/integrations/enforcement-gate.js +2 -2
  65. package/dist/integrations/governance/index.js +1 -1
  66. package/dist/integrations/grok/grok-cli.js +20 -6
  67. package/dist/integrations/grok/hooks/pre-tool-use.js +3 -3
  68. package/dist/integrations/grok/plugin/0xray/.mcp.json +16 -4
  69. package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  70. package/dist/integrations/hermes-agent/__init__.py +90 -79
  71. package/dist/integrations/hermes-agent/after-install.md +14 -14
  72. package/dist/integrations/hermes-agent/bridge.mjs +60 -25
  73. package/dist/integrations/hermes-agent/plugin.yaml +5 -5
  74. package/dist/integrations/hermes-agent/schemas.py +61 -12
  75. package/dist/integrations/hermes-agent/test_plugin.py +124 -124
  76. package/dist/integrations/hermes-agent/tools.py +129 -25
  77. package/dist/integrations/openclaw/README.md +6 -6
  78. package/dist/integrations/openclaw/config.js +1 -1
  79. package/dist/integrations/openclaw/index.js +2 -2
  80. package/dist/integrations/openclaw/types.js +3 -3
  81. package/dist/integrations/plugins/plugin-integration.js +1 -1
  82. package/dist/integrations/plugins/plugin-registry.js +3 -3
  83. package/dist/mcps/architect-tools.server.js +3 -2
  84. package/dist/mcps/auto-format.server.js +2 -2
  85. package/dist/mcps/boot-orchestrator.server.js +2 -2
  86. package/dist/mcps/config/config-loader.js +40 -9
  87. package/dist/mcps/config/server-config-registry.js +10 -10
  88. package/dist/mcps/connection/mcp-connection.js +1 -1
  89. package/dist/mcps/enforcer-tools.server.js +2 -2
  90. package/dist/mcps/estimation.server.js +3 -2
  91. package/dist/mcps/framework-compliance-audit.server.js +2 -2
  92. package/dist/mcps/framework-help.server.js +9 -8
  93. package/dist/mcps/governance.server.js +8 -4
  94. package/dist/mcps/knowledge-skills/api-design.server.js +3 -2
  95. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -2
  96. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +3 -3
  97. package/dist/mcps/knowledge-skills/code-analyzer.server.js +2 -2
  98. package/dist/mcps/knowledge-skills/code-review.server.js +14 -39
  99. package/dist/mcps/knowledge-skills/content-creator.server.js +3 -3
  100. package/dist/mcps/knowledge-skills/database-design.server.js +2 -2
  101. package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -2
  102. package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -2
  103. package/dist/mcps/knowledge-skills/growth-strategist.server.js +3 -3
  104. package/dist/mcps/knowledge-skills/log-monitor.server.js +3 -3
  105. package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
  106. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +3 -3
  107. package/dist/mcps/knowledge-skills/performance-optimization.server.js +2 -2
  108. package/dist/mcps/knowledge-skills/project-analysis.server.js +2 -2
  109. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -2
  110. package/dist/mcps/knowledge-skills/security-audit.server.js +14 -44
  111. package/dist/mcps/knowledge-skills/seo-consultant.server.js +3 -2
  112. package/dist/mcps/knowledge-skills/session-management.server.js +3 -2
  113. package/dist/mcps/knowledge-skills/skill-invocation.server.js +105 -3
  114. package/dist/mcps/knowledge-skills/strategist.server.js +3 -3
  115. package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -2
  117. package/dist/mcps/knowledge-skills/testing-strategy.server.js +2 -2
  118. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -4
  119. package/dist/mcps/lint.server.js +4 -4
  120. package/dist/mcps/mcp-client.js +5 -5
  121. package/dist/mcps/model-health-check.server.js +3 -2
  122. package/dist/mcps/orchestrator/server.js +4 -3
  123. package/dist/mcps/orchestrator.server.js +2 -1
  124. package/dist/mcps/performance-analysis.server.js +2 -2
  125. package/dist/mcps/processor-pipeline.server.js +3 -2
  126. package/dist/mcps/registry.json +1 -1
  127. package/dist/mcps/researcher.server.js +14 -39
  128. package/dist/mcps/security-scan.server.js +2 -2
  129. package/dist/mcps/simulation/server-simulations.js +3 -3
  130. package/dist/mcps/state-manager.server.js +5 -5
  131. package/dist/metrics/agent-metrics.js +1 -1
  132. package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +4 -4
  133. package/dist/orchestrator/intelligent-commit-batcher.js +2 -3
  134. package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
  135. package/dist/orchestrator/orchestrator.js +9 -8
  136. package/dist/orchestrator/universal-registry-bridge.js +4 -4
  137. package/dist/postprocessor/PostProcessor.js +9 -9
  138. package/dist/postprocessor/services/RegressionAnalysisService.js +4 -4
  139. package/dist/postprocessor/triggers/GitHookTrigger.js +18 -18
  140. package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
  141. package/dist/processors/implementations/inference-improvement-processor.js +1 -2
  142. package/dist/processors/implementations/log-protection-processor.js +2 -2
  143. package/dist/processors/implementations/publish-preflight-processor.js +2 -3
  144. package/dist/processors/implementations/regression-testing-processor.js +2 -2
  145. package/dist/processors/implementations/session-summary-processor.js +2 -2
  146. package/dist/processors/implementations/storytelling-trigger-processor.js +1 -2
  147. package/dist/public/about.html +6 -6
  148. package/dist/public/enterprise.html +1 -1
  149. package/dist/public/features.html +2 -2
  150. package/dist/public/index.html +4 -4
  151. package/dist/reporting/report-formatter.js +1 -1
  152. package/dist/scripts/activate-kernel-pipeline.js +4 -4
  153. package/dist/scripts/pre-command +1 -1
  154. package/dist/services/inference-tuner.js +2 -2
  155. package/dist/skills/api-design/SKILL.md +1 -1
  156. package/dist/skills/architect-tools/SKILL.md +1 -1
  157. package/dist/skills/architecture-patterns/SKILL.md +1 -1
  158. package/dist/skills/auto-format/SKILL.md +1 -1
  159. package/dist/skills/boot-orchestrator/SKILL.md +1 -1
  160. package/dist/skills/bug-triage/SKILL.md +1 -1
  161. package/dist/skills/code-analyzer/SKILL.md +1 -1
  162. package/dist/skills/code-review/SKILL.md +1 -1
  163. package/dist/skills/enforcer/SKILL.md +1 -1
  164. package/dist/skills/framework-compliance-audit/SKILL.md +1 -1
  165. package/dist/skills/git-workflow/SKILL.md +1 -1
  166. package/dist/skills/hermes-agent/SKILL.md +42 -42
  167. package/dist/skills/inference-improve/SKILL.md +1 -1
  168. package/dist/skills/lint/SKILL.md +1 -1
  169. package/dist/skills/log-monitor/SKILL.md +1 -1
  170. package/dist/skills/model-health-check/SKILL.md +1 -1
  171. package/dist/skills/multimodal-looker/SKILL.md +1 -1
  172. package/dist/skills/orchestrator/SKILL.md +1 -1
  173. package/dist/skills/performance-analysis/SKILL.md +1 -1
  174. package/dist/skills/performance-optimization/SKILL.md +1 -1
  175. package/dist/skills/processor-pipeline/SKILL.md +1 -1
  176. package/dist/skills/project-analysis/SKILL.md +1 -1
  177. package/dist/skills/refactoring-strategies/SKILL.md +1 -1
  178. package/dist/skills/registry.json +1 -1
  179. package/dist/skills/researcher/SKILL.md +1 -1
  180. package/dist/skills/security-audit/SKILL.md +1 -1
  181. package/dist/skills/security-scan/SKILL.md +1 -1
  182. package/dist/skills/session-management/SKILL.md +1 -1
  183. package/dist/skills/state-manager/SKILL.md +1 -1
  184. package/dist/skills/storyteller/SKILL.md +1 -1
  185. package/dist/skills/testing-best-practices/SKILL.md +1 -1
  186. package/dist/skills/testing-strategy/SKILL.md +1 -1
  187. package/dist/skills/ui-ux-design/SKILL.md +1 -1
  188. package/dist/state/index.js +1 -1
  189. package/dist/state/state-manager.js +3 -4
  190. package/dist/utils/import-resolver.js +1 -1
  191. package/dist/utils/path-resolver.js +2 -2
  192. package/dist/utils/token-manager.js +1 -1
  193. package/dist/validation/estimation-validator.js +1 -1
  194. package/package.json +10 -3
  195. package/scripts/hooks/pre-command +1 -1
  196. package/scripts/hooks/run-hook.js +2 -2
  197. package/scripts/node/auto-reflection-generator.mjs +30 -36
  198. package/scripts/node/govern-reflection.mjs +1 -1
  199. package/scripts/node/postinstall.cjs +37 -2
  200. package/scripts/node/pre-publish-guard.js +13 -9
  201. package/scripts/node/setup-xai-oauth.mjs +244 -0
  202. package/scripts/node/universal-version-manager.js +8 -8
  203. package/scripts/node/version-manager.mjs +1 -1
  204. package/src/integrations/grok/plugin/0xray/.mcp.json +16 -4
  205. package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  206. package/src/mcps/architect-tools.server.ts +2 -2
  207. package/src/mcps/auto-format.server.ts +2 -2
  208. package/src/mcps/boot-orchestrator.server.ts +2 -2
  209. package/src/mcps/config/__tests__/config-loader.test.ts +29 -33
  210. package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
  211. package/src/mcps/config/config-loader.ts +50 -11
  212. package/src/mcps/config/server-config-registry.ts +10 -10
  213. package/src/mcps/connection/mcp-connection.ts +1 -1
  214. package/src/mcps/enforcer-tools.server.ts +2 -2
  215. package/src/mcps/estimation.server.ts +3 -2
  216. package/src/mcps/framework-compliance-audit.server.ts +2 -2
  217. package/src/mcps/framework-help.server.ts +9 -8
  218. package/src/mcps/governance.server.ts +8 -3
  219. package/src/mcps/knowledge-skills/api-design.server.ts +3 -2
  220. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +2 -2
  221. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +2 -2
  222. package/src/mcps/knowledge-skills/code-analyzer.server.ts +2 -2
  223. package/src/mcps/knowledge-skills/code-review.server.ts +21 -36
  224. package/src/mcps/knowledge-skills/content-creator.server.ts +3 -3
  225. package/src/mcps/knowledge-skills/database-design.server.ts +2 -2
  226. package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -2
  227. package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -2
  228. package/src/mcps/knowledge-skills/growth-strategist.server.ts +3 -3
  229. package/src/mcps/knowledge-skills/log-monitor.server.ts +3 -3
  230. package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
  231. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +3 -3
  232. package/src/mcps/knowledge-skills/performance-optimization.server.ts +2 -2
  233. package/src/mcps/knowledge-skills/project-analysis.server.ts +2 -2
  234. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -2
  235. package/src/mcps/knowledge-skills/security-audit.server.ts +21 -40
  236. package/src/mcps/knowledge-skills/seo-consultant.server.ts +3 -2
  237. package/src/mcps/knowledge-skills/session-management.server.ts +3 -2
  238. package/src/mcps/knowledge-skills/skill-invocation.server.ts +113 -3
  239. package/src/mcps/knowledge-skills/strategist.server.ts +3 -3
  240. package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
  241. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -2
  242. package/src/mcps/knowledge-skills/testing-strategy.server.ts +2 -2
  243. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -4
  244. package/src/mcps/lint.server.ts +4 -4
  245. package/src/mcps/mcp-client.ts +5 -5
  246. package/src/mcps/model-health-check.server.ts +2 -2
  247. package/src/mcps/orchestrator/server.ts +4 -3
  248. package/src/mcps/orchestrator.server.ts +2 -1
  249. package/src/mcps/performance-analysis.server.ts +2 -2
  250. package/src/mcps/processor-pipeline.server.ts +3 -2
  251. package/src/mcps/registry.json +1 -1
  252. package/src/mcps/researcher.server.ts +21 -36
  253. package/src/mcps/security-scan.server.ts +2 -2
  254. package/src/mcps/simulation/server-simulations.ts +3 -3
  255. package/src/mcps/state-manager.server.ts +5 -5
  256. package/src/opencode/codex.codex +1 -1
  257. package/src/opencode/commands/dependency-audit.md +3 -3
  258. package/src/opencode/commands/summary-logger.md +4 -4
  259. package/src/opencode/enforcer-config.json +2 -2
  260. package/src/skills/api-design/SKILL.md +1 -1
  261. package/src/skills/architect-tools/SKILL.md +1 -1
  262. package/src/skills/architecture-patterns/SKILL.md +1 -1
  263. package/src/skills/auto-format/SKILL.md +1 -1
  264. package/src/skills/boot-orchestrator/SKILL.md +1 -1
  265. package/src/skills/bug-triage/SKILL.md +1 -1
  266. package/src/skills/code-analyzer/SKILL.md +1 -1
  267. package/src/skills/code-review/SKILL.md +1 -1
  268. package/src/skills/enforcer/SKILL.md +1 -1
  269. package/src/skills/framework-compliance-audit/SKILL.md +1 -1
  270. package/src/skills/git-workflow/SKILL.md +1 -1
  271. package/src/skills/hermes-agent/SKILL.md +42 -42
  272. package/src/skills/inference-improve/SKILL.md +1 -1
  273. package/src/skills/lint/SKILL.md +1 -1
  274. package/src/skills/log-monitor/SKILL.md +1 -1
  275. package/src/skills/model-health-check/SKILL.md +1 -1
  276. package/src/skills/multimodal-looker/SKILL.md +1 -1
  277. package/src/skills/orchestrator/SKILL.md +1 -1
  278. package/src/skills/performance-analysis/SKILL.md +1 -1
  279. package/src/skills/performance-optimization/SKILL.md +1 -1
  280. package/src/skills/processor-pipeline/SKILL.md +1 -1
  281. package/src/skills/project-analysis/SKILL.md +1 -1
  282. package/src/skills/refactoring-strategies/SKILL.md +1 -1
  283. package/src/skills/registry.json +1 -1
  284. package/src/skills/researcher/SKILL.md +1 -1
  285. package/src/skills/security-audit/SKILL.md +1 -1
  286. package/src/skills/security-scan/SKILL.md +1 -1
  287. package/src/skills/session-management/SKILL.md +1 -1
  288. package/src/skills/state-manager/SKILL.md +1 -1
  289. package/src/skills/storyteller/SKILL.md +1 -1
  290. package/src/skills/testing-best-practices/SKILL.md +1 -1
  291. package/src/skills/testing-strategy/SKILL.md +1 -1
  292. package/src/skills/ui-ux-design/SKILL.md +1 -1
  293. package/xray/agents_template.md +46 -0
  294. package/xray/codex.json +598 -0
  295. package/dist/plugin/xray-codex-injection.js +0 -857
  296. /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
@@ -15,6 +15,7 @@ import {
15
15
  import * as fs from "fs";
16
16
  import * as path from "path";
17
17
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
18
+ import { tryLLMGovernance } from "../../governance/llm-governance-provider.js";
18
19
 
19
20
  interface CodeReviewResult {
20
21
  file: string;
@@ -80,7 +81,7 @@ class XrayCodeReviewServer {
80
81
  constructor() {
81
82
  this.server = new Server(
82
83
  {
83
- name: "code-review", version: "1.22.67",
84
+ name: "code-review", version: "3.1.0",
84
85
  },
85
86
  {
86
87
  capabilities: {
@@ -465,47 +466,31 @@ class XrayCodeReviewServer {
465
466
  */
466
467
  async analyzeProposal(args: AnalyzeProposalArgs) {
467
468
  const { proposalTitle = "", proposalDescription = "", evidence = [], proposalType = "" } = args;
468
- const text = `${proposalTitle} ${proposalDescription} ${evidence.join(" ")}`.toLowerCase();
469
-
470
- let decision: "approve" | "reject" | "abstain" = "approve";
471
- let confidence = 0.82;
472
- let reasoning = "The proposal appears reasonable from a code quality and maintainability perspective.";
473
-
474
- if (text.includes("aml") || text.includes("kyc") || text.includes("anti-money")) {
475
- decision = "approve";
476
- confidence = 0.88;
477
- reasoning = "AML/KYC compliance code requires rigorous review: transaction monitoring must handle edge cases, avoid false positives from legitimate patterns, and maintain audit trails for regulatory inspection.";
478
- } else if (text.includes("psd2") || text.includes("strong customer authentication") || text.includes("payment initiation")) {
479
- decision = "approve";
480
- confidence = 0.90;
481
- reasoning = "PSD2 SCA implementation must balance security with user experience. Code should use well-audited MFA libraries, avoid rolling custom authentication, and include comprehensive test coverage for all authentication flows.";
482
- } else if (text.includes("gdpr") || text.includes("right to erasure") || text.includes("data protection")) {
483
- decision = "approve";
484
- confidence = 0.92;
485
- reasoning = "GDPR erasure pipelines require careful code review: cascading deletes must be transactional, audit logs must be preserved, and the 30-day SLA demands observability and monitoring integration.";
486
- } else if (text.includes("extract method")) {
487
- decision = "approve";
488
- confidence = 0.93;
489
- reasoning = "Extract Method is a well-established refactoring pattern that improves readability and reduces cognitive load when applied consistently.";
490
- } else if (text.includes("test coverage")) {
491
- decision = "approve";
492
- confidence = 0.90;
493
- reasoning = "Expanding automated test coverage generally improves long-term code health and reduces regression risk.";
494
- } else if (text.includes("increase timeout") && text.includes("flaky")) {
495
- decision = "reject";
496
- confidence = 0.72;
497
- reasoning = "Repeatedly increasing timeouts to mask flaky tests is an anti-pattern that hides underlying race conditions or timing issues.";
498
- }
499
469
 
500
- if (proposalType === "fix" && text.includes("timeout")) {
501
- confidence = Math.max(0.68, confidence - 0.08);
470
+ const vote = await tryLLMGovernance(
471
+ "code-review",
472
+ proposalTitle,
473
+ proposalDescription,
474
+ evidence,
475
+ proposalType,
476
+ );
477
+
478
+ if (!vote) {
479
+ return {
480
+ content: [
481
+ {
482
+ type: "text",
483
+ text: "DECISION: abstain\nCONFIDENCE: 0.50\nREASONING: No LLM governance provider configured. Set XRAY_GOVERNANCE_LLM_ENABLED=true + XRAY_LLM_ENDPOINT, or install Hermes and run: hermes auth add xai-oauth --no-browser",
484
+ },
485
+ ],
486
+ };
502
487
  }
503
488
 
504
489
  return {
505
490
  content: [
506
491
  {
507
492
  type: "text",
508
- text: `DECISION: ${decision}\nCONFIDENCE: ${confidence.toFixed(2)}\nREASONING: ${reasoning}`,
493
+ text: `DECISION: ${vote.decision}\nCONFIDENCE: ${vote.confidence.toFixed(2)}\nREASONING: ${vote.reasoning}`,
509
494
  },
510
495
  ],
511
496
  };
@@ -1124,7 +1109,7 @@ class XrayCodeReviewServer {
1124
1109
  }
1125
1110
 
1126
1111
  // Run the server if this file is executed directly
1127
- if (import.meta.url === `file://${process.argv[1]}`) {
1112
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1128
1113
  const server = new XrayCodeReviewServer();
1129
1114
  server.run().catch(() => {});
1130
1115
  }
@@ -11,7 +11,7 @@ import {
11
11
  CallToolRequestSchema,
12
12
  ListToolsRequestSchema,
13
13
  } from "@modelcontextprotocol/sdk/types.js";
14
- import * as path from "path";
14
+ import * as fs from "fs";
15
15
  import { fileURLToPath } from "url";
16
16
 
17
17
  interface Tool {
@@ -102,7 +102,7 @@ class SEOCopywriterServer {
102
102
 
103
103
  constructor() {
104
104
  this.server = new Server(
105
- { name: "content-creator", version: "1.22.67" },
105
+ { name: "content-creator", version: "3.1.0" },
106
106
  { capabilities: { tools: {} } },
107
107
  );
108
108
 
@@ -291,7 +291,7 @@ class SEOCopywriterServer {
291
291
  }
292
292
  }
293
293
 
294
- const entryPoint = path.resolve(process.argv[1] ?? "");
294
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
295
295
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
296
296
  const server = new SEOCopywriterServer();
297
297
  server.run();
@@ -117,7 +117,7 @@ class XrayDatabaseDesignServer {
117
117
  constructor() {
118
118
  this.server = new Server(
119
119
  {
120
- name: "database-design", version: "1.22.67",
120
+ name: "database-design", version: "3.1.0",
121
121
  },
122
122
  {
123
123
  capabilities: {
@@ -1192,7 +1192,7 @@ class XrayDatabaseDesignServer {
1192
1192
  }
1193
1193
 
1194
1194
  // Run the server if this file is executed directly
1195
- if (import.meta.url === `file://${process.argv[1]}`) {
1195
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1196
1196
  const server = new XrayDatabaseDesignServer();
1197
1197
  server.run().catch(() => {});
1198
1198
  }
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
+ import * as fs from "fs";
10
11
  import { frameworkLogger } from "../../core/framework-logger.js";
11
12
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
12
13
  import {
@@ -212,7 +213,7 @@ class XrayDevOpsDeploymentServer {
212
213
  constructor() {
213
214
  this.server = new Server(
214
215
  {
215
- name: "devops-deployment", version: "1.22.67",
216
+ name: "devops-deployment", version: "3.1.0",
216
217
  },
217
218
  {
218
219
  capabilities: {
@@ -1614,7 +1615,7 @@ spec:
1614
1615
  }
1615
1616
 
1616
1617
  // Run the server if this file is executed directly
1617
- if (import.meta.url === `file://${process.argv[1]}`) {
1618
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1618
1619
  const server = new XrayDevOpsDeploymentServer();
1619
1620
  server.run().catch(() => {});
1620
1621
  }
@@ -11,6 +11,7 @@ import {
11
11
  CallToolRequestSchema,
12
12
  ListToolsRequestSchema,
13
13
  } from "@modelcontextprotocol/sdk/types.js";
14
+ import * as fs from "fs";
14
15
  import { frameworkLogger } from "../../core/framework-logger.js";
15
16
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
16
17
 
@@ -32,7 +33,7 @@ class XrayGitWorkflowServer {
32
33
  constructor() {
33
34
  this.server = new Server(
34
35
  {
35
- name: "git-workflow", version: "1.22.67",
36
+ name: "git-workflow", version: "3.1.0",
36
37
  },
37
38
  {
38
39
  capabilities: {
@@ -144,7 +145,7 @@ class XrayGitWorkflowServer {
144
145
  }
145
146
  }
146
147
 
147
- if (import.meta.url === `file://${process.argv[1]}`) {
148
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
148
149
  const server = new XrayGitWorkflowServer();
149
150
  server.run().catch(() => {});
150
151
  }
@@ -11,7 +11,7 @@ import {
11
11
  CallToolRequestSchema,
12
12
  ListToolsRequestSchema,
13
13
  } from "@modelcontextprotocol/sdk/types.js";
14
- import * as path from "path";
14
+ import * as fs from "fs";
15
15
  import { fileURLToPath } from "url";
16
16
 
17
17
  interface Tool {
@@ -111,7 +111,7 @@ class MarketingExpertServer {
111
111
 
112
112
  constructor() {
113
113
  this.server = new Server(
114
- { name: "growth-strategist", version: "1.22.67" },
114
+ { name: "growth-strategist", version: "3.1.0" },
115
115
  { capabilities: { tools: {} } },
116
116
  );
117
117
 
@@ -404,7 +404,7 @@ class MarketingExpertServer {
404
404
  }
405
405
  }
406
406
 
407
- const entryPoint = path.resolve(process.argv[1] ?? "");
407
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
408
408
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
409
409
  const server = new MarketingExpertServer();
410
410
  server.run();
@@ -12,7 +12,7 @@ import {
12
12
  CallToolRequestSchema,
13
13
  ListToolsRequestSchema,
14
14
  } from "@modelcontextprotocol/sdk/types.js";
15
- import * as path from "path";
15
+ import * as fs from "fs";
16
16
  import { fileURLToPath } from "url";
17
17
 
18
18
  interface LogEntry {
@@ -117,7 +117,7 @@ class LogMonitorServer {
117
117
 
118
118
  constructor() {
119
119
  this.server = new Server(
120
- { name: "log-monitor", version: "1.22.67" },
120
+ { name: "log-monitor", version: "3.1.0" },
121
121
  { capabilities: { tools: {} } },
122
122
  );
123
123
  this.setupToolHandlers();
@@ -610,7 +610,7 @@ ${analysis.recommendations.map((r) => `- ${r}`).join("\n")}
610
610
  }
611
611
  }
612
612
 
613
- const entryPoint = path.resolve(process.argv[1] ?? "");
613
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
614
614
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
615
615
  const server = new LogMonitorServer();
616
616
  server.run();
@@ -11,7 +11,7 @@ import {
11
11
  CallToolRequestSchema,
12
12
  ListToolsRequestSchema,
13
13
  } from "@modelcontextprotocol/sdk/types.js";
14
- import * as path from "path";
14
+ import * as fs from "fs";
15
15
  import { fileURLToPath } from "url";
16
16
 
17
17
  interface IOSBlueprint {
@@ -113,7 +113,7 @@ class XrayMobileDevelopmentServer {
113
113
  constructor() {
114
114
  this.server = new Server(
115
115
  {
116
- name: "mobile-development", version: "1.22.67",
116
+ name: "mobile-development", version: "3.1.0",
117
117
  },
118
118
  {
119
119
  capabilities: {
@@ -663,7 +663,7 @@ class HomePage extends StatelessWidget {
663
663
  }
664
664
  }
665
665
 
666
- const entryPoint = path.resolve(process.argv[1] ?? "");
666
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
667
667
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
668
668
  const server = new XrayMobileDevelopmentServer();
669
669
  server.start().catch(() => {});
@@ -14,7 +14,7 @@ import {
14
14
  CallToolRequestSchema,
15
15
  ListToolsRequestSchema,
16
16
  } from "@modelcontextprotocol/sdk/types.js";
17
- import * as path from "path";
17
+ import * as fs from "fs";
18
18
  import { fileURLToPath } from "url";
19
19
  import { frameworkLogger } from "../../core/framework-logger.js";
20
20
 
@@ -167,7 +167,7 @@ class MultimodalLookerServer {
167
167
 
168
168
  constructor() {
169
169
  this.server = new Server(
170
- { name: "multimodal-looker", version: "1.22.67" },
170
+ { name: "multimodal-looker", version: "3.1.0" },
171
171
  { capabilities: { tools: {} } },
172
172
  );
173
173
  this.setupToolHandlers();
@@ -1492,7 +1492,7 @@ class MultimodalLookerServer {
1492
1492
  }
1493
1493
  }
1494
1494
 
1495
- const entryPoint = path.resolve(process.argv[1] ?? "");
1495
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
1496
1496
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
1497
1497
  const server = new MultimodalLookerServer();
1498
1498
  server.run().catch((err) => frameworkLogger.log('multimodal-looker', 'run-error', 'error', { error: String(err) }));
@@ -224,7 +224,7 @@ class XrayPerformanceOptimizationServer {
224
224
  constructor() {
225
225
  this.server = new Server(
226
226
  {
227
- name: "performance-optimization", version: "1.22.67",
227
+ name: "performance-optimization", version: "3.1.0",
228
228
  },
229
229
  {
230
230
  capabilities: {
@@ -2055,7 +2055,7 @@ ${result.recommendations.slice(0, 5).map((r, i) => `${i + 1}. ${r}`).join("\n")
2055
2055
  }
2056
2056
  }
2057
2057
 
2058
- if (import.meta.url === `file://${process.argv[1]}`) {
2058
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
2059
2059
  const server = new XrayPerformanceOptimizationServer();
2060
2060
  server.run().catch((error) => {
2061
2061
  frameworkLogger.log("mcp/performance-optimization", "run", "error", { error: String(error) });
@@ -142,7 +142,7 @@ class ProjectAnalysisServer {
142
142
  constructor() {
143
143
  this.server = new Server(
144
144
  {
145
- name: "project-analysis", version: "1.22.67",
145
+ name: "project-analysis", version: "3.1.0",
146
146
  },
147
147
  {
148
148
  capabilities: {
@@ -1103,7 +1103,7 @@ class ProjectAnalysisServer {
1103
1103
  }
1104
1104
 
1105
1105
  // Start the server if run directly
1106
- if (import.meta.url === `file://${process.argv[1]}`) {
1106
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1107
1107
  const server = new ProjectAnalysisServer();
1108
1108
  server.run().catch((error: unknown) => frameworkLogger.log("mcps/project-analysis", "run", "error", { error: String(error) }));
1109
1109
  }
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
9
9
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
+ import * as fs from "fs";
10
11
  import { frameworkLogger } from "../../core/framework-logger.js";
11
12
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
12
13
  import {
@@ -160,7 +161,7 @@ class XrayRefactoringStrategiesServer {
160
161
  constructor() {
161
162
  this.server = new Server(
162
163
  {
163
- name: "refactoring-strategies", version: "1.22.67",
164
+ name: "refactoring-strategies", version: "3.1.0",
164
165
  },
165
166
  {
166
167
  capabilities: {
@@ -1084,7 +1085,7 @@ class XrayRefactoringStrategiesServer {
1084
1085
  }
1085
1086
 
1086
1087
  // Run the server if this file is executed directly
1087
- if (import.meta.url === `file://${process.argv[1]}`) {
1088
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1088
1089
  const server = new XrayRefactoringStrategiesServer();
1089
1090
  server.run().catch(() => {});
1090
1091
  }
@@ -15,6 +15,7 @@ import {
15
15
  import * as fs from "fs";
16
16
  import * as path from "path";
17
17
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
18
+ import { tryLLMGovernance } from "../../governance/llm-governance-provider.js";
18
19
 
19
20
  interface SecurityVulnerability {
20
21
  id: string;
@@ -90,7 +91,7 @@ class XraySecurityAuditServer {
90
91
  constructor() {
91
92
  this.server = new Server(
92
93
  {
93
- name: "security-audit", version: "1.22.67",
94
+ name: "security-audit", version: "3.1.0",
94
95
  },
95
96
  {
96
97
  capabilities: {
@@ -1122,51 +1123,31 @@ class XraySecurityAuditServer {
1122
1123
  */
1123
1124
  async analyzeProposal(args: AnalyzeProposalArgs) {
1124
1125
  const { proposalTitle = "", proposalDescription = "", evidence = [], proposalType = "" } = args;
1125
- const text = `${proposalTitle} ${proposalDescription} ${evidence.join(" ")}`.toLowerCase();
1126
-
1127
- let decision: "approve" | "reject" | "abstain" = "approve";
1128
- let confidence = 0.82;
1129
- let reasoning = "The proposal does not appear to introduce significant new security surface area.";
1130
-
1131
- if (text.includes("aml") || text.includes("kyc") || text.includes("anti-money")) {
1132
- decision = "approve";
1133
- confidence = 0.91;
1134
- reasoning = "AML/KYC compliance measures are critical for regulatory security posture. Automated transaction monitoring closes vulnerability gaps in financial crime detection and demonstrates due diligence for regulatory inspections.";
1135
- } else if (text.includes("psd2") || text.includes("strong customer authentication") || text.includes("payment initiation")) {
1136
- decision = "approve";
1137
- confidence = 0.93;
1138
- reasoning = "PSD2 SCA implementation is a mandatory security control for payment services. Multi-factor authentication with dynamic linking reduces unauthorized payment risk and satisfies EBA regulatory technical standards.";
1139
- } else if (text.includes("gdpr") || text.includes("right to erasure") || text.includes("data protection")) {
1140
- decision = "approve";
1141
- confidence = 0.94;
1142
- reasoning = "GDPR compliance controls are foundational to data security posture. Automated data erasure pipelines reduce data breach exposure windows and satisfy supervisory authority inspection requirements.";
1143
- } else if (text.includes("beneficial ownership") || text.includes("ubo") || text.includes("pep screening")) {
1144
- decision = "approve";
1145
- confidence = 0.87;
1146
- reasoning = "Beneficial ownership transparency and PEP screening are critical AML controls. Verifying ultimate beneficial owners reduces money laundering risk through corporate account structuring.";
1147
- } else if (text.includes("extract method")) {
1148
- decision = "approve";
1149
- confidence = 0.88;
1150
- reasoning = "Extract Method refactoring improves security posture by reducing attack surface in large monolithic files and enabling better isolation of sensitive logic.";
1151
- } else if (text.includes("test coverage")) {
1152
- decision = "approve";
1153
- confidence = 0.91;
1154
- reasoning = "Expanding test coverage is one of the highest-ROI security controls available — more tests surface regressions and boundary condition vulnerabilities earlier.";
1155
- } else if (text.includes("increase timeout") && text.includes("flaky")) {
1156
- decision = "reject";
1157
- confidence = 0.75;
1158
- reasoning = "Repeatedly increasing timeouts to hide flaky tests can mask timing attacks, race conditions, and resource exhaustion vulnerabilities. Root cause remediation is required.";
1159
- }
1160
1126
 
1161
- if (proposalType === "fix" && text.includes("timeout")) {
1162
- confidence = Math.max(0.65, confidence - 0.10);
1127
+ const vote = await tryLLMGovernance(
1128
+ "security-audit",
1129
+ proposalTitle,
1130
+ proposalDescription,
1131
+ evidence,
1132
+ proposalType,
1133
+ );
1134
+
1135
+ if (!vote) {
1136
+ return {
1137
+ content: [
1138
+ {
1139
+ type: "text",
1140
+ text: "DECISION: abstain\nCONFIDENCE: 0.50\nREASONING: No LLM governance provider configured. Set XRAY_GOVERNANCE_LLM_ENABLED=true + XRAY_LLM_ENDPOINT, or install Hermes and run: hermes auth add xai-oauth --no-browser",
1141
+ },
1142
+ ],
1143
+ };
1163
1144
  }
1164
1145
 
1165
1146
  return {
1166
1147
  content: [
1167
1148
  {
1168
1149
  type: "text",
1169
- text: `DECISION: ${decision}\nCONFIDENCE: ${confidence.toFixed(2)}\nREASONING: ${reasoning}`,
1150
+ text: `DECISION: ${vote.decision}\nCONFIDENCE: ${vote.confidence.toFixed(2)}\nREASONING: ${vote.reasoning}`,
1170
1151
  },
1171
1152
  ],
1172
1153
  };
@@ -1185,7 +1166,7 @@ class XraySecurityAuditServer {
1185
1166
  }
1186
1167
 
1187
1168
  // Run the server if this file is executed directly
1188
- if (import.meta.url === `file://${process.argv[1]}`) {
1169
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1189
1170
  const server = new XraySecurityAuditServer();
1190
1171
  server.run().catch(() => {});
1191
1172
  }
@@ -12,6 +12,7 @@ import {
12
12
  CallToolRequestSchema,
13
13
  ListToolsRequestSchema,
14
14
  } from "@modelcontextprotocol/sdk/types.js";
15
+ import * as fs from "fs";
15
16
  import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
16
17
 
17
18
  interface SEOIssue {
@@ -69,7 +70,7 @@ class SEOSpecialistServer {
69
70
 
70
71
  constructor() {
71
72
  this.server = new Server(
72
- { name: "seo-consultant", version: "1.22.67" },
73
+ { name: "seo-consultant", version: "3.1.0" },
73
74
  { capabilities: { tools: {} } },
74
75
  );
75
76
 
@@ -1152,7 +1153,7 @@ Sitemap: ${baseUrl}/sitemap.xml`;
1152
1153
  }
1153
1154
  }
1154
1155
 
1155
- if (import.meta.url === `file://${process.argv[1]}`) {
1156
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1156
1157
  const server = new SEOSpecialistServer();
1157
1158
  server.run().catch(() => {});
1158
1159
  }
@@ -11,6 +11,7 @@ import {
11
11
  CallToolRequestSchema,
12
12
  ListToolsRequestSchema,
13
13
  } from "@modelcontextprotocol/sdk/types.js";
14
+ import * as fs from "fs";
14
15
  import { frameworkLogger } from "../../core/framework-logger.js";
15
16
 
16
17
  interface Tool {
@@ -161,7 +162,7 @@ class SessionManagementServer {
161
162
 
162
163
  constructor() {
163
164
  this.server = new Server(
164
- { name: "session-management", version: "1.22.67" },
165
+ { name: "session-management", version: "3.1.0" },
165
166
  { capabilities: { tools: {} } },
166
167
  );
167
168
 
@@ -568,7 +569,7 @@ class SessionManagementServer {
568
569
  }
569
570
  }
570
571
 
571
- if (import.meta.url === `file://${process.argv[1]}`) {
572
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
572
573
  const server = new SessionManagementServer();
573
574
  server.run().catch((error) => frameworkLogger.log("mcps/session-management", "run", "error", { error: String(error) }));
574
575
  }