0xray 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/codex.codex +1 -1
- package/AGENTS.md +1 -1
- package/dist/AGENTS.md +1 -1
- package/dist/benchmark/performance-benchmark.d.ts +2 -2
- package/dist/benchmark/performance-benchmark.js +3 -3
- package/dist/cli/commands/hermes-install.js +4 -4
- package/dist/cli/commands/mcp-install.js +1 -1
- package/dist/cli/commands/openclaw-install.js +1 -1
- package/dist/cli/commands/plugin-commands.js +2 -2
- package/dist/cli/commands/publish-agent.js +5 -5
- package/dist/cli/commands/skill-install.js +1 -1
- package/dist/cli/commands/status.js +3 -3
- package/dist/cli/commands/storyteller.js +2 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/server.js +1 -1
- package/dist/core/agent-spawn-gate.d.ts +1 -1
- package/dist/core/agent-spawn-gate.js +1 -1
- package/dist/core/boot-orchestrator.d.ts +4 -4
- package/dist/core/boot-orchestrator.js +26 -26
- package/dist/core/bridge.mjs +22 -22
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +4 -3
- package/dist/core/codex-injector.js +11 -10
- package/dist/core/config-loader.d.ts +5 -4
- package/dist/core/config-loader.js +4 -2
- package/dist/core/config-paths.d.ts +9 -8
- package/dist/core/config-paths.js +24 -23
- package/dist/core/context-loader.d.ts +4 -3
- package/dist/core/context-loader.js +7 -5
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/orchestrator.d.ts +1 -0
- package/dist/core/orchestrator.js +3 -2
- package/dist/core/system-prompt-generator.js +2 -2
- package/dist/core/xray-activation.d.ts +4 -4
- package/dist/core/xray-activation.js +29 -24
- package/dist/delegation/agent-delegator.d.ts +3 -3
- package/dist/delegation/agent-delegator.js +3 -3
- package/dist/delegation/metrics-aggregator.d.ts +11 -11
- package/dist/delegation/session-coordinator.d.ts +3 -3
- package/dist/delegation/voting-coordinator.d.ts +3 -3
- package/dist/enforcement/enforcer-tools.js +2 -2
- package/dist/enforcement/loaders/codex-loader.d.ts +1 -1
- package/dist/enforcement/loaders/codex-loader.js +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/inference/deploy-verifier.js +1 -1
- package/dist/inference/inference-cycle.js +7 -7
- package/dist/integrations/base/README.md +2 -2
- package/dist/integrations/governance/index.js +1 -1
- package/dist/integrations/grok/grok-cli.d.ts +1 -1
- package/dist/integrations/grok/grok-cli.js +6 -6
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/dist/integrations/hermes-agent/__init__.py +77 -71
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/after-install.md +14 -14
- package/dist/integrations/hermes-agent/bridge.mjs +14 -14
- package/dist/integrations/hermes-agent/logs/framework/routing-outcomes.json +1 -0
- package/dist/integrations/hermes-agent/plugin.yaml +5 -5
- package/dist/integrations/hermes-agent/schemas.py +12 -12
- package/dist/integrations/hermes-agent/test_plugin.py +128 -125
- package/dist/integrations/hermes-agent/tools.py +85 -23
- package/dist/integrations/openclaw/README.md +16 -16
- package/dist/integrations/openclaw/api-server.d.ts +4 -4
- package/dist/integrations/openclaw/api-server.js +9 -9
- package/dist/integrations/openclaw/config.js +1 -1
- package/dist/integrations/openclaw/hooks/{strray-hooks.d.ts → xray-hooks.d.ts} +4 -4
- package/dist/integrations/openclaw/index.d.ts +4 -4
- package/dist/integrations/openclaw/index.js +4 -4
- package/dist/integrations/openclaw/types.d.ts +1 -1
- package/dist/integrations/plugins/plugin-registry.js +2 -2
- package/dist/mcps/architect-tools.server.d.ts +2 -2
- package/dist/mcps/architect-tools.server.js +3 -3
- package/dist/mcps/auto-format.server.d.ts +2 -2
- package/dist/mcps/auto-format.server.js +3 -3
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -2
- package/dist/mcps/boot-orchestrator.server.js +3 -3
- package/dist/mcps/config/server-config-registry.d.ts +1 -1
- package/dist/mcps/config/server-config-registry.js +7 -7
- package/dist/mcps/connection/mcp-connection.js +1 -1
- package/dist/mcps/enforcer-tools.server.d.ts +2 -2
- package/dist/mcps/enforcer-tools.server.js +3 -3
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -2
- package/dist/mcps/framework-compliance-audit.server.js +3 -3
- package/dist/mcps/framework-help.server.js +6 -6
- package/dist/mcps/in-process-skill-registry.js +6 -6
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -3
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/code-review.server.js +3 -3
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/database-design.server.js +3 -3
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -3
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -3
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +3 -3
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -3
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/security-audit.server.js +3 -3
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -3
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +3 -3
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -2
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -5
- package/dist/mcps/lint.server.d.ts +2 -2
- package/dist/mcps/lint.server.js +5 -5
- package/dist/mcps/mcp-client.js +3 -3
- package/dist/mcps/model-health-check.server.d.ts +2 -2
- package/dist/mcps/model-health-check.server.js +3 -3
- package/dist/mcps/orchestrator/server.js +2 -2
- package/dist/mcps/performance-analysis.server.d.ts +2 -2
- package/dist/mcps/performance-analysis.server.js +3 -3
- package/dist/mcps/processor-pipeline.server.d.ts +2 -2
- package/dist/mcps/processor-pipeline.server.js +3 -3
- package/dist/mcps/researcher.server.d.ts +3 -3
- package/dist/mcps/researcher.server.js +4 -4
- package/dist/mcps/security-scan.server.d.ts +2 -2
- package/dist/mcps/security-scan.server.js +3 -3
- package/dist/mcps/simulation/server-simulations.js +3 -3
- package/dist/metrics/agent-metrics.d.ts +4 -4
- package/dist/metrics/agent-metrics.js +1 -1
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +2 -2
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
- package/dist/orchestrator/intelligent-commit-batcher.d.ts +1 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.d.ts +3 -3
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
- package/dist/orchestrator/orchestrator.d.ts +3 -2
- package/dist/orchestrator/orchestrator.js +8 -6
- package/dist/plugin/xray-codex-injection.d.ts +1 -1
- package/dist/plugin/xray-codex-injection.js +8 -7
- package/dist/postprocessor/PostProcessor.d.ts +2 -2
- package/dist/postprocessor/PostProcessor.js +1 -1
- package/dist/postprocessor/monitoring/MonitoringEngine.d.ts +2 -2
- package/dist/postprocessor/services/RegressionAnalysisService.js +2 -2
- package/dist/postprocessor/triggers/GitHookTrigger.js +14 -14
- package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
- package/dist/processors/implementations/inference-improvement-processor.js +2 -2
- package/dist/processors/implementations/log-protection-processor.d.ts +1 -1
- package/dist/processors/implementations/log-protection-processor.js +2 -2
- package/dist/processors/implementations/publish-preflight-processor.d.ts +1 -1
- package/dist/processors/implementations/publish-preflight-processor.js +3 -3
- package/dist/processors/implementations/regression-testing-processor.js +2 -2
- package/dist/processors/implementations/session-summary-processor.js +2 -2
- package/dist/processors/implementations/storytelling-trigger-processor.js +2 -2
- package/dist/processors/processor-manager.d.ts +2 -2
- package/dist/public/about.html +6 -6
- package/dist/public/enterprise.html +1 -1
- package/dist/public/features.html +2 -2
- package/dist/public/index.html +4 -4
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/scripts/activate-kernel-pipeline.js +2 -2
- package/dist/scripts/pre-command +1 -1
- package/dist/services/inference-tuner.js +2 -2
- package/dist/session/session-cleanup-manager.d.ts +3 -3
- package/dist/session/session-monitor.d.ts +3 -3
- package/dist/session/session-state-manager.d.ts +3 -3
- package/dist/skills/hermes-agent/SKILL.md +11 -11
- package/dist/skills/storyteller/SKILL.md +1 -1
- package/dist/skills/xray-orchestrator/SKILL.md +141 -0
- package/dist/skills/xray-orchestrator/index.d.ts +13 -0
- package/dist/skills/xray-orchestrator/index.js +224 -0
- package/dist/state/index.d.ts +2 -1
- package/dist/state/index.js +2 -1
- package/dist/state/state-manager.d.ts +2 -2
- package/dist/state/state-manager.js +5 -4
- package/dist/utils/import-resolver.js +1 -1
- package/dist/utils/path-resolver.js +2 -2
- package/dist/utils/token-manager.js +1 -1
- package/dist/validation/estimation-validator.js +1 -1
- package/package.json +2 -2
- package/scripts/hooks/pre-command +1 -1
- package/scripts/hooks/run-hook.js +2 -2
- package/scripts/node/auto-reflection-generator.mjs +2 -2
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/release.js +6 -6
- package/scripts/node/release.mjs +10 -10
- package/scripts/node/version-manager.mjs +1 -1
- package/src/integrations/grok/plugin/0xray/.mcp.json +3 -3
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
- package/src/mcps/architect-tools.server.ts +3 -3
- package/src/mcps/auto-format.server.ts +3 -3
- package/src/mcps/boot-orchestrator.server.ts +3 -3
- package/src/mcps/config/server-config-registry.ts +7 -7
- package/src/mcps/connection/mcp-connection.ts +1 -1
- package/src/mcps/enforcer-tools.server.ts +3 -3
- package/src/mcps/framework-compliance-audit.server.ts +3 -3
- package/src/mcps/framework-help.server.ts +6 -6
- package/src/mcps/in-process-skill-registry.ts +6 -6
- package/src/mcps/knowledge-skills/api-design.server.test.ts +8 -8
- package/src/mcps/knowledge-skills/api-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +3 -3
- package/src/mcps/knowledge-skills/code-review.server.ts +3 -3
- package/src/mcps/knowledge-skills/database-design.server.ts +3 -3
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -3
- package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -3
- package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +3 -3
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -3
- package/src/mcps/knowledge-skills/security-audit.server.test.ts +23 -23
- package/src/mcps/knowledge-skills/security-audit.server.ts +3 -3
- package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +28 -28
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -3
- package/src/mcps/knowledge-skills/testing-strategy.server.test.ts +19 -19
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +3 -3
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -5
- package/src/mcps/lint.server.ts +5 -5
- package/src/mcps/mcp-client.ts +3 -3
- package/src/mcps/model-health-check.server.ts +3 -3
- package/src/mcps/orchestrator/server.ts +2 -2
- package/src/mcps/performance-analysis.server.ts +3 -3
- package/src/mcps/processor-pipeline.server.ts +3 -3
- package/src/mcps/researcher.server.ts +4 -4
- package/src/mcps/security-scan.server.ts +3 -3
- package/src/mcps/simulation/server-simulations.ts +3 -3
- package/src/opencode/codex.codex +1 -1
- package/src/skills/hermes-agent/SKILL.md +11 -11
- package/src/skills/storyteller/SKILL.md +1 -1
- package/src/skills/xray-orchestrator/SKILL.md +141 -0
- package/src/skills/xray-orchestrator/index.ts +268 -0
- package/scripts/validate-stringray-comprehensive.js +0 -636
- /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
package/.opencode/codex.codex
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.1.0",
|
|
3
3
|
"terms": [
|
|
4
4
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
|
|
5
5
|
],
|
package/AGENTS.md
CHANGED
|
@@ -86,7 +86,7 @@ xray enforces the Universal Development Codex (60 terms) via Dynamo governance.
|
|
|
86
86
|
|
|
87
87
|
Pure v16 MCPs. Clean. Complete.
|
|
88
88
|
|
|
89
|
-
## Session: v2.
|
|
89
|
+
## Session: v2.1.0 Release Polish
|
|
90
90
|
|
|
91
91
|
- Package: `0xray` (npm), `github.com/0xRayAI/xray`. Version `2.0.0`.
|
|
92
92
|
- Renamed `strray-ai` → `0xray` across 60+ source files, CLI help text, grok plugin, hermes-agent bridge (Python + JS), docusaurus config.
|
package/dist/AGENTS.md
CHANGED
|
@@ -86,7 +86,7 @@ xray enforces the Universal Development Codex (60 terms) via Dynamo governance.
|
|
|
86
86
|
|
|
87
87
|
Pure v16 MCPs. Clean. Complete.
|
|
88
88
|
|
|
89
|
-
## Session: v2.
|
|
89
|
+
## Session: v2.1.0 Release Polish
|
|
90
90
|
|
|
91
91
|
- Package: `0xray` (npm), `github.com/0xRayAI/xray`. Version `2.0.0`.
|
|
92
92
|
- Renamed `strray-ai` → `0xray` across 60+ source files, CLI help text, grok plugin, hermes-agent bridge (Python + JS), docusaurus config.
|
|
@@ -54,7 +54,7 @@ export interface SessionBenchmarkResult {
|
|
|
54
54
|
failoverTimes: number[];
|
|
55
55
|
concurrentSessionOperations: number;
|
|
56
56
|
}
|
|
57
|
-
export declare class
|
|
57
|
+
export declare class XrayPerformanceBenchmark {
|
|
58
58
|
private results;
|
|
59
59
|
private activeBenchmarks;
|
|
60
60
|
/**
|
|
@@ -100,4 +100,4 @@ export declare class StringRayPerformanceBenchmark {
|
|
|
100
100
|
*/
|
|
101
101
|
exportResults(): BenchmarkResult[];
|
|
102
102
|
}
|
|
103
|
-
export declare const performanceBenchmark:
|
|
103
|
+
export declare const performanceBenchmark: XrayPerformanceBenchmark;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .
|
|
1
|
+
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)
|
|
2
2
|
import { frameworkLogger } from "../core/framework-logger.js";
|
|
3
3
|
import crypto from "crypto";
|
|
4
|
-
export class
|
|
4
|
+
export class XrayPerformanceBenchmark {
|
|
5
5
|
results = [];
|
|
6
6
|
activeBenchmarks = new Map();
|
|
7
7
|
/**
|
|
@@ -369,4 +369,4 @@ export class StringRayPerformanceBenchmark {
|
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
// Export singleton instance
|
|
372
|
-
export const performanceBenchmark = new
|
|
372
|
+
export const performanceBenchmark = new XrayPerformanceBenchmark();
|
|
@@ -16,14 +16,14 @@ export function registerHermesCommands(hermesCmd) {
|
|
|
16
16
|
async function installForHermes(options = {}) {
|
|
17
17
|
frameworkLogger.log('hermes-integration', 'install-start', 'info', { options });
|
|
18
18
|
const home = homedir();
|
|
19
|
-
const targetPluginDir = path.join(home, '.hermes/plugins/
|
|
19
|
+
const targetPluginDir = path.join(home, '.hermes/plugins/xray-hermes');
|
|
20
20
|
const possibleSources = [
|
|
21
21
|
path.join(__dirname, '..', '..', '..', 'dist/integrations/hermes-agent'),
|
|
22
22
|
path.join(__dirname, '..', '..', '..', 'src/integrations/hermes-agent'),
|
|
23
23
|
];
|
|
24
24
|
let sourceDir = possibleSources.find(p => fs.existsSync(p));
|
|
25
25
|
if (!sourceDir) {
|
|
26
|
-
console.error('[Hermes] Could not locate the
|
|
26
|
+
console.error('[Hermes] Could not locate the xray-hermes plugin inside the package.');
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
if (options.dryRun) {
|
|
@@ -32,7 +32,7 @@ async function installForHermes(options = {}) {
|
|
|
32
32
|
}
|
|
33
33
|
try {
|
|
34
34
|
if (fs.existsSync(targetPluginDir) && !options.force) {
|
|
35
|
-
console.log('[Hermes]
|
|
35
|
+
console.log('[Hermes] xray-hermes plugin is already installed.');
|
|
36
36
|
console.log('Use --force to reinstall.');
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
@@ -56,7 +56,7 @@ async function installForHermes(options = {}) {
|
|
|
56
56
|
}
|
|
57
57
|
console.log('\n✅ 0xRay is now installed as a Hermes Agent plugin!');
|
|
58
58
|
console.log('Restart Hermes to load the plugin and its tools.');
|
|
59
|
-
console.log(' Run:
|
|
59
|
+
console.log(' Run: npx 0xray status (to verify)');
|
|
60
60
|
}
|
|
61
61
|
catch (err) {
|
|
62
62
|
frameworkLogger.log('hermes-integration', 'install-error', 'error', { error: err.message });
|
|
@@ -3,7 +3,7 @@ import { join, dirname } from "path";
|
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
import { getConfigDir } from "../../core/config-paths.js";
|
|
5
5
|
function getMCPConfigPath() {
|
|
6
|
-
return join(process.cwd(), ".opencode", "
|
|
6
|
+
return join(process.cwd(), ".opencode", "xray", "mcp-registry.json");
|
|
7
7
|
}
|
|
8
8
|
function getBundledMCPRegistry() {
|
|
9
9
|
const paths = [
|
|
@@ -14,7 +14,7 @@ export function registerOpenClawCommands(openclawCmd) {
|
|
|
14
14
|
}
|
|
15
15
|
async function installForOpenClaw(options = {}) {
|
|
16
16
|
frameworkLogger.log('openclaw-integration', 'install-start', 'info', { options });
|
|
17
|
-
const configPath = path.join(process.cwd(), '.
|
|
17
|
+
const configPath = path.join(process.cwd(), '.xray', 'config', 'openclaw.json');
|
|
18
18
|
if (options.dryRun) {
|
|
19
19
|
console.log(`[OpenClaw] Dry run: Would create config at ${configPath}`);
|
|
20
20
|
return;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
import * as fs from "fs";
|
|
15
15
|
import * as path from "path";
|
|
16
16
|
import { spawnSync } from "child_process";
|
|
17
|
-
const PLUGINS_DIR = ".
|
|
18
|
-
const CONFIG_PATH = ".
|
|
17
|
+
const PLUGINS_DIR = ".xray/plugins";
|
|
18
|
+
const CONFIG_PATH = ".xray/config/plugin-config.json";
|
|
19
19
|
export async function pluginListCommand() {
|
|
20
20
|
console.log("\n📦 0xRay Plugins\n");
|
|
21
21
|
console.log("═".repeat(60));
|
|
@@ -69,10 +69,10 @@ function getPackageVersion(cwd) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
catch { /* ignore */ }
|
|
72
|
-
const
|
|
72
|
+
const xrayPkgPath = join(cwd, ".opencode", "package.json");
|
|
73
73
|
try {
|
|
74
|
-
if (existsSync(
|
|
75
|
-
const pkg = JSON.parse(readFileSync(
|
|
74
|
+
if (existsSync(xrayPkgPath)) {
|
|
75
|
+
const pkg = JSON.parse(readFileSync(xrayPkgPath, "utf-8"));
|
|
76
76
|
if (pkg.version)
|
|
77
77
|
return pkg.version;
|
|
78
78
|
}
|
|
@@ -89,7 +89,7 @@ function createAgentManifest(agentName, configPath, version, cwd) {
|
|
|
89
89
|
author: extractYamlField(content, "author") || extractYamlField(content, "maintainer") || "0xRay User",
|
|
90
90
|
license: extractYamlField(content, "license") || "MIT",
|
|
91
91
|
source: extractYamlField(content, "source") || "custom",
|
|
92
|
-
framework: "
|
|
92
|
+
framework: "xray",
|
|
93
93
|
frameworkVersion: getPackageVersion(cwd),
|
|
94
94
|
publishedAt: new Date().toISOString(),
|
|
95
95
|
skills: [],
|
|
@@ -98,7 +98,7 @@ function createAgentManifest(agentName, configPath, version, cwd) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
function packageAgent(agentName, configPath, version, cwd) {
|
|
101
|
-
const outputDir = join(cwd, ".
|
|
101
|
+
const outputDir = join(cwd, ".xray", "publish", agentName);
|
|
102
102
|
mkdirSync(outputDir, { recursive: true });
|
|
103
103
|
const manifest = createAgentManifest(agentName, configPath, version, cwd);
|
|
104
104
|
writeFileSync(join(outputDir, "agent.json"), JSON.stringify(manifest, null, 2));
|
|
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, cpSync
|
|
|
2
2
|
import { join, basename, dirname } from "path";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
function getLocalRegistryPath() {
|
|
5
|
-
return join(process.cwd(), ".opencode", "
|
|
5
|
+
return join(process.cwd(), ".opencode", "xray", "skill-registry.json");
|
|
6
6
|
}
|
|
7
7
|
function getBundledRegistry() {
|
|
8
8
|
const paths = [
|
|
@@ -41,7 +41,7 @@ function getAgentsList(cwd) {
|
|
|
41
41
|
];
|
|
42
42
|
const configuredAgents = [];
|
|
43
43
|
const configDir = getConfigDir(cwd);
|
|
44
|
-
const agentsConfigPath = join(configDir, "
|
|
44
|
+
const agentsConfigPath = join(configDir, "xray", "agents.json");
|
|
45
45
|
if (existsSync(agentsConfigPath)) {
|
|
46
46
|
try {
|
|
47
47
|
const config = JSON.parse(readFileSync(agentsConfigPath, "utf-8"));
|
|
@@ -51,7 +51,7 @@ function getAgentsList(cwd) {
|
|
|
51
51
|
}
|
|
52
52
|
catch { /* ignore */ }
|
|
53
53
|
}
|
|
54
|
-
const featuresPath = join(configDir, "
|
|
54
|
+
const featuresPath = join(configDir, "xray", "features.json");
|
|
55
55
|
if (existsSync(featuresPath)) {
|
|
56
56
|
try {
|
|
57
57
|
const features = JSON.parse(readFileSync(featuresPath, "utf-8"));
|
|
@@ -93,7 +93,7 @@ function getInferenceStatus(cwd) {
|
|
|
93
93
|
let outcomesCount = 0;
|
|
94
94
|
let patternsCount = 0;
|
|
95
95
|
try {
|
|
96
|
-
const inferenceDir = join(getConfigDir(cwd), "
|
|
96
|
+
const inferenceDir = join(getConfigDir(cwd), "xray", "inference");
|
|
97
97
|
const tunerStatusPath = join(inferenceDir, "tuner-status.json");
|
|
98
98
|
if (existsSync(tunerStatusPath)) {
|
|
99
99
|
const status = JSON.parse(readFileSync(tunerStatusPath, "utf-8"));
|
|
@@ -16,8 +16,8 @@ import { execSync } from "child_process";
|
|
|
16
16
|
const STORY_TYPES = ["reflection", "saga", "journey", "narrative"];
|
|
17
17
|
function loadConfig(cwd) {
|
|
18
18
|
const candidates = [
|
|
19
|
-
join(cwd, ".opencode", "
|
|
20
|
-
join(cwd, ".
|
|
19
|
+
join(cwd, ".opencode", "xray", "features.json"),
|
|
20
|
+
join(cwd, ".xray", "features.json"),
|
|
21
21
|
];
|
|
22
22
|
for (const path of candidates) {
|
|
23
23
|
if (existsSync(path)) {
|
package/dist/cli/index.js
CHANGED
|
@@ -385,7 +385,7 @@ program
|
|
|
385
385
|
const path = await import("path");
|
|
386
386
|
let defaultLimit = 500;
|
|
387
387
|
try {
|
|
388
|
-
const featuresPath = path.join(process.cwd(), ".opencode", "plugins", "features.json"); // plain xray primary (min compat .
|
|
388
|
+
const featuresPath = path.join(process.cwd(), ".opencode", "plugins", "features.json"); // plain xray primary (min compat .xray/ handled in getConfigDir per Scope Rule)
|
|
389
389
|
if (fs.existsSync(featuresPath)) {
|
|
390
390
|
const features = JSON.parse(fs.readFileSync(featuresPath, "utf-8"));
|
|
391
391
|
defaultLimit = features.analytics?.default_limit || 500;
|
|
@@ -450,17 +450,17 @@ program
|
|
|
450
450
|
else {
|
|
451
451
|
console.log("✅ xray package installed");
|
|
452
452
|
}
|
|
453
|
-
// Check configuration - check for opencode.json or .
|
|
453
|
+
// Check configuration - check for opencode.json or .xray/ (min compat .xray/ fallback for prior StringRay consumer runtime per Scope Rule; plain xray primary)
|
|
454
454
|
const cwd = process.cwd();
|
|
455
455
|
const opencodeConfigPath = path.join(cwd, "opencode.json");
|
|
456
|
-
const
|
|
456
|
+
const xrayDir = getConfigDir(cwd);
|
|
457
457
|
const opencodeExists = fs.existsSync(opencodeConfigPath);
|
|
458
|
-
const
|
|
458
|
+
const xrayDirExists = fs.existsSync(xrayDir);
|
|
459
459
|
if (opencodeExists) {
|
|
460
460
|
console.log("✅ opencode configuration found");
|
|
461
461
|
}
|
|
462
|
-
else if (
|
|
463
|
-
console.log(`✅ Configuration directory found: ${
|
|
462
|
+
else if (xrayDirExists) {
|
|
463
|
+
console.log(`✅ Configuration directory found: ${xrayDir}`);
|
|
464
464
|
}
|
|
465
465
|
else {
|
|
466
466
|
console.log("ℹ️ No opencode.json or config directory found (run: npx xray fix to create)");
|
|
@@ -684,13 +684,13 @@ program
|
|
|
684
684
|
}
|
|
685
685
|
else {
|
|
686
686
|
console.log('Inference feature is disabled in features.json.');
|
|
687
|
-
console.log('Enable it by setting inference.enabled = true in .opencode/plugins/features.json (min compat .
|
|
687
|
+
console.log('Enable it by setting inference.enabled = true in .opencode/plugins/features.json (min compat .xray/ fallback for prior StringRay consumer runtime per Scope Rule)');
|
|
688
688
|
}
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
691
|
const projectRoot = process.cwd();
|
|
692
692
|
const inferenceDir = `${projectRoot}/docs/inference`;
|
|
693
|
-
const stateDir = `${projectRoot}/.
|
|
693
|
+
const stateDir = `${projectRoot}/.xray/inference`;
|
|
694
694
|
const stateFile = `${stateDir}/inference-cycle-state.json`;
|
|
695
695
|
if (!options.json) {
|
|
696
696
|
console.log('xray Inference Cycle');
|
package/dist/cli/server.js
CHANGED
|
@@ -112,7 +112,7 @@ app.get("/", (req, res) => {
|
|
|
112
112
|
});
|
|
113
113
|
// Add route for refactoring logs
|
|
114
114
|
app.get("/logs", requireAuth, async (req, res) => {
|
|
115
|
-
const logPath = resolveConfigPath("REFACTORING_LOG.md") || join(__dirname, "..", ".
|
|
115
|
+
const logPath = resolveConfigPath("REFACTORING_LOG.md") || join(__dirname, "..", ".xray", "REFACTORING_LOG.md");
|
|
116
116
|
// Server debug logging - remove for production
|
|
117
117
|
try {
|
|
118
118
|
if (fs.existsSync(logPath)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Spawn Gate — Singleton (provider-agnostic)
|
|
3
3
|
*
|
|
4
|
-
* CENTRALIZED CONTROL for all agent process spawning across
|
|
4
|
+
* CENTRALIZED CONTROL for all agent process spawning across Xray
|
|
5
5
|
* (OpenCode, Hermes, or any other MCP-compatible host).
|
|
6
6
|
*
|
|
7
7
|
* Purpose:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Spawn Gate — Singleton (provider-agnostic)
|
|
3
3
|
*
|
|
4
|
-
* CENTRALIZED CONTROL for all agent process spawning across
|
|
4
|
+
* CENTRALIZED CONTROL for all agent process spawning across Xray
|
|
5
5
|
* (OpenCode, Hermes, or any other MCP-compatible host).
|
|
6
6
|
*
|
|
7
7
|
* Purpose:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Boot Orchestrator (min documented consumer runtime compat shim from prior StringRay releases; primary Xray* paths + XRAY_||STRRAY_ env + .
|
|
2
|
+
* Boot Orchestrator (min documented consumer runtime compat shim from prior StringRay releases; primary Xray* paths + XRAY_||STRRAY_ env + .xray fallbacks only; 1-line per Scope Rule).
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
5
5
|
import { type MemoryStats } from "../monitoring/memory-monitor.js";
|
|
6
6
|
export interface BootSequenceConfig {
|
|
7
7
|
enableEnforcement: boolean;
|
|
@@ -28,7 +28,7 @@ export declare class BootOrchestrator {
|
|
|
28
28
|
private pluginRegistry?;
|
|
29
29
|
private pluginServerRegistry?;
|
|
30
30
|
private shutdownInitialized;
|
|
31
|
-
constructor(config?: Partial<BootSequenceConfig>, stateManager?:
|
|
31
|
+
constructor(config?: Partial<BootSequenceConfig>, stateManager?: XrayStateManager);
|
|
32
32
|
/**
|
|
33
33
|
* Initialize delegation system components
|
|
34
34
|
*/
|
|
@@ -94,6 +94,6 @@ export declare class BootOrchestrator {
|
|
|
94
94
|
* Execute the boot sequence (internal framework initialization)
|
|
95
95
|
*/
|
|
96
96
|
executeBootSequence(): Promise<BootResult>;
|
|
97
|
-
private
|
|
97
|
+
private loadXrayConfiguration;
|
|
98
98
|
}
|
|
99
99
|
export declare const bootOrchestrator: BootOrchestrator;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Boot Orchestrator (min documented consumer runtime compat shim from prior StringRay releases; primary Xray* paths + XRAY_||STRRAY_ env + .
|
|
2
|
+
* Boot Orchestrator (min documented consumer runtime compat shim from prior StringRay releases; primary Xray* paths + XRAY_||STRRAY_ env + .xray fallbacks only; 1-line per Scope Rule).
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { XrayContextLoader } from "./context-loader.js";
|
|
5
|
+
import { XrayStateManager } from "../state/state-manager.js";
|
|
6
6
|
import { ProcessorManager } from "../processors/processor-manager.js";
|
|
7
7
|
import { pathResolver } from "../utils/path-resolver.js";
|
|
8
8
|
import * as fs from "fs";
|
|
@@ -20,7 +20,7 @@ import { frameworkLogger } from "../core/framework-logger.js";
|
|
|
20
20
|
import { featuresConfigLoader } from "../core/features-config.js";
|
|
21
21
|
import { memoryMonitor } from "../monitoring/memory-monitor.js";
|
|
22
22
|
import { advancedProfiler } from "../monitoring/advanced-profiler.js";
|
|
23
|
-
import {
|
|
23
|
+
import { xrayConfigLoader } from "./config-loader.js";
|
|
24
24
|
import { PluginRegistry } from "../integrations/plugins/index.js";
|
|
25
25
|
import { PluginServerConfigRegistry } from "../mcps/config/index.js";
|
|
26
26
|
import { initializeGovernanceIntegration } from "../integrations/governance/index.js";
|
|
@@ -30,10 +30,10 @@ import { initializeGovernanceIntegration } from "../integrations/governance/inde
|
|
|
30
30
|
*/
|
|
31
31
|
function setupGracefulShutdown() {
|
|
32
32
|
// Prevent duplicate listeners
|
|
33
|
-
if (process.
|
|
33
|
+
if (process._xrayShutdownSetup) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
process.
|
|
36
|
+
process._xrayShutdownSetup = true;
|
|
37
37
|
let isShuttingDown = false;
|
|
38
38
|
process.on("SIGINT", async () => {
|
|
39
39
|
if (isShuttingDown) {
|
|
@@ -98,8 +98,8 @@ export class BootOrchestrator {
|
|
|
98
98
|
shutdownInitialized = false;
|
|
99
99
|
constructor(config = {}, stateManager) {
|
|
100
100
|
// Initialize components first for state management
|
|
101
|
-
this.contextLoader =
|
|
102
|
-
this.stateManager = stateManager || new
|
|
101
|
+
this.contextLoader = XrayContextLoader.getInstance();
|
|
102
|
+
this.stateManager = stateManager || new XrayStateManager();
|
|
103
103
|
this.processorManager = new ProcessorManager(this.stateManager);
|
|
104
104
|
this.config = {
|
|
105
105
|
enableEnforcement: true,
|
|
@@ -115,7 +115,7 @@ export class BootOrchestrator {
|
|
|
115
115
|
*/
|
|
116
116
|
async initializeDelegationSystem() {
|
|
117
117
|
try {
|
|
118
|
-
const agentDelegator = createAgentDelegator(this.stateManager,
|
|
118
|
+
const agentDelegator = createAgentDelegator(this.stateManager, xrayConfigLoader);
|
|
119
119
|
this.stateManager.set("delegation:agent_delegator", agentDelegator);
|
|
120
120
|
const sessionCoordinator = createSessionCoordinator(this.stateManager);
|
|
121
121
|
this.stateManager.set("delegation:session_coordinator", sessionCoordinator);
|
|
@@ -131,8 +131,8 @@ export class BootOrchestrator {
|
|
|
131
131
|
loadProcessorsConfig() {
|
|
132
132
|
try {
|
|
133
133
|
const configPaths = [
|
|
134
|
-
path.join(process.cwd(), ".
|
|
135
|
-
path.join(process.cwd(), ".opencode", "
|
|
134
|
+
path.join(process.cwd(), ".xray", "features.json"),
|
|
135
|
+
path.join(process.cwd(), ".opencode", "xray", "features.json"),
|
|
136
136
|
];
|
|
137
137
|
for (const configPath of configPaths) {
|
|
138
138
|
if (existsSync(configPath)) {
|
|
@@ -152,7 +152,7 @@ export class BootOrchestrator {
|
|
|
152
152
|
async initializePluginSystem(jobId) {
|
|
153
153
|
try {
|
|
154
154
|
frameworkLogger.log("boot-orchestrator", "initializing plugin system", "info", { jobId });
|
|
155
|
-
const pluginsDir = path.join(process.cwd(), ".
|
|
155
|
+
const pluginsDir = path.join(process.cwd(), ".xray", "plugins");
|
|
156
156
|
this.pluginRegistry = new PluginRegistry({
|
|
157
157
|
pluginsDir,
|
|
158
158
|
autoStart: true,
|
|
@@ -189,7 +189,7 @@ export class BootOrchestrator {
|
|
|
189
189
|
});
|
|
190
190
|
return false;
|
|
191
191
|
}
|
|
192
|
-
const orchestratorInstance = orchestratorModule.strRayOrchestrator;
|
|
192
|
+
const orchestratorInstance = orchestratorModule.xrayOrchestrator || orchestratorModule.strRayOrchestrator;
|
|
193
193
|
if (!orchestratorInstance) {
|
|
194
194
|
frameworkLogger.log("boot-orchestrator", "orchestrator-not-found", "error", { message: "Orchestrator instance not found in module" });
|
|
195
195
|
return false;
|
|
@@ -596,8 +596,8 @@ export class BootOrchestrator {
|
|
|
596
596
|
};
|
|
597
597
|
try {
|
|
598
598
|
frameworkLogger.log("boot-orchestrator", "loading xray configuration", "info", { jobId });
|
|
599
|
-
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .
|
|
600
|
-
await this.
|
|
599
|
+
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)
|
|
600
|
+
await this.loadXrayConfiguration(jobId);
|
|
601
601
|
frameworkLogger.log("boot-orchestrator", "xray configuration loaded", "success", { jobId });
|
|
602
602
|
// Phase 1: Initialize core systems
|
|
603
603
|
frameworkLogger.log("boot-orchestrator", "initializing core systems", "info", { jobId });
|
|
@@ -727,11 +727,11 @@ export class BootOrchestrator {
|
|
|
727
727
|
this.stateManager.set("boot:errors", result.errors);
|
|
728
728
|
return result;
|
|
729
729
|
}
|
|
730
|
-
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .
|
|
731
|
-
async
|
|
730
|
+
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)
|
|
731
|
+
async loadXrayConfiguration(jobId) {
|
|
732
732
|
try {
|
|
733
|
-
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .
|
|
734
|
-
const
|
|
733
|
+
// Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .xray fallbacks)
|
|
734
|
+
const xrayConfig = {
|
|
735
735
|
version: "2.0.0",
|
|
736
736
|
codex_enabled: true,
|
|
737
737
|
codex_version: "v2.0.0",
|
|
@@ -793,13 +793,13 @@ export class BootOrchestrator {
|
|
|
793
793
|
},
|
|
794
794
|
};
|
|
795
795
|
// Store configuration in state manager for use by other components
|
|
796
|
-
this.stateManager.set("
|
|
797
|
-
this.stateManager.set("
|
|
798
|
-
this.stateManager.set("
|
|
799
|
-
this.stateManager.set("
|
|
800
|
-
this.stateManager.set("
|
|
801
|
-
this.stateManager.set("
|
|
802
|
-
this.stateManager.set("
|
|
796
|
+
this.stateManager.set("xray:config", xrayConfig);
|
|
797
|
+
this.stateManager.set("xray:version", xrayConfig.version);
|
|
798
|
+
this.stateManager.set("xray:codex_enabled", xrayConfig.codex_enabled);
|
|
799
|
+
this.stateManager.set("xray:codex_terms", xrayConfig.codex_terms);
|
|
800
|
+
this.stateManager.set("xray:monitoring_metrics", xrayConfig.monitoring_metrics);
|
|
801
|
+
this.stateManager.set("xray:monitoring_alerts", xrayConfig.monitoring_alerts);
|
|
802
|
+
this.stateManager.set("xray:agent_capabilities", xrayConfig.agent_capabilities);
|
|
803
803
|
await frameworkLogger.log("boot-orchestrator", "configuration-loaded", "success", { jobId });
|
|
804
804
|
}
|
|
805
805
|
catch (error) {
|
package/dist/core/bridge.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Xray Universal Bridge
|
|
5
5
|
*
|
|
6
|
-
* Standalone bridge that provides
|
|
6
|
+
* Standalone bridge that provides Xray framework capabilities
|
|
7
7
|
* to ANY consumer — no OpenCode dependency.
|
|
8
8
|
*
|
|
9
9
|
* Supports three transport modes:
|
|
@@ -84,7 +84,7 @@ function findProjectRoot() {
|
|
|
84
84
|
const pkgPath = join(dir, "package.json");
|
|
85
85
|
if (existsSync(pkgPath)) {
|
|
86
86
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
87
|
-
if (pkg.name === "
|
|
87
|
+
if (pkg.name === "0xray" || pkg.dependencies?.["0xray"]) {
|
|
88
88
|
return dir;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -219,11 +219,11 @@ async function handleHealth(input) {
|
|
|
219
219
|
*/
|
|
220
220
|
/** Codex candidate paths — single source of truth for both loadCodexFromFs and handleGetConfig */
|
|
221
221
|
function getCodexCandidates(projectRoot) {
|
|
222
|
-
const envDir = process.env.STRRAY_CONFIG_DIR;
|
|
222
|
+
const envDir = process.env.XRAY_CONFIG_DIR || process.env.STRRAY_CONFIG_DIR;
|
|
223
223
|
const candidates = [];
|
|
224
224
|
if (envDir) candidates.push(join(projectRoot, envDir, "codex.json"));
|
|
225
|
-
candidates.push(join(projectRoot, ".
|
|
226
|
-
candidates.push(join(projectRoot, ".opencode", "
|
|
225
|
+
candidates.push(join(projectRoot, ".xray", "codex.json"));
|
|
226
|
+
candidates.push(join(projectRoot, ".opencode", "xray", "codex.json"));
|
|
227
227
|
candidates.push(join(projectRoot, "codex.json"));
|
|
228
228
|
return candidates;
|
|
229
229
|
}
|
|
@@ -281,7 +281,7 @@ async function handleGetCodexPrompt(input, projectRoot, logDir) {
|
|
|
281
281
|
terms.sort((a, b) => (severityOrder[a.severity] || 3) - (severityOrder[b.severity] || 3));
|
|
282
282
|
if (maxTerms) terms = terms.slice(0, maxTerms);
|
|
283
283
|
|
|
284
|
-
const lines = [`##
|
|
284
|
+
const lines = [`## Xray Universal Development Codex v${termsSource.version}`];
|
|
285
285
|
const emojis = { blocking: "🔴", high: "🟡", medium: "🟢" };
|
|
286
286
|
const labels = { blocking: "BLOCKING", high: "HIGH PRIORITY", medium: "MEDIUM" };
|
|
287
287
|
|
|
@@ -348,8 +348,8 @@ async function handleGetConfig(input, projectRoot, logDir) {
|
|
|
348
348
|
// Load features.json
|
|
349
349
|
const featurePaths = [];
|
|
350
350
|
if (envDir) featurePaths.push(join(projectRoot, envDir, "features.json"));
|
|
351
|
-
featurePaths.push(join(projectRoot, ".
|
|
352
|
-
featurePaths.push(join(projectRoot, ".opencode", "
|
|
351
|
+
featurePaths.push(join(projectRoot, ".xray", "features.json"));
|
|
352
|
+
featurePaths.push(join(projectRoot, ".opencode", "xray", "features.json"));
|
|
353
353
|
|
|
354
354
|
let featurePath = null;
|
|
355
355
|
for (const p of featurePaths) {
|
|
@@ -604,7 +604,7 @@ function handleHooks(input, projectRoot) {
|
|
|
604
604
|
const { action, hooks } = input;
|
|
605
605
|
const hookTypes = hooks || ["pre-commit", "post-commit", "pre-push", "post-push"];
|
|
606
606
|
const gitHooksDir = join(projectRoot, ".git", "hooks");
|
|
607
|
-
const
|
|
607
|
+
const xrayHooksDir = join(projectRoot, "hooks");
|
|
608
608
|
|
|
609
609
|
if (!existsSync(gitHooksDir)) {
|
|
610
610
|
return { error: "Not a git repository — no .git/hooks directory" };
|
|
@@ -616,14 +616,14 @@ function handleHooks(input, projectRoot) {
|
|
|
616
616
|
if (action === "list" || action === "status") {
|
|
617
617
|
for (const hookName of hookTypes) {
|
|
618
618
|
const gitHook = join(gitHooksDir, hookName);
|
|
619
|
-
const
|
|
619
|
+
const xrayHook = join(xrayHooksDir, hookName);
|
|
620
620
|
|
|
621
621
|
if (!existsSync(gitHook)) {
|
|
622
622
|
result.missing.push(hookName);
|
|
623
623
|
} else {
|
|
624
624
|
try {
|
|
625
625
|
const content = readFileSync(gitHook, "utf-8");
|
|
626
|
-
if (content.includes("StringRay") || content.includes("strray") || content.includes("run-hook.js")) {
|
|
626
|
+
if (content.includes("Xray") || content.includes("StringRay") || content.includes("xray") || content.includes("strray") || content.includes("run-hook.js")) {
|
|
627
627
|
result.managed.push(hookName);
|
|
628
628
|
} else {
|
|
629
629
|
result.external.push(hookName);
|
|
@@ -633,8 +633,8 @@ function handleHooks(input, projectRoot) {
|
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
|
|
636
|
-
// Check if
|
|
637
|
-
if (!existsSync(
|
|
636
|
+
// Check if xray source hook exists
|
|
637
|
+
if (!existsSync(xrayHook)) {
|
|
638
638
|
result.stale.push(hookName);
|
|
639
639
|
}
|
|
640
640
|
}
|
|
@@ -644,7 +644,7 @@ function handleHooks(input, projectRoot) {
|
|
|
644
644
|
action,
|
|
645
645
|
hooks: result,
|
|
646
646
|
gitHooksDir,
|
|
647
|
-
|
|
647
|
+
xrayHooksDir,
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
650
|
|
|
@@ -655,7 +655,7 @@ function handleHooks(input, projectRoot) {
|
|
|
655
655
|
const errors = [];
|
|
656
656
|
|
|
657
657
|
for (const hookName of hookTypes) {
|
|
658
|
-
const src = join(
|
|
658
|
+
const src = join(xrayHooksDir, hookName);
|
|
659
659
|
const dst = join(gitHooksDir, hookName);
|
|
660
660
|
|
|
661
661
|
if (!existsSync(src)) {
|
|
@@ -664,11 +664,11 @@ function handleHooks(input, projectRoot) {
|
|
|
664
664
|
}
|
|
665
665
|
|
|
666
666
|
try {
|
|
667
|
-
// Backup existing non-
|
|
667
|
+
// Backup existing non-xray hooks
|
|
668
668
|
if (existsSync(dst)) {
|
|
669
669
|
const content = readFileSync(dst, "utf-8");
|
|
670
|
-
if (!content.includes("StringRay") && !content.includes("strray") && !content.includes("run-hook.js")) {
|
|
671
|
-
renameSync(dst, `${dst}.
|
|
670
|
+
if (!content.includes("Xray") && !content.includes("StringRay") && !content.includes("xray") && !content.includes("strray") && !content.includes("run-hook.js")) {
|
|
671
|
+
renameSync(dst, `${dst}.xray-backup`);
|
|
672
672
|
} else {
|
|
673
673
|
unlinkSync(dst);
|
|
674
674
|
}
|
|
@@ -699,15 +699,15 @@ function handleHooks(input, projectRoot) {
|
|
|
699
699
|
|
|
700
700
|
for (const hookName of hookTypes) {
|
|
701
701
|
const dst = join(gitHooksDir, hookName);
|
|
702
|
-
const backup = `${dst}.
|
|
702
|
+
const backup = `${dst}.xray-backup`;
|
|
703
703
|
|
|
704
704
|
if (!existsSync(dst)) continue;
|
|
705
705
|
|
|
706
706
|
try {
|
|
707
707
|
const content = readFileSync(dst, "utf-8");
|
|
708
|
-
const
|
|
708
|
+
const isXray = content.includes("Xray") || content.includes("StringRay") || content.includes("xray") || content.includes("strray") || content.includes("run-hook.js");
|
|
709
709
|
|
|
710
|
-
if (
|
|
710
|
+
if (isXray || lstatSync(dst).isSymbolicLink()) {
|
|
711
711
|
unlinkSync(dst);
|
|
712
712
|
|
|
713
713
|
// Restore backup if exists
|
|
@@ -89,8 +89,8 @@ export function findCodexPath(projectRoot) {
|
|
|
89
89
|
if (envDir) {
|
|
90
90
|
candidates.push(resolve(root, envDir, "codex.json"));
|
|
91
91
|
}
|
|
92
|
-
candidates.push(join(root, ".
|
|
93
|
-
candidates.push(join(root, ".opencode", "
|
|
92
|
+
candidates.push(join(root, ".xray", "codex.json"));
|
|
93
|
+
candidates.push(join(root, ".opencode", "xray", "codex.json"));
|
|
94
94
|
// Additional fallback locations (for standalone usage)
|
|
95
95
|
candidates.push(join(root, "codex.json"));
|
|
96
96
|
candidates.push(join(root, "src", "codex.json"));
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
* @since 2026-01-06
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
|
-
* Create
|
|
11
|
+
* Create xray-codex-injector hook
|
|
12
12
|
*
|
|
13
13
|
* This hook injects codex context into tool outputs and displays
|
|
14
14
|
* a welcome message on agent startup, following the production-tested
|
|
15
15
|
* pattern from OpenCode's rules-injector.
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
name: "
|
|
17
|
+
export declare function createXrayCodexInjectorHook(): {
|
|
18
|
+
name: "xray-codex-injector";
|
|
19
19
|
hooks: {
|
|
20
20
|
"agent.start": (sessionId: string) => Promise<void>;
|
|
21
21
|
"tool.execute.before": (input: {
|
|
@@ -72,3 +72,4 @@ export declare class CodexInjector {
|
|
|
72
72
|
concerns: string[];
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
+
export { createXrayCodexInjectorHook as createStringRayCodexInjectorHook };
|