0xray 2.1.2 → 2.1.3
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/AGENTS.md +2 -1
- package/README.md +12 -11
- package/dist/AGENTS.md +2 -1
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +12 -11
- package/dist/agents/code-reviewer.js +1 -1
- package/dist/analytics/routing-refiner.js +1 -1
- package/dist/cli/index.js +11 -1
- package/dist/cli/server.js +3 -3
- package/dist/core/activity-logger.d.ts +2 -2
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/boot-orchestrator.d.ts +1 -1
- package/dist/core/boot-orchestrator.js +13 -28
- package/dist/core/bridge.mjs +3 -3
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +0 -1
- package/dist/core/codex-injector.js +2 -3
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.js +1 -1
- package/dist/core/config-paths.d.ts +0 -2
- package/dist/core/config-paths.js +7 -8
- package/dist/core/context-loader.d.ts +1 -1
- package/dist/core/context-loader.js +1 -1
- package/dist/core/errors.d.ts +3 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/features-config.js +1 -1
- package/dist/core/framework-logger.d.ts +3 -3
- package/dist/core/framework-logger.js +17 -9
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +4 -2
- package/dist/core/logging-config.d.ts +2 -1
- package/dist/core/logging-config.js +7 -7
- package/dist/enforcement/loaders/codex-loader.js +1 -1
- package/dist/execution/opencode-cli-invoker.js +5 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/inference/inference-cycle.d.ts +1 -1
- package/dist/inference/inference-cycle.js +10 -10
- package/dist/integrations/base/Integration.js +1 -1
- package/dist/integrations/base/registry.js +19 -19
- package/dist/integrations/grok/grok-cli.js +17 -17
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/hermes-agent/bridge.mjs +1 -1
- package/dist/integrations/openclaw/api-server.d.ts +0 -1
- package/dist/integrations/openclaw/api-server.js +7 -10
- package/dist/integrations/openclaw/client.d.ts +0 -1
- package/dist/integrations/openclaw/client.js +22 -24
- package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
- package/dist/integrations/plugins/plugin-registry.js +5 -5
- package/dist/mcps/architect-tools.server.d.ts +2 -4
- package/dist/mcps/architect-tools.server.js +112 -195
- package/dist/mcps/auto-format.server.d.ts +2 -4
- package/dist/mcps/auto-format.server.js +49 -95
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
- package/dist/mcps/boot-orchestrator.server.js +73 -105
- package/dist/mcps/config/server-config-registry.js +3 -3
- package/dist/mcps/enforcer-tools.server.d.ts +2 -4
- package/dist/mcps/enforcer-tools.server.js +202 -285
- package/dist/mcps/estimation.server.d.ts +2 -4
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
- package/dist/mcps/framework-compliance-audit.server.js +53 -82
- package/dist/mcps/framework-help.server.d.ts +2 -4
- package/dist/mcps/framework-help.server.js +63 -101
- package/dist/mcps/governance.server.js +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
- package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
- package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
- package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
- package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
- package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
- package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
- package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
- package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
- package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
- package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
- package/dist/mcps/lint.server.d.ts +2 -4
- package/dist/mcps/lint.server.js +51 -92
- package/dist/mcps/mcp-client.js +2 -2
- package/dist/mcps/model-health-check.server.d.ts +2 -4
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/performance-analysis.server.d.ts +2 -4
- package/dist/mcps/performance-analysis.server.js +57 -88
- package/dist/mcps/processor-pipeline.server.d.ts +2 -4
- package/dist/mcps/processor-pipeline.server.js +69 -100
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.d.ts +3 -5
- package/dist/mcps/researcher.server.js +81 -154
- package/dist/mcps/security-scan.server.d.ts +2 -4
- package/dist/mcps/security-scan.server.js +54 -96
- package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
- package/dist/mcps/shared/knowledge-skill-base.js +45 -0
- package/dist/{security → mcps/shared}/security-scanner.js +1 -1
- package/dist/mcps/state-manager.server.d.ts +2 -4
- package/dist/mcps/state-manager.server.js +115 -160
- package/dist/orchestrator/orchestrator.d.ts +1 -1
- package/dist/orchestrator/orchestrator.js +1 -1
- 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 +1 -1
- package/dist/postprocessor/PostProcessor.d.ts +4 -44
- package/dist/postprocessor/PostProcessor.js +39 -553
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
- package/dist/processors/processor-manager.js +346 -314
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/security/security-hardener.d.ts +69 -2
- package/dist/security/security-hardener.js +129 -1
- package/dist/skills/registry.json +1 -1
- package/dist/state/index.d.ts +3 -5
- package/dist/state/index.js +1 -7
- package/dist/state/state-manager.d.ts +1 -1
- package/dist/state/state-manager.js +2 -3
- package/package.json +13 -10
- package/scripts/node/universal-version-manager.js +11 -11
- package/src/mcps/architect-tools.server.ts +112 -215
- package/src/mcps/auto-format.server.ts +50 -110
- package/src/mcps/boot-orchestrator.server.ts +75 -121
- package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
- package/src/mcps/config/server-config-registry.ts +3 -3
- package/src/mcps/enforcer-tools.server.ts +212 -310
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +52 -97
- package/src/mcps/framework-help.server.ts +64 -114
- package/src/mcps/governance.server.ts +2 -2
- package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
- package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
- package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
- package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
- package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
- package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
- package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
- package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
- package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
- package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
- package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
- package/src/mcps/lint.server.ts +53 -107
- package/src/mcps/mcp-client.ts +2 -2
- package/src/mcps/model-health-check.server.ts +34 -71
- package/src/mcps/performance-analysis.server.ts +60 -104
- package/src/mcps/processor-pipeline.server.ts +72 -110
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +88 -177
- package/src/mcps/security-scan.server.ts +55 -104
- package/src/mcps/shared/knowledge-skill-base.ts +62 -0
- package/src/mcps/shared/prompt-security-validator.ts +199 -0
- package/src/mcps/shared/security-scanner.ts +599 -0
- package/src/mcps/state-manager.server.ts +117 -175
- 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/registry.json +1 -1
- package/xray/codex.json +1 -1
- package/xray/config.json +1 -1
- package/xray/features.json +1 -1
- package/xray/integrations.json +3 -3
- 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/conftest.py +0 -14
- package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
- package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
- package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
- package/dist/scripts/activate-kernel-pipeline.js +0 -101
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -72
- package/dist/security/security-agent-coordinator.js +0 -204
- package/dist/security/security-auditor.d.ts +0 -56
- package/dist/security/security-auditor.js +0 -584
- package/dist/security/security-hardening-system.d.ts +0 -239
- package/dist/security/security-hardening-system.js +0 -727
- package/dist/security/security-orchestration-layer.d.ts +0 -119
- package/dist/security/security-orchestration-layer.js +0 -496
- /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
- /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
- /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
package/.opencode/codex.codex
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.1.
|
|
2
|
+
"version": "2.1.1",
|
|
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
|
],
|
|
@@ -69,7 +69,7 @@ Comprehensive dependency analysis and security audit for all project dependencie
|
|
|
69
69
|
"vulnerabilities": [
|
|
70
70
|
{
|
|
71
71
|
"package": "lodash",
|
|
72
|
-
"version": "2.
|
|
72
|
+
"version": "2.1.1",
|
|
73
73
|
"severity": "high",
|
|
74
74
|
"cve": "CVE-2021-23337",
|
|
75
75
|
"description": "Command injection vulnerability"
|
|
@@ -85,14 +85,14 @@ Security-focused format for CI/CD integration:
|
|
|
85
85
|
|
|
86
86
|
```json
|
|
87
87
|
{
|
|
88
|
-
"version": "2.
|
|
88
|
+
"version": "2.1.1",
|
|
89
89
|
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
|
|
90
90
|
"runs": [
|
|
91
91
|
{
|
|
92
92
|
"tool": {
|
|
93
93
|
"driver": {
|
|
94
94
|
"name": "Dependency Audit",
|
|
95
|
-
"version": "2.
|
|
95
|
+
"version": "2.1.1"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"results": [...]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "xray 2.0",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Codex-compliant framework configuration for Credible UI project",
|
|
5
5
|
"thresholds": {
|
|
6
6
|
"bundleSize": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
"codex": {
|
|
223
|
-
"version": "2.
|
|
223
|
+
"version": "2.1.1",
|
|
224
224
|
"terms": [
|
|
225
225
|
1,
|
|
226
226
|
2,
|
package/AGENTS.md
CHANGED
|
@@ -107,4 +107,5 @@ Pure v16 MCPs. Clean. Complete.
|
|
|
107
107
|
- `status.ts` CLI command wired into `index.ts`
|
|
108
108
|
- Orphaned files analyzed (not deleted): `security-audit.ts`, `src/security/` (11 files), `session-capture-processor.ts`, `activate-kernel-pipeline.ts`
|
|
109
109
|
- **Hermes-agent bridge backward compat**: all JS/Python bridge files check for both `strray-ai` (old) and `0xray` (new). Default paths updated to `0xray`.
|
|
110
|
-
- **Test suite**:
|
|
110
|
+
- **Test suite**: 162 files, 2282 tests (+ 44 skipped), 0 failures. Build passes clean.
|
|
111
|
+
- **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2282 tests, 0 failures.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 0xRay — Self-Healing AI Governance OS
|
|
2
2
|
|
|
3
|
-
**v2.
|
|
3
|
+
**v2.1.3** — 42 agents · 46 skills · 41 MCP servers · 68 codex terms · ~2,900 tests
|
|
4
4
|
|
|
5
5
|
[](https://0xrayai.github.io/xray/)
|
|
6
6
|
|
|
@@ -24,6 +24,7 @@ npx 0xray status
|
|
|
24
24
|
npx 0xray opencode install # OpenCode (most common)
|
|
25
25
|
npx 0xray grok install # Grok CLI
|
|
26
26
|
npx 0xray hermes install # Hermes Agent
|
|
27
|
+
npx 0xray openclaw install # OpenClaw
|
|
27
28
|
|
|
28
29
|
# Install starter skills (recommended)
|
|
29
30
|
npx 0xray skill:install
|
|
@@ -61,7 +62,7 @@ AI coding assistants are powerful but unreliable. They hallucinate APIs, introdu
|
|
|
61
62
|
├─────────────────────────────────────────────────┤
|
|
62
63
|
│ External Governance (Dynamo) │
|
|
63
64
|
│ Codex enforcement · Multi-agent review · SSOT │
|
|
64
|
-
│
|
|
65
|
+
│ 41 MCP servers (governance + knowledge skills) deliberate proposals │
|
|
65
66
|
├─────────────────────────────────────────────────┤
|
|
66
67
|
│ Autonomous Engine (thinDispatch) │
|
|
67
68
|
│ Task routing · Multi-agent coordination │
|
|
@@ -87,7 +88,7 @@ Routes tasks to the right agents based on complexity (simple tasks go to a singl
|
|
|
87
88
|
| Platform | Install Command | What It Does |
|
|
88
89
|
|----------|----------------|--------------|
|
|
89
90
|
| **OpenCode** | `npx 0xray opencode install` | Installs as native plugin, seeds YML agent surfaces, merges configuration |
|
|
90
|
-
| **Grok CLI** | `npx 0xray grok install` | Registers plugin +
|
|
91
|
+
| **Grok CLI** | `npx 0xray grok install` | Registers plugin + full MCP surface (governance, skills, orchestrator, enforcer + knowledge skills) |
|
|
91
92
|
| **Hermes Agent** | `npx 0xray hermes install` | Copies bridge plugin to `~/.hermes/plugins/` |
|
|
92
93
|
| **OpenClaw** | `npx 0xray openclaw install` | Creates integration config at `.xray/config/openclaw.json` |
|
|
93
94
|
|
|
@@ -178,7 +179,7 @@ Every subsystem is configurable via `features.json` (located at `.opencode/xray/
|
|
|
178
179
|
|
|
179
180
|
```json
|
|
180
181
|
{
|
|
181
|
-
"version": "2.
|
|
182
|
+
"version": "2.1.1",
|
|
182
183
|
"token_optimization": {
|
|
183
184
|
"enabled": true,
|
|
184
185
|
"max_context_tokens": 20000,
|
|
@@ -276,18 +277,18 @@ Install more skills anytime: `npx 0xray skill:install`
|
|
|
276
277
|
|
|
277
278
|
## Testing & Reliability
|
|
278
279
|
|
|
279
|
-
0xRay is battle-tested with
|
|
280
|
+
0xRay is battle-tested with **~2,2282 tests** across every subsystem:
|
|
280
281
|
|
|
281
282
|
| Suite | Tests | Status |
|
|
282
283
|
|-------|-------|--------|
|
|
283
|
-
| Unit & Integration |
|
|
284
|
-
| Performance |
|
|
285
|
-
| Infrastructure |
|
|
284
|
+
| Unit & Integration | 164 files | All pass |
|
|
285
|
+
| Performance | 164 files | All pass |
|
|
286
|
+
| Infrastructure | 164 files | All pass |
|
|
286
287
|
| Consumer E2E | 4 platforms | All pass |
|
|
287
288
|
| OpenCode E2E | 42 solo + 34 orchestrator | All pass |
|
|
288
|
-
| OpenClaw E2E |
|
|
289
|
-
| Hermes E2E |
|
|
290
|
-
| Grok CLI E2E |
|
|
289
|
+
| OpenClaw E2E | 99 E2E | All pass |
|
|
290
|
+
| Hermes E2E | 46 E2E | All pass |
|
|
291
|
+
| Grok CLI E2E | 56 E2E (54 passed, 2 skipped) | All pass |
|
|
291
292
|
|
|
292
293
|
---
|
|
293
294
|
|
package/dist/AGENTS.md
CHANGED
|
@@ -107,4 +107,5 @@ Pure v16 MCPs. Clean. Complete.
|
|
|
107
107
|
- `status.ts` CLI command wired into `index.ts`
|
|
108
108
|
- Orphaned files analyzed (not deleted): `security-audit.ts`, `src/security/` (11 files), `session-capture-processor.ts`, `activate-kernel-pipeline.ts`
|
|
109
109
|
- **Hermes-agent bridge backward compat**: all JS/Python bridge files check for both `strray-ai` (old) and `0xray` (new). Default paths updated to `0xray`.
|
|
110
|
-
- **Test suite**:
|
|
110
|
+
- **Test suite**: 162 files, 2282 tests (+ 44 skipped), 0 failures. Build passes clean.
|
|
111
|
+
- **OpenClaw e2e**: Phase 13 validates `logs/framework/activity.log` via agent tool event → hooks → frameworkLogger pipeline — 2282 tests, 0 failures.
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Conventional Commits](https://www.conventionalcommits.org/).
|
|
6
6
|
|
|
7
|
+
## [2.1.3] - 2026-06-09
|
|
8
|
+
|
|
9
|
+
### 🔄 Changes
|
|
10
|
+
|
|
11
|
+
### 🐛 Bug Fixes
|
|
12
|
+
- fix: normalize PostProcessor and related log keys/IDs to clean frameworkLogger pattern (postprocessor/*, no leading -, no strray remnants); aligns with codex/AGENTS 'frameworkLogger structured logging ONLY' (742a207da)
|
|
13
|
+
- fix: add missing frameworkLogger imports to seo-consultant and tech-writer (post previous console fixes) (af8f7dc86)
|
|
14
|
+
- fix: replace remaining console.error with frameworkLogger in MCP run catches for Codex compliance (6 + 3 no-catch cases) (cdabdeb15)
|
|
15
|
+
|
|
16
|
+
### ♻️ Refactoring
|
|
17
|
+
- refactor: wire security-audit CLI, port encryption into security-hardener, delete 5 orphaned files (1c9f41ef5)
|
|
18
|
+
|
|
19
|
+
### 🧪 Tests
|
|
20
|
+
- test: add openclaw e2e Phase 13 for agent tool event → frameworkLogger → activity.log (c4e30e853)
|
|
21
|
+
|
|
22
|
+
### 🔧 Maintenance
|
|
23
|
+
- chore: final post-fix normalization and verification pass (MCP, security, PostProcessor, logs) - all tests green, no regressions (8262754fe)
|
|
24
|
+
- chore: ensure clean state post-subtract fixes and push verification (a16557a6a)
|
|
25
|
+
|
|
26
|
+
### 🔎 Other Changes
|
|
27
|
+
- docs(reflection): 4-plugin isolated npm-pack + tmp-dir + per-plugin npx install + e2e + subagent + log-monitor verification (grok/hermes/opencode/openclaw) (982aa8434)
|
|
28
|
+
- subtract/simplify phase: MCP base class (39 servers) + fixes (console->frameworkLogger, stale refs in boot/test/package), security consolidation, PostProcessor decomposition, reflection update (0bd3b07a0)
|
|
29
|
+
- v2.1.3 subtract & simplify phase (cdaefe2ed)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
7
33
|
## [2.1.1] - 2026-06-08
|
|
8
34
|
|
|
9
35
|
### 🔄 Changes
|
package/dist/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 0xRay — Self-Healing AI Governance OS
|
|
2
2
|
|
|
3
|
-
**v2.
|
|
3
|
+
**v2.1.3** — 42 agents · 46 skills · 41 MCP servers · 68 codex terms · ~2,900 tests
|
|
4
4
|
|
|
5
5
|
[](https://0xrayai.github.io/xray/)
|
|
6
6
|
|
|
@@ -24,6 +24,7 @@ npx 0xray status
|
|
|
24
24
|
npx 0xray opencode install # OpenCode (most common)
|
|
25
25
|
npx 0xray grok install # Grok CLI
|
|
26
26
|
npx 0xray hermes install # Hermes Agent
|
|
27
|
+
npx 0xray openclaw install # OpenClaw
|
|
27
28
|
|
|
28
29
|
# Install starter skills (recommended)
|
|
29
30
|
npx 0xray skill:install
|
|
@@ -61,7 +62,7 @@ AI coding assistants are powerful but unreliable. They hallucinate APIs, introdu
|
|
|
61
62
|
├─────────────────────────────────────────────────┤
|
|
62
63
|
│ External Governance (Dynamo) │
|
|
63
64
|
│ Codex enforcement · Multi-agent review · SSOT │
|
|
64
|
-
│
|
|
65
|
+
│ 41 MCP servers (governance + knowledge skills) deliberate proposals │
|
|
65
66
|
├─────────────────────────────────────────────────┤
|
|
66
67
|
│ Autonomous Engine (thinDispatch) │
|
|
67
68
|
│ Task routing · Multi-agent coordination │
|
|
@@ -87,7 +88,7 @@ Routes tasks to the right agents based on complexity (simple tasks go to a singl
|
|
|
87
88
|
| Platform | Install Command | What It Does |
|
|
88
89
|
|----------|----------------|--------------|
|
|
89
90
|
| **OpenCode** | `npx 0xray opencode install` | Installs as native plugin, seeds YML agent surfaces, merges configuration |
|
|
90
|
-
| **Grok CLI** | `npx 0xray grok install` | Registers plugin +
|
|
91
|
+
| **Grok CLI** | `npx 0xray grok install` | Registers plugin + full MCP surface (governance, skills, orchestrator, enforcer + knowledge skills) |
|
|
91
92
|
| **Hermes Agent** | `npx 0xray hermes install` | Copies bridge plugin to `~/.hermes/plugins/` |
|
|
92
93
|
| **OpenClaw** | `npx 0xray openclaw install` | Creates integration config at `.xray/config/openclaw.json` |
|
|
93
94
|
|
|
@@ -178,7 +179,7 @@ Every subsystem is configurable via `features.json` (located at `.opencode/xray/
|
|
|
178
179
|
|
|
179
180
|
```json
|
|
180
181
|
{
|
|
181
|
-
"version": "2.
|
|
182
|
+
"version": "2.1.1",
|
|
182
183
|
"token_optimization": {
|
|
183
184
|
"enabled": true,
|
|
184
185
|
"max_context_tokens": 20000,
|
|
@@ -276,18 +277,18 @@ Install more skills anytime: `npx 0xray skill:install`
|
|
|
276
277
|
|
|
277
278
|
## Testing & Reliability
|
|
278
279
|
|
|
279
|
-
0xRay is battle-tested with
|
|
280
|
+
0xRay is battle-tested with **~2,2282 tests** across every subsystem:
|
|
280
281
|
|
|
281
282
|
| Suite | Tests | Status |
|
|
282
283
|
|-------|-------|--------|
|
|
283
|
-
| Unit & Integration |
|
|
284
|
-
| Performance |
|
|
285
|
-
| Infrastructure |
|
|
284
|
+
| Unit & Integration | 164 files | All pass |
|
|
285
|
+
| Performance | 164 files | All pass |
|
|
286
|
+
| Infrastructure | 164 files | All pass |
|
|
286
287
|
| Consumer E2E | 4 platforms | All pass |
|
|
287
288
|
| OpenCode E2E | 42 solo + 34 orchestrator | All pass |
|
|
288
|
-
| OpenClaw E2E |
|
|
289
|
-
| Hermes E2E |
|
|
290
|
-
| Grok CLI E2E |
|
|
289
|
+
| OpenClaw E2E | 99 E2E | All pass |
|
|
290
|
+
| Hermes E2E | 46 E2E | All pass |
|
|
291
|
+
| Grok CLI E2E | 56 E2E (54 passed, 2 skipped) | All pass |
|
|
291
292
|
|
|
292
293
|
---
|
|
293
294
|
|
|
@@ -36,7 +36,7 @@ class RoutingRefiner {
|
|
|
36
36
|
const optimizations = this.suggestMappingOptimizations(promptAnalysis, performanceReport);
|
|
37
37
|
const warnings = this.generateWarnings(newMappings, optimizations);
|
|
38
38
|
return {
|
|
39
|
-
version: "2.
|
|
39
|
+
version: "2.1.1",
|
|
40
40
|
generatedAt: new Date(),
|
|
41
41
|
summary: {
|
|
42
42
|
newMappings: newMappings.length,
|
package/dist/cli/index.js
CHANGED
|
@@ -883,7 +883,8 @@ program
|
|
|
883
883
|
}
|
|
884
884
|
const env = { ...process.env };
|
|
885
885
|
if (server === 'governance') {
|
|
886
|
-
env.
|
|
886
|
+
env.XRAY_FORCE_MCP_GOVERNANCE = 'true';
|
|
887
|
+
// legacy STRRAY_FORCE removed for v2.1.3 clean publish; only XRAY_FORCE_MCP_GOVERNANCE
|
|
887
888
|
}
|
|
888
889
|
const child = spawn(process.execPath, [serverPath], { stdio: 'inherit', env });
|
|
889
890
|
child.on('exit', (code) => process.exit(code ?? 0));
|
|
@@ -949,6 +950,14 @@ pluginCmd
|
|
|
949
950
|
const { pluginUninstallCommand } = await import('./commands/plugin-commands.js');
|
|
950
951
|
await pluginUninstallCommand(name);
|
|
951
952
|
});
|
|
953
|
+
// Security audit command
|
|
954
|
+
program
|
|
955
|
+
.command("security-audit")
|
|
956
|
+
.description("Run comprehensive security audit with vulnerability scanning, compliance checking, and architectural decisions")
|
|
957
|
+
.action(async () => {
|
|
958
|
+
const { securityAuditCommand } = await import("./commands/security-audit.js");
|
|
959
|
+
await securityAuditCommand();
|
|
960
|
+
});
|
|
952
961
|
// Add help text
|
|
953
962
|
program.addHelpText("after", `
|
|
954
963
|
|
|
@@ -967,6 +976,7 @@ Examples:
|
|
|
967
976
|
$ npx 0xray skill:install agency-agents # Install 170+ agency agent skills
|
|
968
977
|
$ npx 0xray skill:install superpowers # Install 14 agentic workflow skills
|
|
969
978
|
$ npx 0xray skill:install <github-url> # Install from any repo
|
|
979
|
+
$ npx 0xray security-audit --deep # Run deep security audit
|
|
970
980
|
$ npx 0xray storyteller saga "v1.18.0 Journey" # Write a saga
|
|
971
981
|
$ npx 0xray storyteller reflection "API Fix" # Write a reflection
|
|
972
982
|
|
package/dist/cli/server.js
CHANGED
|
@@ -15,7 +15,7 @@ const packageJsonPath = join(ROOT_DIR, "package.json");
|
|
|
15
15
|
const { version } = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
16
16
|
const app = express();
|
|
17
17
|
const PORT = 3000;
|
|
18
|
-
const API_KEY = process.env.
|
|
18
|
+
const API_KEY = process.env.XRAY_API_KEY || undefined;
|
|
19
19
|
function timingSafeCompare(a, b) {
|
|
20
20
|
const aBuf = Buffer.from(a, "utf-8");
|
|
21
21
|
const bBuf = Buffer.from(b, "utf-8");
|
|
@@ -26,13 +26,13 @@ function timingSafeCompare(a, b) {
|
|
|
26
26
|
function requireAuth(req, res, next) {
|
|
27
27
|
if (!API_KEY) {
|
|
28
28
|
frameworkLogger.log("cli-server", "auth-skipped", "warning", {
|
|
29
|
-
message: "No
|
|
29
|
+
message: "No XRAY_API_KEY set — API is unauthenticated. Set XRAY_API_KEY in production.",
|
|
30
30
|
});
|
|
31
31
|
return next();
|
|
32
32
|
}
|
|
33
33
|
const providedKey = req.headers["x-api-key"];
|
|
34
34
|
if (typeof providedKey !== "string") {
|
|
35
|
-
return res.status(401).json({ error: "API key required. Set
|
|
35
|
+
return res.status(401).json({ error: "API key required. Set XRAY_API_KEY environment variable." });
|
|
36
36
|
}
|
|
37
37
|
if (!timingSafeCompare(providedKey, API_KEY)) {
|
|
38
38
|
return res.status(403).json({ error: "Invalid API key" });
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - Test results
|
|
10
10
|
*
|
|
11
11
|
* Enable/Disable via:
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* XRAY_ACTIVITY_LOGGING=true (enable)
|
|
13
|
+
* XRAY_ACTIVITY_LOGGING=false (disable, default)
|
|
14
14
|
*
|
|
15
15
|
* @module core/activity-logger
|
|
16
16
|
* @version 1.0.0
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - Test results
|
|
10
10
|
*
|
|
11
11
|
* Enable/Disable via:
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* XRAY_ACTIVITY_LOGGING=true (enable)
|
|
13
|
+
* XRAY_ACTIVITY_LOGGING=false (disable, default)
|
|
14
14
|
*
|
|
15
15
|
* @module core/activity-logger
|
|
16
16
|
* @version 1.0.0
|
|
@@ -21,7 +21,7 @@ import * as zlib from "zlib";
|
|
|
21
21
|
import { frameworkLogger } from "./framework-logger.js";
|
|
22
22
|
const MAX_LOG_SIZE_BYTES = 5 * 1024 * 1024; // 5MB before rotation
|
|
23
23
|
// Global state
|
|
24
|
-
let activityLoggerEnabled = process.env.
|
|
24
|
+
let activityLoggerEnabled = process.env.XRAY_ACTIVITY_LOGGING !== "false";
|
|
25
25
|
let activityLogPath;
|
|
26
26
|
let sessionId;
|
|
27
27
|
let sessionStartTime;
|
|
@@ -184,7 +184,7 @@ export function logActivity(category, level, action, message, details, options)
|
|
|
184
184
|
// Write to report JSON
|
|
185
185
|
writeToReportFile(record);
|
|
186
186
|
// Console output for debug mode
|
|
187
|
-
if (process.env.
|
|
187
|
+
if (process.env.XRAY_ACTIVITY_CONSOLE === "true") {
|
|
188
188
|
frameworkLogger.log("activity-logger", "console-output", "info", { message: `[${record.timestamp}] [${record.category}] ${level.toUpperCase()}: ${message}`, details: details || "" });
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Boot Orchestrator (
|
|
2
|
+
* Boot Orchestrator (consumer runtime compat; primary XRAY_ env + .xray fallbacks).
|
|
3
3
|
*/
|
|
4
4
|
import { XrayStateManager } from "../state/state-manager.js";
|
|
5
5
|
import { type MemoryStats } from "../monitoring/memory-monitor.js";
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Boot Orchestrator (
|
|
2
|
+
* Boot Orchestrator (consumer runtime compat; primary XRAY_ env + .xray fallbacks).
|
|
3
3
|
*/
|
|
4
4
|
import { XrayContextLoader } from "./context-loader.js";
|
|
5
5
|
import { XrayStateManager } from "../state/state-manager.js";
|
|
6
6
|
import { ProcessorManager } from "../processors/processor-manager.js";
|
|
7
|
-
import { pathResolver } from "../utils/path-resolver.js";
|
|
8
7
|
import * as fs from "fs";
|
|
9
8
|
import * as path from "path";
|
|
10
9
|
const { existsSync, readFileSync } = fs;
|
|
11
10
|
// Path configuration - can be overridden by environment or use path resolver
|
|
12
|
-
const AGENTS_BASE_PATH = process.env.
|
|
11
|
+
const AGENTS_BASE_PATH = process.env.XRAY_AGENTS_PATH || "../agents";
|
|
13
12
|
import { createAgentDelegator, createSessionCoordinator, } from "../delegation/index.js";
|
|
14
13
|
import { createSessionCleanupManager } from "../session/session-cleanup-manager.js";
|
|
15
14
|
import { createSessionMonitor } from "../session/session-monitor.js";
|
|
@@ -47,7 +46,7 @@ function setupGracefulShutdown() {
|
|
|
47
46
|
}
|
|
48
47
|
catch (error) {
|
|
49
48
|
// Suppress error output in CLI mode to avoid breaking interface
|
|
50
|
-
if (process.env.
|
|
49
|
+
if (process.env.XRAY_CLI_MODE !== "true" &&
|
|
51
50
|
process.env.OPENCODE_CLI !== "true") {
|
|
52
51
|
frameworkLogger.log("boot-orchestrator", "shutdown-error", "error", { error, message: "Error during graceful shutdown" });
|
|
53
52
|
}
|
|
@@ -69,7 +68,7 @@ function setupGracefulShutdown() {
|
|
|
69
68
|
// Handle uncaught exceptions that might cause JSON parsing errors
|
|
70
69
|
process.on("uncaughtException", (error) => {
|
|
71
70
|
// Suppress error output in CLI mode to avoid breaking interface
|
|
72
|
-
if (process.env.
|
|
71
|
+
if ((process.env.XRAY_CLI_MODE) !== "true" &&
|
|
73
72
|
process.env.OPENCODE_CLI !== "true") {
|
|
74
73
|
frameworkLogger.log("boot-orchestrator", "uncaught-exception", "error", { error, message: "Uncaught Exception" });
|
|
75
74
|
}
|
|
@@ -79,7 +78,7 @@ function setupGracefulShutdown() {
|
|
|
79
78
|
});
|
|
80
79
|
process.on("unhandledRejection", (reason, promise) => {
|
|
81
80
|
// Suppress error output in CLI mode to avoid breaking interface
|
|
82
|
-
if (process.env.
|
|
81
|
+
if ((process.env.XRAY_CLI_MODE) !== "true" &&
|
|
83
82
|
process.env.OPENCODE_CLI !== "true") {
|
|
84
83
|
frameworkLogger.log("boot-orchestrator", "unhandled-rejection", "error", { promise, reason, message: "Unhandled Rejection" });
|
|
85
84
|
}
|
|
@@ -425,23 +424,9 @@ export class BootOrchestrator {
|
|
|
425
424
|
}
|
|
426
425
|
}
|
|
427
426
|
async runInitialSecurityAudit() {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
const auditor = new SecurityAuditor();
|
|
432
|
-
const result = await auditor.auditProject(process.cwd());
|
|
433
|
-
if (result.score < 80) {
|
|
434
|
-
frameworkLogger.log("boot-orchestrator", "low-security-score", "warning", {
|
|
435
|
-
score: result.score,
|
|
436
|
-
message: `Initial security score: ${result.score}/100 (target: 80+)`,
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
return result;
|
|
440
|
-
}
|
|
441
|
-
catch (error) {
|
|
442
|
-
frameworkLogger.log("boot-orchestrator", "security-audit-failed", "error", { error, message: "Failed to run initial security audit" });
|
|
443
|
-
return { score: 0, issues: [] };
|
|
444
|
-
}
|
|
427
|
+
// Consolidated to MCP security-audit.server.ts + shared; initial audit now handled via governance/MCP path
|
|
428
|
+
frameworkLogger.log("boot-orchestrator", "initial-security-audit-skipped", "info", { message: "Security auditor consolidated to MCP layer (see security-audit.server.ts); boot uses hardener/headers only" });
|
|
429
|
+
return { score: 100, issues: [] };
|
|
445
430
|
}
|
|
446
431
|
/**
|
|
447
432
|
* Validate processor health during boot
|
|
@@ -596,7 +581,7 @@ export class BootOrchestrator {
|
|
|
596
581
|
};
|
|
597
582
|
try {
|
|
598
583
|
frameworkLogger.log("boot-orchestrator", "loading xray configuration", "info", { jobId });
|
|
599
|
-
// Consumer runtime compat
|
|
584
|
+
// Consumer runtime compat (XRAY_ env + .xray fallbacks)
|
|
600
585
|
await this.loadXrayConfiguration(jobId);
|
|
601
586
|
frameworkLogger.log("boot-orchestrator", "xray configuration loaded", "success", { jobId });
|
|
602
587
|
// Phase 1: Initialize core systems
|
|
@@ -727,14 +712,14 @@ export class BootOrchestrator {
|
|
|
727
712
|
this.stateManager.set("boot:errors", result.errors);
|
|
728
713
|
return result;
|
|
729
714
|
}
|
|
730
|
-
// Consumer runtime compat
|
|
715
|
+
// Consumer runtime compat (XRAY_ env + .xray fallbacks)
|
|
731
716
|
async loadXrayConfiguration(jobId) {
|
|
732
717
|
try {
|
|
733
|
-
// Consumer runtime compat
|
|
718
|
+
// Consumer runtime compat (XRAY_ env + .xray fallbacks)
|
|
734
719
|
const xrayConfig = {
|
|
735
|
-
version: "2.
|
|
720
|
+
version: "2.1.1",
|
|
736
721
|
codex_enabled: true,
|
|
737
|
-
codex_version: "v2.
|
|
722
|
+
codex_version: "v2.1.1",
|
|
738
723
|
codex_terms: [
|
|
739
724
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
|
740
725
|
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
|
package/dist/core/bridge.mjs
CHANGED
|
@@ -69,7 +69,7 @@ let frameworkLoadAttempted = false;
|
|
|
69
69
|
// ============================================================================
|
|
70
70
|
|
|
71
71
|
function findProjectRoot() {
|
|
72
|
-
const envHome = process.env.
|
|
72
|
+
const envHome = process.env.XRAY_HOME;
|
|
73
73
|
if (envHome && existsSync(join(envHome, "package.json"))) return envHome;
|
|
74
74
|
|
|
75
75
|
const candidates = [
|
|
@@ -219,7 +219,7 @@ 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.XRAY_CONFIG_DIR
|
|
222
|
+
const envDir = process.env.XRAY_CONFIG_DIR;
|
|
223
223
|
const candidates = [];
|
|
224
224
|
if (envDir) candidates.push(join(projectRoot, envDir, "codex.json"));
|
|
225
225
|
candidates.push(join(projectRoot, ".xray", "codex.json"));
|
|
@@ -748,7 +748,7 @@ function startHttpServer(port, projectRoot) {
|
|
|
748
748
|
return new Promise((resolve, reject) => {
|
|
749
749
|
const server = createServer(async (req, res) => {
|
|
750
750
|
// CORS headers (wildcard — restrict via STRRAY_HTTP_CORS_ORIGIN env var in production)
|
|
751
|
-
const corsOrigin =
|
|
751
|
+
const corsOrigin = "*";
|
|
752
752
|
res.setHeader("Content-Type", "application/json");
|
|
753
753
|
res.setHeader("Access-Control-Allow-Origin", corsOrigin);
|
|
754
754
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
@@ -84,13 +84,13 @@ export const BUILTIN_CODEX = {
|
|
|
84
84
|
*/
|
|
85
85
|
export function findCodexPath(projectRoot) {
|
|
86
86
|
const root = projectRoot || process.cwd();
|
|
87
|
-
const envDir = process.env.
|
|
87
|
+
const envDir = process.env.XRAY_CONFIG_DIR;
|
|
88
88
|
const candidates = [];
|
|
89
89
|
if (envDir) {
|
|
90
90
|
candidates.push(resolve(root, envDir, "codex.json"));
|
|
91
91
|
}
|
|
92
92
|
candidates.push(join(root, ".xray", "codex.json"));
|
|
93
|
-
candidates.push(join(root, "
|
|
93
|
+
candidates.push(join(root, "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"));
|
|
@@ -170,7 +170,7 @@ export function createXrayCodexInjectorHook() {
|
|
|
170
170
|
});
|
|
171
171
|
// Skip codex enforcement during testing
|
|
172
172
|
if (process.env.NODE_ENV === "test" ||
|
|
173
|
-
process.env.
|
|
173
|
+
process.env.XRAY_TEST_MODE === "true") {
|
|
174
174
|
await frameworkLogger.log("codex-injector", "skipping enforcement in test mode", "info", { jobId });
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
@@ -263,7 +263,7 @@ export function createXrayCodexInjectorHook() {
|
|
|
263
263
|
frameworkLogger.log("codex-injector", "tool.execute.after hook triggered", "info", { jobId, tool: input.tool, sessionId });
|
|
264
264
|
// Skip codex enforcement during testing
|
|
265
265
|
if (process.env.NODE_ENV === "test" ||
|
|
266
|
-
process.env.
|
|
266
|
+
process.env.XRAY_TEST_MODE === "true") {
|
|
267
267
|
frameworkLogger.log("codex-injector", "skipping injection in test mode", "info", { jobId });
|
|
268
268
|
return output;
|
|
269
269
|
}
|
|
@@ -422,4 +422,3 @@ export class CodexInjector {
|
|
|
422
422
|
return { guidance, concerns };
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
export { createXrayCodexInjectorHook as createStringRayCodexInjectorHook };
|
|
@@ -68,4 +68,4 @@ export declare class XrayConfigLoader {
|
|
|
68
68
|
clearCache(): void;
|
|
69
69
|
}
|
|
70
70
|
export declare const xrayConfigLoader: XrayConfigLoader;
|
|
71
|
-
export { xrayConfigLoader as strRayConfigLoader
|
|
71
|
+
export { xrayConfigLoader as strRayConfigLoader };
|
|
@@ -147,4 +147,4 @@ export class XrayConfigLoader {
|
|
|
147
147
|
// Export singleton instance
|
|
148
148
|
export const xrayConfigLoader = new XrayConfigLoader();
|
|
149
149
|
// Backward compat alias
|
|
150
|
-
export { xrayConfigLoader as strRayConfigLoader
|
|
150
|
+
export { xrayConfigLoader as strRayConfigLoader };
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
*/
|
|
19
19
|
/** Environment variable name for custom config root */
|
|
20
20
|
export declare const XRAY_CONFIG_DIR_ENV = "XRAY_CONFIG_DIR";
|
|
21
|
-
/** Legacy env var name (backward compat) */
|
|
22
|
-
export declare const STRRAY_CONFIG_DIR_ENV = "STRRAY_CONFIG_DIR";
|
|
23
21
|
/**
|
|
24
22
|
* Detect the best available config directory.
|
|
25
23
|
* Scans in priority order and caches the first one that exists (or the first default).
|
|
@@ -21,7 +21,7 @@ import { join, resolve } from "path";
|
|
|
21
21
|
/** Environment variable name for custom config root */
|
|
22
22
|
export const XRAY_CONFIG_DIR_ENV = "XRAY_CONFIG_DIR";
|
|
23
23
|
/** Legacy env var name (backward compat) */
|
|
24
|
-
|
|
24
|
+
// STRRAY_CONFIG_DIR_ENV kept for legacy consumer compat (see bridge and tests)
|
|
25
25
|
/** Resolved config directories, cached per projectRoot */
|
|
26
26
|
const _resolvedConfigDirs = new Map();
|
|
27
27
|
/**
|
|
@@ -33,7 +33,7 @@ export function getConfigDir(projectRoot) {
|
|
|
33
33
|
const cached = _resolvedConfigDirs.get(root);
|
|
34
34
|
if (cached)
|
|
35
35
|
return cached;
|
|
36
|
-
const envDir = process.env[XRAY_CONFIG_DIR_ENV]
|
|
36
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
37
37
|
// Priority candidates
|
|
38
38
|
const candidates = [];
|
|
39
39
|
if (envDir) {
|
|
@@ -64,13 +64,13 @@ export function getConfigDir(projectRoot) {
|
|
|
64
64
|
*/
|
|
65
65
|
export function resolveConfigPath(relativePath, projectRoot) {
|
|
66
66
|
const root = projectRoot || process.cwd();
|
|
67
|
-
const envDir = process.env[XRAY_CONFIG_DIR_ENV]
|
|
67
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
68
68
|
const candidates = [];
|
|
69
69
|
if (envDir) {
|
|
70
70
|
candidates.push(resolve(root, envDir, relativePath));
|
|
71
71
|
}
|
|
72
72
|
candidates.push(join(root, ".xray", relativePath));
|
|
73
|
-
candidates.push(join(root, "
|
|
73
|
+
candidates.push(join(root, "xray", relativePath));
|
|
74
74
|
for (const candidate of candidates) {
|
|
75
75
|
if (existsSync(candidate)) {
|
|
76
76
|
return candidate;
|
|
@@ -86,7 +86,7 @@ export function resolveConfigPath(relativePath, projectRoot) {
|
|
|
86
86
|
*/
|
|
87
87
|
export function resolveStateDir(projectRoot) {
|
|
88
88
|
const root = projectRoot || process.cwd();
|
|
89
|
-
const envDir = process.env[XRAY_CONFIG_DIR_ENV]
|
|
89
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
90
90
|
const candidates = [];
|
|
91
91
|
if (envDir) {
|
|
92
92
|
candidates.push(join(root, envDir, "state"));
|
|
@@ -113,7 +113,7 @@ export function resolveStateFilePath(projectRoot) {
|
|
|
113
113
|
*/
|
|
114
114
|
export function resolveProfilesDir(projectRoot) {
|
|
115
115
|
const root = projectRoot || process.cwd();
|
|
116
|
-
const envDir = process.env[XRAY_CONFIG_DIR_ENV]
|
|
116
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
117
117
|
const candidates = [];
|
|
118
118
|
if (envDir) {
|
|
119
119
|
candidates.push(join(root, envDir, "profiles"));
|
|
@@ -133,14 +133,13 @@ export function resolveProfilesDir(projectRoot) {
|
|
|
133
133
|
*/
|
|
134
134
|
export function resolveCodexPath(projectRoot) {
|
|
135
135
|
const root = projectRoot || process.cwd();
|
|
136
|
-
const envDir = process.env[XRAY_CONFIG_DIR_ENV]
|
|
136
|
+
const envDir = process.env[XRAY_CONFIG_DIR_ENV];
|
|
137
137
|
const candidates = [];
|
|
138
138
|
if (envDir) {
|
|
139
139
|
candidates.push(join(root, envDir, "codex.json"));
|
|
140
140
|
}
|
|
141
141
|
candidates.push(join(root, ".xray", "codex.json"));
|
|
142
142
|
candidates.push(join(root, "xray", "codex.json"));
|
|
143
|
-
candidates.push(join(root, ".opencode", "xray", "codex.json"));
|
|
144
143
|
// Additional fallback locations (for standalone usage)
|
|
145
144
|
candidates.push(join(root, "codex.json"));
|
|
146
145
|
candidates.push(join(root, "src", "codex.json"));
|
|
@@ -119,4 +119,4 @@ export declare class XrayContextLoader {
|
|
|
119
119
|
* Export singleton instance
|
|
120
120
|
*/
|
|
121
121
|
export declare const xrayContextLoader: XrayContextLoader;
|
|
122
|
-
export { xrayContextLoader as strRayContextLoader
|
|
122
|
+
export { xrayContextLoader as strRayContextLoader };
|