0xray 2.0.1 → 2.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/.opencode/codex.codex +1 -1
- package/.opencode/commands/dependency-audit.md +3 -3
- package/.opencode/enforcer-config.json +2 -2
- package/.opencode/hooks/post-commit +1 -1
- package/.opencode/init.sh +2 -2
- package/AGENTS.md +1 -1
- package/README.md +2 -2
- package/dist/AGENTS.md +1 -1
- package/dist/CHANGELOG.md +10 -0
- package/dist/README.md +2 -2
- package/dist/analytics/routing-refiner.js +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 +27 -27
- 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/features-config.js +1 -1
- 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 +4 -4
- package/dist/mcps/auto-format.server.d.ts +2 -2
- package/dist/mcps/auto-format.server.js +4 -4
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -2
- package/dist/mcps/boot-orchestrator.server.js +4 -4
- 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 +4 -4
- package/dist/mcps/estimation.server.js +1 -1
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -2
- package/dist/mcps/framework-compliance-audit.server.js +4 -4
- package/dist/mcps/framework-help.server.js +7 -7
- package/dist/mcps/governance.server.js +1 -1
- 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 +4 -4
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +4 -4
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +1 -1
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +1 -1
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +4 -4
- package/dist/mcps/knowledge-skills/content-creator.server.js +1 -1
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/database-design.server.js +4 -4
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +4 -4
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +4 -4
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +1 -1
- package/dist/mcps/knowledge-skills/log-monitor.server.js +1 -1
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/mobile-development.server.js +4 -4
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +1 -1
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +4 -4
- package/dist/mcps/knowledge-skills/project-analysis.server.js +1 -1
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +4 -4
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +4 -4
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +1 -1
- package/dist/mcps/knowledge-skills/session-management.server.js +1 -1
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +1 -1
- package/dist/mcps/knowledge-skills/strategist.server.js +1 -1
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/tech-writer.server.js +5 -5
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +4 -4
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +4 -4
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +6 -6
- package/dist/mcps/lint.server.d.ts +2 -2
- package/dist/mcps/lint.server.js +6 -6
- 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 +4 -4
- 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 +4 -4
- package/dist/mcps/processor-pipeline.server.d.ts +2 -2
- package/dist/mcps/processor-pipeline.server.js +4 -4
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.d.ts +3 -3
- package/dist/mcps/researcher.server.js +5 -5
- package/dist/mcps/security-scan.server.d.ts +2 -2
- package/dist/mcps/security-scan.server.js +4 -4
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/mcps/state-manager.server.js +1 -1
- 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/orchestrator/universal-registry-bridge.js +1 -1
- 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 +12 -12
- package/dist/skills/registry.json +1 -1
- 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/pre-publish-guard.js +16 -10
- package/scripts/node/release.js +6 -6
- package/scripts/node/release.mjs +11 -11
- package/scripts/node/universal-version-manager.js +2 -2
- 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 +4 -4
- package/src/mcps/auto-format.server.ts +4 -4
- package/src/mcps/boot-orchestrator.server.ts +4 -4
- 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 +4 -4
- package/src/mcps/estimation.server.ts +1 -1
- package/src/mcps/framework-compliance-audit.server.ts +4 -4
- package/src/mcps/framework-help.server.ts +7 -7
- package/src/mcps/governance.server.ts +1 -1
- 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 +4 -4
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +4 -4
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +1 -1
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +1 -1
- package/src/mcps/knowledge-skills/code-review.server.ts +4 -4
- package/src/mcps/knowledge-skills/content-creator.server.ts +1 -1
- package/src/mcps/knowledge-skills/database-design.server.ts +4 -4
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +4 -4
- package/src/mcps/knowledge-skills/git-workflow.server.ts +4 -4
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +1 -1
- package/src/mcps/knowledge-skills/log-monitor.server.ts +1 -1
- package/src/mcps/knowledge-skills/mobile-development.server.ts +4 -4
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +1 -1
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +4 -4
- package/src/mcps/knowledge-skills/project-analysis.server.ts +1 -1
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +4 -4
- package/src/mcps/knowledge-skills/security-audit.server.test.ts +23 -23
- package/src/mcps/knowledge-skills/security-audit.server.ts +4 -4
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +1 -1
- package/src/mcps/knowledge-skills/session-management.server.ts +1 -1
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +1 -1
- package/src/mcps/knowledge-skills/strategist.server.ts +1 -1
- package/src/mcps/knowledge-skills/tech-writer.server.ts +5 -5
- package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +28 -28
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +4 -4
- package/src/mcps/knowledge-skills/testing-strategy.server.test.ts +19 -19
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +4 -4
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +6 -6
- package/src/mcps/lint.server.ts +6 -6
- package/src/mcps/mcp-client.ts +3 -3
- package/src/mcps/model-health-check.server.ts +4 -4
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/performance-analysis.server.ts +4 -4
- package/src/mcps/processor-pipeline.server.ts +4 -4
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +5 -5
- package/src/mcps/security-scan.server.ts +4 -4
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/mcps/state-manager.server.ts +1 -1
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/dependency-audit.md +3 -3
- package/src/opencode/enforcer-config.json +2 -2
- package/src/skills/hermes-agent/SKILL.md +12 -12
- package/src/skills/registry.json +1 -1
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 0xRay activation — reads config from .xray/ runtime state directory.
|
|
3
3
|
*/
|
|
4
4
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
5
5
|
import { ensureCriticalComponents } from "../architect/architectural-integrity.js";
|
|
6
6
|
import { validateRegistryConsistency } from "../agents/registry.js";
|
|
7
|
-
export const
|
|
7
|
+
export const defaultXrayConfig = {
|
|
8
8
|
enableOrchestrator: true,
|
|
9
9
|
enableBootOrchestrator: true,
|
|
10
10
|
enableStateManagement: true,
|
|
@@ -13,9 +13,9 @@ export const defaultStringRayConfig = {
|
|
|
13
13
|
enableProcessors: true,
|
|
14
14
|
enablePostProcessor: true,
|
|
15
15
|
};
|
|
16
|
-
export async function
|
|
16
|
+
export async function activateXrayFramework(config = {}) {
|
|
17
17
|
const jobId = `activation-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
|
18
|
-
const activationConfig = { ...
|
|
18
|
+
const activationConfig = { ...defaultXrayConfig, ...config };
|
|
19
19
|
// Banner display moved to init.sh execution in plugin
|
|
20
20
|
// Framework activation proceeds quietly
|
|
21
21
|
frameworkLogger.log("stringray-activation", "beginning xray framework activation", "info", { jobId, ...activationConfig });
|
|
@@ -57,25 +57,25 @@ export async function activateStringRayFramework(config = {}) {
|
|
|
57
57
|
}
|
|
58
58
|
async function activateCodexInjection(jobId) {
|
|
59
59
|
frameworkLogger.log("stringray-activation", "activating codex injection", "info", { jobId });
|
|
60
|
-
const {
|
|
61
|
-
const hook =
|
|
62
|
-
globalThis.
|
|
63
|
-
globalThis.
|
|
60
|
+
const { createXrayCodexInjectorHook } = await import("./codex-injector.js");
|
|
61
|
+
const hook = createXrayCodexInjectorHook();
|
|
62
|
+
globalThis.xrayHooks = globalThis.xrayHooks || [];
|
|
63
|
+
globalThis.xrayHooks.push(hook);
|
|
64
64
|
frameworkLogger.log("stringray-activation", "codex injection activated", "success", { jobId, hookName: hook.name });
|
|
65
65
|
}
|
|
66
66
|
async function activateHooks(jobId) {
|
|
67
67
|
try {
|
|
68
68
|
frameworkLogger.log("stringray-activation", "activating xray hooks", "info", { jobId });
|
|
69
69
|
// Create and register the Codex injector hook
|
|
70
|
-
const {
|
|
71
|
-
const hook =
|
|
70
|
+
const { createXrayCodexInjectorHook } = await import("./codex-injector");
|
|
71
|
+
const hook = createXrayCodexInjectorHook();
|
|
72
72
|
// Store hook globally for OpenCode to pick up
|
|
73
|
-
globalThis.
|
|
74
|
-
globalThis.
|
|
73
|
+
globalThis.xrayHooks = globalThis.xrayHooks || [];
|
|
74
|
+
globalThis.xrayHooks.push(hook);
|
|
75
75
|
frameworkLogger.log("stringray-activation", "xray hooks activated", "success", {
|
|
76
76
|
jobId,
|
|
77
77
|
hookName: hook.name,
|
|
78
|
-
hooksRegistered: globalThis.
|
|
78
|
+
hooksRegistered: globalThis.xrayHooks.length
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
catch (error) {
|
|
@@ -90,15 +90,16 @@ async function activateBootOrchestrator(jobId) {
|
|
|
90
90
|
}
|
|
91
91
|
async function activateStateManagement(jobId) {
|
|
92
92
|
frameworkLogger.log("stringray-activation", "activating state management", "info", { jobId });
|
|
93
|
-
const {
|
|
94
|
-
const stateManager = new
|
|
93
|
+
const { XrayStateManager } = await import("../state/state-manager");
|
|
94
|
+
const stateManager = new XrayStateManager();
|
|
95
95
|
// Store the state manager instance globally for framework use
|
|
96
|
-
globalThis.
|
|
96
|
+
globalThis.xrayStateManager = stateManager;
|
|
97
|
+
globalThis.strRayStateManager = stateManager; // backward compat
|
|
97
98
|
frameworkLogger.log("stringray-activation", "state management activated", "success", { jobId });
|
|
98
99
|
}
|
|
99
100
|
async function activateOrchestrator(jobId) {
|
|
100
101
|
frameworkLogger.log("stringray-activation", "activating xray orchestrator", "info", { jobId });
|
|
101
|
-
const {
|
|
102
|
+
const { xrayOrchestrator } = await import("./orchestrator");
|
|
102
103
|
// Also activate the multi-agent orchestration coordinator
|
|
103
104
|
const { multiAgentOrchestrationCoordinator } = await import("../orchestrator/multi-agent-orchestration-coordinator");
|
|
104
105
|
frameworkLogger.log("stringray-activation", "xray orchestrator and multi-agent coordination activated", "success", { jobId });
|
|
@@ -106,29 +107,33 @@ async function activateOrchestrator(jobId) {
|
|
|
106
107
|
async function activateProcessors(jobId) {
|
|
107
108
|
frameworkLogger.log("stringray-activation", "activating processor pipeline", "info", { jobId });
|
|
108
109
|
const { ProcessorManager } = await import("../processors/processor-manager");
|
|
109
|
-
const {
|
|
110
|
-
const stateManager = new
|
|
110
|
+
const { XrayStateManager } = await import("../state/state-manager");
|
|
111
|
+
const stateManager = new XrayStateManager();
|
|
111
112
|
const processorManager = new ProcessorManager(stateManager);
|
|
112
113
|
// Store the processor manager instance globally for framework use
|
|
113
|
-
globalThis.
|
|
114
|
+
globalThis.xrayProcessorManager = processorManager;
|
|
115
|
+
globalThis.strRayProcessorManager = processorManager; // backward compat
|
|
114
116
|
frameworkLogger.log("stringray-activation", "processor pipeline activated", "success", { jobId });
|
|
115
117
|
}
|
|
116
118
|
async function activatePostProcessor(jobId) {
|
|
117
119
|
frameworkLogger.log("stringray-activation", "activating post-processor system", "info", { jobId });
|
|
118
120
|
const { PostProcessor } = await import("../postprocessor/PostProcessor");
|
|
119
121
|
// Get existing state manager (should be initialized by boot orchestrator)
|
|
120
|
-
const stateManager = globalThis.
|
|
122
|
+
const stateManager = globalThis.xrayStateManager;
|
|
121
123
|
if (!stateManager) {
|
|
122
124
|
throw new Error("State manager not initialized - boot orchestrator must run first");
|
|
123
125
|
}
|
|
124
126
|
const postProcessor = new PostProcessor(stateManager, null, {});
|
|
125
|
-
globalThis.
|
|
127
|
+
globalThis.xrayPostProcessor = postProcessor;
|
|
128
|
+
globalThis.strRayPostProcessor = postProcessor; // backward compat
|
|
126
129
|
frameworkLogger.log("stringray-activation", "post-processor system activated", "success", { jobId });
|
|
127
130
|
const { pathResolver } = await import("../utils/path-resolver.js");
|
|
128
|
-
globalThis.
|
|
131
|
+
globalThis.xrayPathResolver = pathResolver;
|
|
132
|
+
globalThis.strRayPathResolver = pathResolver; // backward compat
|
|
129
133
|
frameworkLogger.log("stringray-activation", "path resolver activated", "success", { jobId });
|
|
130
134
|
const { CodexInjector } = await import("./codex-injector.js");
|
|
131
135
|
const codexInjector = new CodexInjector();
|
|
132
|
-
globalThis.
|
|
136
|
+
globalThis.xrayCodexInjector = codexInjector;
|
|
137
|
+
globalThis.strRayCodexInjector = codexInjector; // backward compat
|
|
133
138
|
frameworkLogger.log("stringray-activation", "codex injector activated", "success", { jobId });
|
|
134
139
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @since 2026-01-07
|
|
11
11
|
*/
|
|
12
12
|
import { ComplexityScore } from "./complexity-analyzer.js";
|
|
13
|
-
import {
|
|
13
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
14
14
|
import { strRayConfigLoader } from "../core/config-loader.js";
|
|
15
15
|
import { type AggregatedMetrics, type MetricsExport } from "./metrics-aggregator.js";
|
|
16
16
|
export interface AgentCapability {
|
|
@@ -102,7 +102,7 @@ export declare class AgentDelegator {
|
|
|
102
102
|
private agentMetrics;
|
|
103
103
|
/** Minimum confidence for a learned mapping to override hardcoded routing. */
|
|
104
104
|
private static readonly MAPPING_CONFIDENCE_THRESHOLD;
|
|
105
|
-
constructor(stateManager:
|
|
105
|
+
constructor(stateManager: XrayStateManager, configLoader: typeof strRayConfigLoader);
|
|
106
106
|
/**
|
|
107
107
|
* Load routing-mappings.json from disk (fresh each call — picks up tuner writes).
|
|
108
108
|
* Same path resolution as inference-tuner.ts.
|
|
@@ -183,4 +183,4 @@ export declare class AgentDelegator {
|
|
|
183
183
|
exportMetricsData(format?: "json" | "csv" | "summary"): MetricsExport;
|
|
184
184
|
updateAgentCapability(agentName: string, capabilities: Partial<AgentCapability>): void;
|
|
185
185
|
}
|
|
186
|
-
export declare function createAgentDelegator(stateManager:
|
|
186
|
+
export declare function createAgentDelegator(stateManager: XrayStateManager, configLoader: typeof strRayConfigLoader): AgentDelegator;
|
|
@@ -45,9 +45,9 @@ export class AgentDelegator {
|
|
|
45
45
|
*/
|
|
46
46
|
loadRoutingMappings() {
|
|
47
47
|
const candidates = [
|
|
48
|
-
path.resolve(process.cwd(), ".
|
|
48
|
+
path.resolve(process.cwd(), ".xray/routing-mappings.json"),
|
|
49
49
|
path.resolve(process.cwd(), "xray/routing-mappings.json"),
|
|
50
|
-
path.resolve(process.cwd(), ".opencode/
|
|
50
|
+
path.resolve(process.cwd(), ".opencode/xray/routing-mappings.json"),
|
|
51
51
|
path.resolve(process.cwd(), "routing-mappings.json"),
|
|
52
52
|
];
|
|
53
53
|
for (const p of candidates) {
|
|
@@ -451,7 +451,7 @@ export class AgentDelegator {
|
|
|
451
451
|
*/
|
|
452
452
|
resolveProjectDirectory() {
|
|
453
453
|
const root = process.cwd();
|
|
454
|
-
if (fs.existsSync(`${root}/package.json`) || fs.existsSync(`${root}/
|
|
454
|
+
if (fs.existsSync(`${root}/package.json`) || fs.existsSync(`${root}/xray.config.json`)) {
|
|
455
455
|
return root;
|
|
456
456
|
}
|
|
457
457
|
let current = root;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @since 2026-04-16
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { XrayStateManager } from "../state/state-manager.js";
|
|
11
11
|
export interface DelegationMetricEntry {
|
|
12
12
|
timestamp: number;
|
|
13
13
|
operation: string;
|
|
@@ -74,19 +74,19 @@ export interface MetricsExport {
|
|
|
74
74
|
exportedAt: number;
|
|
75
75
|
entryCount: number;
|
|
76
76
|
}
|
|
77
|
-
export declare function getDelegationMetrics(stateManager:
|
|
78
|
-
export declare function getOrchestrationMetrics(stateManager:
|
|
79
|
-
export declare function aggregateDelegationMetrics(stateManager:
|
|
80
|
-
export declare function aggregateOrchestrationMetrics(stateManager:
|
|
81
|
-
export declare function summarizeByAgent(stateManager:
|
|
82
|
-
export declare function summarizeByComplexityLevel(stateManager:
|
|
83
|
-
export declare function summarizeByTimePeriod(stateManager:
|
|
84
|
-
export declare function rotateMetrics(stateManager:
|
|
77
|
+
export declare function getDelegationMetrics(stateManager: XrayStateManager): DelegationMetricEntry[];
|
|
78
|
+
export declare function getOrchestrationMetrics(stateManager: XrayStateManager): OrchestrationMetricEntry[];
|
|
79
|
+
export declare function aggregateDelegationMetrics(stateManager: XrayStateManager): AggregatedMetrics;
|
|
80
|
+
export declare function aggregateOrchestrationMetrics(stateManager: XrayStateManager): AggregatedMetrics;
|
|
81
|
+
export declare function summarizeByAgent(stateManager: XrayStateManager, type?: "delegation" | "orchestration"): Record<string, unknown>;
|
|
82
|
+
export declare function summarizeByComplexityLevel(stateManager: XrayStateManager, type?: "delegation" | "orchestration"): Record<string, unknown>;
|
|
83
|
+
export declare function summarizeByTimePeriod(stateManager: XrayStateManager, type?: "delegation" | "orchestration"): Record<string, unknown>;
|
|
84
|
+
export declare function rotateMetrics(stateManager: XrayStateManager, maxEntries?: number): {
|
|
85
85
|
delegation: number;
|
|
86
86
|
orchestration: number;
|
|
87
87
|
};
|
|
88
|
-
export declare function cleanupOldMetrics(stateManager:
|
|
88
|
+
export declare function cleanupOldMetrics(stateManager: XrayStateManager, olderThan: number): {
|
|
89
89
|
delegation: number;
|
|
90
90
|
orchestration: number;
|
|
91
91
|
};
|
|
92
|
-
export declare function exportMetrics(stateManager:
|
|
92
|
+
export declare function exportMetrics(stateManager: XrayStateManager, format?: "json" | "csv" | "summary"): MetricsExport;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @since 2026-01-07
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
11
11
|
import { DelegationResult } from "./agent-delegator.js";
|
|
12
12
|
export interface SessionContext {
|
|
13
13
|
sessionId: string;
|
|
@@ -63,7 +63,7 @@ export interface SessionMetrics {
|
|
|
63
63
|
export declare class SessionCoordinator {
|
|
64
64
|
private stateManager;
|
|
65
65
|
private sessions;
|
|
66
|
-
constructor(stateManager:
|
|
66
|
+
constructor(stateManager: XrayStateManager);
|
|
67
67
|
/**
|
|
68
68
|
* Get read-only view of all sessions - avoids breaking encapsulation
|
|
69
69
|
*/
|
|
@@ -130,4 +130,4 @@ export declare class SessionCoordinator {
|
|
|
130
130
|
cleanupSession(sessionId: string): void;
|
|
131
131
|
private updateSessionMetrics;
|
|
132
132
|
}
|
|
133
|
-
export declare const createSessionCoordinator: (stateManager:
|
|
133
|
+
export declare const createSessionCoordinator: (stateManager: XrayStateManager) => SessionCoordinator;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import type { VotingSession, VotingResult, StrategySelectionContext, VotingHistoryEntry, VotingMetrics, ConflictResolutionRequest, ConflictResolutionResponse } from "./voting-types.js";
|
|
14
14
|
import { SessionCoordinator } from "./session-coordinator.js";
|
|
15
15
|
import { WeightedVotingAggregator } from "./weighted-voting-aggregator.js";
|
|
16
|
-
import {
|
|
16
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
17
17
|
export interface VotingCoordinatorConfig {
|
|
18
18
|
enableHistoryTracking: boolean;
|
|
19
19
|
enableLearning: boolean;
|
|
@@ -28,7 +28,7 @@ export declare class VotingCoordinator {
|
|
|
28
28
|
private metrics;
|
|
29
29
|
private config;
|
|
30
30
|
private aggregator;
|
|
31
|
-
constructor(stateManager:
|
|
31
|
+
constructor(stateManager: XrayStateManager, sessionCoordinator?: SessionCoordinator, config?: Partial<VotingCoordinatorConfig>);
|
|
32
32
|
initiateVoting(sessionId: string, topic: string, description: string, participants: string[], context?: StrategySelectionContext): Promise<string>;
|
|
33
33
|
submitVote(voteId: string, agentName: string, vote: string, confidence: number, reasoning?: string): boolean;
|
|
34
34
|
resolveVoting(voteId: string): VotingResult | null;
|
|
@@ -46,4 +46,4 @@ export declare class VotingCoordinator {
|
|
|
46
46
|
private initializeMetrics;
|
|
47
47
|
private updateMetricsAfterVote;
|
|
48
48
|
}
|
|
49
|
-
export declare const createVotingCoordinator: (stateManager:
|
|
49
|
+
export declare const createVotingCoordinator: (stateManager: XrayStateManager, sessionCoordinator?: SessionCoordinator) => VotingCoordinator;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { ruleEnforcer, } from "./rule-enforcer.js";
|
|
6
6
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
7
7
|
import { AgentDelegator } from "../delegation/agent-delegator.js";
|
|
8
|
-
import {
|
|
8
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
9
9
|
import { strRayConfigLoader } from "../core/config-loader.js";
|
|
10
10
|
import * as fs from "fs";
|
|
11
11
|
import * as path from "path";
|
|
@@ -325,7 +325,7 @@ async function executeReleaseWorkflow(operation, context, jobId, routing) {
|
|
|
325
325
|
async function delegateToAgent(agentName, operation, context, jobId) {
|
|
326
326
|
try {
|
|
327
327
|
// Create a minimal state manager and config loader for the delegator
|
|
328
|
-
const stateManager = new
|
|
328
|
+
const stateManager = new XrayStateManager();
|
|
329
329
|
// Create the delegator
|
|
330
330
|
const delegator = new AgentDelegator(stateManager, strRayConfigLoader);
|
|
331
331
|
// Build task description for the delegated agent
|
|
@@ -28,7 +28,7 @@ export declare class CodexLoader extends BaseLoader {
|
|
|
28
28
|
readonly name = "codex";
|
|
29
29
|
/**
|
|
30
30
|
* Path to the codex.json file.
|
|
31
|
-
|
|
31
|
+
* Uses the standard config-paths resolver which checks .xray/, .opencode/xray/, etc.
|
|
32
32
|
*/
|
|
33
33
|
private get codexPath();
|
|
34
34
|
/**
|
|
@@ -30,13 +30,13 @@ export class CodexLoader extends BaseLoader {
|
|
|
30
30
|
name = "codex";
|
|
31
31
|
/**
|
|
32
32
|
* Path to the codex.json file.
|
|
33
|
-
|
|
33
|
+
* Uses the standard config-paths resolver which checks .xray/, .opencode/xray/, etc.
|
|
34
34
|
*/
|
|
35
35
|
get codexPath() {
|
|
36
36
|
const candidates = resolveCodexPath();
|
|
37
37
|
const found = candidates.find((p) => existsSync(p));
|
|
38
38
|
// Fallback to primary path even if not found yet
|
|
39
|
-
return found ?? candidates[0] ?? this.resolvePath(".opencode/
|
|
39
|
+
return found ?? candidates[0] ?? this.resolvePath(".opencode/xray/codex.json");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Check if codex.json exists.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* This is the main entry point for the 0xRay framework.
|
|
5
5
|
* It exports the core initialization function and key components.
|
|
6
6
|
*/
|
|
7
|
-
export { StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
-
export { StringRayStateManager } from "./state/index.js";
|
|
7
|
+
export { XrayOrchestrator, XrayOrchestrator as StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
+
export { XrayStateManager, XrayStateManager as StringRayStateManager } from "./state/index.js";
|
|
9
9
|
export { AgentDelegator } from "./delegation/index.js";
|
|
10
10
|
export { frameworkLogger } from "./core/framework-logger.js";
|
|
11
11
|
export { BUILTIN_CODEX } from "./core/codex-formatter.js";
|
|
12
|
-
import {
|
|
13
|
-
export { defaultStringRayConfig };
|
|
12
|
+
import { defaultXrayConfig } from "./core/index.js";
|
|
13
|
+
export { defaultXrayConfig, defaultXrayConfig as defaultStringRayConfig };
|
|
14
14
|
export { OpenClawIntegration, initializeOpenClawIntegration, getOpenClawIntegration, shutdownOpenClawIntegration } from "./integrations/openclaw/index.js";
|
|
15
15
|
export type { OpenClawIntegrationConfig } from "./integrations/openclaw/types.js";
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function initializeXray(config?: {}): {
|
|
17
17
|
success: boolean;
|
|
18
18
|
config: {
|
|
19
19
|
enableOrchestrator: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
* This is the main entry point for the 0xRay framework.
|
|
5
5
|
* It exports the core initialization function and key components.
|
|
6
6
|
*/
|
|
7
|
-
export { StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
-
export { StringRayStateManager } from "./state/index.js";
|
|
7
|
+
export { XrayOrchestrator, XrayOrchestrator as StringRayOrchestrator } from "./orchestrator/orchestrator.js";
|
|
8
|
+
export { XrayStateManager, XrayStateManager as StringRayStateManager } from "./state/index.js";
|
|
9
9
|
export { AgentDelegator } from "./delegation/index.js";
|
|
10
10
|
export { frameworkLogger } from "./core/framework-logger.js";
|
|
11
11
|
export { BUILTIN_CODEX } from "./core/codex-formatter.js";
|
|
12
|
-
import {
|
|
13
|
-
export { defaultStringRayConfig };
|
|
12
|
+
import { defaultXrayConfig } from "./core/index.js";
|
|
13
|
+
export { defaultXrayConfig, defaultXrayConfig as defaultStringRayConfig };
|
|
14
14
|
export { OpenClawIntegration, initializeOpenClawIntegration, getOpenClawIntegration, shutdownOpenClawIntegration } from "./integrations/openclaw/index.js";
|
|
15
15
|
// Main initialization function
|
|
16
|
-
export function
|
|
17
|
-
const mergedConfig = { ...
|
|
16
|
+
export function initializeXray(config = {}) {
|
|
17
|
+
const mergedConfig = { ...defaultXrayConfig, ...config };
|
|
18
18
|
// Return a standardized initialization result
|
|
19
19
|
return {
|
|
20
20
|
success: true,
|
|
@@ -43,7 +43,7 @@ export class DeployVerifier {
|
|
|
43
43
|
if (!packCheck.passed) {
|
|
44
44
|
return this.result(false, version, tarballPath, installDir, checks, startTime);
|
|
45
45
|
}
|
|
46
|
-
installDir = fs.mkdtempSync(path.join(os.tmpdir(), "
|
|
46
|
+
installDir = fs.mkdtempSync(path.join(os.tmpdir(), "xray-deploy-verify-"));
|
|
47
47
|
const installCheck = this.runCheck("npm-install-fresh", () => {
|
|
48
48
|
this.exec(`npm install ${tarballPath} --no-save`, installDir, 60000);
|
|
49
49
|
return "Fresh install succeeded";
|
|
@@ -3,7 +3,7 @@ import * as path from "path";
|
|
|
3
3
|
import { shouldTriggerCycle, accumulateCorpus } from "./inference-accumulator.js";
|
|
4
4
|
import { DeployVerifier } from "./deploy-verifier.js";
|
|
5
5
|
import { VotingCoordinator } from "../delegation/voting-coordinator.js";
|
|
6
|
-
import {
|
|
6
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
7
7
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
8
8
|
import { getGovernanceIntegration } from "../integrations/governance/index.js";
|
|
9
9
|
import { featuresConfigLoader } from "../core/features-config.js";
|
|
@@ -50,7 +50,7 @@ export class InferenceCycle {
|
|
|
50
50
|
constructor(projectRoot, agentInvoker, options) {
|
|
51
51
|
this.projectRoot = projectRoot || process.cwd();
|
|
52
52
|
this.inferenceDir = path.join(this.projectRoot, "docs", "inference");
|
|
53
|
-
this.stateDir = path.join(this.projectRoot, ".
|
|
53
|
+
this.stateDir = path.join(this.projectRoot, ".xray", "inference");
|
|
54
54
|
this.agentInvoker = agentInvoker ?? null;
|
|
55
55
|
this.options = options ?? {};
|
|
56
56
|
}
|
|
@@ -353,7 +353,7 @@ export class InferenceCycle {
|
|
|
353
353
|
``,
|
|
354
354
|
`1. Read the relevant source files`,
|
|
355
355
|
`2. Add the missing guard, validation, or edge case handling`,
|
|
356
|
-
`3. If this is a codex rule, add the term to .opencode/
|
|
356
|
+
`3. If this is a codex rule, add the term to .opencode/xray/codex.json`,
|
|
357
357
|
`4. Make minimal, surgical changes`,
|
|
358
358
|
].join("\n");
|
|
359
359
|
try {
|
|
@@ -922,7 +922,7 @@ Respond with EXACTLY one of:
|
|
|
922
922
|
fs.mkdirSync(this.stateDir, { recursive: true });
|
|
923
923
|
}
|
|
924
924
|
const stateFile = path.join(this.stateDir, "governance-state.json");
|
|
925
|
-
const stateManager = new
|
|
925
|
+
const stateManager = new XrayStateManager();
|
|
926
926
|
if (fs.existsSync(stateFile)) {
|
|
927
927
|
try {
|
|
928
928
|
const data = JSON.parse(fs.readFileSync(stateFile, "utf-8"));
|
|
@@ -975,10 +975,10 @@ Respond with EXACTLY one of:
|
|
|
975
975
|
return texts.join("\n").trim();
|
|
976
976
|
}
|
|
977
977
|
resolveOpencodeRoot() {
|
|
978
|
-
// Use the provider-agnostic config path resolver (prefers .
|
|
978
|
+
// Use the provider-agnostic config path resolver (prefers .xray/, falls back to .opencode/xray/)
|
|
979
979
|
const configDir = getConfigDir(this.projectRoot);
|
|
980
|
-
// If we resolved to a .
|
|
981
|
-
if (configDir.includes(".
|
|
980
|
+
// If we resolved to a .xray or custom dir, use its parent as the "root"
|
|
981
|
+
if (configDir.includes(".xray") || configDir.includes("xray")) {
|
|
982
982
|
return path.dirname(configDir);
|
|
983
983
|
}
|
|
984
984
|
// Legacy fallback
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Integration Base System
|
|
2
2
|
|
|
3
|
-
The Integration Base System provides a standardized foundation for creating and managing
|
|
3
|
+
The Integration Base System provides a standardized foundation for creating and managing Xray integrations. It includes the `BaseIntegration` class, `IntegrationRegistry`, and supporting types that ensure consistent lifecycle management, event handling, and configuration across all integrations.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ src/integrations/
|
|
|
21
21
|
│ ├── ExampleIntegration.ts # Example implementation
|
|
22
22
|
│ └── index.ts # Module exports
|
|
23
23
|
├── core/ # Core framework integrations
|
|
24
|
-
│ └──
|
|
24
|
+
│ └── xray-integration.ts # Cross-framework integration
|
|
25
25
|
└── openclaw/ # External service integrations
|
|
26
26
|
├── index.ts
|
|
27
27
|
├── client.ts
|
|
@@ -283,7 +283,7 @@ export class InferenceGovernanceIntegration extends BaseIntegration {
|
|
|
283
283
|
*/
|
|
284
284
|
async loadConfig() {
|
|
285
285
|
try {
|
|
286
|
-
const configPath = path.join(process.cwd(), '.opencode', '
|
|
286
|
+
const configPath = path.join(process.cwd(), '.opencode', 'xray', 'features.json');
|
|
287
287
|
if (!fs.existsSync(configPath)) {
|
|
288
288
|
await this.log('warning', 'features.json not found, using defaults');
|
|
289
289
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Grok CLI Integration for
|
|
2
|
+
* Grok CLI Integration for 0xRay
|
|
3
3
|
*
|
|
4
4
|
* This module provides the integration points for using 0xRay with the official Grok CLI.
|
|
5
5
|
*
|
|
@@ -60,14 +60,14 @@ export async function installForGrokCLI(options = {}) {
|
|
|
60
60
|
const govMcpPath = path.resolve(__dirname, '..', '..', '..', 'dist/mcps/governance.server.js');
|
|
61
61
|
const skillsMcpPath = path.resolve(__dirname, '..', '..', '..', 'dist/mcps/knowledge-skills/skill-invocation.server.js');
|
|
62
62
|
try {
|
|
63
|
-
execSync(`grok mcp add
|
|
64
|
-
execSync(`grok mcp add
|
|
65
|
-
console.log('\x1b[32m✓ Registered
|
|
63
|
+
execSync(`grok mcp add xray-governance --command node --args "${govMcpPath}" --env "STRRAY_FORCE_MCP_GOVERNANCE=true" --env "STRRAY_ROOT=${process.cwd()}"`, { stdio: 'pipe' });
|
|
64
|
+
execSync(`grok mcp add xray-skills --command node --args "${skillsMcpPath}" --env "STRRAY_ROOT=${process.cwd()}"`, { stdio: 'pipe' });
|
|
65
|
+
console.log('\x1b[32m✓ Registered xray MCP servers with Grok CLI\x1b[0m');
|
|
66
66
|
}
|
|
67
67
|
catch {
|
|
68
68
|
console.log('\nCould not auto-register MCP servers. Run manually:');
|
|
69
|
-
console.log(` grok mcp add
|
|
70
|
-
console.log(` grok mcp add
|
|
69
|
+
console.log(` grok mcp add xray-governance --command node --args "${govMcpPath}"`);
|
|
70
|
+
console.log(` grok mcp add xray-skills --command node --args "${skillsMcpPath}"`);
|
|
71
71
|
}
|
|
72
72
|
console.log('\n✅ 0xRay is now installed as a first-class Grok CLI plugin!');
|
|
73
73
|
console.log('Restart Grok or run `grok` to load the new hooks and MCP servers.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Grok CLI PreToolUse Hook Handler for
|
|
3
|
+
* Grok CLI PreToolUse Hook Handler for 0xRay — First Class Citizen
|
|
4
4
|
*
|
|
5
5
|
* Real governance enforcement hook.
|
|
6
6
|
* When Grok is about to execute a tool (write_file, edit, terminal cmd, etc.),
|
|
@@ -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
|
}
|