0xray 3.1.0 → 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 +6 -0
- package/.plugin/plugin.json +11 -0
- package/AGENTS-consumer.md +46 -0
- package/AGENTS.md +8 -8
- package/LICENSE +1 -1
- package/README.md +8 -8
- package/SKILLS.md +140 -0
- package/dist/.gitignore.default +59 -0
- package/dist/AGENTS.md +8 -8
- package/dist/CHANGELOG.md +25 -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 +1 -2
- 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 +8 -0
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +9 -0
- package/dist/cli/commands/opencode-install.js +22 -0
- package/dist/cli/commands/skill-install.js +39 -2
- package/dist/cli/commands/status.js +5 -0
- package/dist/cli/commands/storyteller.js +1 -1
- package/dist/cli/index.js +12 -6
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.js +12 -13
- package/dist/core/bridge.mjs +4 -4
- package/dist/core/codex-formatter.js +1 -2
- package/dist/core/codex-injector.js +3 -3
- package/dist/core/config-loader.js +1 -2
- package/dist/core/config-paths.js +30 -23
- package/dist/core/context-loader.js +0 -3
- 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 +1 -1
- package/dist/core/xray-activation.js +3 -4
- package/dist/delegation/agent-delegator.js +2 -2
- package/dist/enforcement/enforcer-tools.js +2 -2
- 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 +14 -1
- package/dist/index.js +3 -5
- package/dist/inference/inference-cycle.js +11 -11
- 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 +25 -14
- package/dist/integrations/hermes-agent/bridge.mjs +39 -4
- package/dist/integrations/hermes-agent/schemas.py +49 -0
- package/dist/integrations/hermes-agent/test_plugin.py +7 -7
- package/dist/integrations/hermes-agent/tools.py +107 -3
- 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 +1 -1
- 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/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 +3 -2
- 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 +2 -2
- 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 +2 -2
- 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 +3 -2
- package/dist/mcps/lint.server.js +2 -2
- package/dist/mcps/model-health-check.server.js +3 -2
- package/dist/mcps/orchestrator/server.js +2 -1
- 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 +2 -2
- package/dist/mcps/security-scan.server.js +2 -2
- 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 +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.js +0 -1
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +1 -1
- package/dist/orchestrator/orchestrator.js +1 -2
- package/dist/orchestrator/universal-registry-bridge.js +1 -1
- package/dist/postprocessor/PostProcessor.js +5 -5
- package/dist/postprocessor/services/RegressionAnalysisService.js +2 -2
- package/dist/postprocessor/triggers/GitHookTrigger.js +4 -4
- package/dist/processors/implementations/inference-improvement-processor.js +0 -1
- package/dist/processors/implementations/publish-preflight-processor.js +0 -1
- package/dist/processors/implementations/session-summary-processor.js +2 -2
- package/dist/processors/implementations/storytelling-trigger-processor.js +0 -1
- 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 +2 -2
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +1 -1
- 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 +2 -2
- 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 +0 -1
- package/dist/state/state-manager.js +1 -2
- package/dist/utils/import-resolver.js +1 -1
- package/dist/utils/path-resolver.js +2 -2
- 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/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/config-loader.ts +50 -11
- 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 +3 -2
- 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 +2 -2
- 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 +2 -2
- 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 +3 -2
- package/src/mcps/lint.server.ts +2 -2
- package/src/mcps/model-health-check.server.ts +2 -2
- package/src/mcps/orchestrator/server.ts +2 -1
- 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 +2 -2
- package/src/mcps/security-scan.server.ts +2 -2
- 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 +2 -2
- 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,13 +2,40 @@
|
|
|
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)
|
|
38
|
+
|
|
12
39
|
|
|
13
40
|
# ── Tool: xray_validate ─────────────────────────────────────
|
|
14
41
|
|
|
@@ -189,7 +216,7 @@ def xray_hooks(args: dict, **kwargs) -> str:
|
|
|
189
216
|
else:
|
|
190
217
|
try:
|
|
191
218
|
content = git_hook.read_text()[:500]
|
|
192
|
-
if "Xray" in content or "xray" in content or
|
|
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)
|
|
@@ -212,7 +239,7 @@ def xray_hooks(args: dict, **kwargs) -> str:
|
|
|
212
239
|
if dst.exists():
|
|
213
240
|
try:
|
|
214
241
|
content = dst.read_text()[:500]
|
|
215
|
-
if "Xray" not in content and "xray" not in content
|
|
242
|
+
if "Xray" not in content and "xray" not in content:
|
|
216
243
|
dst.rename(dst.with_suffix(".xray-backup"))
|
|
217
244
|
else:
|
|
218
245
|
dst.unlink()
|
|
@@ -238,7 +265,7 @@ def xray_hooks(args: dict, **kwargs) -> str:
|
|
|
238
265
|
continue
|
|
239
266
|
try:
|
|
240
267
|
content = dst.read_text()[:500]
|
|
241
|
-
is_xray = "Xray" in content or "xray" in content or
|
|
268
|
+
is_xray = "Xray" in content or "xray" in content or False or "run-hook.js" in content
|
|
242
269
|
if is_xray or dst.is_symlink():
|
|
243
270
|
dst.unlink()
|
|
244
271
|
if backup.exists():
|
|
@@ -251,3 +278,80 @@ def xray_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,
|
|
@@ -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,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
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import * as fs from "fs";
|
|
4
5
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
5
6
|
import { AGENT_REGISTRY } from "../agents/registry.js";
|
|
6
7
|
class FrameworkHelpServer {
|
|
7
8
|
server;
|
|
8
9
|
constructor() {
|
|
9
10
|
this.server = new Server({
|
|
10
|
-
name: "xray/framework-help", version: "1.
|
|
11
|
+
name: "xray/framework-help", version: "3.1.0",
|
|
11
12
|
}, {
|
|
12
13
|
capabilities: {
|
|
13
14
|
tools: {},
|
|
@@ -393,7 +394,7 @@ ${items.map(([name, desc]) => `- **${name}**: ${desc}`).join("\n")}
|
|
|
393
394
|
}
|
|
394
395
|
}
|
|
395
396
|
// Auto-start if this file is run directly - conditional server initialization for development/testing
|
|
396
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
397
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
397
398
|
const server = new FrameworkHelpServer();
|
|
398
399
|
server.start().catch((error) => frameworkLogger.log("mcps/framework-help", "run", "error", { error: String(error) }));
|
|
399
400
|
}
|
|
@@ -18,7 +18,6 @@ import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js
|
|
|
18
18
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
19
19
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
20
20
|
import * as fs from "fs";
|
|
21
|
-
import * as path from "path";
|
|
22
21
|
import { fileURLToPath } from "url";
|
|
23
22
|
import { randomUUID } from "crypto";
|
|
24
23
|
import { getGovernanceService } from "../governance/governance-service.js";
|
|
@@ -29,7 +28,7 @@ class GovernanceServer {
|
|
|
29
28
|
server;
|
|
30
29
|
constructor() {
|
|
31
30
|
this.server = new Server({
|
|
32
|
-
name: "governance", version: "1.
|
|
31
|
+
name: "governance", version: "3.1.0",
|
|
33
32
|
}, {
|
|
34
33
|
capabilities: {
|
|
35
34
|
tools: {},
|
|
@@ -395,7 +394,12 @@ class GovernanceServer {
|
|
|
395
394
|
*/
|
|
396
395
|
async runHttp(port = parseInt(process.env.MCP_PORT ?? "3100", 10)) {
|
|
397
396
|
await this.initializeGovernance();
|
|
398
|
-
const
|
|
397
|
+
const mcpHost = process.env.MCP_HOST || "127.0.0.1";
|
|
398
|
+
const allowedHosts = process.env.MCP_ALLOWED_HOSTS?.split(",");
|
|
399
|
+
const app = createMcpExpressApp({
|
|
400
|
+
host: mcpHost,
|
|
401
|
+
...(allowedHosts ? { allowedHosts } : {}),
|
|
402
|
+
});
|
|
399
403
|
const transport = new StreamableHTTPServerTransport({
|
|
400
404
|
sessionIdGenerator: () => randomUUID(),
|
|
401
405
|
});
|
|
@@ -441,7 +445,7 @@ class GovernanceServer {
|
|
|
441
445
|
}
|
|
442
446
|
}
|
|
443
447
|
// Start the server if this file is run directly
|
|
444
|
-
const entryPoint =
|
|
448
|
+
const entryPoint = fs.realpathSync(process.argv[1] ?? "");
|
|
445
449
|
if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
|
|
446
450
|
// If --port or MCP_PORT is set, use HTTP transport (for Grok CLI compatibility)
|
|
447
451
|
const cliPort = process.argv.find((a) => a.startsWith("--port="))?.split("=")[1];
|
|
@@ -7,12 +7,13 @@
|
|
|
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 { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
11
12
|
class XrayApiDesignServer {
|
|
12
13
|
server;
|
|
13
14
|
constructor() {
|
|
14
15
|
this.server = new Server({
|
|
15
|
-
name: "api-design", version: "1.
|
|
16
|
+
name: "api-design", version: "3.1.0",
|
|
16
17
|
}, {
|
|
17
18
|
capabilities: {
|
|
18
19
|
tools: {},
|
|
@@ -116,7 +117,7 @@ class XrayApiDesignServer {
|
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
120
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
120
121
|
const server = new XrayApiDesignServer();
|
|
121
122
|
server.run().catch(() => { });
|
|
122
123
|
}
|
|
@@ -7,12 +7,13 @@
|
|
|
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 { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
11
12
|
class XrayArchitecturePatternsServer {
|
|
12
13
|
server;
|
|
13
14
|
constructor() {
|
|
14
15
|
this.server = new Server({
|
|
15
|
-
name: "architecture-patterns", version: "1.
|
|
16
|
+
name: "architecture-patterns", version: "3.1.0",
|
|
16
17
|
}, {
|
|
17
18
|
capabilities: {
|
|
18
19
|
tools: {},
|
|
@@ -106,7 +107,7 @@ class XrayArchitecturePatternsServer {
|
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
110
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
110
111
|
const server = new XrayArchitecturePatternsServer();
|
|
111
112
|
server.run().catch(() => { });
|
|
112
113
|
}
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
9
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
10
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
-
import * as
|
|
11
|
+
import * as fs from "fs";
|
|
12
12
|
import { fileURLToPath } from "url";
|
|
13
13
|
class BugTriageSpecialistServer {
|
|
14
14
|
server;
|
|
15
15
|
constructor() {
|
|
16
|
-
this.server = new Server({ name: "bug-triage-specialist", version: "1.
|
|
16
|
+
this.server = new Server({ name: "bug-triage-specialist", version: "3.1.0" }, { capabilities: { tools: {} } });
|
|
17
17
|
this.setupToolHandlers();
|
|
18
18
|
}
|
|
19
19
|
setupToolHandlers() {
|
|
@@ -466,7 +466,7 @@ class BugTriageSpecialistServer {
|
|
|
466
466
|
await this.server.connect(transport);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const entryPoint =
|
|
469
|
+
const entryPoint = fs.realpathSync(process.argv[1] ?? "");
|
|
470
470
|
if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
|
|
471
471
|
const server = new BugTriageSpecialistServer();
|
|
472
472
|
server.run();
|
|
@@ -242,7 +242,7 @@ class CodeAnalyzerServer {
|
|
|
242
242
|
},
|
|
243
243
|
];
|
|
244
244
|
constructor() {
|
|
245
|
-
this.server = new Server({ name: "code-analyzer", version: "1.
|
|
245
|
+
this.server = new Server({ name: "code-analyzer", version: "3.1.0" }, { capabilities: { tools: {} } });
|
|
246
246
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
247
247
|
tools: this.tools,
|
|
248
248
|
}));
|
|
@@ -599,7 +599,7 @@ class CodeAnalyzerServer {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
602
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
603
603
|
new CodeAnalyzerServer().run().catch(() => { });
|
|
604
604
|
}
|
|
605
605
|
export default CodeAnalyzerServer;
|
|
@@ -15,7 +15,7 @@ class XrayCodeReviewServer {
|
|
|
15
15
|
server;
|
|
16
16
|
constructor() {
|
|
17
17
|
this.server = new Server({
|
|
18
|
-
name: "code-review", version: "1.
|
|
18
|
+
name: "code-review", version: "3.1.0",
|
|
19
19
|
}, {
|
|
20
20
|
capabilities: {
|
|
21
21
|
tools: {},
|
|
@@ -815,7 +815,7 @@ class XrayCodeReviewServer {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
// Run the server if this file is executed directly
|
|
818
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
818
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
819
819
|
const server = new XrayCodeReviewServer();
|
|
820
820
|
server.run().catch(() => { });
|
|
821
821
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
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
|
|
10
|
+
import * as fs from "fs";
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
12
|
class SEOCopywriterServer {
|
|
13
13
|
server;
|
|
@@ -86,7 +86,7 @@ class SEOCopywriterServer {
|
|
|
86
86
|
},
|
|
87
87
|
];
|
|
88
88
|
constructor() {
|
|
89
|
-
this.server = new Server({ name: "content-creator", version: "1.
|
|
89
|
+
this.server = new Server({ name: "content-creator", version: "3.1.0" }, { capabilities: { tools: {} } });
|
|
90
90
|
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
91
91
|
tools: this.tools,
|
|
92
92
|
}));
|
|
@@ -248,7 +248,7 @@ class SEOCopywriterServer {
|
|
|
248
248
|
await this.server.connect(transport);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
const entryPoint =
|
|
251
|
+
const entryPoint = fs.realpathSync(process.argv[1] ?? "");
|
|
252
252
|
if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
|
|
253
253
|
const server = new SEOCopywriterServer();
|
|
254
254
|
server.run();
|
|
@@ -14,7 +14,7 @@ class XrayDatabaseDesignServer {
|
|
|
14
14
|
server;
|
|
15
15
|
constructor() {
|
|
16
16
|
this.server = new Server({
|
|
17
|
-
name: "database-design", version: "1.
|
|
17
|
+
name: "database-design", version: "3.1.0",
|
|
18
18
|
}, {
|
|
19
19
|
capabilities: {
|
|
20
20
|
tools: {},
|
|
@@ -815,7 +815,7 @@ class XrayDatabaseDesignServer {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
// Run the server if this file is executed directly
|
|
818
|
-
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
818
|
+
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
819
819
|
const server = new XrayDatabaseDesignServer();
|
|
820
820
|
server.run().catch(() => { });
|
|
821
821
|
}
|