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.
- package/.gitignore.default +59 -0
- package/.mcp.json +35 -0
- package/.opencode/codex.codex +1 -1
- package/.opencode/commands/dependency-audit.md +3 -3
- package/.opencode/commands/summary-logger.md +4 -4
- package/.opencode/enforcer-config.json +2 -2
- package/.opencode/hooks/post-commit +1 -1
- package/.opencode/init.sh +10 -4
- package/.plugin/plugin.json +11 -0
- package/AGENTS-consumer.md +46 -0
- package/AGENTS.md +10 -10
- package/LICENSE +1 -1
- package/README.md +8 -8
- package/SKILLS.md +140 -0
- package/dist/.gitignore.default +59 -0
- package/dist/AGENTS.md +10 -10
- package/dist/CHANGELOG.md +34 -0
- package/dist/LICENSE +1 -1
- package/dist/README.md +8 -8
- package/dist/SKILLS.md +140 -0
- package/dist/agents/index.js +3 -1
- package/dist/agents/registry.js +13 -0
- package/dist/analytics/routing-refiner.js +1 -1
- package/dist/architect/architectural-integrity.js +3 -3
- package/dist/benchmark/performance-benchmark.js +4 -3
- package/dist/cli/commands/antigravity-status.js +23 -23
- package/dist/cli/commands/credible-init.js +1 -1
- package/dist/cli/commands/hermes-install.js +12 -4
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +10 -1
- package/dist/cli/commands/opencode-install.js +22 -0
- package/dist/cli/commands/plugin-commands.js +2 -2
- package/dist/cli/commands/publish-agent.js +5 -5
- package/dist/cli/commands/skill-install.js +39 -2
- package/dist/cli/commands/status.js +8 -3
- package/dist/cli/commands/storyteller.js +2 -2
- package/dist/cli/index.js +17 -11
- package/dist/cli/server.js +4 -4
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.js +30 -31
- package/dist/core/bridge.mjs +26 -26
- package/dist/core/codex-formatter.js +2 -3
- package/dist/core/codex-injector.js +7 -7
- package/dist/core/config-loader.js +3 -2
- package/dist/core/config-paths.js +38 -31
- package/dist/core/context-loader.js +5 -5
- package/dist/core/features-config.js +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/logging-config.js +7 -7
- package/dist/core/orchestrator.js +2 -2
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.js +42 -41
- package/dist/delegation/agent-delegator.js +3 -3
- package/dist/enforcement/enforcer-tools.js +4 -4
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/execution/opencode-cli-invoker.js +1 -1
- package/dist/governance/governance-service.js +1 -1
- package/dist/governance/llm-governance-provider.js +223 -0
- package/dist/index.js +6 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +16 -16
- package/dist/integrations/base/README.md +1 -1
- package/dist/integrations/enforcement-gate.js +2 -2
- package/dist/integrations/governance/index.js +1 -1
- package/dist/integrations/grok/grok-cli.js +20 -6
- package/dist/integrations/grok/hooks/pre-tool-use.js +3 -3
- package/dist/integrations/grok/plugin/0xray/.mcp.json +16 -4
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/dist/integrations/hermes-agent/__init__.py +90 -79
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +60 -25
- package/dist/integrations/hermes-agent/plugin.yaml +5 -5
- package/dist/integrations/hermes-agent/schemas.py +61 -12
- package/dist/integrations/hermes-agent/test_plugin.py +124 -124
- package/dist/integrations/hermes-agent/tools.py +129 -25
- package/dist/integrations/openclaw/README.md +6 -6
- package/dist/integrations/openclaw/config.js +1 -1
- package/dist/integrations/openclaw/index.js +2 -2
- package/dist/integrations/openclaw/types.js +3 -3
- package/dist/integrations/plugins/plugin-integration.js +1 -1
- package/dist/integrations/plugins/plugin-registry.js +3 -3
- package/dist/mcps/architect-tools.server.js +3 -2
- package/dist/mcps/auto-format.server.js +2 -2
- package/dist/mcps/boot-orchestrator.server.js +2 -2
- package/dist/mcps/config/config-loader.js +40 -9
- package/dist/mcps/config/server-config-registry.js +10 -10
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/enforcer-tools.server.js +2 -2
- package/dist/mcps/estimation.server.js +3 -2
- package/dist/mcps/framework-compliance-audit.server.js +2 -2
- package/dist/mcps/framework-help.server.js +9 -8
- package/dist/mcps/governance.server.js +8 -4
- package/dist/mcps/knowledge-skills/api-design.server.js +3 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -2
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +3 -3
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +14 -39
- package/dist/mcps/knowledge-skills/content-creator.server.js +3 -3
- package/dist/mcps/knowledge-skills/database-design.server.js +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -2
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +3 -3
- package/dist/mcps/knowledge-skills/log-monitor.server.js +3 -3
- package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +3 -3
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +2 -2
- package/dist/mcps/knowledge-skills/project-analysis.server.js +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +14 -44
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +3 -2
- package/dist/mcps/knowledge-skills/session-management.server.js +3 -2
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +105 -3
- package/dist/mcps/knowledge-skills/strategist.server.js +3 -3
- package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -4
- package/dist/mcps/lint.server.js +4 -4
- package/dist/mcps/mcp-client.js +5 -5
- package/dist/mcps/model-health-check.server.js +3 -2
- package/dist/mcps/orchestrator/server.js +4 -3
- package/dist/mcps/orchestrator.server.js +2 -1
- package/dist/mcps/performance-analysis.server.js +2 -2
- package/dist/mcps/processor-pipeline.server.js +3 -2
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.js +14 -39
- package/dist/mcps/security-scan.server.js +2 -2
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/mcps/state-manager.server.js +5 -5
- package/dist/metrics/agent-metrics.js +1 -1
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +4 -4
- package/dist/orchestrator/intelligent-commit-batcher.js +2 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.js +9 -8
- package/dist/orchestrator/universal-registry-bridge.js +4 -4
- package/dist/postprocessor/PostProcessor.js +9 -9
- package/dist/postprocessor/services/RegressionAnalysisService.js +4 -4
- package/dist/postprocessor/triggers/GitHookTrigger.js +18 -18
- package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
- package/dist/processors/implementations/inference-improvement-processor.js +1 -2
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.js +2 -3
- package/dist/processors/implementations/regression-testing-processor.js +2 -2
- package/dist/processors/implementations/session-summary-processor.js +2 -2
- package/dist/processors/implementations/storytelling-trigger-processor.js +1 -2
- package/dist/public/about.html +6 -6
- package/dist/public/enterprise.html +1 -1
- package/dist/public/features.html +2 -2
- package/dist/public/index.html +4 -4
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +4 -4
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +2 -2
- package/dist/skills/api-design/SKILL.md +1 -1
- package/dist/skills/architect-tools/SKILL.md +1 -1
- package/dist/skills/architecture-patterns/SKILL.md +1 -1
- package/dist/skills/auto-format/SKILL.md +1 -1
- package/dist/skills/boot-orchestrator/SKILL.md +1 -1
- package/dist/skills/bug-triage/SKILL.md +1 -1
- package/dist/skills/code-analyzer/SKILL.md +1 -1
- package/dist/skills/code-review/SKILL.md +1 -1
- package/dist/skills/enforcer/SKILL.md +1 -1
- package/dist/skills/framework-compliance-audit/SKILL.md +1 -1
- package/dist/skills/git-workflow/SKILL.md +1 -1
- package/dist/skills/hermes-agent/SKILL.md +42 -42
- package/dist/skills/inference-improve/SKILL.md +1 -1
- package/dist/skills/lint/SKILL.md +1 -1
- package/dist/skills/log-monitor/SKILL.md +1 -1
- package/dist/skills/model-health-check/SKILL.md +1 -1
- package/dist/skills/multimodal-looker/SKILL.md +1 -1
- package/dist/skills/orchestrator/SKILL.md +1 -1
- package/dist/skills/performance-analysis/SKILL.md +1 -1
- package/dist/skills/performance-optimization/SKILL.md +1 -1
- package/dist/skills/processor-pipeline/SKILL.md +1 -1
- package/dist/skills/project-analysis/SKILL.md +1 -1
- package/dist/skills/refactoring-strategies/SKILL.md +1 -1
- package/dist/skills/registry.json +1 -1
- package/dist/skills/researcher/SKILL.md +1 -1
- package/dist/skills/security-audit/SKILL.md +1 -1
- package/dist/skills/security-scan/SKILL.md +1 -1
- package/dist/skills/session-management/SKILL.md +1 -1
- package/dist/skills/state-manager/SKILL.md +1 -1
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/skills/testing-best-practices/SKILL.md +1 -1
- package/dist/skills/testing-strategy/SKILL.md +1 -1
- package/dist/skills/ui-ux-design/SKILL.md +1 -1
- package/dist/state/index.js +1 -1
- package/dist/state/state-manager.js +3 -4
- package/dist/utils/import-resolver.js +1 -1
- package/dist/utils/path-resolver.js +2 -2
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +10 -3
- package/scripts/hooks/pre-command +1 -1
- package/scripts/hooks/run-hook.js +2 -2
- package/scripts/node/auto-reflection-generator.mjs +30 -36
- package/scripts/node/govern-reflection.mjs +1 -1
- package/scripts/node/postinstall.cjs +37 -2
- package/scripts/node/pre-publish-guard.js +13 -9
- package/scripts/node/setup-xai-oauth.mjs +244 -0
- package/scripts/node/universal-version-manager.js +8 -8
- package/scripts/node/version-manager.mjs +1 -1
- package/src/integrations/grok/plugin/0xray/.mcp.json +16 -4
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/src/mcps/architect-tools.server.ts +2 -2
- package/src/mcps/auto-format.server.ts +2 -2
- package/src/mcps/boot-orchestrator.server.ts +2 -2
- package/src/mcps/config/__tests__/config-loader.test.ts +29 -33
- package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
- package/src/mcps/config/config-loader.ts +50 -11
- package/src/mcps/config/server-config-registry.ts +10 -10
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/enforcer-tools.server.ts +2 -2
- package/src/mcps/estimation.server.ts +3 -2
- package/src/mcps/framework-compliance-audit.server.ts +2 -2
- package/src/mcps/framework-help.server.ts +9 -8
- package/src/mcps/governance.server.ts +8 -3
- package/src/mcps/knowledge-skills/api-design.server.ts +3 -2
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +2 -2
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +2 -2
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +2 -2
- package/src/mcps/knowledge-skills/code-review.server.ts +21 -36
- package/src/mcps/knowledge-skills/content-creator.server.ts +3 -3
- package/src/mcps/knowledge-skills/database-design.server.ts +2 -2
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -2
- package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -2
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +3 -3
- package/src/mcps/knowledge-skills/log-monitor.server.ts +3 -3
- package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +3 -3
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +2 -2
- package/src/mcps/knowledge-skills/project-analysis.server.ts +2 -2
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -2
- package/src/mcps/knowledge-skills/security-audit.server.ts +21 -40
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +3 -2
- package/src/mcps/knowledge-skills/session-management.server.ts +3 -2
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +113 -3
- package/src/mcps/knowledge-skills/strategist.server.ts +3 -3
- package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -2
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +2 -2
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -4
- package/src/mcps/lint.server.ts +4 -4
- package/src/mcps/mcp-client.ts +5 -5
- package/src/mcps/model-health-check.server.ts +2 -2
- package/src/mcps/orchestrator/server.ts +4 -3
- package/src/mcps/orchestrator.server.ts +2 -1
- package/src/mcps/performance-analysis.server.ts +2 -2
- package/src/mcps/processor-pipeline.server.ts +3 -2
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +21 -36
- package/src/mcps/security-scan.server.ts +2 -2
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/mcps/state-manager.server.ts +5 -5
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/dependency-audit.md +3 -3
- package/src/opencode/commands/summary-logger.md +4 -4
- package/src/opencode/enforcer-config.json +2 -2
- package/src/skills/api-design/SKILL.md +1 -1
- package/src/skills/architect-tools/SKILL.md +1 -1
- package/src/skills/architecture-patterns/SKILL.md +1 -1
- package/src/skills/auto-format/SKILL.md +1 -1
- package/src/skills/boot-orchestrator/SKILL.md +1 -1
- package/src/skills/bug-triage/SKILL.md +1 -1
- package/src/skills/code-analyzer/SKILL.md +1 -1
- package/src/skills/code-review/SKILL.md +1 -1
- package/src/skills/enforcer/SKILL.md +1 -1
- package/src/skills/framework-compliance-audit/SKILL.md +1 -1
- package/src/skills/git-workflow/SKILL.md +1 -1
- package/src/skills/hermes-agent/SKILL.md +42 -42
- package/src/skills/inference-improve/SKILL.md +1 -1
- package/src/skills/lint/SKILL.md +1 -1
- package/src/skills/log-monitor/SKILL.md +1 -1
- package/src/skills/model-health-check/SKILL.md +1 -1
- package/src/skills/multimodal-looker/SKILL.md +1 -1
- package/src/skills/orchestrator/SKILL.md +1 -1
- package/src/skills/performance-analysis/SKILL.md +1 -1
- package/src/skills/performance-optimization/SKILL.md +1 -1
- package/src/skills/processor-pipeline/SKILL.md +1 -1
- package/src/skills/project-analysis/SKILL.md +1 -1
- package/src/skills/refactoring-strategies/SKILL.md +1 -1
- package/src/skills/registry.json +1 -1
- package/src/skills/researcher/SKILL.md +1 -1
- package/src/skills/security-audit/SKILL.md +1 -1
- package/src/skills/security-scan/SKILL.md +1 -1
- package/src/skills/session-management/SKILL.md +1 -1
- package/src/skills/state-manager/SKILL.md +1 -1
- package/src/skills/storyteller/SKILL.md +1 -1
- package/src/skills/testing-best-practices/SKILL.md +1 -1
- package/src/skills/testing-strategy/SKILL.md +1 -1
- package/src/skills/ui-ux-design/SKILL.md +1 -1
- package/xray/agents_template.md +46 -0
- package/xray/codex.json +598 -0
- package/dist/plugin/xray-codex-injection.js +0 -857
- /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
|
@@ -2,17 +2,44 @@
|
|
|
2
2
|
|
|
3
3
|
v2.0: Now uses the Node.js bridge for real framework integration.
|
|
4
4
|
Falls back to CLI (npx 0xray) when bridge is unavailable.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import subprocess
|
|
9
|
+
import shutil
|
|
10
|
+
import os
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from . import schemas
|
|
13
|
+
|
|
14
|
+
def _bridge_call(command: dict, timeout: int = 10) -> dict:
|
|
15
|
+
"""Call the Hermes bridge via subprocess stdin."""
|
|
16
|
+
from . import _call_bridge
|
|
17
|
+
return _call_bridge(command, timeout)
|
|
18
|
+
|
|
19
|
+
def _run_xray(args: list, timeout: int = 30) -> str:
|
|
20
|
+
"""Fallback: run npx 0xray CLI command."""
|
|
21
|
+
try:
|
|
22
|
+
result = subprocess.run(
|
|
5
23
|
["npx", "0xray"] + args,
|
|
24
|
+
capture_output=True, text=True, timeout=timeout,
|
|
25
|
+
)
|
|
26
|
+
return result.stdout
|
|
27
|
+
except FileNotFoundError:
|
|
6
28
|
return json.dumps({"error": "0xray not found. Run: npm install -g 0xray"})
|
|
7
29
|
except subprocess.TimeoutExpired:
|
|
8
30
|
return json.dumps({"error": f"Command timed out after {timeout}s"})
|
|
9
31
|
except Exception as e:
|
|
10
32
|
return json.dumps({"error": str(e)})
|
|
11
33
|
|
|
34
|
+
def _get_project_root() -> str:
|
|
35
|
+
"""Find project root (used in fallback mode)."""
|
|
36
|
+
from . import PROJECT_ROOT
|
|
37
|
+
return str(PROJECT_ROOT)
|
|
12
38
|
|
|
13
|
-
# ── Tool: strray_validate ─────────────────────────────────────
|
|
14
39
|
|
|
15
|
-
|
|
40
|
+
# ── Tool: xray_validate ─────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
def xray_validate(args: dict, **kwargs) -> str:
|
|
16
43
|
"""Run pre-commit validation on files using the framework.
|
|
17
44
|
|
|
18
45
|
Uses bridge for real quality gate + processor pipeline.
|
|
@@ -41,7 +68,7 @@ def strray_validate(args: dict, **kwargs) -> str:
|
|
|
41
68
|
})
|
|
42
69
|
|
|
43
70
|
# Fallback to CLI
|
|
44
|
-
result = json.loads(
|
|
71
|
+
result = json.loads(_run_xray(["validate"], timeout=30))
|
|
45
72
|
if "error" in result:
|
|
46
73
|
return json.dumps(result)
|
|
47
74
|
|
|
@@ -54,10 +81,10 @@ def strray_validate(args: dict, **kwargs) -> str:
|
|
|
54
81
|
})
|
|
55
82
|
|
|
56
83
|
|
|
57
|
-
# ── Tool:
|
|
84
|
+
# ── Tool: xray_codex_check ──────────────────────────────────
|
|
58
85
|
|
|
59
|
-
def
|
|
60
|
-
"""Check code against
|
|
86
|
+
def xray_codex_check(args: dict, **kwargs) -> str:
|
|
87
|
+
"""Check code against Xray codex rules.
|
|
61
88
|
|
|
62
89
|
Uses bridge for real quality gate codex checks.
|
|
63
90
|
Falls back to CLI if bridge unavailable.
|
|
@@ -93,7 +120,7 @@ def strray_codex_check(args: dict, **kwargs) -> str:
|
|
|
93
120
|
"focus_areas": focus_areas or "all",
|
|
94
121
|
"code_length": len(code),
|
|
95
122
|
"note": "Bridge unavailable — basic analysis only. "
|
|
96
|
-
"Full codex validation available via MCP:
|
|
123
|
+
"Full codex validation available via MCP: mcp_xray_enforcer_codex_enforcement",
|
|
97
124
|
"via": "static",
|
|
98
125
|
})
|
|
99
126
|
|
|
@@ -109,7 +136,7 @@ def strray_codex_check(args: dict, **kwargs) -> str:
|
|
|
109
136
|
"via": "bridge",
|
|
110
137
|
})
|
|
111
138
|
|
|
112
|
-
result = json.loads(
|
|
139
|
+
result = json.loads(_run_xray(["health"], timeout=15))
|
|
113
140
|
if "error" in result:
|
|
114
141
|
return json.dumps(result)
|
|
115
142
|
|
|
@@ -121,10 +148,10 @@ def strray_codex_check(args: dict, **kwargs) -> str:
|
|
|
121
148
|
})
|
|
122
149
|
|
|
123
150
|
|
|
124
|
-
# ── Tool:
|
|
151
|
+
# ── Tool: xray_health ───────────────────────────────────────
|
|
125
152
|
|
|
126
|
-
def
|
|
127
|
-
"""Check
|
|
153
|
+
def xray_health(args: dict, **kwargs) -> str:
|
|
154
|
+
"""Check Xray framework health via bridge.
|
|
128
155
|
|
|
129
156
|
Returns framework status, loaded components, version.
|
|
130
157
|
"""
|
|
@@ -141,13 +168,13 @@ def strray_health(args: dict, **kwargs) -> str:
|
|
|
141
168
|
})
|
|
142
169
|
|
|
143
170
|
# Fallback to CLI
|
|
144
|
-
return
|
|
171
|
+
return _run_xray(["health"], timeout=15)
|
|
145
172
|
|
|
146
173
|
|
|
147
|
-
# ── Tool:
|
|
174
|
+
# ── Tool: xray_hooks ───────────────────────────────────────
|
|
148
175
|
|
|
149
|
-
def
|
|
150
|
-
"""Manage
|
|
176
|
+
def xray_hooks(args: dict, **kwargs) -> str:
|
|
177
|
+
"""Manage Xray git hooks.
|
|
151
178
|
|
|
152
179
|
Actions: install, uninstall, list, status
|
|
153
180
|
Uses bridge for hook management when available.
|
|
@@ -174,7 +201,7 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
174
201
|
|
|
175
202
|
# Fallback: direct file-based hook management
|
|
176
203
|
git_hooks_dir = Path(_get_project_root()) / ".git" / "hooks"
|
|
177
|
-
|
|
204
|
+
xray_hooks_dir = Path(_get_project_root()) / "hooks"
|
|
178
205
|
|
|
179
206
|
if not git_hooks_dir.exists():
|
|
180
207
|
return json.dumps({"error": "Not a git repository", "via": "fallback"})
|
|
@@ -183,19 +210,19 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
183
210
|
result = {"managed": [], "missing": [], "external": [], "stale": []}
|
|
184
211
|
for hook_name in hooks:
|
|
185
212
|
git_hook = git_hooks_dir / hook_name
|
|
186
|
-
|
|
213
|
+
xray_hook = xray_hooks_dir / hook_name
|
|
187
214
|
if not git_hook.exists():
|
|
188
215
|
result["missing"].append(hook_name)
|
|
189
216
|
else:
|
|
190
217
|
try:
|
|
191
218
|
content = git_hook.read_text()[:500]
|
|
192
|
-
if "
|
|
219
|
+
if "Xray" in content or "xray" in content or False or "run-hook.js" in content:
|
|
193
220
|
result["managed"].append(hook_name)
|
|
194
221
|
else:
|
|
195
222
|
result["external"].append(hook_name)
|
|
196
223
|
except OSError:
|
|
197
224
|
result["external"].append(hook_name)
|
|
198
|
-
if not
|
|
225
|
+
if not xray_hook.exists():
|
|
199
226
|
result["stale"].append(hook_name)
|
|
200
227
|
return json.dumps({"status": "ok", "action": action, **result, "via": "fallback"})
|
|
201
228
|
|
|
@@ -203,7 +230,7 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
203
230
|
installed = []
|
|
204
231
|
skipped = []
|
|
205
232
|
for hook_name in hooks:
|
|
206
|
-
src =
|
|
233
|
+
src = xray_hooks_dir / hook_name
|
|
207
234
|
dst = git_hooks_dir / hook_name
|
|
208
235
|
if not src.exists():
|
|
209
236
|
skipped.append(hook_name)
|
|
@@ -212,8 +239,8 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
212
239
|
if dst.exists():
|
|
213
240
|
try:
|
|
214
241
|
content = dst.read_text()[:500]
|
|
215
|
-
if "
|
|
216
|
-
dst.rename(dst.with_suffix(".
|
|
242
|
+
if "Xray" not in content and "xray" not in content:
|
|
243
|
+
dst.rename(dst.with_suffix(".xray-backup"))
|
|
217
244
|
else:
|
|
218
245
|
dst.unlink()
|
|
219
246
|
except OSError:
|
|
@@ -233,13 +260,13 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
233
260
|
restored = []
|
|
234
261
|
for hook_name in hooks:
|
|
235
262
|
dst = git_hooks_dir / hook_name
|
|
236
|
-
backup = dst.with_suffix(".
|
|
263
|
+
backup = dst.with_suffix(".xray-backup")
|
|
237
264
|
if not dst.exists():
|
|
238
265
|
continue
|
|
239
266
|
try:
|
|
240
267
|
content = dst.read_text()[:500]
|
|
241
|
-
|
|
242
|
-
if
|
|
268
|
+
is_xray = "Xray" in content or "xray" in content or False or "run-hook.js" in content
|
|
269
|
+
if is_xray or dst.is_symlink():
|
|
243
270
|
dst.unlink()
|
|
244
271
|
if backup.exists():
|
|
245
272
|
shutil.move(str(backup), str(dst))
|
|
@@ -251,3 +278,80 @@ def strray_hooks(args: dict, **kwargs) -> str:
|
|
|
251
278
|
return json.dumps({"status": "ok", "action": "uninstall", "removed": removed, "restored": restored, "via": "fallback"})
|
|
252
279
|
|
|
253
280
|
return json.dumps({"error": f"Unknown action: {action}", "via": "fallback"})
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
# ── Tool: xray_skill_install ─────────────────────────────────
|
|
284
|
+
|
|
285
|
+
def xray_skill_install(args: dict, **kwargs) -> str:
|
|
286
|
+
"""Install skills from registry or git repo via bridge."""
|
|
287
|
+
source = args.get("source", "")
|
|
288
|
+
|
|
289
|
+
if not source:
|
|
290
|
+
return json.dumps({"error": "No source specified for skill install"})
|
|
291
|
+
|
|
292
|
+
bridge_result = _bridge_call({
|
|
293
|
+
"command": "skill-install",
|
|
294
|
+
"source": source,
|
|
295
|
+
}, timeout=120)
|
|
296
|
+
|
|
297
|
+
if "error" not in bridge_result:
|
|
298
|
+
return json.dumps({
|
|
299
|
+
"status": "ok",
|
|
300
|
+
"source": source,
|
|
301
|
+
"output": bridge_result.get("output", ""),
|
|
302
|
+
"via": "bridge",
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
# Fallback to CLI
|
|
306
|
+
result = _run_xray(["skill:install", source], timeout=120)
|
|
307
|
+
try:
|
|
308
|
+
parsed = json.loads(result)
|
|
309
|
+
if "error" in parsed:
|
|
310
|
+
return json.dumps(parsed)
|
|
311
|
+
except json.JSONDecodeError:
|
|
312
|
+
pass
|
|
313
|
+
return json.dumps({
|
|
314
|
+
"status": "ok",
|
|
315
|
+
"source": source,
|
|
316
|
+
"output": result.strip(),
|
|
317
|
+
"via": "cli",
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
# ── Tool: xray_skill_registry ───────────────────────────────
|
|
322
|
+
|
|
323
|
+
def xray_skill_registry(args: dict, **kwargs) -> str:
|
|
324
|
+
"""Manage skill registry sources via bridge."""
|
|
325
|
+
action = args.get("action", "list")
|
|
326
|
+
name = args.get("name", "")
|
|
327
|
+
url = args.get("url", "")
|
|
328
|
+
|
|
329
|
+
bridge_args = {"command": "skill-registry", "action": action}
|
|
330
|
+
if name:
|
|
331
|
+
bridge_args["source"] = name
|
|
332
|
+
if url:
|
|
333
|
+
bridge_args["url"] = url
|
|
334
|
+
|
|
335
|
+
bridge_result = _bridge_call(bridge_args, timeout=30)
|
|
336
|
+
|
|
337
|
+
if "error" not in bridge_result:
|
|
338
|
+
return json.dumps({
|
|
339
|
+
"status": "ok",
|
|
340
|
+
"action": action,
|
|
341
|
+
"output": bridge_result.get("output", ""),
|
|
342
|
+
"via": "bridge",
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
# Fallback to CLI
|
|
346
|
+
cli_args = ["skill:registry", action]
|
|
347
|
+
if name:
|
|
348
|
+
cli_args.extend(["--name", name])
|
|
349
|
+
if url:
|
|
350
|
+
cli_args.extend(["--url", url])
|
|
351
|
+
result = _run_xray(cli_args, timeout=30)
|
|
352
|
+
return json.dumps({
|
|
353
|
+
"status": "ok",
|
|
354
|
+
"action": action,
|
|
355
|
+
"output": result.strip(),
|
|
356
|
+
"via": "cli",
|
|
357
|
+
})
|
|
@@ -37,7 +37,7 @@ npm install ws
|
|
|
37
37
|
|
|
38
38
|
### 2. Configure OpenClaw
|
|
39
39
|
|
|
40
|
-
Create `.
|
|
40
|
+
Create `.xray/config/openclaw.json`:
|
|
41
41
|
|
|
42
42
|
```json
|
|
43
43
|
{
|
|
@@ -82,11 +82,11 @@ const integration = await initializeOpenClawIntegration('/path/to/config.json',
|
|
|
82
82
|
|
|
83
83
|
After installation, use these commands in any OpenClaw channel:
|
|
84
84
|
|
|
85
|
-
- `/
|
|
86
|
-
- `/
|
|
87
|
-
- `/
|
|
88
|
-
- `/
|
|
89
|
-
- `/
|
|
85
|
+
- `/xray` - Show status
|
|
86
|
+
- `/xray-analyze <file>` - Analyze code
|
|
87
|
+
- `/xray-code <file>` - Code review
|
|
88
|
+
- `/xray-file <file>` - Read file
|
|
89
|
+
- `/xray-exec <command>` - Execute command
|
|
90
90
|
|
|
91
91
|
## Configuration
|
|
92
92
|
|
|
@@ -54,7 +54,7 @@ export class OpenClawConfigLoader {
|
|
|
54
54
|
loadedAt = 0;
|
|
55
55
|
constructor(configPath) {
|
|
56
56
|
this.configPath = configPath ||
|
|
57
|
-
path.join(process.cwd(), '.
|
|
57
|
+
path.join(process.cwd(), '.xray', 'config', 'openclaw.json');
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Load configuration from file with environment variable overrides
|
|
@@ -12,7 +12,7 @@ import { OpenClawClient } from './client.js';
|
|
|
12
12
|
import { XrayAPIServer } from './api-server.js';
|
|
13
13
|
import { initializeGovernanceIntegration } from '../governance/index.js';
|
|
14
14
|
import { featuresConfigLoader } from '../../core/features-config.js';
|
|
15
|
-
import { OpenClawHooksManager } from './hooks/
|
|
15
|
+
import { OpenClawHooksManager } from './hooks/xray-hooks.js';
|
|
16
16
|
import { mcpClientManager } from '../../mcps/mcp-client.js';
|
|
17
17
|
/**
|
|
18
18
|
* Main OpenClaw Integration class
|
|
@@ -348,4 +348,4 @@ export * from './types.js';
|
|
|
348
348
|
export * from './config.js';
|
|
349
349
|
export * from './client.js';
|
|
350
350
|
export * from './api-server.js';
|
|
351
|
-
export { OpenClawHooksManager } from './hooks/
|
|
351
|
+
export { OpenClawHooksManager } from './hooks/xray-hooks.js';
|
|
@@ -37,9 +37,9 @@ export var OpenClawErrorCode;
|
|
|
37
37
|
OpenClawErrorCode["SKILL_LOAD_FAILED"] = "SKILL_LOAD_FAILED";
|
|
38
38
|
OpenClawErrorCode["SKILL_EXECUTION_FAILED"] = "SKILL_EXECUTION_FAILED";
|
|
39
39
|
// 0xRay errors
|
|
40
|
-
OpenClawErrorCode["
|
|
41
|
-
OpenClawErrorCode["
|
|
42
|
-
OpenClawErrorCode["
|
|
40
|
+
OpenClawErrorCode["XRAY_UNAVAILABLE"] = "XRAY_UNAVAILABLE";
|
|
41
|
+
OpenClawErrorCode["XRAY_TIMEOUT"] = "XRAY_TIMEOUT";
|
|
42
|
+
OpenClawErrorCode["XRAY_ERROR"] = "XRAY_ERROR";
|
|
43
43
|
// Configuration errors
|
|
44
44
|
OpenClawErrorCode["CONFIG_INVALID"] = "CONFIG_INVALID";
|
|
45
45
|
OpenClawErrorCode["CONFIG_MISSING"] = "CONFIG_MISSING";
|
|
@@ -245,7 +245,7 @@ export class PluginIntegration extends BaseIntegration {
|
|
|
245
245
|
author: parsed.author ? String(parsed.author) : undefined,
|
|
246
246
|
homepage: parsed.homepage ? String(parsed.homepage) : undefined,
|
|
247
247
|
repository: parsed.repository ? String(parsed.repository) : undefined,
|
|
248
|
-
|
|
248
|
+
minXrayVersion: parsed.minXrayVersion ? String(parsed.minXrayVersion) : undefined,
|
|
249
249
|
runtime: parsed.runtime,
|
|
250
250
|
tools: parsed.tools,
|
|
251
251
|
capabilities: parsed.capabilities,
|
|
@@ -46,8 +46,8 @@ export class PluginRegistry extends EventEmitter {
|
|
|
46
46
|
reloadDebounce = new Map();
|
|
47
47
|
constructor(config = {}) {
|
|
48
48
|
super();
|
|
49
|
-
this.pluginsDir = config.pluginsDir || ".
|
|
50
|
-
this.configPath = config.configPath || ".
|
|
49
|
+
this.pluginsDir = config.pluginsDir || ".xray/plugins";
|
|
50
|
+
this.configPath = config.configPath || ".xray/config/plugin-config.json";
|
|
51
51
|
this.autoStart = config.autoStart ?? true;
|
|
52
52
|
this.enableMetrics = config.enableMetrics ?? true;
|
|
53
53
|
this.enableHotReload = config.enableHotReload ?? false;
|
|
@@ -172,7 +172,7 @@ export class PluginRegistry extends EventEmitter {
|
|
|
172
172
|
author: parsed.author ? String(parsed.author) : undefined,
|
|
173
173
|
homepage: parsed.homepage ? String(parsed.homepage) : undefined,
|
|
174
174
|
repository: parsed.repository ? String(parsed.repository) : undefined,
|
|
175
|
-
|
|
175
|
+
minXrayVersion: parsed.minXrayVersion ? String(parsed.minXrayVersion) : undefined,
|
|
176
176
|
runtime: parsed.runtime,
|
|
177
177
|
tools: parsed.tools,
|
|
178
178
|
capabilities: parsed.capabilities,
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
9
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
|
+
import * as fs from "fs";
|
|
10
11
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
11
12
|
import { contextAnalysis as architectContextAnalysis, codebaseStructure as architectCodebaseStructure, dependencyAnalysis as architectDependencyAnalysis, architectureAssessment as architectArchitectureAssessment, } from "../architect/architect-tools.js";
|
|
12
13
|
class XrayArchitectToolsServer {
|
|
13
14
|
server;
|
|
14
15
|
constructor() {
|
|
15
16
|
this.server = new Server({
|
|
16
|
-
name: "architect-tools", version: "1.
|
|
17
|
+
name: "architect-tools", version: "3.1.0",
|
|
17
18
|
}, {
|
|
18
19
|
capabilities: {
|
|
19
20
|
tools: {},
|
|
@@ -270,7 +271,7 @@ class XrayArchitectToolsServer {
|
|
|
270
271
|
});
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
274
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
274
275
|
const server = new XrayArchitectToolsServer();
|
|
275
276
|
server.run().catch((error) => frameworkLogger.log("mcps/architect-tools", "run", "error", { error: String(error) }));
|
|
276
277
|
}
|
|
@@ -13,7 +13,7 @@ class XrayAutoFormatServer {
|
|
|
13
13
|
server;
|
|
14
14
|
constructor() {
|
|
15
15
|
this.server = new Server({
|
|
16
|
-
name: "auto-format", version: "1.
|
|
16
|
+
name: "auto-format", version: "3.1.0",
|
|
17
17
|
}, {
|
|
18
18
|
capabilities: {
|
|
19
19
|
tools: {},
|
|
@@ -406,7 +406,7 @@ ${checkResults.details.map((d) => `• ${d}`).join("\n")}
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
// Start the server if run directly
|
|
409
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
409
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
410
410
|
const server = new XrayAutoFormatServer();
|
|
411
411
|
server.run().catch((error) => frameworkLogger.log("mcps/auto-format", "run", "error", { error: String(error) }));
|
|
412
412
|
}
|
|
@@ -30,7 +30,7 @@ class XrayBootOrchestratorServer {
|
|
|
30
30
|
];
|
|
31
31
|
constructor() {
|
|
32
32
|
this.server = new Server({
|
|
33
|
-
name: "boot-orchestrator", version: "1.
|
|
33
|
+
name: "boot-orchestrator", version: "3.1.0",
|
|
34
34
|
}, {
|
|
35
35
|
capabilities: {
|
|
36
36
|
tools: {},
|
|
@@ -846,7 +846,7 @@ ${results.warnings.length > 0 ? `**Warnings:**\n${results.warnings.map((w) => `
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
// Start the server if run directly
|
|
849
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
849
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
850
850
|
const server = new XrayBootOrchestratorServer();
|
|
851
851
|
server.run().catch((error) => frameworkLogger.log("mcps/boot-orchestrator", "run", "error", { error: String(error) }));
|
|
852
852
|
}
|
|
@@ -26,11 +26,26 @@ export class ConfigLoader {
|
|
|
26
26
|
try {
|
|
27
27
|
const content = fs.readFileSync(configPath, 'utf-8');
|
|
28
28
|
const parsed = JSON.parse(content);
|
|
29
|
-
// Handle
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
// Handle array format
|
|
30
|
+
if (Array.isArray(parsed)) {
|
|
31
|
+
return { success: true, configs: parsed };
|
|
32
|
+
}
|
|
33
|
+
// Handle standard MCP format (mcpServers object — Claude/OpenCode .mcp.json)
|
|
34
|
+
if (parsed.mcpServers && typeof parsed.mcpServers === 'object') {
|
|
35
|
+
const configs = Object.entries(parsed.mcpServers).map(([serverName, config]) => ({
|
|
36
|
+
serverName,
|
|
37
|
+
command: config.command || '',
|
|
38
|
+
args: config.args || [],
|
|
39
|
+
timeout: config.timeout ?? 30000,
|
|
40
|
+
env: config.env,
|
|
41
|
+
}));
|
|
42
|
+
return { success: true, configs };
|
|
43
|
+
}
|
|
44
|
+
// Handle object with servers property
|
|
45
|
+
if (parsed.servers) {
|
|
46
|
+
return { success: true, configs: parsed.servers };
|
|
47
|
+
}
|
|
48
|
+
return { success: true, configs: [] };
|
|
34
49
|
}
|
|
35
50
|
catch (error) {
|
|
36
51
|
return {
|
|
@@ -78,10 +93,26 @@ export class ConfigLoader {
|
|
|
78
93
|
}
|
|
79
94
|
const content = fs.readFileSync(filePath, 'utf-8');
|
|
80
95
|
const parsed = JSON.parse(content);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
: parsed
|
|
84
|
-
|
|
96
|
+
// Handle array format
|
|
97
|
+
if (Array.isArray(parsed)) {
|
|
98
|
+
return { success: true, configs: parsed };
|
|
99
|
+
}
|
|
100
|
+
// Handle standard MCP format (mcpServers object)
|
|
101
|
+
if (parsed.mcpServers && typeof parsed.mcpServers === 'object') {
|
|
102
|
+
const configs = Object.entries(parsed.mcpServers).map(([serverName, config]) => ({
|
|
103
|
+
serverName,
|
|
104
|
+
command: config.command || '',
|
|
105
|
+
args: config.args || [],
|
|
106
|
+
timeout: config.timeout ?? 30000,
|
|
107
|
+
env: config.env,
|
|
108
|
+
}));
|
|
109
|
+
return { success: true, configs };
|
|
110
|
+
}
|
|
111
|
+
// Handle object with servers property
|
|
112
|
+
if (parsed.servers) {
|
|
113
|
+
return { success: true, configs: parsed.servers };
|
|
114
|
+
}
|
|
115
|
+
return { success: true, configs: [] };
|
|
85
116
|
}
|
|
86
117
|
catch (error) {
|
|
87
118
|
return {
|
|
@@ -16,20 +16,20 @@ import fs from 'fs';
|
|
|
16
16
|
/**
|
|
17
17
|
* Resolve the correct framework root and MCP servers path.
|
|
18
18
|
* Priority:
|
|
19
|
-
* 1.
|
|
20
|
-
* 2. The "
|
|
19
|
+
* 1. XRAY_DEV_PATH env var (explicit dev override)
|
|
20
|
+
* 2. The "xray" field in the nearest package.json that declares it (works in both source tree and installed package)
|
|
21
21
|
* 3. Safe fallback to node_modules/0xray/dist
|
|
22
22
|
*/
|
|
23
23
|
function resolveFrameworkPaths() {
|
|
24
24
|
// Highest priority: explicit environment override
|
|
25
|
-
if (process.env.
|
|
26
|
-
const devPath = process.env.
|
|
25
|
+
if (process.env.XRAY_DEV_PATH) {
|
|
26
|
+
const devPath = process.env.XRAY_DEV_PATH;
|
|
27
27
|
return {
|
|
28
28
|
frameworkRoot: devPath,
|
|
29
29
|
mcpServersPath: join(devPath, 'mcps'),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
// Walk upward from this module to find the package that owns the "
|
|
32
|
+
// Walk upward from this module to find the package that owns the "xray" config
|
|
33
33
|
let currentDir = dirname(fileURLToPath(import.meta.url));
|
|
34
34
|
// Safety limit to avoid walking the entire filesystem
|
|
35
35
|
const MAX_LEVELS = 12;
|
|
@@ -38,10 +38,10 @@ function resolveFrameworkPaths() {
|
|
|
38
38
|
if (fs.existsSync(pkgPath)) {
|
|
39
39
|
try {
|
|
40
40
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
41
|
-
if (pkg.name === '0xray' && pkg.
|
|
42
|
-
const
|
|
41
|
+
if (pkg.name === '0xray' && pkg.xray) {
|
|
42
|
+
const xrayCfg = pkg.xray;
|
|
43
43
|
const frameworkRoot = currentDir;
|
|
44
|
-
const declaredMcp =
|
|
44
|
+
const declaredMcp = xrayCfg.mcpServersPath || (xrayCfg.dist ? join(xrayCfg.dist, 'mcps') : 'dist/mcps');
|
|
45
45
|
return {
|
|
46
46
|
frameworkRoot,
|
|
47
47
|
mcpServersPath: join(frameworkRoot, declaredMcp),
|
|
@@ -60,7 +60,7 @@ function resolveFrameworkPaths() {
|
|
|
60
60
|
// Final fallback (should almost never be reached)
|
|
61
61
|
const fallback = 'node_modules/0xray/dist';
|
|
62
62
|
frameworkLogger.log('server-config-registry', 'using-fallback-path', 'warning', {
|
|
63
|
-
reason: 'Could not locate
|
|
63
|
+
reason: 'Could not locate xray package.json with "xray" field',
|
|
64
64
|
fallback,
|
|
65
65
|
});
|
|
66
66
|
return {
|
|
@@ -323,7 +323,7 @@ export class ServerConfigRegistry {
|
|
|
323
323
|
/**
|
|
324
324
|
* Create a dynamic configuration for an unknown server
|
|
325
325
|
* Uses the knowledge-skills directory as default location.
|
|
326
|
-
* Now respects the "
|
|
326
|
+
* Now respects the "xray" field declared in package.json.
|
|
327
327
|
*/
|
|
328
328
|
createDynamicConfig(serverName) {
|
|
329
329
|
// Validate serverName against path traversal attacks
|
|
@@ -16,7 +16,7 @@ class XrayEnforcerToolsServer {
|
|
|
16
16
|
server;
|
|
17
17
|
constructor() {
|
|
18
18
|
this.server = new Server({
|
|
19
|
-
name: "enforcer", version: "1.
|
|
19
|
+
name: "enforcer", version: "3.1.0",
|
|
20
20
|
}, {
|
|
21
21
|
capabilities: {
|
|
22
22
|
tools: {},
|
|
@@ -771,7 +771,7 @@ class XrayEnforcerToolsServer {
|
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
774
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
775
775
|
const server = new XrayEnforcerToolsServer();
|
|
776
776
|
server.run().catch((error) => frameworkLogger.log("mcps/enforcer", "run", "error", { error: String(error) }));
|
|
777
777
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
7
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
8
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
+
import * as fs from "fs";
|
|
9
10
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
10
11
|
import { getEstimationValidator } from "../validation/estimation-validator.js";
|
|
11
12
|
/**
|
|
@@ -17,7 +18,7 @@ class EstimationServer {
|
|
|
17
18
|
validator = getEstimationValidator();
|
|
18
19
|
constructor() {
|
|
19
20
|
this.server = new Server({
|
|
20
|
-
name: "estimation-validator", version: "1.
|
|
21
|
+
name: "estimation-validator", version: "3.1.0",
|
|
21
22
|
}, {
|
|
22
23
|
capabilities: { tools: {} },
|
|
23
24
|
});
|
|
@@ -185,7 +186,7 @@ class EstimationServer {
|
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
// Run if called directly
|
|
188
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
189
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
189
190
|
const server = new EstimationServer();
|
|
190
191
|
server.start().catch((error) => frameworkLogger.log("mcps/estimation", "run", "error", { error: String(error) }));
|
|
191
192
|
}
|
|
@@ -12,7 +12,7 @@ class XrayFrameworkComplianceAuditServer {
|
|
|
12
12
|
server;
|
|
13
13
|
constructor() {
|
|
14
14
|
this.server = new Server({
|
|
15
|
-
name: "framework-compliance-audit", version: "1.
|
|
15
|
+
name: "framework-compliance-audit", version: "3.1.0",
|
|
16
16
|
}, {
|
|
17
17
|
capabilities: {
|
|
18
18
|
tools: {},
|
|
@@ -493,7 +493,7 @@ ${results.recommendations.map((r) => `• 💡 ${r}`).join("\n")}
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
// Start the server if run directly
|
|
496
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
496
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
497
497
|
const server = new XrayFrameworkComplianceAuditServer();
|
|
498
498
|
server.run().catch((error) => frameworkLogger.log("mcps/framework-compliance-audit", "run", "error", { error: String(error) }));
|
|
499
499
|
}
|