0xray 3.0.14 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/.gitignore.default +59 -0
  2. package/.mcp.json +35 -0
  3. package/.opencode/codex.codex +1 -1
  4. package/.opencode/commands/dependency-audit.md +3 -3
  5. package/.opencode/commands/summary-logger.md +4 -4
  6. package/.opencode/enforcer-config.json +2 -2
  7. package/.opencode/hooks/post-commit +1 -1
  8. package/.opencode/init.sh +10 -4
  9. package/.plugin/plugin.json +11 -0
  10. package/AGENTS-consumer.md +46 -0
  11. package/AGENTS.md +10 -10
  12. package/LICENSE +1 -1
  13. package/README.md +8 -8
  14. package/SKILLS.md +140 -0
  15. package/dist/.gitignore.default +59 -0
  16. package/dist/AGENTS.md +10 -10
  17. package/dist/CHANGELOG.md +34 -0
  18. package/dist/LICENSE +1 -1
  19. package/dist/README.md +8 -8
  20. package/dist/SKILLS.md +140 -0
  21. package/dist/agents/index.js +3 -1
  22. package/dist/agents/registry.js +13 -0
  23. package/dist/analytics/routing-refiner.js +1 -1
  24. package/dist/architect/architectural-integrity.js +3 -3
  25. package/dist/benchmark/performance-benchmark.js +4 -3
  26. package/dist/cli/commands/antigravity-status.js +23 -23
  27. package/dist/cli/commands/credible-init.js +1 -1
  28. package/dist/cli/commands/hermes-install.js +12 -4
  29. package/dist/cli/commands/mcp-install.js +1 -1
  30. package/dist/cli/commands/openclaw-install.js +10 -1
  31. package/dist/cli/commands/opencode-install.js +22 -0
  32. package/dist/cli/commands/plugin-commands.js +2 -2
  33. package/dist/cli/commands/publish-agent.js +5 -5
  34. package/dist/cli/commands/skill-install.js +39 -2
  35. package/dist/cli/commands/status.js +8 -3
  36. package/dist/cli/commands/storyteller.js +2 -2
  37. package/dist/cli/index.js +17 -11
  38. package/dist/cli/server.js +4 -4
  39. package/dist/core/activity-logger.js +4 -4
  40. package/dist/core/agent-spawn-gate.js +1 -1
  41. package/dist/core/boot-orchestrator.js +30 -31
  42. package/dist/core/bridge.mjs +26 -26
  43. package/dist/core/codex-formatter.js +2 -3
  44. package/dist/core/codex-injector.js +7 -7
  45. package/dist/core/config-loader.js +3 -2
  46. package/dist/core/config-paths.js +38 -31
  47. package/dist/core/context-loader.js +5 -5
  48. package/dist/core/features-config.js +1 -1
  49. package/dist/core/index.js +2 -2
  50. package/dist/core/logging-config.js +7 -7
  51. package/dist/core/orchestrator.js +2 -2
  52. package/dist/core/system-prompt-generator.js +2 -2
  53. package/dist/core/xray-activation.js +42 -41
  54. package/dist/delegation/agent-delegator.js +3 -3
  55. package/dist/enforcement/enforcer-tools.js +4 -4
  56. package/dist/enforcement/loaders/codex-loader.js +2 -2
  57. package/dist/execution/opencode-cli-invoker.js +1 -1
  58. package/dist/governance/governance-service.js +1 -1
  59. package/dist/governance/llm-governance-provider.js +223 -0
  60. package/dist/index.js +6 -6
  61. package/dist/inference/deploy-verifier.js +1 -1
  62. package/dist/inference/inference-cycle.js +16 -16
  63. package/dist/integrations/base/README.md +1 -1
  64. package/dist/integrations/enforcement-gate.js +2 -2
  65. package/dist/integrations/governance/index.js +1 -1
  66. package/dist/integrations/grok/grok-cli.js +20 -6
  67. package/dist/integrations/grok/hooks/pre-tool-use.js +3 -3
  68. package/dist/integrations/grok/plugin/0xray/.mcp.json +16 -4
  69. package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  70. package/dist/integrations/hermes-agent/__init__.py +90 -79
  71. package/dist/integrations/hermes-agent/after-install.md +14 -14
  72. package/dist/integrations/hermes-agent/bridge.mjs +60 -25
  73. package/dist/integrations/hermes-agent/plugin.yaml +5 -5
  74. package/dist/integrations/hermes-agent/schemas.py +61 -12
  75. package/dist/integrations/hermes-agent/test_plugin.py +124 -124
  76. package/dist/integrations/hermes-agent/tools.py +129 -25
  77. package/dist/integrations/openclaw/README.md +6 -6
  78. package/dist/integrations/openclaw/config.js +1 -1
  79. package/dist/integrations/openclaw/index.js +2 -2
  80. package/dist/integrations/openclaw/types.js +3 -3
  81. package/dist/integrations/plugins/plugin-integration.js +1 -1
  82. package/dist/integrations/plugins/plugin-registry.js +3 -3
  83. package/dist/mcps/architect-tools.server.js +3 -2
  84. package/dist/mcps/auto-format.server.js +2 -2
  85. package/dist/mcps/boot-orchestrator.server.js +2 -2
  86. package/dist/mcps/config/config-loader.js +40 -9
  87. package/dist/mcps/config/server-config-registry.js +10 -10
  88. package/dist/mcps/connection/mcp-connection.js +1 -1
  89. package/dist/mcps/enforcer-tools.server.js +2 -2
  90. package/dist/mcps/estimation.server.js +3 -2
  91. package/dist/mcps/framework-compliance-audit.server.js +2 -2
  92. package/dist/mcps/framework-help.server.js +9 -8
  93. package/dist/mcps/governance.server.js +8 -4
  94. package/dist/mcps/knowledge-skills/api-design.server.js +3 -2
  95. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -2
  96. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +3 -3
  97. package/dist/mcps/knowledge-skills/code-analyzer.server.js +2 -2
  98. package/dist/mcps/knowledge-skills/code-review.server.js +14 -39
  99. package/dist/mcps/knowledge-skills/content-creator.server.js +3 -3
  100. package/dist/mcps/knowledge-skills/database-design.server.js +2 -2
  101. package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -2
  102. package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -2
  103. package/dist/mcps/knowledge-skills/growth-strategist.server.js +3 -3
  104. package/dist/mcps/knowledge-skills/log-monitor.server.js +3 -3
  105. package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
  106. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +3 -3
  107. package/dist/mcps/knowledge-skills/performance-optimization.server.js +2 -2
  108. package/dist/mcps/knowledge-skills/project-analysis.server.js +2 -2
  109. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -2
  110. package/dist/mcps/knowledge-skills/security-audit.server.js +14 -44
  111. package/dist/mcps/knowledge-skills/seo-consultant.server.js +3 -2
  112. package/dist/mcps/knowledge-skills/session-management.server.js +3 -2
  113. package/dist/mcps/knowledge-skills/skill-invocation.server.js +105 -3
  114. package/dist/mcps/knowledge-skills/strategist.server.js +3 -3
  115. package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -2
  117. package/dist/mcps/knowledge-skills/testing-strategy.server.js +2 -2
  118. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -4
  119. package/dist/mcps/lint.server.js +4 -4
  120. package/dist/mcps/mcp-client.js +5 -5
  121. package/dist/mcps/model-health-check.server.js +3 -2
  122. package/dist/mcps/orchestrator/server.js +4 -3
  123. package/dist/mcps/orchestrator.server.js +2 -1
  124. package/dist/mcps/performance-analysis.server.js +2 -2
  125. package/dist/mcps/processor-pipeline.server.js +3 -2
  126. package/dist/mcps/registry.json +1 -1
  127. package/dist/mcps/researcher.server.js +14 -39
  128. package/dist/mcps/security-scan.server.js +2 -2
  129. package/dist/mcps/simulation/server-simulations.js +3 -3
  130. package/dist/mcps/state-manager.server.js +5 -5
  131. package/dist/metrics/agent-metrics.js +1 -1
  132. package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +4 -4
  133. package/dist/orchestrator/intelligent-commit-batcher.js +2 -3
  134. package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
  135. package/dist/orchestrator/orchestrator.js +9 -8
  136. package/dist/orchestrator/universal-registry-bridge.js +4 -4
  137. package/dist/postprocessor/PostProcessor.js +9 -9
  138. package/dist/postprocessor/services/RegressionAnalysisService.js +4 -4
  139. package/dist/postprocessor/triggers/GitHookTrigger.js +18 -18
  140. package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
  141. package/dist/processors/implementations/inference-improvement-processor.js +1 -2
  142. package/dist/processors/implementations/log-protection-processor.js +2 -2
  143. package/dist/processors/implementations/publish-preflight-processor.js +2 -3
  144. package/dist/processors/implementations/regression-testing-processor.js +2 -2
  145. package/dist/processors/implementations/session-summary-processor.js +2 -2
  146. package/dist/processors/implementations/storytelling-trigger-processor.js +1 -2
  147. package/dist/public/about.html +6 -6
  148. package/dist/public/enterprise.html +1 -1
  149. package/dist/public/features.html +2 -2
  150. package/dist/public/index.html +4 -4
  151. package/dist/reporting/report-formatter.js +1 -1
  152. package/dist/scripts/activate-kernel-pipeline.js +4 -4
  153. package/dist/scripts/pre-command +1 -1
  154. package/dist/services/inference-tuner.js +2 -2
  155. package/dist/skills/api-design/SKILL.md +1 -1
  156. package/dist/skills/architect-tools/SKILL.md +1 -1
  157. package/dist/skills/architecture-patterns/SKILL.md +1 -1
  158. package/dist/skills/auto-format/SKILL.md +1 -1
  159. package/dist/skills/boot-orchestrator/SKILL.md +1 -1
  160. package/dist/skills/bug-triage/SKILL.md +1 -1
  161. package/dist/skills/code-analyzer/SKILL.md +1 -1
  162. package/dist/skills/code-review/SKILL.md +1 -1
  163. package/dist/skills/enforcer/SKILL.md +1 -1
  164. package/dist/skills/framework-compliance-audit/SKILL.md +1 -1
  165. package/dist/skills/git-workflow/SKILL.md +1 -1
  166. package/dist/skills/hermes-agent/SKILL.md +42 -42
  167. package/dist/skills/inference-improve/SKILL.md +1 -1
  168. package/dist/skills/lint/SKILL.md +1 -1
  169. package/dist/skills/log-monitor/SKILL.md +1 -1
  170. package/dist/skills/model-health-check/SKILL.md +1 -1
  171. package/dist/skills/multimodal-looker/SKILL.md +1 -1
  172. package/dist/skills/orchestrator/SKILL.md +1 -1
  173. package/dist/skills/performance-analysis/SKILL.md +1 -1
  174. package/dist/skills/performance-optimization/SKILL.md +1 -1
  175. package/dist/skills/processor-pipeline/SKILL.md +1 -1
  176. package/dist/skills/project-analysis/SKILL.md +1 -1
  177. package/dist/skills/refactoring-strategies/SKILL.md +1 -1
  178. package/dist/skills/registry.json +1 -1
  179. package/dist/skills/researcher/SKILL.md +1 -1
  180. package/dist/skills/security-audit/SKILL.md +1 -1
  181. package/dist/skills/security-scan/SKILL.md +1 -1
  182. package/dist/skills/session-management/SKILL.md +1 -1
  183. package/dist/skills/state-manager/SKILL.md +1 -1
  184. package/dist/skills/storyteller/SKILL.md +1 -1
  185. package/dist/skills/testing-best-practices/SKILL.md +1 -1
  186. package/dist/skills/testing-strategy/SKILL.md +1 -1
  187. package/dist/skills/ui-ux-design/SKILL.md +1 -1
  188. package/dist/state/index.js +1 -1
  189. package/dist/state/state-manager.js +3 -4
  190. package/dist/utils/import-resolver.js +1 -1
  191. package/dist/utils/path-resolver.js +2 -2
  192. package/dist/utils/token-manager.js +1 -1
  193. package/dist/validation/estimation-validator.js +1 -1
  194. package/package.json +10 -3
  195. package/scripts/hooks/pre-command +1 -1
  196. package/scripts/hooks/run-hook.js +2 -2
  197. package/scripts/node/auto-reflection-generator.mjs +30 -36
  198. package/scripts/node/govern-reflection.mjs +1 -1
  199. package/scripts/node/postinstall.cjs +37 -2
  200. package/scripts/node/pre-publish-guard.js +13 -9
  201. package/scripts/node/setup-xai-oauth.mjs +244 -0
  202. package/scripts/node/universal-version-manager.js +8 -8
  203. package/scripts/node/version-manager.mjs +1 -1
  204. package/src/integrations/grok/plugin/0xray/.mcp.json +16 -4
  205. package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  206. package/src/mcps/architect-tools.server.ts +2 -2
  207. package/src/mcps/auto-format.server.ts +2 -2
  208. package/src/mcps/boot-orchestrator.server.ts +2 -2
  209. package/src/mcps/config/__tests__/config-loader.test.ts +29 -33
  210. package/src/mcps/config/__tests__/server-config-registry.test.ts +12 -12
  211. package/src/mcps/config/config-loader.ts +50 -11
  212. package/src/mcps/config/server-config-registry.ts +10 -10
  213. package/src/mcps/connection/mcp-connection.ts +1 -1
  214. package/src/mcps/enforcer-tools.server.ts +2 -2
  215. package/src/mcps/estimation.server.ts +3 -2
  216. package/src/mcps/framework-compliance-audit.server.ts +2 -2
  217. package/src/mcps/framework-help.server.ts +9 -8
  218. package/src/mcps/governance.server.ts +8 -3
  219. package/src/mcps/knowledge-skills/api-design.server.ts +3 -2
  220. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +2 -2
  221. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +2 -2
  222. package/src/mcps/knowledge-skills/code-analyzer.server.ts +2 -2
  223. package/src/mcps/knowledge-skills/code-review.server.ts +21 -36
  224. package/src/mcps/knowledge-skills/content-creator.server.ts +3 -3
  225. package/src/mcps/knowledge-skills/database-design.server.ts +2 -2
  226. package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -2
  227. package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -2
  228. package/src/mcps/knowledge-skills/growth-strategist.server.ts +3 -3
  229. package/src/mcps/knowledge-skills/log-monitor.server.ts +3 -3
  230. package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
  231. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +3 -3
  232. package/src/mcps/knowledge-skills/performance-optimization.server.ts +2 -2
  233. package/src/mcps/knowledge-skills/project-analysis.server.ts +2 -2
  234. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -2
  235. package/src/mcps/knowledge-skills/security-audit.server.ts +21 -40
  236. package/src/mcps/knowledge-skills/seo-consultant.server.ts +3 -2
  237. package/src/mcps/knowledge-skills/session-management.server.ts +3 -2
  238. package/src/mcps/knowledge-skills/skill-invocation.server.ts +113 -3
  239. package/src/mcps/knowledge-skills/strategist.server.ts +3 -3
  240. package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
  241. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -2
  242. package/src/mcps/knowledge-skills/testing-strategy.server.ts +2 -2
  243. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -4
  244. package/src/mcps/lint.server.ts +4 -4
  245. package/src/mcps/mcp-client.ts +5 -5
  246. package/src/mcps/model-health-check.server.ts +2 -2
  247. package/src/mcps/orchestrator/server.ts +4 -3
  248. package/src/mcps/orchestrator.server.ts +2 -1
  249. package/src/mcps/performance-analysis.server.ts +2 -2
  250. package/src/mcps/processor-pipeline.server.ts +3 -2
  251. package/src/mcps/registry.json +1 -1
  252. package/src/mcps/researcher.server.ts +21 -36
  253. package/src/mcps/security-scan.server.ts +2 -2
  254. package/src/mcps/simulation/server-simulations.ts +3 -3
  255. package/src/mcps/state-manager.server.ts +5 -5
  256. package/src/opencode/codex.codex +1 -1
  257. package/src/opencode/commands/dependency-audit.md +3 -3
  258. package/src/opencode/commands/summary-logger.md +4 -4
  259. package/src/opencode/enforcer-config.json +2 -2
  260. package/src/skills/api-design/SKILL.md +1 -1
  261. package/src/skills/architect-tools/SKILL.md +1 -1
  262. package/src/skills/architecture-patterns/SKILL.md +1 -1
  263. package/src/skills/auto-format/SKILL.md +1 -1
  264. package/src/skills/boot-orchestrator/SKILL.md +1 -1
  265. package/src/skills/bug-triage/SKILL.md +1 -1
  266. package/src/skills/code-analyzer/SKILL.md +1 -1
  267. package/src/skills/code-review/SKILL.md +1 -1
  268. package/src/skills/enforcer/SKILL.md +1 -1
  269. package/src/skills/framework-compliance-audit/SKILL.md +1 -1
  270. package/src/skills/git-workflow/SKILL.md +1 -1
  271. package/src/skills/hermes-agent/SKILL.md +42 -42
  272. package/src/skills/inference-improve/SKILL.md +1 -1
  273. package/src/skills/lint/SKILL.md +1 -1
  274. package/src/skills/log-monitor/SKILL.md +1 -1
  275. package/src/skills/model-health-check/SKILL.md +1 -1
  276. package/src/skills/multimodal-looker/SKILL.md +1 -1
  277. package/src/skills/orchestrator/SKILL.md +1 -1
  278. package/src/skills/performance-analysis/SKILL.md +1 -1
  279. package/src/skills/performance-optimization/SKILL.md +1 -1
  280. package/src/skills/processor-pipeline/SKILL.md +1 -1
  281. package/src/skills/project-analysis/SKILL.md +1 -1
  282. package/src/skills/refactoring-strategies/SKILL.md +1 -1
  283. package/src/skills/registry.json +1 -1
  284. package/src/skills/researcher/SKILL.md +1 -1
  285. package/src/skills/security-audit/SKILL.md +1 -1
  286. package/src/skills/security-scan/SKILL.md +1 -1
  287. package/src/skills/session-management/SKILL.md +1 -1
  288. package/src/skills/state-manager/SKILL.md +1 -1
  289. package/src/skills/storyteller/SKILL.md +1 -1
  290. package/src/skills/testing-best-practices/SKILL.md +1 -1
  291. package/src/skills/testing-strategy/SKILL.md +1 -1
  292. package/src/skills/ui-ux-design/SKILL.md +1 -1
  293. package/xray/agents_template.md +46 -0
  294. package/xray/codex.json +598 -0
  295. package/dist/plugin/xray-codex-injection.js +0 -857
  296. /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
@@ -26,6 +26,11 @@ function getSkillsList(cwd) {
26
26
  const skillDirs = readdirSync(skillsPath).filter((f) => existsSync(join(skillsPath, f, "SKILL.md")));
27
27
  skills.push(...skillDirs);
28
28
  }
29
+ const opencodeSkillsPath = join(cwd, ".opencode", "skills");
30
+ if (existsSync(opencodeSkillsPath)) {
31
+ const skillDirs = readdirSync(opencodeSkillsPath).filter((f) => existsSync(join(opencodeSkillsPath, f, "SKILL.md")));
32
+ skills.push(...skillDirs);
33
+ }
29
34
  const uniqueSkills = [...new Set(skills)];
30
35
  return { count: uniqueSkills.length, names: uniqueSkills.sort() };
31
36
  }
@@ -41,7 +46,7 @@ function getAgentsList(cwd) {
41
46
  ];
42
47
  const configuredAgents = [];
43
48
  const configDir = getConfigDir(cwd);
44
- const agentsConfigPath = join(configDir, "strray", "agents.json");
49
+ const agentsConfigPath = join(configDir, "xray", "agents.json");
45
50
  if (existsSync(agentsConfigPath)) {
46
51
  try {
47
52
  const config = JSON.parse(readFileSync(agentsConfigPath, "utf-8"));
@@ -51,7 +56,7 @@ function getAgentsList(cwd) {
51
56
  }
52
57
  catch { /* ignore */ }
53
58
  }
54
- const featuresPath = join(configDir, "strray", "features.json");
59
+ const featuresPath = join(configDir, "xray", "features.json");
55
60
  if (existsSync(featuresPath)) {
56
61
  try {
57
62
  const features = JSON.parse(readFileSync(featuresPath, "utf-8"));
@@ -93,7 +98,7 @@ function getInferenceStatus(cwd) {
93
98
  let outcomesCount = 0;
94
99
  let patternsCount = 0;
95
100
  try {
96
- const inferenceDir = join(getConfigDir(cwd), "strray", "inference");
101
+ const inferenceDir = join(getConfigDir(cwd), "xray", "inference");
97
102
  const tunerStatusPath = join(inferenceDir, "tuner-status.json");
98
103
  if (existsSync(tunerStatusPath)) {
99
104
  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", "strray", "features.json"),
20
- join(cwd, ".strray", "features.json"),
19
+ join(cwd, ".xray", "features.json"),
20
+ join(cwd, ".opencode", "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 .strray/ handled in getConfigDir per Scope Rule)
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 .strray/ (min compat .strray/ fallback for prior StringRay consumer runtime per Scope Rule; plain xray primary)
453
+ // Check configuration - check for opencode.json or .xray/ (min compat .xray/ fallback for prior 0xRay 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 strrayDir = getConfigDir(cwd);
456
+ const xrayDir = getConfigDir(cwd);
457
457
  const opencodeExists = fs.existsSync(opencodeConfigPath);
458
- const strrayDirExists = fs.existsSync(strrayDir);
458
+ const configDirExists = fs.existsSync(xrayDir);
459
459
  if (opencodeExists) {
460
460
  console.log("✅ opencode configuration found");
461
461
  }
462
- else if (strrayDirExists) {
463
- console.log(`✅ Configuration directory found: ${strrayDir}`);
462
+ else if (configDirExists) {
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 .strray/ fallback for prior StringRay consumer runtime per Scope Rule)');
687
+ console.log('Enable it by setting inference.enabled = true in .opencode/plugins/features.json (min compat .xray/ fallback for prior 0xRay 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}/.strray/inference`;
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');
@@ -865,15 +865,20 @@ program
865
865
  program
866
866
  .command('mcp')
867
867
  .description('Run an MCP server subprocess (used by Grok/OpenCode .mcp.json)')
868
- .argument('<server>', 'Server name: governance or skills')
868
+ .argument('<server>', 'Server name: governance, skills, researcher, code-review, architect-tools, enforcer, orchestrator')
869
869
  .action(async (server) => {
870
870
  const serverMap = {
871
871
  governance: 'dist/mcps/governance.server.js',
872
872
  skills: 'dist/mcps/knowledge-skills/skill-invocation.server.js',
873
+ researcher: 'dist/mcps/researcher.server.js',
874
+ 'code-review': 'dist/mcps/knowledge-skills/code-review.server.js',
875
+ 'architect-tools': 'dist/mcps/architect-tools.server.js',
876
+ enforcer: 'dist/mcps/enforcer-tools.server.js',
877
+ orchestrator: 'dist/mcps/orchestrator.server.js',
873
878
  };
874
879
  const relPath = serverMap[server];
875
880
  if (!relPath) {
876
- console.error(`Unknown MCP server: ${server}. Use: governance, skills`);
881
+ console.error(`Unknown MCP server: ${server}. Use: governance, skills, researcher, code-review, architect-tools, enforcer, orchestrator`);
877
882
  process.exit(1);
878
883
  }
879
884
  const serverPath = resolve(join(packageRoot, relPath));
@@ -883,7 +888,8 @@ program
883
888
  }
884
889
  const env = { ...process.env };
885
890
  if (server === 'governance') {
886
- env.STRRAY_FORCE_MCP_GOVERNANCE = 'true';
891
+ env.XRAY_FORCE_MCP_GOVERNANCE = 'true';
892
+ env.XRAY_FORCE_MCP_GOVERNANCE = 'true';
887
893
  }
888
894
  const child = spawn(process.execPath, [serverPath], { stdio: 'inherit', env });
889
895
  child.on('exit', (code) => process.exit(code ?? 0));
@@ -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.STRRAY_API_KEY || undefined;
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 STRRAY_API_KEY set — API is unauthenticated. Set STRRAY_API_KEY in production.",
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 STRRAY_API_KEY environment variable." });
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" });
@@ -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, "..", ".strray", "REFACTORING_LOG.md");
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)) {
@@ -9,8 +9,8 @@
9
9
  * - Test results
10
10
  *
11
11
  * Enable/Disable via:
12
- * STRRAY_ACTIVITY_LOGGING=true (enable)
13
- * STRRAY_ACTIVITY_LOGGING=false (disable, default)
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.STRRAY_ACTIVITY_LOGGING !== "false";
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.STRRAY_ACTIVITY_CONSOLE === "true") {
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,7 +1,7 @@
1
1
  /**
2
2
  * Agent Spawn Gate — Singleton (provider-agnostic)
3
3
  *
4
- * CENTRALIZED CONTROL for all agent process spawning across StringRay
4
+ * CENTRALIZED CONTROL for all agent process spawning across 0xRay
5
5
  * (OpenCode, Hermes, or any other MCP-compatible host).
6
6
  *
7
7
  * Purpose:
@@ -1,15 +1,15 @@
1
1
  /**
2
- * Boot Orchestrator (min documented consumer runtime compat shim from prior StringRay releases; primary Xray* paths + XRAY_||STRRAY_ env + .strray fallbacks only; 1-line per Scope Rule).
2
+ * Boot Orchestrator (min documented consumer runtime compat shim from prior 0xRay releases; primary Xray paths + .xray fallbacks only; 1-line per Scope Rule).
3
3
  */
4
- import { StringRayContextLoader } from "./context-loader.js";
5
- import { StringRayStateManager } from "../state/state-manager.js";
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";
9
9
  import * as path from "path";
10
10
  const { existsSync, readFileSync } = fs;
11
11
  // Path configuration - can be overridden by environment or use path resolver
12
- const AGENTS_BASE_PATH = process.env.STRRAY_AGENTS_PATH || "../agents";
12
+ const AGENTS_BASE_PATH = process.env.XRAY_AGENTS_PATH || process.env.XRAY_AGENTS_PATH || "../agents";
13
13
  import { createAgentDelegator, createSessionCoordinator, } from "../delegation/index.js";
14
14
  import { createSessionCleanupManager } from "../session/session-cleanup-manager.js";
15
15
  import { createSessionMonitor } from "../session/session-monitor.js";
@@ -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 { strRayConfigLoader } from "./config-loader.js";
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._strrayShutdownSetup) {
33
+ if (process._xrayShutdownSetup) {
34
34
  return;
35
35
  }
36
- process._strrayShutdownSetup = true;
36
+ process._xrayShutdownSetup = true;
37
37
  let isShuttingDown = false;
38
38
  process.on("SIGINT", async () => {
39
39
  if (isShuttingDown) {
@@ -47,7 +47,7 @@ function setupGracefulShutdown() {
47
47
  }
48
48
  catch (error) {
49
49
  // Suppress error output in CLI mode to avoid breaking interface
50
- if (process.env.STRRAY_CLI_MODE !== "true" &&
50
+ if (process.env.XRAY_CLI_MODE !== "true" &&
51
51
  process.env.OPENCODE_CLI !== "true") {
52
52
  frameworkLogger.log("boot-orchestrator", "shutdown-error", "error", { error, message: "Error during graceful shutdown" });
53
53
  }
@@ -69,7 +69,7 @@ function setupGracefulShutdown() {
69
69
  // Handle uncaught exceptions that might cause JSON parsing errors
70
70
  process.on("uncaughtException", (error) => {
71
71
  // Suppress error output in CLI mode to avoid breaking interface
72
- if (process.env.STRRAY_CLI_MODE !== "true" &&
72
+ if (process.env.XRAY_CLI_MODE !== "true" &&
73
73
  process.env.OPENCODE_CLI !== "true") {
74
74
  frameworkLogger.log("boot-orchestrator", "uncaught-exception", "error", { error, message: "Uncaught Exception" });
75
75
  }
@@ -79,7 +79,7 @@ function setupGracefulShutdown() {
79
79
  });
80
80
  process.on("unhandledRejection", (reason, promise) => {
81
81
  // Suppress error output in CLI mode to avoid breaking interface
82
- if (process.env.STRRAY_CLI_MODE !== "true" &&
82
+ if (process.env.XRAY_CLI_MODE !== "true" &&
83
83
  process.env.OPENCODE_CLI !== "true") {
84
84
  frameworkLogger.log("boot-orchestrator", "unhandled-rejection", "error", { promise, reason, message: "Unhandled Rejection" });
85
85
  }
@@ -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 = StringRayContextLoader.getInstance();
102
- this.stateManager = stateManager || new StringRayStateManager();
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, strRayConfigLoader);
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,7 @@ export class BootOrchestrator {
131
131
  loadProcessorsConfig() {
132
132
  try {
133
133
  const configPaths = [
134
- path.join(process.cwd(), ".strray", "features.json"),
135
- path.join(process.cwd(), ".opencode", "strray", "features.json"),
134
+ path.join(process.cwd(), ".xray", "features.json"),
136
135
  ];
137
136
  for (const configPath of configPaths) {
138
137
  if (existsSync(configPath)) {
@@ -152,7 +151,7 @@ export class BootOrchestrator {
152
151
  async initializePluginSystem(jobId) {
153
152
  try {
154
153
  frameworkLogger.log("boot-orchestrator", "initializing plugin system", "info", { jobId });
155
- const pluginsDir = path.join(process.cwd(), ".strray", "plugins");
154
+ const pluginsDir = path.join(process.cwd(), ".xray", "plugins");
156
155
  this.pluginRegistry = new PluginRegistry({
157
156
  pluginsDir,
158
157
  autoStart: true,
@@ -189,7 +188,7 @@ export class BootOrchestrator {
189
188
  });
190
189
  return false;
191
190
  }
192
- const orchestratorInstance = orchestratorModule.strRayOrchestrator;
191
+ const orchestratorInstance = orchestratorModule.xrayOrchestrator;
193
192
  if (!orchestratorInstance) {
194
193
  frameworkLogger.log("boot-orchestrator", "orchestrator-not-found", "error", { message: "Orchestrator instance not found in module" });
195
194
  return false;
@@ -596,8 +595,8 @@ export class BootOrchestrator {
596
595
  };
597
596
  try {
598
597
  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 + .strray fallbacks)
600
- await this.loadStringRayConfiguration(jobId);
598
+ // Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; primary xray paths + .xray fallbacks)
599
+ await this.loadXrayConfiguration(jobId);
601
600
  frameworkLogger.log("boot-orchestrator", "xray configuration loaded", "success", { jobId });
602
601
  // Phase 1: Initialize core systems
603
602
  frameworkLogger.log("boot-orchestrator", "initializing core systems", "info", { jobId });
@@ -727,12 +726,12 @@ export class BootOrchestrator {
727
726
  this.stateManager.set("boot:errors", result.errors);
728
727
  return result;
729
728
  }
730
- // Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .strray fallbacks)
731
- async loadStringRayConfiguration(jobId) {
729
+ // Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; primary xray paths + .xray fallbacks)
730
+ async loadXrayConfiguration(jobId) {
732
731
  try {
733
- // Consumer runtime compat shim from prior StringRay releases (1-line min per Scope Rule; primary xray paths + XRAY_||STRRAY_ env + .strray fallbacks)
734
- const stringRayConfig = {
735
- version: "1.22.67",
732
+ // Consumer runtime compat shim from prior 0xRay releases (1-line min per Scope Rule; primary xray paths + .xray fallbacks)
733
+ const xrayConfig = {
734
+ version: "3.1.0",
736
735
  codex_enabled: true,
737
736
  codex_version: "v1.7.5",
738
737
  codex_terms: [
@@ -793,13 +792,13 @@ export class BootOrchestrator {
793
792
  },
794
793
  };
795
794
  // Store configuration in state manager for use by other components
796
- this.stateManager.set("strray:config", stringRayConfig);
797
- this.stateManager.set("strray:version", stringRayConfig.version);
798
- this.stateManager.set("strray:codex_enabled", stringRayConfig.codex_enabled);
799
- this.stateManager.set("strray:codex_terms", stringRayConfig.codex_terms);
800
- this.stateManager.set("strray:monitoring_metrics", stringRayConfig.monitoring_metrics);
801
- this.stateManager.set("strray:monitoring_alerts", stringRayConfig.monitoring_alerts);
802
- this.stateManager.set("strray:agent_capabilities", stringRayConfig.agent_capabilities);
795
+ this.stateManager.set("xray:config", xrayConfig);
796
+ this.stateManager.set("xray:version", xrayConfig.version);
797
+ this.stateManager.set("xray:codex_enabled", xrayConfig.codex_enabled);
798
+ this.stateManager.set("xray:codex_terms", xrayConfig.codex_terms);
799
+ this.stateManager.set("xray:monitoring_metrics", xrayConfig.monitoring_metrics);
800
+ this.stateManager.set("xray:monitoring_alerts", xrayConfig.monitoring_alerts);
801
+ this.stateManager.set("xray:agent_capabilities", xrayConfig.agent_capabilities);
803
802
  await frameworkLogger.log("boot-orchestrator", "configuration-loaded", "success", { jobId });
804
803
  }
805
804
  catch (error) {
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * StringRay Universal Bridge
4
+ * 0xRay Universal Bridge
5
5
  *
6
- * Standalone bridge that provides StringRay framework capabilities
6
+ * Standalone bridge that provides 0xRay framework capabilities
7
7
  * to ANY consumer — no OpenCode dependency.
8
8
  *
9
9
  * Supports three transport modes:
@@ -69,12 +69,12 @@ let frameworkLoadAttempted = false;
69
69
  // ============================================================================
70
70
 
71
71
  function findProjectRoot() {
72
- const envHome = process.env.STRRAY_HOME;
72
+ const envHome = process.env.XRAY_HOME;
73
73
  if (envHome && existsSync(join(envHome, "package.json"))) return envHome;
74
74
 
75
75
  const candidates = [
76
76
  process.cwd(),
77
- join(homedir(), "dev", "stringray"),
77
+ join(homedir(), "dev", "xray"),
78
78
  join(dirname(__dirname), "..", ".."), // core/ -> project root
79
79
  join(dirname(__dirname), "..", "..", ".."), // integrations/ -> project root
80
80
  ];
@@ -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 === "strray-ai" || pkg.dependencies?.["strray-ai"] || pkg.name === "0xray" || pkg.dependencies?.["0xray"]) {
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;
223
223
  const candidates = [];
224
224
  if (envDir) candidates.push(join(projectRoot, envDir, "codex.json"));
225
- candidates.push(join(projectRoot, ".strray", "codex.json"));
226
- candidates.push(join(projectRoot, ".opencode", "strray", "codex.json"));
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 = [`## StringRay Universal Development Codex v${termsSource.version}`];
284
+ const lines = [`## 0xRay 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, ".strray", "features.json"));
352
- featurePaths.push(join(projectRoot, ".opencode", "strray", "features.json"));
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 strrayHooksDir = join(projectRoot, "hooks");
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 strrayHook = join(strrayHooksDir, hookName);
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("0xRay") || content.includes("xray") || 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 strray source hook exists
637
- if (!existsSync(strrayHook)) {
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
- strrayHooksDir,
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(strrayHooksDir, hookName);
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-strray hooks
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}.strray-backup`);
670
+ if (!content.includes("0xRay") && !content.includes("xray") && !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}.strray-backup`;
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 isStrray = content.includes("StringRay") || content.includes("strray") || content.includes("run-hook.js");
708
+ const isXray = content.includes("0xRay") || content.includes("xray") || content.includes("run-hook.js");
709
709
 
710
- if (isStrray || lstatSync(dst).isSymbolicLink()) {
710
+ if (isXray || lstatSync(dst).isSymbolicLink()) {
711
711
  unlinkSync(dst);
712
712
 
713
713
  // Restore backup if exists
@@ -747,8 +747,8 @@ function startHttpServer(port, projectRoot) {
747
747
 
748
748
  return new Promise((resolve, reject) => {
749
749
  const server = createServer(async (req, res) => {
750
- // CORS headers (wildcard — restrict via STRRAY_HTTP_CORS_ORIGIN env var in production)
751
- const corsOrigin = process.env.STRRAY_HTTP_CORS_ORIGIN || "*";
750
+ // CORS headers (wildcard — restrict via XRAY_HTTP_CORS_ORIGIN env var in production)
751
+ const corsOrigin = process.env.XRAY_HTTP_CORS_ORIGIN || "*";
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,12 @@ export const BUILTIN_CODEX = {
84
84
  */
85
85
  export function findCodexPath(projectRoot) {
86
86
  const root = projectRoot || process.cwd();
87
- const envDir = process.env.STRRAY_CONFIG_DIR;
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
- candidates.push(join(root, ".strray", "codex.json"));
93
- candidates.push(join(root, ".opencode", "strray", "codex.json"));
92
+ candidates.push(join(root, ".xray", "codex.json"));
94
93
  // Additional fallback locations (for standalone usage)
95
94
  candidates.push(join(root, "codex.json"));
96
95
  candidates.push(join(root, "src", "codex.json"));
@@ -13,7 +13,7 @@ import { frameworkLogger } from "../core/framework-logger.js";
13
13
  import { resolveCodexPath } from "./config-paths.js";
14
14
  // Dynamic imports for cross-environment compatibility
15
15
  let extractCodexMetadata;
16
- let StringRayContextLoader;
16
+ let XrayContextLoaderClass;
17
17
  let importsInitialized = false;
18
18
  async function initializeImports() {
19
19
  if (importsInitialized)
@@ -22,13 +22,13 @@ async function initializeImports() {
22
22
  const codexParser = await import("../utils/codex-parser.js");
23
23
  const contextLoaderModule = await import("./context-loader.js");
24
24
  extractCodexMetadata = codexParser.extractCodexMetadata;
25
- StringRayContextLoader = contextLoaderModule.StringRayContextLoader;
25
+ XrayContextLoaderClass = contextLoaderModule.XrayContextLoader;
26
26
  }
27
27
  catch {
28
28
  const codexParser = await import("../utils/codex-parser");
29
29
  const contextLoaderModule = await import("./context-loader");
30
30
  extractCodexMetadata = codexParser.extractCodexMetadata;
31
- StringRayContextLoader = contextLoaderModule.StringRayContextLoader;
31
+ XrayContextLoaderClass = contextLoaderModule.XrayContextLoader;
32
32
  }
33
33
  importsInitialized = true;
34
34
  }
@@ -38,7 +38,7 @@ async function initializeImports() {
38
38
  const codexCache = new Map();
39
39
  /**
40
40
  * Codex file locations resolved through the standard priority chain.
41
- * Uses config-paths.ts resolver so STRRAY_CONFIG_DIR and .strray/ work.
41
+ * Uses config-paths.ts resolver so XRAY_CONFIG_DIR and .xray/ work.
42
42
  */
43
43
  function getCodexFileLocations(projectRoot) {
44
44
  const root = projectRoot || process.cwd();
@@ -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.STRRAY_TEST_MODE === "true") {
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
  }
@@ -193,7 +193,7 @@ export function createXrayCodexInjectorHook() {
193
193
  await frameworkLogger.log("codex-injector", "codex context loaded for validation", "success", { jobId, contextCount: codexContexts.length });
194
194
  // Use the initialized context loader
195
195
  await initializeImports();
196
- const ContextLoaderClass = StringRayContextLoader;
196
+ const ContextLoaderClass = XrayContextLoaderClass;
197
197
  const contextLoader = new ContextLoaderClass();
198
198
  const loadResult = await contextLoader.loadCodexContext(sessionId);
199
199
  if (!loadResult.success || !loadResult.context) {
@@ -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.STRRAY_TEST_MODE === "true") {
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
  }
@@ -10,7 +10,7 @@ import * as fs from "fs";
10
10
  import * as path from "path";
11
11
  import { frameworkLogger } from "./framework-logger.js";
12
12
  import { getConfigDir, resolveConfigPath } from "./config-paths.js";
13
- export class StringRayConfigLoader {
13
+ export class XrayConfigLoader {
14
14
  configPath;
15
15
  cachedConfig = null;
16
16
  cacheExpiry = 30000; // 30 seconds
@@ -145,4 +145,5 @@ export class StringRayConfigLoader {
145
145
  }
146
146
  }
147
147
  // Export singleton instance
148
- export const strRayConfigLoader = new StringRayConfigLoader();
148
+ export const xrayConfigLoader = new XrayConfigLoader();
149
+ // Backward compat aliases