0xray 2.0.1 → 2.1.0
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/.opencode/codex.codex +1 -1
- package/AGENTS.md +1 -1
- package/dist/AGENTS.md +1 -1
- package/dist/benchmark/performance-benchmark.d.ts +2 -2
- package/dist/benchmark/performance-benchmark.js +3 -3
- package/dist/cli/commands/hermes-install.js +4 -4
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +1 -1
- 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 +1 -1
- package/dist/cli/commands/status.js +3 -3
- package/dist/cli/commands/storyteller.js +2 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/server.js +1 -1
- package/dist/core/agent-spawn-gate.d.ts +1 -1
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.d.ts +4 -4
- package/dist/core/boot-orchestrator.js +26 -26
- package/dist/core/bridge.mjs +22 -22
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +4 -3
- package/dist/core/codex-injector.js +11 -10
- package/dist/core/config-loader.d.ts +5 -4
- package/dist/core/config-loader.js +4 -2
- package/dist/core/config-paths.d.ts +9 -8
- package/dist/core/config-paths.js +24 -23
- package/dist/core/context-loader.d.ts +4 -3
- package/dist/core/context-loader.js +7 -5
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/orchestrator.d.ts +1 -0
- package/dist/core/orchestrator.js +3 -2
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.d.ts +4 -4
- package/dist/core/xray-activation.js +29 -24
- package/dist/delegation/agent-delegator.d.ts +3 -3
- package/dist/delegation/agent-delegator.js +3 -3
- package/dist/delegation/metrics-aggregator.d.ts +11 -11
- package/dist/delegation/session-coordinator.d.ts +3 -3
- package/dist/delegation/voting-coordinator.d.ts +3 -3
- package/dist/enforcement/enforcer-tools.js +2 -2
- package/dist/enforcement/loaders/codex-loader.d.ts +1 -1
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +7 -7
- package/dist/integrations/base/README.md +2 -2
- package/dist/integrations/governance/index.js +1 -1
- package/dist/integrations/grok/grok-cli.d.ts +1 -1
- package/dist/integrations/grok/grok-cli.js +6 -6
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/dist/integrations/hermes-agent/__init__.py +77 -71
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +14 -14
- package/dist/integrations/hermes-agent/logs/framework/routing-outcomes.json +1 -0
- package/dist/integrations/hermes-agent/plugin.yaml +5 -5
- package/dist/integrations/hermes-agent/schemas.py +12 -12
- package/dist/integrations/hermes-agent/test_plugin.py +128 -125
- package/dist/integrations/hermes-agent/tools.py +85 -23
- package/dist/integrations/openclaw/README.md +16 -16
- package/dist/integrations/openclaw/api-server.d.ts +4 -4
- package/dist/integrations/openclaw/api-server.js +9 -9
- package/dist/integrations/openclaw/config.js +1 -1
- package/dist/integrations/openclaw/hooks/{strray-hooks.d.ts → xray-hooks.d.ts} +4 -4
- package/dist/integrations/openclaw/index.d.ts +4 -4
- package/dist/integrations/openclaw/index.js +4 -4
- package/dist/integrations/openclaw/types.d.ts +1 -1
- package/dist/integrations/plugins/plugin-registry.js +2 -2
- package/dist/mcps/architect-tools.server.d.ts +2 -2
- package/dist/mcps/architect-tools.server.js +3 -3
- package/dist/mcps/auto-format.server.d.ts +2 -2
- package/dist/mcps/auto-format.server.js +3 -3
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -2
- package/dist/mcps/boot-orchestrator.server.js +3 -3
- package/dist/mcps/config/server-config-registry.d.ts +1 -1
- package/dist/mcps/config/server-config-registry.js +7 -7
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/enforcer-tools.server.d.ts +2 -2
- package/dist/mcps/enforcer-tools.server.js +3 -3
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -2
- package/dist/mcps/framework-compliance-audit.server.js +3 -3
- package/dist/mcps/framework-help.server.js +6 -6
- package/dist/mcps/in-process-skill-registry.js +6 -6
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -3
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +3 -3
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/database-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -3
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -3
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +3 -3
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -3
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +3 -3
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +3 -3
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -5
- package/dist/mcps/lint.server.d.ts +2 -2
- package/dist/mcps/lint.server.js +5 -5
- package/dist/mcps/mcp-client.js +3 -3
- package/dist/mcps/model-health-check.server.d.ts +2 -2
- package/dist/mcps/model-health-check.server.js +3 -3
- package/dist/mcps/orchestrator/server.js +2 -2
- package/dist/mcps/performance-analysis.server.d.ts +2 -2
- package/dist/mcps/performance-analysis.server.js +3 -3
- package/dist/mcps/processor-pipeline.server.d.ts +2 -2
- package/dist/mcps/processor-pipeline.server.js +3 -3
- package/dist/mcps/researcher.server.d.ts +3 -3
- package/dist/mcps/researcher.server.js +4 -4
- package/dist/mcps/security-scan.server.d.ts +2 -2
- package/dist/mcps/security-scan.server.js +3 -3
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/metrics/agent-metrics.d.ts +4 -4
- package/dist/metrics/agent-metrics.js +1 -1
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +2 -2
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.d.ts +1 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.d.ts +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.d.ts +3 -2
- package/dist/orchestrator/orchestrator.js +8 -6
- package/dist/plugin/xray-codex-injection.d.ts +1 -1
- package/dist/plugin/xray-codex-injection.js +8 -7
- package/dist/postprocessor/PostProcessor.d.ts +2 -2
- package/dist/postprocessor/PostProcessor.js +1 -1
- package/dist/postprocessor/monitoring/MonitoringEngine.d.ts +2 -2
- package/dist/postprocessor/services/RegressionAnalysisService.js +2 -2
- package/dist/postprocessor/triggers/GitHookTrigger.js +14 -14
- package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
- package/dist/processors/implementations/inference-improvement-processor.js +2 -2
- package/dist/processors/implementations/log-protection-processor.d.ts +1 -1
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.d.ts +1 -1
- package/dist/processors/implementations/publish-preflight-processor.js +3 -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 +2 -2
- package/dist/processors/processor-manager.d.ts +2 -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 +2 -2
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +2 -2
- package/dist/session/session-cleanup-manager.d.ts +3 -3
- package/dist/session/session-monitor.d.ts +3 -3
- package/dist/session/session-state-manager.d.ts +3 -3
- package/dist/skills/hermes-agent/SKILL.md +11 -11
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/skills/xray-orchestrator/SKILL.md +141 -0
- package/dist/skills/xray-orchestrator/index.d.ts +13 -0
- package/dist/skills/xray-orchestrator/index.js +224 -0
- package/dist/state/index.d.ts +2 -1
- package/dist/state/index.js +2 -1
- package/dist/state/state-manager.d.ts +2 -2
- package/dist/state/state-manager.js +5 -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 +2 -2
- package/scripts/hooks/pre-command +1 -1
- package/scripts/hooks/run-hook.js +2 -2
- package/scripts/node/auto-reflection-generator.mjs +2 -2
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/release.js +6 -6
- package/scripts/node/release.mjs +10 -10
- package/scripts/node/version-manager.mjs +1 -1
- package/src/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/src/mcps/architect-tools.server.ts +3 -3
- package/src/mcps/auto-format.server.ts +3 -3
- package/src/mcps/boot-orchestrator.server.ts +3 -3
- package/src/mcps/config/server-config-registry.ts +7 -7
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/enforcer-tools.server.ts +3 -3
- package/src/mcps/framework-compliance-audit.server.ts +3 -3
- package/src/mcps/framework-help.server.ts +6 -6
- package/src/mcps/in-process-skill-registry.ts +6 -6
- package/src/mcps/knowledge-skills/api-design.server.test.ts +8 -8
- package/src/mcps/knowledge-skills/api-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +3 -3
- package/src/mcps/knowledge-skills/code-review.server.ts +3 -3
- package/src/mcps/knowledge-skills/database-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -3
- package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -3
- package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +3 -3
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -3
- package/src/mcps/knowledge-skills/security-audit.server.test.ts +23 -23
- package/src/mcps/knowledge-skills/security-audit.server.ts +3 -3
- package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +28 -28
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-strategy.server.test.ts +19 -19
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +3 -3
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -5
- package/src/mcps/lint.server.ts +5 -5
- package/src/mcps/mcp-client.ts +3 -3
- package/src/mcps/model-health-check.server.ts +3 -3
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/performance-analysis.server.ts +3 -3
- package/src/mcps/processor-pipeline.server.ts +3 -3
- package/src/mcps/researcher.server.ts +4 -4
- package/src/mcps/security-scan.server.ts +3 -3
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/opencode/codex.codex +1 -1
- package/src/skills/hermes-agent/SKILL.md +11 -11
- package/src/skills/storyteller/SKILL.md +1 -1
- package/src/skills/xray-orchestrator/SKILL.md +141 -0
- package/src/skills/xray-orchestrator/index.ts +268 -0
- package/scripts/validate-stringray-comprehensive.js +0 -636
- /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
package/scripts/node/release.js
CHANGED
|
@@ -63,7 +63,7 @@ function main() {
|
|
|
63
63
|
if (bumpType === "major" || bumpType === "minor") parts[2] = 0;
|
|
64
64
|
const nextVersion = parts.join(".");
|
|
65
65
|
|
|
66
|
-
console.log(`\n${BOLD}${BLUE}🚀
|
|
66
|
+
console.log(`\n${BOLD}${BLUE}🚀 0xray Release${RESET}`);
|
|
67
67
|
console.log(`${BOLD} ${currentVersion} → ${nextVersion} (${bumpType})${RESET}\n`);
|
|
68
68
|
|
|
69
69
|
if (dryRun) {
|
|
@@ -123,20 +123,20 @@ function main() {
|
|
|
123
123
|
console.log(`${BLUE}▸ Publishing to npm${RESET}`);
|
|
124
124
|
try {
|
|
125
125
|
execSync("npm publish --access public", { cwd: rootDir, stdio: "inherit" });
|
|
126
|
-
console.log(`${GREEN} ✓ Published
|
|
126
|
+
console.log(`${GREEN} ✓ Published 0xray@${nextVersion}${RESET}`);
|
|
127
127
|
} catch (e) {
|
|
128
128
|
const errMsg = (e.stderr?.toString() || "") + (e.message || "");
|
|
129
129
|
if (errMsg.includes("previously published")) {
|
|
130
|
-
console.log(`${GREEN} ✓ Already published
|
|
130
|
+
console.log(`${GREEN} ✓ Already published 0xray@${nextVersion}${RESET}`);
|
|
131
131
|
} else {
|
|
132
132
|
console.log(`${RED} ✗ Publish failed. Trying with --ignore-scripts...${RESET}`);
|
|
133
133
|
try {
|
|
134
134
|
execSync("npm publish --access public --ignore-scripts", { cwd: rootDir, stdio: "pipe", encoding: "utf-8" });
|
|
135
|
-
console.log(`${GREEN} ✓ Published
|
|
135
|
+
console.log(`${GREEN} ✓ Published 0xray@${nextVersion} (ignore-scripts)${RESET}`);
|
|
136
136
|
} catch (e2) {
|
|
137
137
|
const errMsg2 = (e2.stderr?.toString() || "") + (e2.message || "");
|
|
138
138
|
if (errMsg2.includes("previously published")) {
|
|
139
|
-
console.log(`${GREEN} ✓ Already published
|
|
139
|
+
console.log(`${GREEN} ✓ Already published 0xray@${nextVersion}${RESET}`);
|
|
140
140
|
} else {
|
|
141
141
|
console.log(`${RED} ✗ Publish failed: ${errMsg2.slice(0, 200)}${RESET}`);
|
|
142
142
|
process.exit(1);
|
|
@@ -153,7 +153,7 @@ function main() {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
console.log(`\n${BOLD}${GREEN}✅ Released
|
|
156
|
+
console.log(`\n${BOLD}${GREEN}✅ Released 0xray@${nextVersion}${RESET}\n`);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
main();
|
package/scripts/node/release.mjs
CHANGED
|
@@ -98,19 +98,19 @@ async function main() {
|
|
|
98
98
|
// This removes the brittle "must be exactly one ahead" problem.
|
|
99
99
|
let publishedVersion;
|
|
100
100
|
try {
|
|
101
|
-
publishedVersion = execSync('npm view
|
|
101
|
+
publishedVersion = execSync('npm view 0xray version', { encoding: 'utf-8' }).trim();
|
|
102
102
|
console.log(`📌 Latest published on npm: ${publishedVersion}`);
|
|
103
103
|
} catch {
|
|
104
|
-
publishedVersion =
|
|
105
|
-
console.log('⚠️ Could not fetch published version from npm
|
|
104
|
+
publishedVersion = null;
|
|
105
|
+
console.log('⚠️ Could not fetch published version from npm — will use local version');
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const
|
|
109
|
-
|
|
108
|
+
const baseVersion = publishedVersion || getCurrentVersion();
|
|
109
|
+
const targetVersion = bumpVersion(baseVersion, releaseType);
|
|
110
|
+
console.log(`📌 Target version (computed from ${publishedVersion ? 'registry' : 'local'}): ${targetVersion}`);
|
|
110
111
|
console.log(`📌 Release type: ${releaseType}`);
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
if (currentVersion !== targetVersion) {
|
|
113
|
+
if (publishedVersion && currentVersion !== targetVersion) {
|
|
114
114
|
console.log(`⚠️ Local version (${currentVersion}) differs from computed target. Using computed target ${targetVersion}.`);
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -154,13 +154,13 @@ async function main() {
|
|
|
154
154
|
|
|
155
155
|
// Step 5: Push
|
|
156
156
|
console.log('\n📦 Step 5: Pushing to origin...');
|
|
157
|
-
runCommand('git push origin
|
|
157
|
+
runCommand('git push origin main', 'Failed to push to origin');
|
|
158
158
|
runCommand(`git push origin v${newVersion}`, 'Failed to push tag');
|
|
159
159
|
|
|
160
160
|
// Step 6: Publish to npm
|
|
161
161
|
console.log('\n📦 Step 6: Publishing to npm...');
|
|
162
162
|
runCommand('npm publish --access public', 'npm publish failed');
|
|
163
|
-
console.log(`✅ Published
|
|
163
|
+
console.log(`✅ Published 0xray@${newVersion} to npm`);
|
|
164
164
|
|
|
165
165
|
console.log('\n╔════════════════════════════════════════════════════════╗');
|
|
166
166
|
console.log('║ ✅ Release Complete! ║');
|
|
@@ -190,7 +190,7 @@ async function main() {
|
|
|
190
190
|
{EMOJI} {feature - consumer benefit}
|
|
191
191
|
{EMOJI} {feature - consumer benefit}
|
|
192
192
|
\`\`\`
|
|
193
|
-
npm install
|
|
193
|
+
npm install 0xray@latest
|
|
194
194
|
\`\`\`
|
|
195
195
|
What xray is: {one sentence positioning}
|
|
196
196
|
#xray #AIOps #DevTools #SelfHealing #NPM`;
|
|
@@ -308,7 +308,7 @@ function updateAgentsMd(counts) {
|
|
|
308
308
|
|
|
309
309
|
// Legacy header count update (min compat for old consumer AGENTS.md files only; xray v2 YML SSOT primary)
|
|
310
310
|
agentsMd = agentsMd.replace(
|
|
311
|
-
/0xRay\s*2\.0\s*-\s*\d+\s+Agents|
|
|
311
|
+
/0xRay\s*2\.0\s*-\s*\d+\s+Agents|xray\s*v2\s*-\s*\d+\s+Agents/,
|
|
312
312
|
`xray v2 - ${counts.agents} Agents`
|
|
313
313
|
);
|
|
314
314
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mcpServers": {
|
|
3
|
-
"
|
|
3
|
+
"xray-governance": {
|
|
4
4
|
"command": "npx",
|
|
5
5
|
"args": ["-y", "0xray", "mcp", "governance"],
|
|
6
6
|
"env": {
|
|
7
|
-
"
|
|
7
|
+
"XRAY_FORCE_MCP_GOVERNANCE": "true"
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
-
"
|
|
10
|
+
"xray-skills": {
|
|
11
11
|
"command": "npx",
|
|
12
12
|
"args": ["-y", "0xray", "mcp", "skills"]
|
|
13
13
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node",
|
|
10
10
|
"args": [
|
|
11
|
-
"${
|
|
11
|
+
"${XRAY_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/pre-tool-use.js"
|
|
12
12
|
],
|
|
13
13
|
"timeout": 30000
|
|
14
14
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
23
|
"command": "echo",
|
|
24
|
-
"args": ["[0xRay] Grok session started with
|
|
24
|
+
"args": ["[0xRay] Grok session started with 0xRay governance enabled"]
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
}
|
|
@@ -35,7 +35,7 @@ interface FileNode {
|
|
|
35
35
|
extension: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
class
|
|
38
|
+
class XrayArchitectToolsServer {
|
|
39
39
|
private server: Server;
|
|
40
40
|
|
|
41
41
|
constructor() {
|
|
@@ -336,8 +336,8 @@ class StringRayArchitectToolsServer {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
339
|
-
const server = new
|
|
339
|
+
const server = new XrayArchitectToolsServer();
|
|
340
340
|
server.run().catch((error) => frameworkLogger.log("mcps/architect-tools", "run", "error", { error: String(error) }));
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
export default
|
|
343
|
+
export default XrayArchitectToolsServer;
|
|
@@ -34,7 +34,7 @@ interface FormatResults {
|
|
|
34
34
|
changes: Record<string, string[]>;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
class
|
|
37
|
+
class XrayAutoFormatServer {
|
|
38
38
|
private server: Server;
|
|
39
39
|
|
|
40
40
|
constructor() {
|
|
@@ -522,8 +522,8 @@ ${checkResults.details.map((d) => `• ${d}`).join("\n")}
|
|
|
522
522
|
|
|
523
523
|
// Start the server if run directly
|
|
524
524
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
525
|
-
const server = new
|
|
525
|
+
const server = new XrayAutoFormatServer();
|
|
526
526
|
server.run().catch((error) => frameworkLogger.log("mcps/auto-format", "run", "error", { error: String(error) }));
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
export {
|
|
529
|
+
export { XrayAutoFormatServer };
|
|
@@ -92,7 +92,7 @@ interface ShutdownFrameworkArgs {
|
|
|
92
92
|
saveState?: boolean;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
class
|
|
95
|
+
class XrayBootOrchestratorServer {
|
|
96
96
|
private server: Server;
|
|
97
97
|
private bootStatus: {
|
|
98
98
|
initialized: boolean;
|
|
@@ -1075,8 +1075,8 @@ ${results.warnings.length > 0 ? `**Warnings:**\n${results.warnings.map((w: strin
|
|
|
1075
1075
|
|
|
1076
1076
|
// Start the server if run directly
|
|
1077
1077
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1078
|
-
const server = new
|
|
1078
|
+
const server = new XrayBootOrchestratorServer();
|
|
1079
1079
|
server.run().catch((error) => frameworkLogger.log("mcps/boot-orchestrator", "run", "error", { error: String(error) }));
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
|
-
export {
|
|
1082
|
+
export { XrayBootOrchestratorServer };
|
|
@@ -21,7 +21,7 @@ import fs from 'fs';
|
|
|
21
21
|
* Resolve the correct framework root and MCP servers path.
|
|
22
22
|
* Priority:
|
|
23
23
|
* 1. STRRAY_DEV_PATH env var (explicit dev override)
|
|
24
|
-
* 2. The "
|
|
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 } {
|
|
@@ -34,7 +34,7 @@ function resolveFrameworkPaths(): { frameworkRoot: string; mcpServersPath: strin
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
// Walk upward from this module to find the package that owns the "
|
|
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.
|
|
48
|
-
const
|
|
47
|
+
if (pkg.name === '0xray' && pkg.xray) {
|
|
48
|
+
const xrayCfg = pkg.xray as Record<string, string>;
|
|
49
49
|
const frameworkRoot = currentDir;
|
|
50
|
-
const declaredMcp =
|
|
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
|
|
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
|
-
|
|
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
|
|
@@ -138,7 +138,7 @@ interface SecurityScanResults {
|
|
|
138
138
|
promptValidation?: { isSafe: boolean; riskLevel: string; violations: string[] } | { error: string };
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
class
|
|
141
|
+
class XrayEnforcerToolsServer {
|
|
142
142
|
private server: Server;
|
|
143
143
|
|
|
144
144
|
constructor() {
|
|
@@ -1099,8 +1099,8 @@ class StringRayEnforcerToolsServer {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1102
|
-
const server = new
|
|
1102
|
+
const server = new XrayEnforcerToolsServer();
|
|
1103
1103
|
server.run().catch((error) => frameworkLogger.log("mcps/enforcer", "run", "error", { error: String(error) }));
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
|
-
export default
|
|
1106
|
+
export default XrayEnforcerToolsServer;
|
|
@@ -33,7 +33,7 @@ interface AuditResults {
|
|
|
33
33
|
summary: string;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
class
|
|
36
|
+
class XrayFrameworkComplianceAuditServer {
|
|
37
37
|
private server: Server;
|
|
38
38
|
|
|
39
39
|
constructor() {
|
|
@@ -628,8 +628,8 @@ ${results.recommendations.map((r) => `• 💡 ${r}`).join("\n")}
|
|
|
628
628
|
|
|
629
629
|
// Start the server if run directly
|
|
630
630
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
631
|
-
const server = new
|
|
631
|
+
const server = new XrayFrameworkComplianceAuditServer();
|
|
632
632
|
server.run().catch((error) => frameworkLogger.log("mcps/framework-compliance-audit", "run", "error", { error: String(error) }));
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
export {
|
|
635
|
+
export { XrayFrameworkComplianceAuditServer };
|
|
@@ -40,7 +40,7 @@ class FrameworkHelpServer {
|
|
|
40
40
|
return {
|
|
41
41
|
tools: [
|
|
42
42
|
{
|
|
43
|
-
name: "
|
|
43
|
+
name: "xray_get_capabilities",
|
|
44
44
|
description:
|
|
45
45
|
"Get comprehensive list of all 0xRay framework capabilities, commands, and available tools",
|
|
46
46
|
inputSchema: {
|
|
@@ -63,7 +63,7 @@ class FrameworkHelpServer {
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
name: "
|
|
66
|
+
name: "xray_get_commands",
|
|
67
67
|
description:
|
|
68
68
|
"Get list of available 0xRay commands and their usage",
|
|
69
69
|
inputSchema: {
|
|
@@ -84,7 +84,7 @@ class FrameworkHelpServer {
|
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
name: "
|
|
87
|
+
name: "xray_explain_capability",
|
|
88
88
|
description:
|
|
89
89
|
"Get detailed explanation of a specific 0xRay capability",
|
|
90
90
|
inputSchema: {
|
|
@@ -108,11 +108,11 @@ class FrameworkHelpServer {
|
|
|
108
108
|
|
|
109
109
|
try {
|
|
110
110
|
switch (name) {
|
|
111
|
-
case "
|
|
111
|
+
case "xray_get_capabilities":
|
|
112
112
|
return this.handleGetCapabilities(args);
|
|
113
|
-
case "
|
|
113
|
+
case "xray_get_commands":
|
|
114
114
|
return this.handleGetCommands(args);
|
|
115
|
-
case "
|
|
115
|
+
case "xray_explain_capability":
|
|
116
116
|
return this.handleExplainCapability(args);
|
|
117
117
|
default:
|
|
118
118
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { XrayCodeReviewServer } from "./knowledge-skills/code-review.server.js";
|
|
2
|
+
import { XraySecurityAuditServer } from "./knowledge-skills/security-audit.server.js";
|
|
3
|
+
import { XrayLibrarianServer } from "./researcher.server.js";
|
|
4
4
|
|
|
5
5
|
interface AnalyzeProposalArgs {
|
|
6
6
|
proposalTitle?: string;
|
|
@@ -25,7 +25,7 @@ const instances = new Map<string, InProcessSkillHandler>();
|
|
|
25
25
|
|
|
26
26
|
function getCodeReview(): InProcessSkillHandler {
|
|
27
27
|
if (!instances.has("code-review")) {
|
|
28
|
-
const server = new
|
|
28
|
+
const server = new XrayCodeReviewServer();
|
|
29
29
|
instances.set("code-review", {
|
|
30
30
|
analyzeProposal: (args) => server.analyzeProposal(args) as Promise<AnalyzeProposalResult>,
|
|
31
31
|
});
|
|
@@ -35,7 +35,7 @@ function getCodeReview(): InProcessSkillHandler {
|
|
|
35
35
|
|
|
36
36
|
function getSecurityAudit(): InProcessSkillHandler {
|
|
37
37
|
if (!instances.has("security-audit")) {
|
|
38
|
-
const server = new
|
|
38
|
+
const server = new XraySecurityAuditServer();
|
|
39
39
|
instances.set("security-audit", {
|
|
40
40
|
analyzeProposal: (args) => server.analyzeProposal(args) as Promise<AnalyzeProposalResult>,
|
|
41
41
|
});
|
|
@@ -45,7 +45,7 @@ function getSecurityAudit(): InProcessSkillHandler {
|
|
|
45
45
|
|
|
46
46
|
function getResearcher(): InProcessSkillHandler {
|
|
47
47
|
if (!instances.has("researcher")) {
|
|
48
|
-
const server = new
|
|
48
|
+
const server = new XrayLibrarianServer();
|
|
49
49
|
instances.set("researcher", {
|
|
50
50
|
analyzeProposal: (args) => server.analyzeProposal(args) as Promise<AnalyzeProposalResult>,
|
|
51
51
|
});
|
|
@@ -3,35 +3,35 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, beforeEach } from "vitest";
|
|
6
|
-
import
|
|
6
|
+
import XrayApiDesignServer from "./api-design.server";
|
|
7
7
|
|
|
8
8
|
describe("api-design.server integration", () => {
|
|
9
9
|
describe("module exports", () => {
|
|
10
10
|
it("should export a server class", () => {
|
|
11
|
-
expect(
|
|
12
|
-
expect(typeof
|
|
11
|
+
expect(XrayApiDesignServer).toBeDefined();
|
|
12
|
+
expect(typeof XrayApiDesignServer).toBe("function");
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
it("should be able to instantiate the server", () => {
|
|
16
|
-
const server = new
|
|
16
|
+
const server = new XrayApiDesignServer();
|
|
17
17
|
expect(server).toBeDefined();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it("should have run method", () => {
|
|
21
|
-
const server = new
|
|
21
|
+
const server = new XrayApiDesignServer();
|
|
22
22
|
expect(typeof server.run).toBe("function");
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
describe("server structure", () => {
|
|
27
|
-
let server:
|
|
27
|
+
let server: XrayApiDesignServer;
|
|
28
28
|
|
|
29
29
|
beforeEach(() => {
|
|
30
|
-
server = new
|
|
30
|
+
server = new XrayApiDesignServer();
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
it("should instantiate correctly", () => {
|
|
34
|
-
expect(server).toBeInstanceOf(
|
|
34
|
+
expect(server).toBeInstanceOf(XrayApiDesignServer);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
it("should have run async method", () => {
|
|
@@ -25,7 +25,7 @@ interface ValidateApiDesignArgs {
|
|
|
25
25
|
standards?: string[];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
class
|
|
28
|
+
class XrayApiDesignServer {
|
|
29
29
|
private server: Server;
|
|
30
30
|
|
|
31
31
|
constructor() {
|
|
@@ -153,8 +153,8 @@ class StringRayApiDesignServer {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
156
|
-
const server = new
|
|
156
|
+
const server = new XrayApiDesignServer();
|
|
157
157
|
server.run().catch(() => {});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export default
|
|
160
|
+
export default XrayApiDesignServer;
|
|
@@ -27,7 +27,7 @@ interface RecommendPatternsArgs {
|
|
|
27
27
|
scale?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
class
|
|
30
|
+
class XrayArchitecturePatternsServer {
|
|
31
31
|
private server: Server;
|
|
32
32
|
|
|
33
33
|
constructor() {
|
|
@@ -145,8 +145,8 @@ class StringRayArchitecturePatternsServer {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
148
|
-
const server = new
|
|
148
|
+
const server = new XrayArchitecturePatternsServer();
|
|
149
149
|
server.run().catch(() => {});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export default
|
|
152
|
+
export default XrayArchitecturePatternsServer;
|
|
@@ -74,7 +74,7 @@ interface StandardsViolation {
|
|
|
74
74
|
severity: "high" | "medium" | "low";
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
class
|
|
77
|
+
class XrayCodeReviewServer {
|
|
78
78
|
private server: Server;
|
|
79
79
|
|
|
80
80
|
constructor() {
|
|
@@ -1125,8 +1125,8 @@ class StringRayCodeReviewServer {
|
|
|
1125
1125
|
|
|
1126
1126
|
// Run the server if this file is executed directly
|
|
1127
1127
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1128
|
-
const server = new
|
|
1128
|
+
const server = new XrayCodeReviewServer();
|
|
1129
1129
|
server.run().catch(() => {});
|
|
1130
1130
|
}
|
|
1131
1131
|
|
|
1132
|
-
export {
|
|
1132
|
+
export { XrayCodeReviewServer };
|
|
@@ -111,7 +111,7 @@ interface SchemaComparison {
|
|
|
111
111
|
hasDataLoss: boolean;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
class
|
|
114
|
+
class XrayDatabaseDesignServer {
|
|
115
115
|
private server: Server;
|
|
116
116
|
|
|
117
117
|
constructor() {
|
|
@@ -1193,8 +1193,8 @@ class StringRayDatabaseDesignServer {
|
|
|
1193
1193
|
|
|
1194
1194
|
// Run the server if this file is executed directly
|
|
1195
1195
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1196
|
-
const server = new
|
|
1196
|
+
const server = new XrayDatabaseDesignServer();
|
|
1197
1197
|
server.run().catch(() => {});
|
|
1198
1198
|
}
|
|
1199
1199
|
|
|
1200
|
-
export {
|
|
1200
|
+
export { XrayDatabaseDesignServer };
|
|
@@ -206,7 +206,7 @@ interface OptimizationRoadmap {
|
|
|
206
206
|
finalMetrics: DeploymentMetricsInput;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
class
|
|
209
|
+
class XrayDevOpsDeploymentServer {
|
|
210
210
|
private server: Server;
|
|
211
211
|
|
|
212
212
|
constructor() {
|
|
@@ -1615,8 +1615,8 @@ spec:
|
|
|
1615
1615
|
|
|
1616
1616
|
// Run the server if this file is executed directly
|
|
1617
1617
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1618
|
-
const server = new
|
|
1618
|
+
const server = new XrayDevOpsDeploymentServer();
|
|
1619
1619
|
server.run().catch(() => {});
|
|
1620
1620
|
}
|
|
1621
1621
|
|
|
1622
|
-
export {
|
|
1622
|
+
export { XrayDevOpsDeploymentServer };
|
|
@@ -26,7 +26,7 @@ interface RecommendBranchingStrategyArgs {
|
|
|
26
26
|
releaseFrequency?: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
class
|
|
29
|
+
class XrayGitWorkflowServer {
|
|
30
30
|
private server: Server;
|
|
31
31
|
|
|
32
32
|
constructor() {
|
|
@@ -145,8 +145,8 @@ class StringRayGitWorkflowServer {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
148
|
-
const server = new
|
|
148
|
+
const server = new XrayGitWorkflowServer();
|
|
149
149
|
server.run().catch(() => {});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export default
|
|
152
|
+
export default XrayGitWorkflowServer;
|
|
@@ -107,7 +107,7 @@ interface AppStoreMetadataArgs {
|
|
|
107
107
|
features?: string[];
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
class
|
|
110
|
+
class XrayMobileDevelopmentServer {
|
|
111
111
|
private server: Server;
|
|
112
112
|
|
|
113
113
|
constructor() {
|
|
@@ -665,8 +665,8 @@ class HomePage extends StatelessWidget {
|
|
|
665
665
|
|
|
666
666
|
const entryPoint = path.resolve(process.argv[1] ?? "");
|
|
667
667
|
if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
|
|
668
|
-
const server = new
|
|
668
|
+
const server = new XrayMobileDevelopmentServer();
|
|
669
669
|
server.start().catch(() => {});
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
-
export {
|
|
672
|
+
export { XrayMobileDevelopmentServer };
|
|
@@ -217,7 +217,7 @@ interface McpToolResponse {
|
|
|
217
217
|
data?: Record<string, unknown>;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
class
|
|
220
|
+
class XrayPerformanceOptimizationServer {
|
|
221
221
|
private server: Server;
|
|
222
222
|
private startTime: number;
|
|
223
223
|
|
|
@@ -2056,10 +2056,10 @@ ${result.recommendations.slice(0, 5).map((r, i) => `${i + 1}. ${r}`).join("\n")
|
|
|
2056
2056
|
}
|
|
2057
2057
|
|
|
2058
2058
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
2059
|
-
const server = new
|
|
2059
|
+
const server = new XrayPerformanceOptimizationServer();
|
|
2060
2060
|
server.run().catch((error) => {
|
|
2061
2061
|
frameworkLogger.log("mcp/performance-optimization", "run", "error", { error: String(error) });
|
|
2062
2062
|
});
|
|
2063
2063
|
}
|
|
2064
2064
|
|
|
2065
|
-
export {
|
|
2065
|
+
export { XrayPerformanceOptimizationServer };
|
|
@@ -154,7 +154,7 @@ interface RollbackPlan {
|
|
|
154
154
|
emergencyProcedures: string[];
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
class
|
|
157
|
+
class XrayRefactoringStrategiesServer {
|
|
158
158
|
private server: Server;
|
|
159
159
|
|
|
160
160
|
constructor() {
|
|
@@ -1085,8 +1085,8 @@ class StringRayRefactoringStrategiesServer {
|
|
|
1085
1085
|
|
|
1086
1086
|
// Run the server if this file is executed directly
|
|
1087
1087
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1088
|
-
const server = new
|
|
1088
|
+
const server = new XrayRefactoringStrategiesServer();
|
|
1089
1089
|
server.run().catch(() => {});
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
|
-
export {
|
|
1092
|
+
export { XrayRefactoringStrategiesServer };
|