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
@@ -40,7 +40,7 @@ class XrayAutoFormatServer {
40
40
  constructor() {
41
41
  this.server = new Server(
42
42
  {
43
- name: "auto-format", version: "1.22.67",
43
+ name: "auto-format", version: "3.1.0",
44
44
  },
45
45
  {
46
46
  capabilities: {
@@ -521,7 +521,7 @@ ${checkResults.details.map((d) => `• ${d}`).join("\n")}
521
521
  }
522
522
 
523
523
  // Start the server if run directly
524
- if (import.meta.url === `file://${process.argv[1]}`) {
524
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
525
525
  const server = new XrayAutoFormatServer();
526
526
  server.run().catch((error) => frameworkLogger.log("mcps/auto-format", "run", "error", { error: String(error) }));
527
527
  }
@@ -120,7 +120,7 @@ class XrayBootOrchestratorServer {
120
120
  constructor() {
121
121
  this.server = new Server(
122
122
  {
123
- name: "boot-orchestrator", version: "1.22.67",
123
+ name: "boot-orchestrator", version: "3.1.0",
124
124
  },
125
125
  {
126
126
  capabilities: {
@@ -1074,7 +1074,7 @@ ${results.warnings.length > 0 ? `**Warnings:**\n${results.warnings.map((w: strin
1074
1074
  }
1075
1075
 
1076
1076
  // Start the server if run directly
1077
- if (import.meta.url === `file://${process.argv[1]}`) {
1077
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1078
1078
  const server = new XrayBootOrchestratorServer();
1079
1079
  server.run().catch((error) => frameworkLogger.log("mcps/boot-orchestrator", "run", "error", { error: String(error) }));
1080
1080
  }
@@ -17,25 +17,19 @@ describe('ConfigLoader', () => {
17
17
 
18
18
  beforeEach(() => {
19
19
  loader = new ConfigLoader();
20
+ // Remove default paths so tests don't pick up the real .mcp.json
21
+ loader.resetConfigPaths();
20
22
  // Clean up any existing test files
21
- if (fs.existsSync(testConfigPath)) {
22
- fs.unlinkSync(testConfigPath);
23
- }
24
- if (fs.existsSync(testConfigPath2)) {
25
- fs.unlinkSync(testConfigPath2);
26
- }
27
- if (fs.existsSync(testDir)) {
28
- fs.rmdirSync(testDir);
23
+ for (const p of [testConfigPath, testConfigPath2]) {
24
+ if (fs.existsSync(p)) fs.unlinkSync(p);
29
25
  }
26
+ if (fs.existsSync(testDir)) fs.rmdirSync(testDir);
30
27
  });
31
28
 
32
29
  afterEach(() => {
33
30
  // Clean up test files
34
- if (fs.existsSync(testConfigPath)) {
35
- fs.unlinkSync(testConfigPath);
36
- }
37
- if (fs.existsSync(testConfigPath2)) {
38
- fs.unlinkSync(testConfigPath2);
31
+ for (const p of [testConfigPath, testConfigPath2]) {
32
+ if (fs.existsSync(p)) fs.unlinkSync(p);
39
33
  }
40
34
  if (fs.existsSync(testDir)) {
41
35
  fs.rmdirSync(testDir);
@@ -163,20 +157,24 @@ describe('ConfigLoader', () => {
163
157
  });
164
158
 
165
159
  describe('getConfigPaths', () => {
166
- it('should return default paths', () => {
167
- const paths = loader.getConfigPaths();
168
- expect(paths).toContain('.mcp.json');
169
- expect(paths).toContain('.opencode/mcp.json');
170
- expect(paths).toContain('mcp.config.json');
171
- });
172
-
173
160
  it('should return added paths', () => {
161
+ loader.addConfigPath('.mcp.json');
174
162
  loader.addConfigPath('custom/path.json');
175
163
  const paths = loader.getConfigPaths();
164
+ expect(paths).toContain('.mcp.json');
176
165
  expect(paths).toContain('custom/path.json');
177
166
  });
178
167
 
168
+ it('should return default paths via new instance', () => {
169
+ const fresh = new ConfigLoader();
170
+ const paths = fresh.getConfigPaths();
171
+ expect(paths).toContain('.mcp.json');
172
+ expect(paths).toContain('.opencode/mcp.json');
173
+ expect(paths).toContain('mcp.config.json');
174
+ });
175
+
179
176
  it('should return copy of paths array', () => {
177
+ loader.addConfigPath('.mcp.json');
180
178
  const paths = loader.getConfigPaths();
181
179
  paths.push('modified');
182
180
  const paths2 = loader.getConfigPaths();
@@ -186,10 +184,12 @@ describe('ConfigLoader', () => {
186
184
 
187
185
  describe('resetConfigPaths', () => {
188
186
  it('should reset to default paths', () => {
189
- loader.addConfigPath('custom/path.json');
190
- loader.resetConfigPaths();
187
+ // Add a custom path, then reset — must use fresh loader for baseline
188
+ const fresh = new ConfigLoader();
189
+ fresh.addConfigPath('custom/path.json');
190
+ fresh.resetConfigPaths();
191
191
 
192
- const paths = loader.getConfigPaths();
192
+ const paths = fresh.getConfigPaths();
193
193
  expect(paths).not.toContain('custom/path.json');
194
194
  expect(paths).toContain('.mcp.json');
195
195
  });
@@ -269,15 +269,6 @@ describe('ConfigLoader', () => {
269
269
  expect(loader.hasConfigFile()).toBe(false);
270
270
  });
271
271
 
272
- it('should return true when default config file exists', () => {
273
- const testConfigs = [{ serverName: 'test', command: 'node', args: ['test.js'], timeout: 30000 }];
274
- fs.writeFileSync('.mcp.json', JSON.stringify(testConfigs));
275
-
276
- expect(loader.hasConfigFile()).toBe(true);
277
-
278
- fs.unlinkSync('.mcp.json');
279
- });
280
-
281
272
  it('should return true when added config file exists', () => {
282
273
  const testConfigs = [{ serverName: 'test', command: 'node', args: ['test.js'], timeout: 30000 }];
283
274
  fs.writeFileSync(testConfigPath, JSON.stringify(testConfigs));
@@ -285,6 +276,11 @@ describe('ConfigLoader', () => {
285
276
 
286
277
  expect(loader.hasConfigFile()).toBe(true);
287
278
  });
279
+
280
+ it('should return false when only real .mcp.json exists but not in paths', () => {
281
+ // After resetConfigPaths, the real .mcp.json is not in the path list
282
+ expect(loader.hasConfigFile()).toBe(false);
283
+ });
288
284
  });
289
285
 
290
286
  describe('default singleton', () => {
@@ -294,7 +290,7 @@ describe('ConfigLoader', () => {
294
290
 
295
291
  it('defaultConfigLoader should have default paths', () => {
296
292
  const paths = defaultConfigLoader.getConfigPaths();
297
- expect(paths).toContain('.mcp.json');
293
+ expect(paths.length).toBeGreaterThan(0);
298
294
  });
299
295
  });
300
296
 
@@ -164,38 +164,38 @@ describe('ServerConfigRegistry', () => {
164
164
  expect(config.timeout).toBe(30000);
165
165
  });
166
166
 
167
- it('should use STRRAY_DEV_PATH env var in dynamic config', () => {
168
- const originalEnv = process.env.STRRAY_DEV_PATH;
169
- process.env.STRRAY_DEV_PATH = 'custom-dist';
167
+ it('should use XRAY_DEV_PATH env var in dynamic config', () => {
168
+ const originalEnv = process.env.XRAY_DEV_PATH;
169
+ process.env.XRAY_DEV_PATH = 'custom-dist';
170
170
 
171
171
  const config = registry.createDynamicConfig('test-server');
172
172
  expect(config.args[0]).toContain('custom-dist');
173
173
 
174
- process.env.STRRAY_DEV_PATH = originalEnv;
174
+ process.env.XRAY_DEV_PATH = originalEnv;
175
175
  });
176
176
  });
177
177
 
178
178
  describe('environment path handling', () => {
179
- it('should use resolved framework path when STRRAY_DEV_PATH is not set', () => {
180
- const originalEnv = process.env.STRRAY_DEV_PATH;
181
- delete process.env.STRRAY_DEV_PATH;
179
+ it('should use resolved framework path when XRAY_DEV_PATH is not set', () => {
180
+ const originalEnv = process.env.XRAY_DEV_PATH;
181
+ delete process.env.XRAY_DEV_PATH;
182
182
 
183
183
  const freshRegistry = new ServerConfigRegistry();
184
184
  const config = freshRegistry.get('code-review');
185
185
  expect(config?.args[0]).toContain('.server.js');
186
186
 
187
- process.env.STRRAY_DEV_PATH = originalEnv;
187
+ process.env.XRAY_DEV_PATH = originalEnv;
188
188
  });
189
189
 
190
- it('should use STRRAY_DEV_PATH when set', () => {
191
- const originalEnv = process.env.STRRAY_DEV_PATH;
192
- process.env.STRRAY_DEV_PATH = 'dist';
190
+ it('should use XRAY_DEV_PATH when set', () => {
191
+ const originalEnv = process.env.XRAY_DEV_PATH;
192
+ process.env.XRAY_DEV_PATH = 'dist';
193
193
 
194
194
  const freshRegistry = new ServerConfigRegistry();
195
195
  const config = freshRegistry.get('code-review');
196
196
  expect(config?.args[0]).toContain('dist/');
197
197
 
198
- process.env.STRRAY_DEV_PATH = originalEnv;
198
+ process.env.XRAY_DEV_PATH = originalEnv;
199
199
  });
200
200
  });
201
201
 
@@ -41,12 +41,31 @@ export class ConfigLoader {
41
41
  const content = fs.readFileSync(configPath, 'utf-8');
42
42
  const parsed = JSON.parse(content);
43
43
 
44
- // Handle both array format and object with servers property
45
- const configs: IServerConfig[] = Array.isArray(parsed)
46
- ? parsed
47
- : parsed.servers || [];
48
-
49
- return { success: true, configs };
44
+ // Handle array format
45
+ if (Array.isArray(parsed)) {
46
+ return { success: true, configs: parsed };
47
+ }
48
+
49
+ // Handle standard MCP format (mcpServers object — Claude/OpenCode .mcp.json)
50
+ if (parsed.mcpServers && typeof parsed.mcpServers === 'object') {
51
+ const configs: IServerConfig[] = Object.entries(parsed.mcpServers).map(
52
+ ([serverName, config]: [string, any]) => ({
53
+ serverName,
54
+ command: config.command || '',
55
+ args: config.args || [],
56
+ timeout: config.timeout ?? 30000,
57
+ env: config.env,
58
+ }),
59
+ );
60
+ return { success: true, configs };
61
+ }
62
+
63
+ // Handle object with servers property
64
+ if (parsed.servers) {
65
+ return { success: true, configs: parsed.servers };
66
+ }
67
+
68
+ return { success: true, configs: [] };
50
69
  } catch (error) {
51
70
  return {
52
71
  success: false,
@@ -100,11 +119,31 @@ export class ConfigLoader {
100
119
  const content = fs.readFileSync(filePath, 'utf-8');
101
120
  const parsed = JSON.parse(content);
102
121
 
103
- const configs: IServerConfig[] = Array.isArray(parsed)
104
- ? parsed
105
- : parsed.servers || [];
106
-
107
- return { success: true, configs };
122
+ // Handle array format
123
+ if (Array.isArray(parsed)) {
124
+ return { success: true, configs: parsed };
125
+ }
126
+
127
+ // Handle standard MCP format (mcpServers object)
128
+ if (parsed.mcpServers && typeof parsed.mcpServers === 'object') {
129
+ const configs: IServerConfig[] = Object.entries(parsed.mcpServers).map(
130
+ ([serverName, config]: [string, any]) => ({
131
+ serverName,
132
+ command: config.command || '',
133
+ args: config.args || [],
134
+ timeout: config.timeout ?? 30000,
135
+ env: config.env,
136
+ }),
137
+ );
138
+ return { success: true, configs };
139
+ }
140
+
141
+ // Handle object with servers property
142
+ if (parsed.servers) {
143
+ return { success: true, configs: parsed.servers };
144
+ }
145
+
146
+ return { success: true, configs: [] };
108
147
  } catch (error) {
109
148
  return {
110
149
  success: false,
@@ -20,21 +20,21 @@ import fs from 'fs';
20
20
  /**
21
21
  * Resolve the correct framework root and MCP servers path.
22
22
  * Priority:
23
- * 1. STRRAY_DEV_PATH env var (explicit dev override)
24
- * 2. The "strray" field in the nearest package.json that declares it (works in both source tree and installed package)
23
+ * 1. XRAY_DEV_PATH env var (explicit dev override)
24
+ * 2. The "xray" field in the nearest package.json that declares it (works in both source tree and installed package)
25
25
  * 3. Safe fallback to node_modules/0xray/dist
26
26
  */
27
27
  function resolveFrameworkPaths(): { frameworkRoot: string; mcpServersPath: string } {
28
28
  // Highest priority: explicit environment override
29
- if (process.env.STRRAY_DEV_PATH) {
30
- const devPath = process.env.STRRAY_DEV_PATH;
29
+ if (process.env.XRAY_DEV_PATH) {
30
+ const devPath = process.env.XRAY_DEV_PATH;
31
31
  return {
32
32
  frameworkRoot: devPath,
33
33
  mcpServersPath: join(devPath, 'mcps'),
34
34
  };
35
35
  }
36
36
 
37
- // Walk upward from this module to find the package that owns the "strray" config
37
+ // Walk upward from this module to find the package that owns the "xray" config
38
38
  let currentDir = dirname(fileURLToPath(import.meta.url));
39
39
 
40
40
  // Safety limit to avoid walking the entire filesystem
@@ -44,10 +44,10 @@ function resolveFrameworkPaths(): { frameworkRoot: string; mcpServersPath: strin
44
44
  if (fs.existsSync(pkgPath)) {
45
45
  try {
46
46
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
47
- if (pkg.name === '0xray' && pkg.strray) {
48
- const strrayCfg = pkg.strray as Record<string, string>;
47
+ if (pkg.name === '0xray' && pkg.xray) {
48
+ const xrayCfg = pkg.xray as Record<string, string>;
49
49
  const frameworkRoot = currentDir;
50
- const declaredMcp = strrayCfg.mcpServersPath || (strrayCfg.dist ? join(strrayCfg.dist, 'mcps') : 'dist/mcps');
50
+ const declaredMcp = xrayCfg.mcpServersPath || (xrayCfg.dist ? join(xrayCfg.dist, 'mcps') : 'dist/mcps');
51
51
  return {
52
52
  frameworkRoot,
53
53
  mcpServersPath: join(frameworkRoot, declaredMcp),
@@ -65,7 +65,7 @@ function resolveFrameworkPaths(): { frameworkRoot: string; mcpServersPath: strin
65
65
  // Final fallback (should almost never be reached)
66
66
  const fallback = 'node_modules/0xray/dist';
67
67
  frameworkLogger.log('server-config-registry', 'using-fallback-path', 'warning', {
68
- reason: 'Could not locate strray package.json with "strray" field',
68
+ reason: 'Could not locate xray package.json with "xray" field',
69
69
  fallback,
70
70
  });
71
71
  return {
@@ -367,7 +367,7 @@ export class ServerConfigRegistry {
367
367
  /**
368
368
  * Create a dynamic configuration for an unknown server
369
369
  * Uses the knowledge-skills directory as default location.
370
- * Now respects the "strray" field declared in package.json.
370
+ * Now respects the "xray" field declared in package.json.
371
371
  */
372
372
  createDynamicConfig(serverName: string): IServerConfig {
373
373
  // Validate serverName against path traversal attacks
@@ -77,7 +77,7 @@ export class McpConnection extends EventEmitter implements IMcpConnection {
77
77
  protocolVersion: MCP_PROTOCOL_VERSION,
78
78
  capabilities: {},
79
79
  clientInfo: {
80
- name: 'strray-mcp-client',
80
+ name: 'xray-mcp-client',
81
81
  version: '1.7.5',
82
82
  },
83
83
  },
@@ -144,7 +144,7 @@ class XrayEnforcerToolsServer {
144
144
  constructor() {
145
145
  this.server = new Server(
146
146
  {
147
- name: "enforcer", version: "1.22.67",
147
+ name: "enforcer", version: "3.1.0",
148
148
  },
149
149
  {
150
150
  capabilities: {
@@ -1098,7 +1098,7 @@ class XrayEnforcerToolsServer {
1098
1098
  }
1099
1099
  }
1100
1100
 
1101
- if (import.meta.url === `file://${process.argv[1]}`) {
1101
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
1102
1102
  const server = new XrayEnforcerToolsServer();
1103
1103
  server.run().catch((error) => frameworkLogger.log("mcps/enforcer", "run", "error", { error: String(error) }));
1104
1104
  }
@@ -10,6 +10,7 @@ import {
10
10
  CallToolRequestSchema,
11
11
  ListToolsRequestSchema,
12
12
  } from "@modelcontextprotocol/sdk/types.js";
13
+ import * as fs from "fs";
13
14
  import { frameworkLogger } from "../core/framework-logger.js";
14
15
  import { getEstimationValidator } from "../validation/estimation-validator.js";
15
16
 
@@ -24,7 +25,7 @@ class EstimationServer {
24
25
  constructor() {
25
26
  this.server = new Server(
26
27
  {
27
- name: "estimation-validator", version: "1.22.67",
28
+ name: "estimation-validator", version: "3.1.0",
28
29
  },
29
30
  {
30
31
  capabilities: { tools: {} },
@@ -221,7 +222,7 @@ class EstimationServer {
221
222
  }
222
223
 
223
224
  // Run if called directly
224
- if (import.meta.url === `file://${process.argv[1]}`) {
225
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
225
226
  const server = new EstimationServer();
226
227
  server.start().catch((error) => frameworkLogger.log("mcps/estimation", "run", "error", { error: String(error) }));
227
228
  }
@@ -39,7 +39,7 @@ class XrayFrameworkComplianceAuditServer {
39
39
  constructor() {
40
40
  this.server = new Server(
41
41
  {
42
- name: "framework-compliance-audit", version: "1.22.67",
42
+ name: "framework-compliance-audit", version: "3.1.0",
43
43
  },
44
44
  {
45
45
  capabilities: {
@@ -627,7 +627,7 @@ ${results.recommendations.map((r) => `• 💡 ${r}`).join("\n")}
627
627
  }
628
628
 
629
629
  // Start the server if run directly
630
- if (import.meta.url === `file://${process.argv[1]}`) {
630
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
631
631
  const server = new XrayFrameworkComplianceAuditServer();
632
632
  server.run().catch((error) => frameworkLogger.log("mcps/framework-compliance-audit", "run", "error", { error: String(error) }));
633
633
  }
@@ -6,6 +6,7 @@ import {
6
6
  ListToolsRequestSchema,
7
7
  McpError,
8
8
  } from "@modelcontextprotocol/sdk/types.js";
9
+ import * as fs from "fs";
9
10
  import { frameworkLogger } from "../core/framework-logger.js";
10
11
  import { AGENT_REGISTRY, getActiveAgents } from "../agents/registry.js";
11
12
 
@@ -22,7 +23,7 @@ class FrameworkHelpServer {
22
23
  constructor() {
23
24
  this.server = new Server(
24
25
  {
25
- name: "xray/framework-help", version: "1.22.67",
26
+ name: "xray/framework-help", version: "3.1.0",
26
27
  },
27
28
  {
28
29
  capabilities: {
@@ -40,7 +41,7 @@ class FrameworkHelpServer {
40
41
  return {
41
42
  tools: [
42
43
  {
43
- name: "strray_get_capabilities",
44
+ name: "xray_get_capabilities",
44
45
  description:
45
46
  "Get comprehensive list of all 0xRay framework capabilities, commands, and available tools",
46
47
  inputSchema: {
@@ -63,7 +64,7 @@ class FrameworkHelpServer {
63
64
  },
64
65
  },
65
66
  {
66
- name: "strray_get_commands",
67
+ name: "xray_get_commands",
67
68
  description:
68
69
  "Get list of available 0xRay commands and their usage",
69
70
  inputSchema: {
@@ -84,7 +85,7 @@ class FrameworkHelpServer {
84
85
  },
85
86
  },
86
87
  {
87
- name: "strray_explain_capability",
88
+ name: "xray_explain_capability",
88
89
  description:
89
90
  "Get detailed explanation of a specific 0xRay capability",
90
91
  inputSchema: {
@@ -108,11 +109,11 @@ class FrameworkHelpServer {
108
109
 
109
110
  try {
110
111
  switch (name) {
111
- case "strray_get_capabilities":
112
+ case "xray_get_capabilities":
112
113
  return this.handleGetCapabilities(args);
113
- case "strray_get_commands":
114
+ case "xray_get_commands":
114
115
  return this.handleGetCommands(args);
115
- case "strray_explain_capability":
116
+ case "xray_explain_capability":
116
117
  return this.handleExplainCapability(args);
117
118
  default:
118
119
  throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
@@ -459,7 +460,7 @@ ${items.map(([name, desc]) => `- **${name}**: ${desc}`).join("\n")}
459
460
  }
460
461
 
461
462
  // Auto-start if this file is run directly - conditional server initialization for development/testing
462
- if (import.meta.url === `file://${process.argv[1]}`) {
463
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
463
464
  const server = new FrameworkHelpServer();
464
465
  server.start().catch((error) => frameworkLogger.log("mcps/framework-help", "run", "error", { error: String(error) }));
465
466
  }
@@ -68,7 +68,7 @@ class GovernanceServer {
68
68
  constructor() {
69
69
  this.server = new Server(
70
70
  {
71
- name: "governance", version: "1.22.67",
71
+ name: "governance", version: "3.1.0",
72
72
  },
73
73
  {
74
74
  capabilities: {
@@ -475,7 +475,12 @@ class GovernanceServer {
475
475
  async runHttp(port: number = parseInt(process.env.MCP_PORT ?? "3100", 10)): Promise<void> {
476
476
  await this.initializeGovernance();
477
477
 
478
- const app = createMcpExpressApp();
478
+ const mcpHost = process.env.MCP_HOST || "127.0.0.1";
479
+ const allowedHosts = process.env.MCP_ALLOWED_HOSTS?.split(",");
480
+ const app = createMcpExpressApp({
481
+ host: mcpHost,
482
+ ...(allowedHosts ? { allowedHosts } : {}),
483
+ });
479
484
  const transport = new StreamableHTTPServerTransport({
480
485
  sessionIdGenerator: () => randomUUID(),
481
486
  });
@@ -527,7 +532,7 @@ class GovernanceServer {
527
532
  }
528
533
 
529
534
  // Start the server if this file is run directly
530
- const entryPoint = path.resolve(process.argv[1] ?? "");
535
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
531
536
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
532
537
  // If --port or MCP_PORT is set, use HTTP transport (for Grok CLI compatibility)
533
538
  const cliPort = process.argv.find((a) => a.startsWith("--port="))?.split("=")[1];
@@ -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
 
@@ -31,7 +32,7 @@ class XrayApiDesignServer {
31
32
  constructor() {
32
33
  this.server = new Server(
33
34
  {
34
- name: "api-design", version: "1.22.67",
35
+ name: "api-design", version: "3.1.0",
35
36
  },
36
37
  {
37
38
  capabilities: {
@@ -152,7 +153,7 @@ class XrayApiDesignServer {
152
153
  }
153
154
  }
154
155
 
155
- if (import.meta.url === `file://${process.argv[1]}`) {
156
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
156
157
  const server = new XrayApiDesignServer();
157
158
  server.run().catch(() => {});
158
159
  }
@@ -33,7 +33,7 @@ class XrayArchitecturePatternsServer {
33
33
  constructor() {
34
34
  this.server = new Server(
35
35
  {
36
- name: "architecture-patterns", version: "1.22.67",
36
+ name: "architecture-patterns", version: "3.1.0",
37
37
  },
38
38
  {
39
39
  capabilities: {
@@ -144,7 +144,7 @@ class XrayArchitecturePatternsServer {
144
144
  }
145
145
  }
146
146
 
147
- if (import.meta.url === `file://${process.argv[1]}`) {
147
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) {
148
148
  const server = new XrayArchitecturePatternsServer();
149
149
  server.run().catch(() => {});
150
150
  }
@@ -81,7 +81,7 @@ class BugTriageSpecialistServer {
81
81
 
82
82
  constructor() {
83
83
  this.server = new Server(
84
- { name: "bug-triage-specialist", version: "1.22.67" },
84
+ { name: "bug-triage-specialist", version: "3.1.0" },
85
85
  { capabilities: { tools: {} } },
86
86
  );
87
87
  this.setupToolHandlers();
@@ -615,7 +615,7 @@ class BugTriageSpecialistServer {
615
615
  }
616
616
  }
617
617
 
618
- const entryPoint = path.resolve(process.argv[1] ?? "");
618
+ const entryPoint = fs.realpathSync(process.argv[1] ?? "");
619
619
  if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
620
620
  const server = new BugTriageSpecialistServer();
621
621
  server.run();
@@ -303,7 +303,7 @@ class CodeAnalyzerServer {
303
303
 
304
304
  constructor() {
305
305
  this.server = new Server(
306
- { name: "code-analyzer", version: "1.22.67" },
306
+ { name: "code-analyzer", version: "3.1.0" },
307
307
  { capabilities: { tools: {} } },
308
308
  );
309
309
 
@@ -587,5 +587,5 @@ class CodeAnalyzerServer {
587
587
  }
588
588
  }
589
589
 
590
- if (import.meta.url === `file://${process.argv[1]}`) { new CodeAnalyzerServer().run().catch(() => {}); }
590
+ if (import.meta.url === `file://${fs.realpathSync(process.argv[1]!)}`) { new CodeAnalyzerServer().run().catch(() => {}); }
591
591
  export default CodeAnalyzerServer;