0xray 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/.opencode/codex.codex +1 -1
  2. package/AGENTS.md +1 -1
  3. package/dist/AGENTS.md +1 -1
  4. package/dist/benchmark/performance-benchmark.d.ts +2 -2
  5. package/dist/benchmark/performance-benchmark.js +3 -3
  6. package/dist/cli/commands/hermes-install.js +4 -4
  7. package/dist/cli/commands/mcp-install.js +1 -1
  8. package/dist/cli/commands/openclaw-install.js +1 -1
  9. package/dist/cli/commands/plugin-commands.js +2 -2
  10. package/dist/cli/commands/publish-agent.js +5 -5
  11. package/dist/cli/commands/skill-install.js +1 -1
  12. package/dist/cli/commands/status.js +3 -3
  13. package/dist/cli/commands/storyteller.js +2 -2
  14. package/dist/cli/index.js +8 -8
  15. package/dist/cli/server.js +1 -1
  16. package/dist/core/agent-spawn-gate.d.ts +1 -1
  17. package/dist/core/agent-spawn-gate.js +1 -1
  18. package/dist/core/boot-orchestrator.d.ts +4 -4
  19. package/dist/core/boot-orchestrator.js +26 -26
  20. package/dist/core/bridge.mjs +22 -22
  21. package/dist/core/codex-formatter.js +2 -2
  22. package/dist/core/codex-injector.d.ts +4 -3
  23. package/dist/core/codex-injector.js +11 -10
  24. package/dist/core/config-loader.d.ts +5 -4
  25. package/dist/core/config-loader.js +4 -2
  26. package/dist/core/config-paths.d.ts +9 -8
  27. package/dist/core/config-paths.js +24 -23
  28. package/dist/core/context-loader.d.ts +4 -3
  29. package/dist/core/context-loader.js +7 -5
  30. package/dist/core/index.d.ts +1 -1
  31. package/dist/core/index.js +1 -1
  32. package/dist/core/orchestrator.d.ts +1 -0
  33. package/dist/core/orchestrator.js +3 -2
  34. package/dist/core/system-prompt-generator.js +2 -2
  35. package/dist/core/xray-activation.d.ts +4 -4
  36. package/dist/core/xray-activation.js +29 -24
  37. package/dist/delegation/agent-delegator.d.ts +3 -3
  38. package/dist/delegation/agent-delegator.js +3 -3
  39. package/dist/delegation/metrics-aggregator.d.ts +11 -11
  40. package/dist/delegation/session-coordinator.d.ts +3 -3
  41. package/dist/delegation/voting-coordinator.d.ts +3 -3
  42. package/dist/enforcement/enforcer-tools.js +2 -2
  43. package/dist/enforcement/loaders/codex-loader.d.ts +1 -1
  44. package/dist/enforcement/loaders/codex-loader.js +2 -2
  45. package/dist/index.d.ts +5 -5
  46. package/dist/index.js +6 -6
  47. package/dist/inference/deploy-verifier.js +1 -1
  48. package/dist/inference/inference-cycle.js +7 -7
  49. package/dist/integrations/base/README.md +2 -2
  50. package/dist/integrations/governance/index.js +1 -1
  51. package/dist/integrations/grok/grok-cli.d.ts +1 -1
  52. package/dist/integrations/grok/grok-cli.js +6 -6
  53. package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
  54. package/dist/integrations/grok/plugin/0xray/.mcp.json +3 -3
  55. package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  56. package/dist/integrations/hermes-agent/__init__.py +77 -71
  57. package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
  58. package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  59. package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
  60. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
  61. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
  62. package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
  63. package/dist/integrations/hermes-agent/after-install.md +14 -14
  64. package/dist/integrations/hermes-agent/bridge.mjs +14 -14
  65. package/dist/integrations/hermes-agent/logs/framework/routing-outcomes.json +1 -0
  66. package/dist/integrations/hermes-agent/plugin.yaml +5 -5
  67. package/dist/integrations/hermes-agent/schemas.py +12 -12
  68. package/dist/integrations/hermes-agent/test_plugin.py +128 -125
  69. package/dist/integrations/hermes-agent/tools.py +85 -23
  70. package/dist/integrations/openclaw/README.md +16 -16
  71. package/dist/integrations/openclaw/api-server.d.ts +4 -4
  72. package/dist/integrations/openclaw/api-server.js +9 -9
  73. package/dist/integrations/openclaw/config.js +1 -1
  74. package/dist/integrations/openclaw/hooks/{strray-hooks.d.ts → xray-hooks.d.ts} +4 -4
  75. package/dist/integrations/openclaw/index.d.ts +4 -4
  76. package/dist/integrations/openclaw/index.js +4 -4
  77. package/dist/integrations/openclaw/types.d.ts +1 -1
  78. package/dist/integrations/plugins/plugin-registry.js +2 -2
  79. package/dist/mcps/architect-tools.server.d.ts +2 -2
  80. package/dist/mcps/architect-tools.server.js +3 -3
  81. package/dist/mcps/auto-format.server.d.ts +2 -2
  82. package/dist/mcps/auto-format.server.js +3 -3
  83. package/dist/mcps/boot-orchestrator.server.d.ts +2 -2
  84. package/dist/mcps/boot-orchestrator.server.js +3 -3
  85. package/dist/mcps/config/server-config-registry.d.ts +1 -1
  86. package/dist/mcps/config/server-config-registry.js +7 -7
  87. package/dist/mcps/connection/mcp-connection.js +1 -1
  88. package/dist/mcps/enforcer-tools.server.d.ts +2 -2
  89. package/dist/mcps/enforcer-tools.server.js +3 -3
  90. package/dist/mcps/framework-compliance-audit.server.d.ts +2 -2
  91. package/dist/mcps/framework-compliance-audit.server.js +3 -3
  92. package/dist/mcps/framework-help.server.js +6 -6
  93. package/dist/mcps/in-process-skill-registry.js +6 -6
  94. package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -2
  95. package/dist/mcps/knowledge-skills/api-design.server.js +3 -3
  96. package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -2
  97. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +3 -3
  98. package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -2
  99. package/dist/mcps/knowledge-skills/code-review.server.js +3 -3
  100. package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -2
  101. package/dist/mcps/knowledge-skills/database-design.server.js +3 -3
  102. package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -2
  103. package/dist/mcps/knowledge-skills/devops-deployment.server.js +3 -3
  104. package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -2
  105. package/dist/mcps/knowledge-skills/git-workflow.server.js +3 -3
  106. package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -2
  107. package/dist/mcps/knowledge-skills/mobile-development.server.js +3 -3
  108. package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -2
  109. package/dist/mcps/knowledge-skills/performance-optimization.server.js +3 -3
  110. package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -2
  111. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +3 -3
  112. package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -2
  113. package/dist/mcps/knowledge-skills/security-audit.server.js +3 -3
  114. package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -2
  115. package/dist/mcps/knowledge-skills/tech-writer.server.js +3 -3
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -2
  117. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +3 -3
  118. package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -2
  119. package/dist/mcps/knowledge-skills/testing-strategy.server.js +3 -3
  120. package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -2
  121. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +5 -5
  122. package/dist/mcps/lint.server.d.ts +2 -2
  123. package/dist/mcps/lint.server.js +5 -5
  124. package/dist/mcps/mcp-client.js +3 -3
  125. package/dist/mcps/model-health-check.server.d.ts +2 -2
  126. package/dist/mcps/model-health-check.server.js +3 -3
  127. package/dist/mcps/orchestrator/server.js +2 -2
  128. package/dist/mcps/performance-analysis.server.d.ts +2 -2
  129. package/dist/mcps/performance-analysis.server.js +3 -3
  130. package/dist/mcps/processor-pipeline.server.d.ts +2 -2
  131. package/dist/mcps/processor-pipeline.server.js +3 -3
  132. package/dist/mcps/researcher.server.d.ts +3 -3
  133. package/dist/mcps/researcher.server.js +4 -4
  134. package/dist/mcps/security-scan.server.d.ts +2 -2
  135. package/dist/mcps/security-scan.server.js +3 -3
  136. package/dist/mcps/simulation/server-simulations.js +3 -3
  137. package/dist/metrics/agent-metrics.d.ts +4 -4
  138. package/dist/metrics/agent-metrics.js +1 -1
  139. package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +2 -2
  140. package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +2 -2
  141. package/dist/orchestrator/intelligent-commit-batcher.d.ts +1 -1
  142. package/dist/orchestrator/intelligent-commit-batcher.js +3 -3
  143. package/dist/orchestrator/multi-agent-orchestration-coordinator.d.ts +3 -3
  144. package/dist/orchestrator/multi-agent-orchestration-coordinator.js +9 -9
  145. package/dist/orchestrator/orchestrator.d.ts +3 -2
  146. package/dist/orchestrator/orchestrator.js +8 -6
  147. package/dist/plugin/xray-codex-injection.d.ts +1 -1
  148. package/dist/plugin/xray-codex-injection.js +8 -7
  149. package/dist/postprocessor/PostProcessor.d.ts +2 -2
  150. package/dist/postprocessor/PostProcessor.js +1 -1
  151. package/dist/postprocessor/monitoring/MonitoringEngine.d.ts +2 -2
  152. package/dist/postprocessor/services/RegressionAnalysisService.js +2 -2
  153. package/dist/postprocessor/triggers/GitHookTrigger.js +14 -14
  154. package/dist/processors/implementations/agents-md-validation-processor.js +2 -2
  155. package/dist/processors/implementations/inference-improvement-processor.js +2 -2
  156. package/dist/processors/implementations/log-protection-processor.d.ts +1 -1
  157. package/dist/processors/implementations/log-protection-processor.js +2 -2
  158. package/dist/processors/implementations/publish-preflight-processor.d.ts +1 -1
  159. package/dist/processors/implementations/publish-preflight-processor.js +3 -3
  160. package/dist/processors/implementations/regression-testing-processor.js +2 -2
  161. package/dist/processors/implementations/session-summary-processor.js +2 -2
  162. package/dist/processors/implementations/storytelling-trigger-processor.js +2 -2
  163. package/dist/processors/processor-manager.d.ts +2 -2
  164. package/dist/public/about.html +6 -6
  165. package/dist/public/enterprise.html +1 -1
  166. package/dist/public/features.html +2 -2
  167. package/dist/public/index.html +4 -4
  168. package/dist/reporting/report-formatter.js +1 -1
  169. package/dist/scripts/activate-kernel-pipeline.js +2 -2
  170. package/dist/scripts/pre-command +1 -1
  171. package/dist/services/inference-tuner.js +2 -2
  172. package/dist/session/session-cleanup-manager.d.ts +3 -3
  173. package/dist/session/session-monitor.d.ts +3 -3
  174. package/dist/session/session-state-manager.d.ts +3 -3
  175. package/dist/skills/hermes-agent/SKILL.md +11 -11
  176. package/dist/skills/storyteller/SKILL.md +1 -1
  177. package/dist/skills/xray-orchestrator/SKILL.md +141 -0
  178. package/dist/skills/xray-orchestrator/index.d.ts +13 -0
  179. package/dist/skills/xray-orchestrator/index.js +224 -0
  180. package/dist/state/index.d.ts +2 -1
  181. package/dist/state/index.js +2 -1
  182. package/dist/state/state-manager.d.ts +2 -2
  183. package/dist/state/state-manager.js +5 -4
  184. package/dist/utils/import-resolver.js +1 -1
  185. package/dist/utils/path-resolver.js +2 -2
  186. package/dist/utils/token-manager.js +1 -1
  187. package/dist/validation/estimation-validator.js +1 -1
  188. package/package.json +2 -2
  189. package/scripts/hooks/pre-command +1 -1
  190. package/scripts/hooks/run-hook.js +2 -2
  191. package/scripts/node/auto-reflection-generator.mjs +2 -2
  192. package/scripts/node/postinstall.cjs +1 -1
  193. package/scripts/node/release.js +6 -6
  194. package/scripts/node/release.mjs +10 -10
  195. package/scripts/node/version-manager.mjs +1 -1
  196. package/src/integrations/grok/plugin/0xray/.mcp.json +3 -3
  197. package/src/integrations/grok/plugin/0xray/hooks/hooks.json +2 -2
  198. package/src/mcps/architect-tools.server.ts +3 -3
  199. package/src/mcps/auto-format.server.ts +3 -3
  200. package/src/mcps/boot-orchestrator.server.ts +3 -3
  201. package/src/mcps/config/server-config-registry.ts +7 -7
  202. package/src/mcps/connection/mcp-connection.ts +1 -1
  203. package/src/mcps/enforcer-tools.server.ts +3 -3
  204. package/src/mcps/framework-compliance-audit.server.ts +3 -3
  205. package/src/mcps/framework-help.server.ts +6 -6
  206. package/src/mcps/in-process-skill-registry.ts +6 -6
  207. package/src/mcps/knowledge-skills/api-design.server.test.ts +8 -8
  208. package/src/mcps/knowledge-skills/api-design.server.ts +3 -3
  209. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +3 -3
  210. package/src/mcps/knowledge-skills/code-review.server.ts +3 -3
  211. package/src/mcps/knowledge-skills/database-design.server.ts +3 -3
  212. package/src/mcps/knowledge-skills/devops-deployment.server.ts +3 -3
  213. package/src/mcps/knowledge-skills/git-workflow.server.ts +3 -3
  214. package/src/mcps/knowledge-skills/mobile-development.server.ts +3 -3
  215. package/src/mcps/knowledge-skills/performance-optimization.server.ts +3 -3
  216. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +3 -3
  217. package/src/mcps/knowledge-skills/security-audit.server.test.ts +23 -23
  218. package/src/mcps/knowledge-skills/security-audit.server.ts +3 -3
  219. package/src/mcps/knowledge-skills/tech-writer.server.ts +3 -3
  220. package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +28 -28
  221. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +3 -3
  222. package/src/mcps/knowledge-skills/testing-strategy.server.test.ts +19 -19
  223. package/src/mcps/knowledge-skills/testing-strategy.server.ts +3 -3
  224. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +5 -5
  225. package/src/mcps/lint.server.ts +5 -5
  226. package/src/mcps/mcp-client.ts +3 -3
  227. package/src/mcps/model-health-check.server.ts +3 -3
  228. package/src/mcps/orchestrator/server.ts +2 -2
  229. package/src/mcps/performance-analysis.server.ts +3 -3
  230. package/src/mcps/processor-pipeline.server.ts +3 -3
  231. package/src/mcps/researcher.server.ts +4 -4
  232. package/src/mcps/security-scan.server.ts +3 -3
  233. package/src/mcps/simulation/server-simulations.ts +3 -3
  234. package/src/opencode/codex.codex +1 -1
  235. package/src/skills/hermes-agent/SKILL.md +11 -11
  236. package/src/skills/storyteller/SKILL.md +1 -1
  237. package/src/skills/xray-orchestrator/SKILL.md +141 -0
  238. package/src/skills/xray-orchestrator/index.ts +268 -0
  239. package/scripts/validate-stringray-comprehensive.js +0 -636
  240. /package/dist/integrations/openclaw/hooks/{strray-hooks.js → xray-hooks.js} +0 -0
@@ -39,7 +39,7 @@ interface SecuritySummaryResults {
39
39
  summary: string;
40
40
  }
41
41
 
42
- class StringRaySecurityScanServer {
42
+ class XraySecurityScanServer {
43
43
  private server: Server;
44
44
 
45
45
  constructor() {
@@ -644,8 +644,8 @@ ${results.recommendations.map((r) => `• ${r}`).join("\n") || "No recommendatio
644
644
 
645
645
  // Start the server if run directly
646
646
  if (import.meta.url === `file://${process.argv[1]}`) {
647
- const server = new StringRaySecurityScanServer();
647
+ const server = new XraySecurityScanServer();
648
648
  server.run().catch((error) => frameworkLogger.log("mcps/security-scan", "run", "error", { error: String(error) }));
649
649
  }
650
650
 
651
- export { StringRaySecurityScanServer };
651
+ export { XraySecurityScanServer };
@@ -86,7 +86,7 @@ export const researcherSimulations: Record<string, SimulatorFunction> = {
86
86
  * Framework Help server simulations
87
87
  */
88
88
  export const frameworkHelpSimulations: Record<string, SimulatorFunction> = {
89
- strray_get_capabilities: (): MCPToolResult => ({
89
+ xray_get_capabilities: (): MCPToolResult => ({
90
90
  content: [
91
91
  {
92
92
  type: 'text',
@@ -118,7 +118,7 @@ export const frameworkHelpSimulations: Record<string, SimulatorFunction> = {
118
118
  ],
119
119
  }),
120
120
 
121
- strray_get_commands: (): MCPToolResult => ({
121
+ xray_get_commands: (): MCPToolResult => ({
122
122
  content: [
123
123
  {
124
124
  type: 'text',
@@ -146,7 +146,7 @@ framework-reporting-system - Generate comprehensive framework reports
146
146
  ],
147
147
  }),
148
148
 
149
- strray_explain_capability: (): MCPToolResult => ({
149
+ xray_explain_capability: (): MCPToolResult => ({
150
150
  content: [
151
151
  {
152
152
  type: 'text',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.0",
2
+ "version": "2.1.0",
3
3
  "terms": [
4
4
  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
5
5
  ],
@@ -1,21 +1,21 @@
1
1
  ---
2
2
  name: hermes-agent
3
- description: Manage StringRay framework from Hermes Agent via the native strray-hermes plugin. Covers the 4 plugin tools (validate, codex_check, health, hooks), lifecycle hooks, slash commands, bridge architecture, and CLI fallback.
3
+ description: Manage 0xRay framework from Hermes Agent via the native strray-hermes plugin. Covers the 4 plugin tools (validate, codex_check, health, hooks), lifecycle hooks, slash commands, bridge architecture, and CLI fallback.
4
4
  version: 2.1.0
5
- author: StringRay AI
5
+ author: 0xRay AI
6
6
  metadata:
7
7
  hermes:
8
- tags: [StringRay, Plugin, Validation, Codex, GitHooks, Bridge]
8
+ tags: [0xRay, Plugin, Validation, Codex, GitHooks, Bridge]
9
9
  related_skills: []
10
10
  ---
11
11
 
12
- # StringRay Hermes Plugin (strray-hermes)
12
+ # 0xRay Hermes Plugin (strray-hermes)
13
13
 
14
- Native Hermes plugin providing StringRay framework integration — quality gates, codex enforcement, git hooks, and full pre/post processing pipeline. Runs via a Node.js bridge to compiled framework components.
14
+ Native Hermes plugin providing 0xRay framework integration — quality gates, codex enforcement, git hooks, and full pre/post processing pipeline. Runs via a Node.js bridge to compiled framework components.
15
15
 
16
16
  ## When to Use
17
17
 
18
- - User asks about StringRay health, validation, or codex checks
18
+ - User asks about 0xRay health, validation, or codex checks
19
19
  - User wants to install/manage git hooks for automated enforcement
20
20
  - User asks about the plugin's tools, hooks, or slash commands
21
21
  - User asks about bridge errors or framework not loading
@@ -28,7 +28,7 @@ Native Hermes plugin providing StringRay framework integration — quality gates
28
28
  ├── __init__.py # Plugin registration, hooks, slash commands
29
29
  ├── tools.py # 4 tool handlers (validate, codex_check, health, hooks)
30
30
  ├── schemas.py # JSON schemas the LLM sees
31
- ├── bridge.mjs # Node.js bridge to compiled StringRay framework
31
+ ├── bridge.mjs # Node.js bridge to compiled 0xRay framework
32
32
  ├── plugin.yaml # Plugin metadata (name, version, tools, hooks)
33
33
  ├── types.py # TypeScript-equivalent type definitions
34
34
  ├── after-install.md # Post-install instructions
@@ -43,7 +43,7 @@ Native Hermes plugin providing StringRay framework integration — quality gates
43
43
 
44
44
  **Fallback:** When bridge is unavailable, tools fall back to `npx 0xray` CLI commands.
45
45
 
46
- **Config path resolution:** `STRRAY_CONFIG_DIR/` > `.strray/` > `.opencode/strray/` > built-in defaults.
46
+ **Config path resolution:** `STRRAY_CONFIG_DIR/` > `.xray/` > `.opencode/xray/` > built-in defaults.
47
47
 
48
48
  ## 4 Tools
49
49
 
@@ -90,7 +90,7 @@ Returns: framework status, version, component availability, node version.
90
90
 
91
91
  ### strray_hooks
92
92
 
93
- Manage StringRay git hooks (install, uninstall, list, status).
93
+ Manage 0xRay git hooks (install, uninstall, list, status).
94
94
 
95
95
  ```
96
96
  strray_hooks(action="install")
@@ -122,7 +122,7 @@ Fires before ANY tool executes:
122
122
  1. Tracks session stats
123
123
  2. Logs tool-start event to `logs/framework/plugin-tool-events.log`
124
124
  3. For code-producing tools (write_file, patch, execute_code, write, edit): runs quality gate + pre-processors via bridge
125
- 4. For other tools: nudges when a StringRay MCP alternative exists (e.g., grep → search_codebase, eslint → strray_lint)
125
+ 4. For other tools: nudges when a 0xRay MCP alternative exists (e.g., grep → search_codebase, eslint → strray_lint)
126
126
 
127
127
  ### post_tool_call
128
128
 
@@ -164,7 +164,7 @@ All logs go to `logs/framework/` in the project root:
164
164
 
165
165
  | User Says | Tool / Command |
166
166
  |----------|---------------|
167
- | "Is StringRay working?" | `strray_health()` or `/strray status` |
167
+ | "Is 0xRay working?" | `strray_health()` or `/strray status` |
168
168
  | "Check these files before I commit" | `strray_validate(files=[...], operation="commit")` |
169
169
  | "Is this code codex compliant?" | `strray_codex_check(code=..., operation="create")` |
170
170
  | "Set up git hooks" | `strray_hooks(action="install")` |
@@ -96,7 +96,7 @@ codex_terms: [5, 7, 32] # Related Codex term numbers
96
96
  ```markdown
97
97
  ## What Next?
98
98
 
99
- - Related Codex terms: [codex.json](../../.opencode/strray/codex.json)
99
+ - Related Codex terms: [codex.json](../../.opencode/xray/codex.json)
100
100
  - Next story to write: [suggestion]
101
101
  ```
102
102
 
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: xray-orchestrator
3
+ description: |
4
+ Main orchestration skill for xray agents.
5
+ Provides commands to coordinate agent work and invoke xray APIs
6
+ through the local HTTP API server.
7
+ metadata:
8
+ openclaw:
9
+ primaryEnv: XRAY_API_KEY
10
+ emoji: 🤖
11
+ author: xray
12
+ tags:
13
+ - ai
14
+ - orchestration
15
+ - agent
16
+ user-invocable: true
17
+ ---
18
+
19
+ # xray Orchestrator Commands
20
+
21
+ ## /xray
22
+
23
+ Display xray status and available commands.
24
+
25
+ **Usage:** `/xray`
26
+
27
+ **Example:**
28
+ ```
29
+ /xray
30
+ ```
31
+
32
+ ## /xray-status
33
+
34
+ Get detailed status of xray integration including connection status.
35
+
36
+ **Usage:** `/xray-status`
37
+
38
+ **Example:**
39
+ ```
40
+ /xray-status
41
+ ```
42
+
43
+ ## /xray-analyze
44
+
45
+ Analyze code using xray code analysis capabilities.
46
+
47
+ **Usage:** `/xray-analyze <file-path>`
48
+
49
+ **Arguments:**
50
+ - `file-path`: Path to file to analyze (required)
51
+
52
+ **Example:**
53
+ ```
54
+ /xray-analyze src/index.ts
55
+ ```
56
+
57
+ ## /xray-code
58
+
59
+ Perform code review on a file.
60
+
61
+ **Usage:** `/xray-code <file-path> [options]`
62
+
63
+ **Arguments:**
64
+ - `file-path`: Path to file to review (required)
65
+ - `--fix`: Attempt to fix issues automatically (optional)
66
+
67
+ **Example:**
68
+ ```
69
+ /xray-code src/utils/helper.ts
70
+ /xray-code src/utils/helper.ts --fix
71
+ ```
72
+
73
+ ## /xray-file
74
+
75
+ Read file using xray file tools.
76
+
77
+ **Usage:** `/xray-file <file-path> [line-start:line-end]`
78
+
79
+ **Arguments:**
80
+ - `file-path`: Path to file to read (required)
81
+ - `line-start:line-end`: Line range to read (optional)
82
+
83
+ **Example:**
84
+ ```
85
+ /xray-file src/index.ts
86
+ /xray-file src/index.ts 1:50
87
+ ```
88
+
89
+ ## /xray-exec
90
+
91
+ Execute arbitrary xray command or script.
92
+
93
+ **Usage:** `/xray-exec <command>`
94
+
95
+ **Arguments:**
96
+ - `command`: Command to execute (required)
97
+
98
+ **Example:**
99
+ ```
100
+ /xray-exec list files src/
101
+ ```
102
+
103
+ ## /xray-help
104
+
105
+ Show this help message.
106
+
107
+ **Usage:** `/xray-help [command]`
108
+
109
+ **Arguments:**
110
+ - `command`: Specific command to get help for (optional)
111
+
112
+ **Example:**
113
+ ```
114
+ /xray-help
115
+ /xray-help xray-analyze
116
+ ```
117
+
118
+ # Implementation Notes
119
+
120
+ This skill acts as the main interface between OpenClaw channels and xray agents.
121
+ It processes user commands and forwards them to the xray API server running on localhost:18431.
122
+
123
+ ## API Endpoints
124
+
125
+ - `POST /api/agent/invoke` - Invoke xray agent
126
+ - `GET /api/agent/status` - Get agent status
127
+ - `GET /health` - Health check
128
+
129
+ ## Authentication
130
+
131
+ The skill reads the `XRAY_API_KEY` environment variable for authentication.
132
+
133
+ ## Error Handling
134
+
135
+ All errors are caught and formatted as user-friendly messages.
136
+ Detailed error information is logged for debugging.
137
+
138
+ # Dependencies
139
+
140
+ - xray API server running on localhost:18431
141
+ - XRAY_API_KEY environment variable
@@ -0,0 +1,268 @@
1
+ /**
2
+ * xray Orchestrator Skill
3
+ *
4
+ * OpenClaw skill that provides xray orchestration commands.
5
+ *
6
+ * @version 1.0.0
7
+ * @since 2026-03-14
8
+ */
9
+
10
+ const API_BASE = process.env.XRAY_API_URL || 'http://localhost:18431';
11
+ const API_KEY = process.env.XRAY_API_KEY;
12
+
13
+ interface ParsedArgs extends Record<string, unknown> {
14
+ _?: string[];
15
+ }
16
+
17
+ function parseArgs(input: string): { command: string; args: ParsedArgs } {
18
+ const parts = input.trim().split(/\s+/);
19
+ const command = parts[0] || '';
20
+ const args: ParsedArgs = {};
21
+
22
+ for (const part of parts.slice(1)) {
23
+ if (part.startsWith('--')) {
24
+ const key = part.slice(2);
25
+ args[key] = true;
26
+ } else if (part.includes(':')) {
27
+ const colonIdx = part.indexOf(':');
28
+ const key = part.slice(0, colonIdx);
29
+ const value = part.slice(colonIdx + 1);
30
+ if (key && value) args[key] = value;
31
+ } else if (!args._) {
32
+ args._ = [];
33
+ args._.push(part);
34
+ } else {
35
+ args._.push(part);
36
+ }
37
+ }
38
+
39
+ return { command, args };
40
+ }
41
+
42
+ async function callAPI(endpoint: string, data?: Record<string, unknown>): Promise<Record<string, unknown>> {
43
+ const headers: Record<string, string> = {
44
+ 'Content-Type': 'application/json',
45
+ };
46
+
47
+ if (API_KEY) {
48
+ headers['Authorization'] = `Bearer ${API_KEY}`;
49
+ }
50
+
51
+ const response = await fetch(`${API_BASE}${endpoint}`, {
52
+ method: data ? 'POST' : 'GET',
53
+ headers,
54
+ body: data ? JSON.stringify(data) : null,
55
+ });
56
+
57
+ if (!response.ok) {
58
+ const error = await response.json().catch(() => ({ error: 'Unknown error' }));
59
+ throw new Error(error.error || `HTTP ${response.status}`);
60
+ }
61
+
62
+ return response.json();
63
+ }
64
+
65
+ export async function handleSkill(input: string): Promise<string> {
66
+ const { command, args } = parseArgs(input);
67
+
68
+ try {
69
+ switch (command.toLowerCase()) {
70
+ // xray primary
71
+ case 'xray':
72
+ case 'xray-status':
73
+ return await handleStatus();
74
+
75
+ case 'xray-analyze':
76
+ return await handleAnalyze(args);
77
+
78
+ case 'xray-code':
79
+ return await handleCodeReview(args);
80
+
81
+ case 'xray-file':
82
+ return await handleFileRead(args);
83
+
84
+ case 'xray-exec':
85
+ return await handleExec(args);
86
+
87
+ case 'xray-help':
88
+ return handleHelp(args._ as string | undefined);
89
+
90
+ default:
91
+ return formatHelp();
92
+ }
93
+ } catch (error) {
94
+ const message = error instanceof Error ? error.message : String(error);
95
+ return `❌ Error: ${message}`;
96
+ }
97
+ }
98
+
99
+ async function handleStatus(): Promise<string> {
100
+ const health = await callAPI('/health') as { status: string; version: string; uptime: number };
101
+
102
+ return `🤖 xray Status
103
+
104
+ • Status: ${health.status}
105
+ • Version: ${health.version}
106
+ • Uptime: ${formatUptime(health.uptime)}
107
+
108
+ Use /xray-help for available commands.`;
109
+ }
110
+
111
+ async function handleAnalyze(args: Record<string, unknown>): Promise<string> {
112
+ const filePath = (args._ as string[])?.[0];
113
+
114
+ if (!filePath) {
115
+ return '❌ Usage: /xray-analyze <file-path>';
116
+ }
117
+
118
+ const result = await callAPI('/api/agent/invoke', {
119
+ command: 'analyze',
120
+ args: { filePath },
121
+ }) as { success: boolean; result?: unknown; error?: string };
122
+
123
+ if (!result.success) {
124
+ return `❌ Analysis failed: ${result.error}`;
125
+ }
126
+
127
+ return `✅ Analysis complete for ${filePath}\n\n${JSON.stringify(result.result, null, 2)}`;
128
+ }
129
+
130
+ async function handleCodeReview(args: Record<string, unknown>): Promise<string> {
131
+ const filePath = (args._ as string[])?.[0];
132
+ const fix = args.fix === true;
133
+
134
+ if (!filePath) {
135
+ return '❌ Usage: /xray-code <file-path> [--fix]';
136
+ }
137
+
138
+ const result = await callAPI('/api/agent/invoke', {
139
+ command: 'code-review',
140
+ args: { filePath, fix },
141
+ }) as { success: boolean; result?: unknown; error?: string };
142
+
143
+ if (!result.success) {
144
+ return `❌ Code review failed: ${result.error}`;
145
+ }
146
+
147
+ return `✅ Code review complete for ${filePath}\n\n${JSON.stringify(result.result, null, 2)}`;
148
+ }
149
+
150
+ async function handleFileRead(args: Record<string, unknown>): Promise<string> {
151
+ const rest = args._ as string[] | undefined;
152
+ const filePath = rest?.[0];
153
+ const range = rest?.[1];
154
+
155
+ if (!filePath) {
156
+ return '❌ Usage: /xray-file <file-path> [line-start:line-end]';
157
+ }
158
+
159
+ let lineRange: { start?: number; end?: number } | undefined;
160
+ if (range?.includes(':')) {
161
+ const [rawStart, rawEnd] = range.split(':');
162
+ lineRange = {};
163
+ if (rawStart) lineRange.start = Number(rawStart);
164
+ if (rawEnd) lineRange.end = Number(rawEnd);
165
+ }
166
+
167
+ const result = await callAPI('/api/agent/invoke', {
168
+ command: 'read',
169
+ args: { filePath, ...lineRange },
170
+ }) as { success: boolean; result?: unknown; error?: string };
171
+
172
+ if (!result.success) {
173
+ return `❌ File read failed: ${result.error}`;
174
+ }
175
+
176
+ return `📄 ${filePath}\n\`\`\`\n${result.result}\n\`\`\``;
177
+ }
178
+
179
+ async function handleExec(args: Record<string, unknown>): Promise<string> {
180
+ const command = (args._ as string[])?.[0];
181
+
182
+ if (!command) {
183
+ return '❌ Usage: /xray-exec <command>';
184
+ }
185
+
186
+ const result = await callAPI('/api/agent/invoke', {
187
+ command: 'exec',
188
+ args: { command },
189
+ }) as { success: boolean; result?: unknown; error?: string };
190
+
191
+ if (!result.success) {
192
+ return `❌ Execution failed: ${result.error}`;
193
+ }
194
+
195
+ return `✅ Command executed\n\n${JSON.stringify(result.result, null, 2)}`;
196
+ }
197
+
198
+ function handleHelp(command?: string): string {
199
+ if (command) {
200
+ switch (command) {
201
+ case 'xray-analyze':
202
+ return `📖 /xray-analyze <file-path>
203
+
204
+ Analyze code in a file.
205
+
206
+ Example: /xray-analyze src/index.ts`;
207
+
208
+ case 'xray-code':
209
+ return `📖 /xray-code <file-path> [--fix]
210
+
211
+ Perform code review on a file.
212
+ Use --fix to attempt automatic fixes.
213
+
214
+ Example: /xray-code src/utils/helper.ts
215
+ Example: /xray-code src/utils/helper.ts --fix`;
216
+
217
+ case 'xray-file':
218
+ return `📖 /xray-file <file-path> [line-start:line-end]
219
+
220
+ Read a file.
221
+ Optionally specify line range.
222
+
223
+ Example: /xray-file src/index.ts
224
+ Example: /xray-file src/index.ts 1:50`;
225
+
226
+ case 'xray-exec':
227
+ return `📖 /xray-exec <command>
228
+
229
+ Execute an arbitrary command.
230
+
231
+ Example: /xray-exec list files src/`;
232
+
233
+ default:
234
+ return `Unknown command: ${command}`;
235
+ }
236
+ }
237
+
238
+ return formatHelp();
239
+ }
240
+
241
+ function formatHelp(): string {
242
+ return `🤖 xray Orchestrator
243
+
244
+ Available Commands:
245
+ • /xray - Show status
246
+ • /xray-analyze <file> - Analyze code
247
+ • /xray-code <file> [--fix] - Code review
248
+ • /xray-file <file> [lines] - Read file
249
+ • /xray-exec <command> - Execute command
250
+ • /xray-help [command] - Show help
251
+
252
+ Use /xray-help <command> for detailed usage.`;
253
+ }
254
+
255
+ function formatUptime(ms: number): string {
256
+ const seconds = Math.floor(ms / 1000);
257
+ const minutes = Math.floor(seconds / 60);
258
+ const hours = Math.floor(minutes / 60);
259
+ const days = Math.floor(hours / 24);
260
+
261
+ if (days > 0) return `${days}d ${hours % 24}h`;
262
+ if (hours > 0) return `${hours}h ${minutes % 60}m`;
263
+ if (minutes > 0) return `${minutes}m`;
264
+ return `${seconds}s`;
265
+ }
266
+
267
+ // Export for OpenClaw
268
+ export default { handleSkill };