0xray 3.0.14 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore.default +59 -0
- package/.mcp.json +35 -0
- package/.opencode/codex.codex +1 -1
- package/.opencode/commands/dependency-audit.md +3 -3
- package/.opencode/commands/summary-logger.md +4 -4
- package/.opencode/enforcer-config.json +2 -2
- package/.opencode/hooks/post-commit +1 -1
- package/.opencode/init.sh +10 -4
- package/.plugin/plugin.json +11 -0
- package/AGENTS-consumer.md +46 -0
- package/AGENTS.md +10 -10
- package/LICENSE +1 -1
- package/README.md +8 -8
- package/SKILLS.md +140 -0
- package/dist/.gitignore.default +59 -0
- package/dist/AGENTS.md +10 -10
- package/dist/CHANGELOG.md +34 -0
- package/dist/LICENSE +1 -1
- package/dist/README.md +8 -8
- package/dist/SKILLS.md +140 -0
- package/dist/agents/index.js +3 -1
- package/dist/agents/registry.js +13 -0
- package/dist/analytics/routing-refiner.js +1 -1
- package/dist/architect/architectural-integrity.js +3 -3
- package/dist/benchmark/performance-benchmark.js +4 -3
- package/dist/cli/commands/antigravity-status.js +23 -23
- package/dist/cli/commands/credible-init.js +1 -1
- package/dist/cli/commands/hermes-install.js +12 -4
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +10 -1
- package/dist/cli/commands/opencode-install.js +22 -0
- package/dist/cli/commands/plugin-commands.js +2 -2
- package/dist/cli/commands/publish-agent.js +5 -5
- package/dist/cli/commands/skill-install.js +39 -2
- package/dist/cli/commands/status.js +8 -3
- package/dist/cli/commands/storyteller.js +2 -2
- package/dist/cli/index.js +17 -11
- package/dist/cli/server.js +4 -4
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.js +30 -31
- package/dist/core/bridge.mjs +26 -26
- package/dist/core/codex-formatter.js +2 -3
- package/dist/core/codex-injector.js +7 -7
- package/dist/core/config-loader.js +3 -2
- package/dist/core/config-paths.js +38 -31
- package/dist/core/context-loader.js +5 -5
- package/dist/core/features-config.js +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/logging-config.js +7 -7
- package/dist/core/orchestrator.js +2 -2
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.js +42 -41
- package/dist/delegation/agent-delegator.js +3 -3
- package/dist/enforcement/enforcer-tools.js +4 -4
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/execution/opencode-cli-invoker.js +1 -1
- package/dist/governance/governance-service.js +1 -1
- package/dist/governance/llm-governance-provider.js +223 -0
- package/dist/index.js +6 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +16 -16
- package/dist/integrations/base/README.md +1 -1
- package/dist/integrations/enforcement-gate.js +2 -2
- package/dist/integrations/governance/index.js +1 -1
- package/dist/integrations/grok/grok-cli.js +20 -6
- package/dist/integrations/grok/hooks/pre-tool-use.js +3 -3
- package/dist/integrations/grok/plugin/0xray/.mcp.json +16 -4
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/dist/integrations/hermes-agent/__init__.py +90 -79
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +60 -25
- package/dist/integrations/hermes-agent/plugin.yaml +5 -5
- package/dist/integrations/hermes-agent/schemas.py +61 -12
- package/dist/integrations/hermes-agent/test_plugin.py +124 -124
- package/dist/integrations/hermes-agent/tools.py +129 -25
- package/dist/integrations/openclaw/README.md +6 -6
- package/dist/integrations/openclaw/config.js +1 -1
- package/dist/integrations/openclaw/index.js +2 -2
- package/dist/integrations/openclaw/types.js +3 -3
- package/dist/integrations/plugins/plugin-integration.js +1 -1
- package/dist/integrations/plugins/plugin-registry.js +3 -3
- package/dist/mcps/architect-tools.server.js +3 -2
- package/dist/mcps/auto-format.server.js +2 -2
- package/dist/mcps/boot-orchestrator.server.js +2 -2
- package/dist/mcps/config/config-loader.js +40 -9
- package/dist/mcps/config/server-config-registry.js +10 -10
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/enforcer-tools.server.js +2 -2
- package/dist/mcps/estimation.server.js +3 -2
- package/dist/mcps/framework-compliance-audit.server.js +2 -2
- package/dist/mcps/framework-help.server.js +9 -8
- package/dist/mcps/governance.server.js +8 -4
- package/dist/mcps/knowledge-skills/api-design.server.js +3 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -2
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +3 -3
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +14 -39
- package/dist/mcps/knowledge-skills/content-creator.server.js +3 -3
- package/dist/mcps/knowledge-skills/database-design.server.js +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -2
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +3 -3
- package/dist/mcps/knowledge-skills/log-monitor.server.js +3 -3
- package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +3 -3
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +2 -2
- package/dist/mcps/knowledge-skills/project-analysis.server.js +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +14 -44
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +3 -2
- package/dist/mcps/knowledge-skills/session-management.server.js +3 -2
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +105 -3
- package/dist/mcps/knowledge-skills/strategist.server.js +3 -3
- package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -4
- package/dist/mcps/lint.server.js +4 -4
- package/dist/mcps/mcp-client.js +5 -5
- package/dist/mcps/model-health-check.server.js +3 -2
- package/dist/mcps/orchestrator/server.js +4 -3
- package/dist/mcps/orchestrator.server.js +2 -1
- package/dist/mcps/performance-analysis.server.js +2 -2
- package/dist/mcps/processor-pipeline.server.js +3 -2
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.js +14 -39
- package/dist/mcps/security-scan.server.js +2 -2
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/mcps/state-manager.server.js +5 -5
- package/dist/metrics/agent-metrics.js +1 -1
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +4 -4
- package/dist/orchestrator/intelligent-commit-batcher.js +2 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.js +9 -8
- package/dist/orchestrator/universal-registry-bridge.js +4 -4
- package/dist/postprocessor/PostProcessor.js +9 -9
- package/dist/postprocessor/services/RegressionAnalysisService.js +4 -4
- package/dist/postprocessor/triggers/GitHookTrigger.js +18 -18
- package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
- package/dist/processors/implementations/inference-improvement-processor.js +1 -2
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.js +2 -3
- package/dist/processors/implementations/regression-testing-processor.js +2 -2
- package/dist/processors/implementations/session-summary-processor.js +2 -2
- package/dist/processors/implementations/storytelling-trigger-processor.js +1 -2
- package/dist/public/about.html +6 -6
- package/dist/public/enterprise.html +1 -1
- package/dist/public/features.html +2 -2
- package/dist/public/index.html +4 -4
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +4 -4
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +2 -2
- package/dist/skills/api-design/SKILL.md +1 -1
- package/dist/skills/architect-tools/SKILL.md +1 -1
- package/dist/skills/architecture-patterns/SKILL.md +1 -1
- package/dist/skills/auto-format/SKILL.md +1 -1
- package/dist/skills/boot-orchestrator/SKILL.md +1 -1
- package/dist/skills/bug-triage/SKILL.md +1 -1
- package/dist/skills/code-analyzer/SKILL.md +1 -1
- package/dist/skills/code-review/SKILL.md +1 -1
- package/dist/skills/enforcer/SKILL.md +1 -1
- package/dist/skills/framework-compliance-audit/SKILL.md +1 -1
- package/dist/skills/git-workflow/SKILL.md +1 -1
- package/dist/skills/hermes-agent/SKILL.md +42 -42
- package/dist/skills/inference-improve/SKILL.md +1 -1
- package/dist/skills/lint/SKILL.md +1 -1
- package/dist/skills/log-monitor/SKILL.md +1 -1
- package/dist/skills/model-health-check/SKILL.md +1 -1
- package/dist/skills/multimodal-looker/SKILL.md +1 -1
- package/dist/skills/orchestrator/SKILL.md +1 -1
- package/dist/skills/performance-analysis/SKILL.md +1 -1
- package/dist/skills/performance-optimization/SKILL.md +1 -1
- package/dist/skills/processor-pipeline/SKILL.md +1 -1
- package/dist/skills/project-analysis/SKILL.md +1 -1
- package/dist/skills/refactoring-strategies/SKILL.md +1 -1
- package/dist/skills/registry.json +1 -1
- package/dist/skills/researcher/SKILL.md +1 -1
- package/dist/skills/security-audit/SKILL.md +1 -1
- package/dist/skills/security-scan/SKILL.md +1 -1
- package/dist/skills/session-management/SKILL.md +1 -1
- package/dist/skills/state-manager/SKILL.md +1 -1
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/skills/testing-best-practices/SKILL.md +1 -1
- package/dist/skills/testing-strategy/SKILL.md +1 -1
- package/dist/skills/ui-ux-design/SKILL.md +1 -1
- package/dist/state/index.js +1 -1
- package/dist/state/state-manager.js +3 -4
- package/dist/utils/import-resolver.js +1 -1
- package/dist/utils/path-resolver.js +2 -2
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +10 -3
- package/scripts/hooks/pre-command +1 -1
- package/scripts/hooks/run-hook.js +2 -2
- package/scripts/node/auto-reflection-generator.mjs +30 -36
- package/scripts/node/govern-reflection.mjs +1 -1
- package/scripts/node/postinstall.cjs +37 -2
- package/scripts/node/pre-publish-guard.js +13 -9
- package/scripts/node/setup-xai-oauth.mjs +244 -0
- package/scripts/node/universal-version-manager.js +8 -8
- package/scripts/node/version-manager.mjs +1 -1
- package/src/integrations/grok/plugin/0xray/.mcp.json +16 -4
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/src/mcps/architect-tools.server.ts +2 -2
- package/src/mcps/auto-format.server.ts +2 -2
- package/src/mcps/boot-orchestrator.server.ts +2 -2
- package/src/mcps/config/__tests__/config-loader.test.ts +29 -33
- package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
- package/src/mcps/config/config-loader.ts +50 -11
- package/src/mcps/config/server-config-registry.ts +10 -10
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/enforcer-tools.server.ts +2 -2
- package/src/mcps/estimation.server.ts +3 -2
- package/src/mcps/framework-compliance-audit.server.ts +2 -2
- package/src/mcps/framework-help.server.ts +9 -8
- package/src/mcps/governance.server.ts +8 -3
- package/src/mcps/knowledge-skills/api-design.server.ts +3 -2
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +2 -2
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +2 -2
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +2 -2
- package/src/mcps/knowledge-skills/code-review.server.ts +21 -36
- package/src/mcps/knowledge-skills/content-creator.server.ts +3 -3
- package/src/mcps/knowledge-skills/database-design.server.ts +2 -2
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -2
- package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -2
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +3 -3
- package/src/mcps/knowledge-skills/log-monitor.server.ts +3 -3
- package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +3 -3
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +2 -2
- package/src/mcps/knowledge-skills/project-analysis.server.ts +2 -2
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -2
- package/src/mcps/knowledge-skills/security-audit.server.ts +21 -40
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +3 -2
- package/src/mcps/knowledge-skills/session-management.server.ts +3 -2
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +113 -3
- package/src/mcps/knowledge-skills/strategist.server.ts +3 -3
- package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -2
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +2 -2
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -4
- package/src/mcps/lint.server.ts +4 -4
- package/src/mcps/mcp-client.ts +5 -5
- package/src/mcps/model-health-check.server.ts +2 -2
- package/src/mcps/orchestrator/server.ts +4 -3
- package/src/mcps/orchestrator.server.ts +2 -1
- package/src/mcps/performance-analysis.server.ts +2 -2
- package/src/mcps/processor-pipeline.server.ts +3 -2
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +21 -36
- package/src/mcps/security-scan.server.ts +2 -2
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/mcps/state-manager.server.ts +5 -5
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/dependency-audit.md +3 -3
- package/src/opencode/commands/summary-logger.md +4 -4
- package/src/opencode/enforcer-config.json +2 -2
- package/src/skills/api-design/SKILL.md +1 -1
- package/src/skills/architect-tools/SKILL.md +1 -1
- package/src/skills/architecture-patterns/SKILL.md +1 -1
- package/src/skills/auto-format/SKILL.md +1 -1
- package/src/skills/boot-orchestrator/SKILL.md +1 -1
- package/src/skills/bug-triage/SKILL.md +1 -1
- package/src/skills/code-analyzer/SKILL.md +1 -1
- package/src/skills/code-review/SKILL.md +1 -1
- package/src/skills/enforcer/SKILL.md +1 -1
- package/src/skills/framework-compliance-audit/SKILL.md +1 -1
- package/src/skills/git-workflow/SKILL.md +1 -1
- package/src/skills/hermes-agent/SKILL.md +42 -42
- package/src/skills/inference-improve/SKILL.md +1 -1
- package/src/skills/lint/SKILL.md +1 -1
- package/src/skills/log-monitor/SKILL.md +1 -1
- package/src/skills/model-health-check/SKILL.md +1 -1
- package/src/skills/multimodal-looker/SKILL.md +1 -1
- package/src/skills/orchestrator/SKILL.md +1 -1
- package/src/skills/performance-analysis/SKILL.md +1 -1
- package/src/skills/performance-optimization/SKILL.md +1 -1
- package/src/skills/processor-pipeline/SKILL.md +1 -1
- package/src/skills/project-analysis/SKILL.md +1 -1
- package/src/skills/refactoring-strategies/SKILL.md +1 -1
- package/src/skills/registry.json +1 -1
- package/src/skills/researcher/SKILL.md +1 -1
- package/src/skills/security-audit/SKILL.md +1 -1
- package/src/skills/security-scan/SKILL.md +1 -1
- package/src/skills/session-management/SKILL.md +1 -1
- package/src/skills/state-manager/SKILL.md +1 -1
- package/src/skills/storyteller/SKILL.md +1 -1
- package/src/skills/testing-best-practices/SKILL.md +1 -1
- package/src/skills/testing-strategy/SKILL.md +1 -1
- package/src/skills/ui-ux-design/SKILL.md +1 -1
- package/xray/agents_template.md +46 -0
- package/xray/codex.json +598 -0
- package/dist/plugin/xray-codex-injection.js +0 -857
- /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
|
@@ -2,25 +2,23 @@
|
|
|
2
2
|
* Config Path Resolver
|
|
3
3
|
*
|
|
4
4
|
* Centralizes all 0xRay config file path resolution.
|
|
5
|
-
* Supports
|
|
6
|
-
* making .opencode/ completely optional for environments like Hermes Agent.
|
|
5
|
+
* Supports XRAY_CONFIG_DIR env var for custom config roots.
|
|
7
6
|
*
|
|
8
7
|
* Resolution order (per file type):
|
|
9
|
-
* 1.
|
|
10
|
-
* 2. .
|
|
11
|
-
* 3.
|
|
12
|
-
* 4. null (callers fall back to built-in defaults)
|
|
8
|
+
* 1. XRAY_CONFIG_DIR/<relative_path> (if env var set)
|
|
9
|
+
* 2. .xray/<relative_path> (preferred lightweight root)
|
|
10
|
+
* 3. null (callers fall back to built-in defaults)
|
|
13
11
|
*
|
|
14
12
|
* For state/data directories, uses:
|
|
15
|
-
* 1.
|
|
16
|
-
* 2. .
|
|
13
|
+
* 1. XRAY_CONFIG_DIR/state (if env var set)
|
|
14
|
+
* 2. .xray/state
|
|
17
15
|
* 3. .opencode/state (legacy)
|
|
18
|
-
* 4. .
|
|
16
|
+
* 4. .xray/state (default — always writable)
|
|
19
17
|
*/
|
|
20
18
|
import { existsSync } from "fs";
|
|
21
19
|
import { join, resolve } from "path";
|
|
22
20
|
/** Environment variable name for custom config root */
|
|
23
|
-
export const
|
|
21
|
+
export const XRAY_CONFIG_DIR_ENV = "XRAY_CONFIG_DIR";
|
|
24
22
|
/** Resolved config directories, cached per projectRoot */
|
|
25
23
|
const _resolvedConfigDirs = new Map();
|
|
26
24
|
/**
|
|
@@ -28,11 +26,11 @@ const _resolvedConfigDirs = new Map();
|
|
|
28
26
|
* Scans in priority order and caches the first one that exists (or the first default).
|
|
29
27
|
*/
|
|
30
28
|
export function getConfigDir(projectRoot) {
|
|
31
|
-
const root = projectRoot
|
|
29
|
+
const root = resolveRoot(projectRoot);
|
|
32
30
|
const cached = _resolvedConfigDirs.get(root);
|
|
33
31
|
if (cached)
|
|
34
32
|
return cached;
|
|
35
|
-
const envDir = process.env[
|
|
33
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
36
34
|
// Priority candidates
|
|
37
35
|
const candidates = [];
|
|
38
36
|
if (envDir) {
|
|
@@ -40,8 +38,7 @@ export function getConfigDir(projectRoot) {
|
|
|
40
38
|
const resolved = resolve(root, envDir);
|
|
41
39
|
candidates.push({ dir: resolved, source: "env" });
|
|
42
40
|
}
|
|
43
|
-
candidates.push({ dir: join(root, ".
|
|
44
|
-
candidates.push({ dir: join(root, ".opencode", "strray"), source: "dot-opencode" });
|
|
41
|
+
candidates.push({ dir: join(root, ".xray"), source: "dot-xray" });
|
|
45
42
|
// Return the first that exists, or the highest-priority default
|
|
46
43
|
for (const c of candidates) {
|
|
47
44
|
if (existsSync(c.dir)) {
|
|
@@ -49,7 +46,7 @@ export function getConfigDir(projectRoot) {
|
|
|
49
46
|
return c.dir;
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
// Nothing exists — use highest priority default (env > .
|
|
49
|
+
// Nothing exists — use highest priority default (env > .xray)
|
|
53
50
|
const defaultDir = candidates[0];
|
|
54
51
|
_resolvedConfigDirs.set(root, defaultDir.dir);
|
|
55
52
|
return defaultDir.dir;
|
|
@@ -62,14 +59,13 @@ export function getConfigDir(projectRoot) {
|
|
|
62
59
|
* @param projectRoot - Optional project root override
|
|
63
60
|
*/
|
|
64
61
|
export function resolveConfigPath(relativePath, projectRoot) {
|
|
65
|
-
const root = projectRoot
|
|
66
|
-
const envDir = process.env[
|
|
62
|
+
const root = resolveRoot(projectRoot);
|
|
63
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
67
64
|
const candidates = [];
|
|
68
65
|
if (envDir) {
|
|
69
66
|
candidates.push(resolve(root, envDir, relativePath));
|
|
70
67
|
}
|
|
71
|
-
candidates.push(join(root, ".
|
|
72
|
-
candidates.push(join(root, ".opencode", "strray", relativePath));
|
|
68
|
+
candidates.push(join(root, ".xray", relativePath));
|
|
73
69
|
for (const candidate of candidates) {
|
|
74
70
|
if (existsSync(candidate)) {
|
|
75
71
|
return candidate;
|
|
@@ -84,13 +80,13 @@ export function resolveConfigPath(relativePath, projectRoot) {
|
|
|
84
80
|
* Similar logic to resolveConfigPath but for the state/ subdirectory.
|
|
85
81
|
*/
|
|
86
82
|
export function resolveStateDir(projectRoot) {
|
|
87
|
-
const root = projectRoot
|
|
88
|
-
const envDir = process.env[
|
|
83
|
+
const root = resolveRoot(projectRoot);
|
|
84
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
89
85
|
const candidates = [];
|
|
90
86
|
if (envDir) {
|
|
91
87
|
candidates.push(join(root, envDir, "state"));
|
|
92
88
|
}
|
|
93
|
-
candidates.push(join(root, ".
|
|
89
|
+
candidates.push(join(root, ".xray", "state"));
|
|
94
90
|
candidates.push(join(root, ".opencode", "state"));
|
|
95
91
|
for (const candidate of candidates) {
|
|
96
92
|
if (existsSync(candidate)) {
|
|
@@ -111,14 +107,13 @@ export function resolveStateFilePath(projectRoot) {
|
|
|
111
107
|
* Get the profiles storage directory.
|
|
112
108
|
*/
|
|
113
109
|
export function resolveProfilesDir(projectRoot) {
|
|
114
|
-
const root = projectRoot
|
|
115
|
-
const envDir = process.env[
|
|
110
|
+
const root = resolveRoot(projectRoot);
|
|
111
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
116
112
|
const candidates = [];
|
|
117
113
|
if (envDir) {
|
|
118
114
|
candidates.push(join(root, envDir, "profiles"));
|
|
119
115
|
}
|
|
120
|
-
candidates.push(join(root, ".
|
|
121
|
-
candidates.push(join(root, ".opencode", "strray", "profiles"));
|
|
116
|
+
candidates.push(join(root, ".xray", "profiles"));
|
|
122
117
|
for (const candidate of candidates) {
|
|
123
118
|
if (existsSync(candidate)) {
|
|
124
119
|
return candidate;
|
|
@@ -130,16 +125,28 @@ export function resolveProfilesDir(projectRoot) {
|
|
|
130
125
|
* Resolve codex.json path.
|
|
131
126
|
* Has additional fallback locations beyond the standard config dir.
|
|
132
127
|
*/
|
|
128
|
+
/** Environment variable for explicit project root override */
|
|
129
|
+
export const XRAY_ROOT_ENV = "XRAY_ROOT";
|
|
130
|
+
/**
|
|
131
|
+
* Resolve project root using XRAY_ROOT env var if set,
|
|
132
|
+
* otherwise fall back to projectRoot param or cwd.
|
|
133
|
+
*/
|
|
134
|
+
export function resolveProjectRoot(projectRoot) {
|
|
135
|
+
return process.env[XRAY_ROOT_ENV] || projectRoot || process.cwd();
|
|
136
|
+
}
|
|
137
|
+
/** @deprecated Use resolveProjectRoot — kept for internal consistency */
|
|
138
|
+
function resolveRoot(projectRoot) {
|
|
139
|
+
return resolveProjectRoot(projectRoot);
|
|
140
|
+
}
|
|
133
141
|
export function resolveCodexPath(projectRoot) {
|
|
134
|
-
const root = projectRoot
|
|
135
|
-
const envDir = process.env[
|
|
142
|
+
const root = resolveRoot(projectRoot);
|
|
143
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
136
144
|
const candidates = [];
|
|
137
145
|
if (envDir) {
|
|
138
146
|
candidates.push(join(root, envDir, "codex.json"));
|
|
139
147
|
}
|
|
140
|
-
candidates.push(join(root, ".
|
|
148
|
+
candidates.push(join(root, ".xray", "codex.json"));
|
|
141
149
|
candidates.push(join(root, "xray", "codex.json"));
|
|
142
|
-
candidates.push(join(root, ".opencode", "strray", "codex.json"));
|
|
143
150
|
// Additional fallback locations (for standalone usage)
|
|
144
151
|
candidates.push(join(root, "codex.json"));
|
|
145
152
|
candidates.push(join(root, "src", "codex.json"));
|
|
@@ -150,7 +157,7 @@ export function resolveCodexPath(projectRoot) {
|
|
|
150
157
|
* Get the logs directory for framework logging.
|
|
151
158
|
*/
|
|
152
159
|
export function resolveLogDir(projectRoot) {
|
|
153
|
-
const root = projectRoot
|
|
160
|
+
const root = resolveRoot(projectRoot);
|
|
154
161
|
// Logs always go to logs/framework/ regardless of config dir
|
|
155
162
|
return join(root, "logs", "framework");
|
|
156
163
|
}
|
|
@@ -22,7 +22,7 @@ function isValidMatch(match, index) {
|
|
|
22
22
|
*
|
|
23
23
|
* Loads and parses the Universal Development Codex v1.2.0 from codex.json
|
|
24
24
|
*/
|
|
25
|
-
export class
|
|
25
|
+
export class XrayContextLoader {
|
|
26
26
|
static instance;
|
|
27
27
|
cachedContext = null;
|
|
28
28
|
codexFilePaths = [];
|
|
@@ -33,10 +33,10 @@ export class StringRayContextLoader {
|
|
|
33
33
|
* Get singleton instance
|
|
34
34
|
*/
|
|
35
35
|
static getInstance() {
|
|
36
|
-
if (!
|
|
37
|
-
|
|
36
|
+
if (!XrayContextLoader.instance) {
|
|
37
|
+
XrayContextLoader.instance = new XrayContextLoader();
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return XrayContextLoader.instance;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Load codex context
|
|
@@ -266,4 +266,4 @@ export class StringRayContextLoader {
|
|
|
266
266
|
/**
|
|
267
267
|
* Export singleton instance
|
|
268
268
|
*/
|
|
269
|
-
export const
|
|
269
|
+
export const xrayContextLoader = XrayContextLoader.getInstance();
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { KernelOrchestrator } from "./orchestrator.js";
|
|
2
|
-
export {
|
|
2
|
+
export { defaultXrayConfig } from "./xray-activation.js";
|
|
3
3
|
// Decoupled config path resolution (Layer 1)
|
|
4
|
-
export { getConfigDir, resolveConfigPath, resolveStateDir, resolveProfilesDir, resolveCodexPath, resolveLogDir, resetConfigDirCache,
|
|
4
|
+
export { getConfigDir, resolveConfigPath, resolveStateDir, resolveProfilesDir, resolveCodexPath, resolveLogDir, resetConfigDirCache, XRAY_CONFIG_DIR_ENV, } from "./config-paths.js";
|
|
5
5
|
// Standalone codex formatter (Layer 2)
|
|
6
6
|
export { formatCodexPrompt, formatMinimalCodexPrompt, getCodexConfig, findCodexPath, loadCodex, BUILTIN_CODEX, } from "./codex-formatter.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Default logging configuration
|
|
2
2
|
const defaultLoggingConfig = {
|
|
3
|
-
enabled: process.env.
|
|
4
|
-
level: process.env.
|
|
3
|
+
enabled: process.env.XRAY_LOGGING_ENABLED !== "false", // Default true, can be disabled
|
|
4
|
+
level: process.env.XRAY_LOG_LEVEL || "info",
|
|
5
5
|
destinations: ["console", "file"],
|
|
6
|
-
performanceMode: process.env.
|
|
6
|
+
performanceMode: process.env.XRAY_PERFORMANCE_MODE === "true",
|
|
7
7
|
};
|
|
8
8
|
// Available log levels in priority order (higher index = more verbose)
|
|
9
9
|
const LOG_LEVELS = ["debug", "info", "warn", "error"];
|
|
@@ -32,12 +32,12 @@ export function shouldLog(level) {
|
|
|
32
32
|
return messageLevelIndex >= currentLevelIndex;
|
|
33
33
|
}
|
|
34
34
|
// Environment variable configuration
|
|
35
|
-
if (process.env.
|
|
35
|
+
if (process.env.XRAY_LOGGING_ENABLED === "false") {
|
|
36
36
|
setLoggingConfig({ enabled: false });
|
|
37
37
|
}
|
|
38
|
-
if (process.env.
|
|
39
|
-
setLoggingConfig({ level: process.env.
|
|
38
|
+
if (process.env.XRAY_LOG_LEVEL) {
|
|
39
|
+
setLoggingConfig({ level: process.env.XRAY_LOG_LEVEL });
|
|
40
40
|
}
|
|
41
|
-
if (process.env.
|
|
41
|
+
if (process.env.XRAY_PERFORMANCE_MODE === "true") {
|
|
42
42
|
setLoggingConfig({ performanceMode: true });
|
|
43
43
|
}
|
|
@@ -267,7 +267,7 @@ export class KernelOrchestrator {
|
|
|
267
267
|
`B) Use a single orchestrator for all dependent tasks\n` +
|
|
268
268
|
`C) Remove the dependency if it's not needed\n\n` +
|
|
269
269
|
`Example of correct usage:\n` +
|
|
270
|
-
` const orch = new
|
|
270
|
+
` const orch = new XrayOrchestrator();\n` +
|
|
271
271
|
` await orch.executeComplexTask("test", [\n` +
|
|
272
272
|
` { id: "task-1" },\n` +
|
|
273
273
|
` { id: "task-2", dependencies: ["task-1"] } // ✅ Same orchestrator\n` +
|
|
@@ -405,4 +405,4 @@ export class KernelOrchestrator {
|
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
export const
|
|
408
|
+
export const xrayOrchestrator = new KernelOrchestrator();
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
* @since 2026-03-03
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { XrayContextLoader } from "./context-loader.js";
|
|
11
11
|
import { validateContext, preventSystemPromptBloat } from "./context-validator.js";
|
|
12
12
|
import fs from "fs";
|
|
13
13
|
import path from "path";
|
|
@@ -140,7 +140,7 @@ export async function generateLeanSystemPrompt(config = {}) {
|
|
|
140
140
|
let finalPrompt = systemPrompt;
|
|
141
141
|
if (showCodexContext && enableTokenOptimization) {
|
|
142
142
|
try {
|
|
143
|
-
const contextLoader =
|
|
143
|
+
const contextLoader = XrayContextLoader.getInstance();
|
|
144
144
|
const loadResult = await contextLoader.loadCodexContext(process.cwd());
|
|
145
145
|
if (loadResult.success && loadResult.context) {
|
|
146
146
|
const codexSummary = generateCodexSummary(loadResult.context, maxTokenBudget);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Consumer runtime compat shim from prior
|
|
2
|
+
* Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; primary xray paths + .xray fallbacks).
|
|
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,15 +13,15 @@ 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
|
-
frameworkLogger.log("
|
|
21
|
+
frameworkLogger.log("xray-activation", "beginning xray framework activation", "info", { jobId, ...activationConfig });
|
|
22
22
|
const registryValidation = validateRegistryConsistency();
|
|
23
23
|
if (!registryValidation.valid) {
|
|
24
|
-
frameworkLogger.log("
|
|
24
|
+
frameworkLogger.log("xray-activation", "registry-validation-failed", "warning", { errors: registryValidation.errors });
|
|
25
25
|
}
|
|
26
26
|
try {
|
|
27
27
|
if (activationConfig.enableCodexInjection) {
|
|
@@ -48,87 +48,88 @@ export async function activateStringRayFramework(config = {}) {
|
|
|
48
48
|
// Ensure architectural integrity - critical components must always be active
|
|
49
49
|
await ensureCriticalComponents();
|
|
50
50
|
// Loading display moved to init.sh for dramatic line-by-line presentation
|
|
51
|
-
frameworkLogger.log("
|
|
51
|
+
frameworkLogger.log("xray-activation", "xray framework activation completed successfully", "success", { jobId });
|
|
52
52
|
}
|
|
53
53
|
catch (error) {
|
|
54
|
-
await frameworkLogger.log("
|
|
54
|
+
await frameworkLogger.log("xray-activation", "framework-activation-failed", "error", { jobId, error: String(error) });
|
|
55
55
|
throw error;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
async function activateCodexInjection(jobId) {
|
|
59
|
-
frameworkLogger.log("
|
|
59
|
+
frameworkLogger.log("xray-activation", "activating codex injection", "info", { jobId });
|
|
60
60
|
const { createXrayCodexInjectorHook } = await import("./codex-injector.js");
|
|
61
61
|
const hook = createXrayCodexInjectorHook();
|
|
62
|
-
globalThis.
|
|
63
|
-
globalThis.
|
|
64
|
-
frameworkLogger.log("
|
|
62
|
+
globalThis.xrayHooks = globalThis.xrayHooks || [];
|
|
63
|
+
globalThis.xrayHooks.push(hook);
|
|
64
|
+
frameworkLogger.log("xray-activation", "codex injection activated", "success", { jobId, hookName: hook.name });
|
|
65
65
|
}
|
|
66
66
|
async function activateHooks(jobId) {
|
|
67
67
|
try {
|
|
68
|
-
frameworkLogger.log("
|
|
68
|
+
frameworkLogger.log("xray-activation", "activating xray hooks", "info", { jobId });
|
|
69
69
|
// Create and register the Codex injector hook
|
|
70
70
|
const { createXrayCodexInjectorHook } = await import("./codex-injector");
|
|
71
71
|
const hook = createXrayCodexInjectorHook();
|
|
72
72
|
// Store hook globally for OpenCode to pick up
|
|
73
|
-
globalThis.
|
|
74
|
-
globalThis.
|
|
75
|
-
frameworkLogger.log("
|
|
73
|
+
globalThis.xrayHooks = globalThis.xrayHooks || [];
|
|
74
|
+
globalThis.xrayHooks.push(hook);
|
|
75
|
+
frameworkLogger.log("xray-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) {
|
|
82
|
-
await frameworkLogger.log("
|
|
82
|
+
await frameworkLogger.log("xray-activation", "hooks activation failed", "error", { jobId, error: String(error) });
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
async function activateBootOrchestrator(jobId) {
|
|
86
|
-
frameworkLogger.log("
|
|
86
|
+
frameworkLogger.log("xray-activation", "activating boot orchestrator", "info", { jobId });
|
|
87
87
|
const { bootOrchestrator } = await import("./boot-orchestrator");
|
|
88
88
|
await bootOrchestrator.executeBootSequence();
|
|
89
|
-
frameworkLogger.log("
|
|
89
|
+
frameworkLogger.log("xray-activation", "boot orchestrator activated", "success", { jobId });
|
|
90
90
|
}
|
|
91
91
|
async function activateStateManagement(jobId) {
|
|
92
|
-
frameworkLogger.log("
|
|
93
|
-
const {
|
|
94
|
-
const stateManager = new
|
|
92
|
+
frameworkLogger.log("xray-activation", "activating state management", "info", { jobId });
|
|
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.
|
|
97
|
-
frameworkLogger.log("
|
|
96
|
+
globalThis.xrayStateManager = stateManager;
|
|
97
|
+
frameworkLogger.log("xray-activation", "state management activated", "success", { jobId });
|
|
98
98
|
}
|
|
99
99
|
async function activateOrchestrator(jobId) {
|
|
100
|
-
frameworkLogger.log("
|
|
101
|
-
const {
|
|
100
|
+
frameworkLogger.log("xray-activation", "activating xray orchestrator", "info", { jobId });
|
|
101
|
+
const { xrayOrchestrator } = await import("./orchestrator");
|
|
102
102
|
// Also activate the multi-agent orchestration coordinator
|
|
103
103
|
const { multiAgentOrchestrationCoordinator } = await import("../orchestrator/multi-agent-orchestration-coordinator");
|
|
104
|
-
frameworkLogger.log("
|
|
104
|
+
frameworkLogger.log("xray-activation", "xray orchestrator and multi-agent coordination activated", "success", { jobId });
|
|
105
105
|
}
|
|
106
106
|
async function activateProcessors(jobId) {
|
|
107
|
-
frameworkLogger.log("
|
|
107
|
+
frameworkLogger.log("xray-activation", "activating processor pipeline", "info", { jobId });
|
|
108
108
|
const { ProcessorManager } = await import("../processors/processor-manager");
|
|
109
|
-
const {
|
|
110
|
-
const stateManager = new
|
|
109
|
+
const { XrayStateManager } = await import("../state/state-manager");
|
|
110
|
+
const stateManager = new XrayStateManager();
|
|
111
111
|
const processorManager = new ProcessorManager(stateManager);
|
|
112
112
|
// Store the processor manager instance globally for framework use
|
|
113
|
-
globalThis.
|
|
114
|
-
frameworkLogger.log("
|
|
113
|
+
globalThis.xrayProcessorManager = processorManager;
|
|
114
|
+
frameworkLogger.log("xray-activation", "processor pipeline activated", "success", { jobId });
|
|
115
115
|
}
|
|
116
116
|
async function activatePostProcessor(jobId) {
|
|
117
|
-
frameworkLogger.log("
|
|
117
|
+
frameworkLogger.log("xray-activation", "activating post-processor system", "info", { jobId });
|
|
118
118
|
const { PostProcessor } = await import("../postprocessor/PostProcessor");
|
|
119
119
|
// Get existing state manager (should be initialized by boot orchestrator)
|
|
120
|
-
const stateManager = globalThis.
|
|
120
|
+
const stateManager = globalThis.xrayStateManager;
|
|
121
121
|
if (!stateManager) {
|
|
122
122
|
throw new Error("State manager not initialized - boot orchestrator must run first");
|
|
123
123
|
}
|
|
124
124
|
const postProcessor = new PostProcessor(stateManager, null, {});
|
|
125
|
-
globalThis.
|
|
126
|
-
frameworkLogger.log("
|
|
125
|
+
globalThis.xrayPostProcessor = postProcessor;
|
|
126
|
+
frameworkLogger.log("xray-activation", "post-processor system activated", "success", { jobId });
|
|
127
127
|
const { pathResolver } = await import("../utils/path-resolver.js");
|
|
128
|
-
globalThis.
|
|
129
|
-
frameworkLogger.log("
|
|
128
|
+
globalThis.xrayPathResolver = pathResolver;
|
|
129
|
+
frameworkLogger.log("xray-activation", "path resolver activated", "success", { jobId });
|
|
130
130
|
const { CodexInjector } = await import("./codex-injector.js");
|
|
131
131
|
const codexInjector = new CodexInjector();
|
|
132
|
-
globalThis.
|
|
133
|
-
frameworkLogger.log("
|
|
132
|
+
globalThis.xrayCodexInjector = codexInjector;
|
|
133
|
+
frameworkLogger.log("xray-activation", "codex injector activated", "success", { jobId });
|
|
134
134
|
}
|
|
135
|
+
// Backward compat aliases
|
|
@@ -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(), ".
|
|
50
|
+
path.resolve(process.cwd(), ".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;
|
|
@@ -5,8 +5,8 @@
|
|
|
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 {
|
|
9
|
-
import {
|
|
8
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
9
|
+
import { xrayConfigLoader } from "../core/config-loader.js";
|
|
10
10
|
import * as fs from "fs";
|
|
11
11
|
import * as path from "path";
|
|
12
12
|
// Minimum confidence to auto-delegate to another agent
|
|
@@ -325,9 +325,9 @@ 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
|
-
const delegator = new AgentDelegator(stateManager,
|
|
330
|
+
const delegator = new AgentDelegator(stateManager, xrayConfigLoader);
|
|
331
331
|
// Build task description for the delegated agent
|
|
332
332
|
const taskDescription = buildTaskDescription(operation, context);
|
|
333
333
|
// Build the delegation request
|
|
@@ -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/, 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(".
|
|
39
|
+
return found ?? candidates[0] ?? this.resolvePath(".xray/codex.json");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Check if codex.json exists.
|
|
@@ -17,7 +17,7 @@ import { getConfigDir } from "../core/config-paths.js";
|
|
|
17
17
|
let opencodeAvailable = null;
|
|
18
18
|
export async function invokeViaOpencode(agentName, prompt, projectRoot = process.cwd()) {
|
|
19
19
|
// In pure MCP mode we must never reach here
|
|
20
|
-
if (process.env.
|
|
20
|
+
if (process.env.XRAY_FORCE_MCP_GOVERNANCE === "true") {
|
|
21
21
|
throw new Error(`[PURE MCP] invokeViaOpencode called for "${agentName}" — this path is forbidden.`);
|
|
22
22
|
}
|
|
23
23
|
// GATE: Centralized spawn gate — blocks all agent spawning by default
|
|
@@ -128,7 +128,7 @@ export class GovernanceService {
|
|
|
128
128
|
}
|
|
129
129
|
async callSkillServer(serverName, proposals, context) {
|
|
130
130
|
const votes = [];
|
|
131
|
-
const useInProcess = process.env.VERCEL === '1';
|
|
131
|
+
const useInProcess = process.env.VERCEL === '1' || !!process.env.RAILWAY_ENVIRONMENT;
|
|
132
132
|
for (const proposal of proposals) {
|
|
133
133
|
try {
|
|
134
134
|
let text = '';
|