0xray 3.0.14 → 3.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/hooks/post-commit +1 -1
- package/.opencode/init.sh +4 -4
- package/AGENTS.md +2 -2
- package/dist/AGENTS.md +2 -2
- package/dist/CHANGELOG.md +9 -0
- package/dist/benchmark/performance-benchmark.js +4 -2
- 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 +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/server.js +4 -4
- package/dist/core/boot-orchestrator.js +24 -24
- package/dist/core/bridge.mjs +22 -22
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.js +5 -5
- package/dist/core/config-loader.js +4 -2
- package/dist/core/config-paths.js +14 -14
- package/dist/core/context-loader.js +8 -5
- package/dist/core/index.js +1 -1
- package/dist/core/orchestrator.js +1 -1
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.js +42 -40
- 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/governance/llm-governance-provider.js +210 -0
- package/dist/index.js +8 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +7 -7
- package/dist/integrations/hermes-agent/__init__.py +72 -72
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +24 -24
- 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 +117 -117
- package/dist/integrations/hermes-agent/tools.py +25 -25
- package/dist/integrations/plugins/plugin-registry.js +2 -2
- package/dist/mcps/config/server-config-registry.js +10 -10
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/framework-help.server.js +6 -6
- package/dist/mcps/knowledge-skills/code-review.server.js +12 -37
- package/dist/mcps/knowledge-skills/security-audit.server.js +12 -42
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +2 -2
- package/dist/mcps/lint.server.js +2 -2
- package/dist/mcps/mcp-client.js +5 -5
- package/dist/mcps/orchestrator/server.js +2 -2
- package/dist/mcps/researcher.server.js +12 -37
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.js +10 -8
- package/dist/orchestrator/universal-registry-bridge.js +3 -3
- package/dist/plugin/xray-codex-injection.js +21 -21
- package/dist/postprocessor/PostProcessor.js +5 -5
- 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 +1 -1
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- 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 +1 -1
- package/dist/processors/implementations/storytelling-trigger-processor.js +1 -1
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +2 -2
- package/dist/services/inference-tuner.js +2 -2
- package/dist/skills/hermes-agent/SKILL.md +42 -42
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/state/index.js +2 -1
- package/dist/state/state-manager.js +3 -3
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +1 -1
- package/scripts/node/pre-publish-guard.js +13 -9
- package/scripts/node/universal-version-manager.js +2 -2
- package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
- package/src/mcps/config/server-config-registry.ts +10 -10
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/framework-help.server.ts +6 -6
- package/src/mcps/knowledge-skills/code-review.server.ts +19 -34
- package/src/mcps/knowledge-skills/security-audit.server.ts +19 -38
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +2 -2
- package/src/mcps/lint.server.ts +2 -2
- package/src/mcps/mcp-client.ts +5 -5
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/researcher.server.ts +19 -34
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/skills/hermes-agent/SKILL.md +42 -42
- package/src/skills/storyteller/SKILL.md +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Xray Framework Bridge for Hermes Agent
|
|
5
5
|
*
|
|
6
|
-
* Provides direct access to
|
|
6
|
+
* Provides direct access to Xray framework components
|
|
7
7
|
* (ProcessorManager, QualityGate, StateManager) from Python.
|
|
8
8
|
* Uses JSON stdin/stdout protocol for IPC.
|
|
9
9
|
*
|
|
@@ -44,7 +44,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
44
44
|
|
|
45
45
|
// ── Framework components (lazy-loaded) ───────────────────────
|
|
46
46
|
let ProcessorManager = null;
|
|
47
|
-
let
|
|
47
|
+
let XrayStateManager = null;
|
|
48
48
|
let featuresConfigLoader = null;
|
|
49
49
|
let runQualityGateWithLogging = null;
|
|
50
50
|
let enforcerValidators = null;
|
|
@@ -53,7 +53,7 @@ let frameworkLoadAttempted = false;
|
|
|
53
53
|
|
|
54
54
|
// ── Project root detection ───────────────────────────────────
|
|
55
55
|
function findProjectRoot() {
|
|
56
|
-
const envHome = process.env.
|
|
56
|
+
const envHome = process.env.XRAY_HOME;
|
|
57
57
|
if (envHome && existsSync(join(envHome, "package.json"))) return envHome;
|
|
58
58
|
|
|
59
59
|
const candidates = [
|
|
@@ -67,7 +67,7 @@ function findProjectRoot() {
|
|
|
67
67
|
const pkgPath = join(dir, "package.json");
|
|
68
68
|
if (existsSync(pkgPath)) {
|
|
69
69
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
70
|
-
if (pkg.name === "
|
|
70
|
+
if (pkg.name === "0xray" || pkg.dependencies?.["0xray"] || pkg.name === "0xray" || pkg.dependencies?.["0xray"]) {
|
|
71
71
|
return dir;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -149,11 +149,11 @@ async function loadFramework(projectRoot) {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
if (!
|
|
152
|
+
if (!XrayStateManager) {
|
|
153
153
|
const smPath = join(distDir, "state", "state-manager.js");
|
|
154
154
|
if (existsSync(smPath)) {
|
|
155
155
|
const sm = await import(smPath);
|
|
156
|
-
|
|
156
|
+
XrayStateManager = sm.XrayStateManager;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -230,15 +230,15 @@ async function runQualityGateCheck(context, projectRoot, logDir) {
|
|
|
230
230
|
|
|
231
231
|
// ── Processor Pipeline ───────────────────────────────────────
|
|
232
232
|
async function runProcessors(tool, args, phase, projectRoot, logDir) {
|
|
233
|
-
if (!ProcessorManager || !
|
|
233
|
+
if (!ProcessorManager || !XrayStateManager) {
|
|
234
234
|
return { ran: false, reason: "framework modules not loaded" };
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
const logger = new BridgeLogger(logDir);
|
|
238
238
|
|
|
239
239
|
try {
|
|
240
|
-
const stateDir = join(projectRoot, ".
|
|
241
|
-
const stateManager = new
|
|
240
|
+
const stateDir = join(projectRoot, ".xray", "state");
|
|
241
|
+
const stateManager = new XrayStateManager(stateDir);
|
|
242
242
|
const processorManager = new ProcessorManager(stateManager);
|
|
243
243
|
|
|
244
244
|
// Register processors matching OpenCode plugin
|
|
@@ -353,7 +353,7 @@ async function handleHealth(input) {
|
|
|
353
353
|
const components = {
|
|
354
354
|
qualityGate: !!runQualityGateWithLogging,
|
|
355
355
|
processorManager: !!ProcessorManager,
|
|
356
|
-
stateManager: !!
|
|
356
|
+
stateManager: !!XrayStateManager,
|
|
357
357
|
featuresConfig: !!featuresConfigLoader,
|
|
358
358
|
};
|
|
359
359
|
|
|
@@ -563,7 +563,7 @@ function handleHooks(input, projectRoot) {
|
|
|
563
563
|
const { action, hooks } = input;
|
|
564
564
|
const hookTypes = hooks || ["pre-commit", "post-commit", "pre-push", "post-push"];
|
|
565
565
|
const gitHooksDir = join(projectRoot, ".git", "hooks");
|
|
566
|
-
const
|
|
566
|
+
const xrayHooksDir = join(projectRoot, "hooks");
|
|
567
567
|
|
|
568
568
|
if (!existsSync(gitHooksDir)) {
|
|
569
569
|
return { error: "Not a git repository — no .git/hooks directory" };
|
|
@@ -575,14 +575,14 @@ function handleHooks(input, projectRoot) {
|
|
|
575
575
|
if (action === "list" || action === "status") {
|
|
576
576
|
for (const hookName of hookTypes) {
|
|
577
577
|
const gitHook = join(gitHooksDir, hookName);
|
|
578
|
-
const
|
|
578
|
+
const xrayHook = join(xrayHooksDir, hookName);
|
|
579
579
|
|
|
580
580
|
if (!existsSync(gitHook)) {
|
|
581
581
|
result.missing.push(hookName);
|
|
582
582
|
} else {
|
|
583
583
|
try {
|
|
584
584
|
const content = readFileSync(gitHook, "utf-8");
|
|
585
|
-
if (content.includes("
|
|
585
|
+
if (content.includes("Xray") || content.includes("xray") || content.includes("strray") || content.includes("run-hook.js")) {
|
|
586
586
|
result.managed.push(hookName);
|
|
587
587
|
} else {
|
|
588
588
|
result.external.push(hookName);
|
|
@@ -592,8 +592,8 @@ function handleHooks(input, projectRoot) {
|
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
-
// Check if
|
|
596
|
-
if (!existsSync(
|
|
595
|
+
// Check if xray source hook exists
|
|
596
|
+
if (!existsSync(xrayHook)) {
|
|
597
597
|
result.stale.push(hookName);
|
|
598
598
|
}
|
|
599
599
|
}
|
|
@@ -603,7 +603,7 @@ function handleHooks(input, projectRoot) {
|
|
|
603
603
|
action,
|
|
604
604
|
hooks: result,
|
|
605
605
|
gitHooksDir,
|
|
606
|
-
|
|
606
|
+
xrayHooksDir,
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
609
|
|
|
@@ -614,7 +614,7 @@ function handleHooks(input, projectRoot) {
|
|
|
614
614
|
const errors = [];
|
|
615
615
|
|
|
616
616
|
for (const hookName of hookTypes) {
|
|
617
|
-
const src = join(
|
|
617
|
+
const src = join(xrayHooksDir, hookName);
|
|
618
618
|
const dst = join(gitHooksDir, hookName);
|
|
619
619
|
|
|
620
620
|
if (!existsSync(src)) {
|
|
@@ -623,11 +623,11 @@ function handleHooks(input, projectRoot) {
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
try {
|
|
626
|
-
// Backup existing non-
|
|
626
|
+
// Backup existing non-xray hooks
|
|
627
627
|
if (existsSync(dst)) {
|
|
628
628
|
const content = readFileSync(dst, "utf-8");
|
|
629
|
-
if (!content.includes("
|
|
630
|
-
renameSync(dst, `${dst}.
|
|
629
|
+
if (!content.includes("Xray") && !content.includes("xray") && !content.includes("strray") && !content.includes("run-hook.js")) {
|
|
630
|
+
renameSync(dst, `${dst}.xray-backup`);
|
|
631
631
|
} else {
|
|
632
632
|
unlinkSync(dst);
|
|
633
633
|
}
|
|
@@ -659,15 +659,15 @@ function handleHooks(input, projectRoot) {
|
|
|
659
659
|
|
|
660
660
|
for (const hookName of hookTypes) {
|
|
661
661
|
const dst = join(gitHooksDir, hookName);
|
|
662
|
-
const backup = `${dst}.
|
|
662
|
+
const backup = `${dst}.xray-backup`;
|
|
663
663
|
|
|
664
664
|
if (!existsSync(dst)) continue;
|
|
665
665
|
|
|
666
666
|
try {
|
|
667
667
|
const content = readFileSync(dst, "utf-8");
|
|
668
|
-
const
|
|
668
|
+
const isXray = content.includes("Xray") || content.includes("xray") || content.includes("strray") || content.includes("run-hook.js");
|
|
669
669
|
|
|
670
|
-
if (
|
|
670
|
+
if (isXray || lstatSync(dst).isSymbolicLink()) {
|
|
671
671
|
unlinkSync(dst);
|
|
672
672
|
|
|
673
673
|
// Restore backup if exists
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
name:
|
|
1
|
+
name: xray-hermes
|
|
2
2
|
version: 2.2.0
|
|
3
3
|
description: 0xRay AI integration plugin — auto-enforcement hooks, quality gates, git hooks, and tool awareness for Hermes Agent
|
|
4
4
|
author: 0xRay AI
|
|
5
5
|
provides_tools:
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
6
|
+
- xray_validate
|
|
7
|
+
- xray_codex_check
|
|
8
|
+
- xray_health
|
|
9
|
+
- xray_hooks
|
|
10
10
|
provides_hooks:
|
|
11
11
|
- pre_tool_call
|
|
12
12
|
- post_tool_call
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Tool schemas — what the LLM sees."""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
"name": "
|
|
3
|
+
XRAY_VALIDATE = {
|
|
4
|
+
"name": "xray_validate",
|
|
5
5
|
"description": (
|
|
6
|
-
"Run
|
|
6
|
+
"Run Xray pre-commit validation on specified files. "
|
|
7
7
|
"Checks codex compliance, rule validation, and quality gates. "
|
|
8
8
|
"Use this before committing any code changes. Returns pass/fail "
|
|
9
9
|
"with actionable remediation for any violations."
|
|
@@ -26,8 +26,8 @@ STRRAY_VALIDATE = {
|
|
|
26
26
|
},
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
"name": "
|
|
29
|
+
XRAY_CODEX_CHECK = {
|
|
30
|
+
"name": "xray_codex_check",
|
|
31
31
|
"description": (
|
|
32
32
|
"Validate code against the Universal Development Codex (60 error-prevention terms). "
|
|
33
33
|
"Checks error-handling, type-safety, performance, security, and architecture patterns. "
|
|
@@ -57,12 +57,12 @@ STRRAY_CODEX_CHECK = {
|
|
|
57
57
|
},
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
"name": "
|
|
60
|
+
XRAY_HEALTH = {
|
|
61
|
+
"name": "xray_health",
|
|
62
62
|
"description": (
|
|
63
|
-
"Run
|
|
63
|
+
"Run Xray framework health check. Returns version, agent count, "
|
|
64
64
|
"MCP server status, and enforcement statistics. Use to verify the "
|
|
65
|
-
"
|
|
65
|
+
"Xray integration is working correctly."
|
|
66
66
|
),
|
|
67
67
|
"parameters": {
|
|
68
68
|
"type": "object",
|
|
@@ -70,10 +70,10 @@ STRRAY_HEALTH = {
|
|
|
70
70
|
},
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
"name": "
|
|
73
|
+
XRAY_HOOKS = {
|
|
74
|
+
"name": "xray_hooks",
|
|
75
75
|
"description": (
|
|
76
|
-
"Manage
|
|
76
|
+
"Manage Xray git hooks (install, uninstall, list, status). "
|
|
77
77
|
"Installs pre-commit, post-commit, pre-push, and post-push hooks "
|
|
78
78
|
"that run TypeScript validation, Codex checks, and monitoring. "
|
|
79
79
|
"Use 'install' to set up all hooks, 'list' to see current status."
|