0xray 2.1.1 → 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.
Files changed (254) hide show
  1. package/.opencode/codex.codex +1 -1
  2. package/.opencode/commands/dependency-audit.md +3 -3
  3. package/.opencode/enforcer-config.json +2 -2
  4. package/AGENTS.md +3 -2
  5. package/README.md +12 -11
  6. package/dist/AGENTS.md +3 -2
  7. package/dist/CHANGELOG.md +26 -0
  8. package/dist/README.md +12 -11
  9. package/dist/agents/code-reviewer.js +1 -1
  10. package/dist/analytics/routing-refiner.js +1 -1
  11. package/dist/cli/index.js +11 -1
  12. package/dist/cli/server.js +3 -3
  13. package/dist/core/activity-logger.d.ts +2 -2
  14. package/dist/core/activity-logger.js +4 -4
  15. package/dist/core/boot-orchestrator.d.ts +1 -1
  16. package/dist/core/boot-orchestrator.js +13 -28
  17. package/dist/core/bridge.mjs +3 -3
  18. package/dist/core/codex-formatter.js +2 -2
  19. package/dist/core/codex-injector.d.ts +0 -1
  20. package/dist/core/codex-injector.js +2 -3
  21. package/dist/core/config-loader.d.ts +1 -1
  22. package/dist/core/config-loader.js +1 -1
  23. package/dist/core/config-paths.d.ts +0 -2
  24. package/dist/core/config-paths.js +7 -8
  25. package/dist/core/context-loader.d.ts +1 -1
  26. package/dist/core/context-loader.js +1 -1
  27. package/dist/core/errors.d.ts +3 -0
  28. package/dist/core/errors.js +10 -0
  29. package/dist/core/features-config.js +1 -1
  30. package/dist/core/framework-logger.d.ts +3 -3
  31. package/dist/core/framework-logger.js +17 -9
  32. package/dist/core/index.d.ts +2 -2
  33. package/dist/core/index.js +4 -2
  34. package/dist/core/logging-config.d.ts +2 -1
  35. package/dist/core/logging-config.js +7 -7
  36. package/dist/enforcement/loaders/codex-loader.js +1 -1
  37. package/dist/execution/opencode-cli-invoker.js +5 -5
  38. package/dist/governance/governance-service.js +1 -1
  39. package/dist/index.d.ts +3 -3
  40. package/dist/index.js +3 -3
  41. package/dist/inference/inference-cycle.d.ts +1 -1
  42. package/dist/inference/inference-cycle.js +10 -10
  43. package/dist/integrations/base/Integration.js +1 -1
  44. package/dist/integrations/base/registry.js +19 -19
  45. package/dist/integrations/grok/grok-cli.js +17 -17
  46. package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
  47. package/dist/integrations/hermes-agent/bridge.mjs +1 -1
  48. package/dist/integrations/openclaw/api-server.d.ts +0 -1
  49. package/dist/integrations/openclaw/api-server.js +7 -10
  50. package/dist/integrations/openclaw/client.d.ts +0 -1
  51. package/dist/integrations/openclaw/client.js +22 -24
  52. package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
  53. package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
  54. package/dist/integrations/plugins/plugin-registry.js +5 -5
  55. package/dist/mcps/architect-tools.server.d.ts +2 -4
  56. package/dist/mcps/architect-tools.server.js +112 -195
  57. package/dist/mcps/auto-format.server.d.ts +2 -4
  58. package/dist/mcps/auto-format.server.js +49 -95
  59. package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
  60. package/dist/mcps/boot-orchestrator.server.js +73 -105
  61. package/dist/mcps/config/server-config-registry.js +3 -3
  62. package/dist/mcps/enforcer-tools.server.d.ts +2 -4
  63. package/dist/mcps/enforcer-tools.server.js +202 -285
  64. package/dist/mcps/estimation.server.d.ts +2 -4
  65. package/dist/mcps/estimation.server.js +63 -107
  66. package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
  67. package/dist/mcps/framework-compliance-audit.server.js +53 -82
  68. package/dist/mcps/framework-help.server.d.ts +2 -4
  69. package/dist/mcps/framework-help.server.js +63 -101
  70. package/dist/mcps/governance.server.js +2 -2
  71. package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
  72. package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
  73. package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
  74. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
  75. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
  76. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
  77. package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
  78. package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
  79. package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
  80. package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
  81. package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
  82. package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
  83. package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
  84. package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
  85. package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
  86. package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
  87. package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
  88. package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
  89. package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
  90. package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
  91. package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
  92. package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
  93. package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
  94. package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
  95. package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
  96. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
  97. package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
  98. package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
  99. package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
  100. package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
  101. package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
  102. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
  103. package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
  104. package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
  105. package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
  106. package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
  107. package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
  108. package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
  109. package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
  110. package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
  111. package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
  112. package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
  113. package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
  114. package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
  115. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
  116. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
  117. package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
  118. package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
  119. package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
  120. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
  121. package/dist/mcps/lint.server.d.ts +2 -4
  122. package/dist/mcps/lint.server.js +51 -92
  123. package/dist/mcps/mcp-client.js +2 -2
  124. package/dist/mcps/model-health-check.server.d.ts +2 -4
  125. package/dist/mcps/model-health-check.server.js +32 -60
  126. package/dist/mcps/performance-analysis.server.d.ts +2 -4
  127. package/dist/mcps/performance-analysis.server.js +57 -88
  128. package/dist/mcps/processor-pipeline.server.d.ts +2 -4
  129. package/dist/mcps/processor-pipeline.server.js +69 -100
  130. package/dist/mcps/registry.json +1 -1
  131. package/dist/mcps/researcher.server.d.ts +3 -5
  132. package/dist/mcps/researcher.server.js +81 -154
  133. package/dist/mcps/security-scan.server.d.ts +2 -4
  134. package/dist/mcps/security-scan.server.js +54 -96
  135. package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
  136. package/dist/mcps/shared/knowledge-skill-base.js +45 -0
  137. package/dist/{security → mcps/shared}/security-scanner.js +1 -1
  138. package/dist/mcps/state-manager.server.d.ts +2 -4
  139. package/dist/mcps/state-manager.server.js +115 -160
  140. package/dist/orchestrator/orchestrator.d.ts +1 -1
  141. package/dist/orchestrator/orchestrator.js +1 -1
  142. package/dist/orchestrator/universal-registry-bridge.js +1 -1
  143. package/dist/plugin/xray-codex-injection.d.ts +1 -1
  144. package/dist/plugin/xray-codex-injection.js +1 -1
  145. package/dist/postprocessor/PostProcessor.d.ts +4 -44
  146. package/dist/postprocessor/PostProcessor.js +39 -553
  147. package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
  148. package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
  149. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
  150. package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
  151. package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
  152. package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
  153. package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
  154. package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
  155. package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
  156. package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
  157. package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
  158. package/dist/processors/processor-manager.js +346 -314
  159. package/dist/reporting/report-formatter.js +1 -1
  160. package/dist/security/security-hardener.d.ts +69 -2
  161. package/dist/security/security-hardener.js +129 -1
  162. package/dist/skills/registry.json +1 -1
  163. package/dist/state/index.d.ts +3 -5
  164. package/dist/state/index.js +1 -7
  165. package/dist/state/state-manager.d.ts +1 -1
  166. package/dist/state/state-manager.js +2 -3
  167. package/package.json +14 -10
  168. package/scripts/node/setup.cjs +32 -0
  169. package/scripts/node/universal-version-manager.js +11 -11
  170. package/src/mcps/architect-tools.server.ts +112 -215
  171. package/src/mcps/auto-format.server.ts +50 -110
  172. package/src/mcps/boot-orchestrator.server.ts +75 -121
  173. package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
  174. package/src/mcps/config/server-config-registry.ts +3 -3
  175. package/src/mcps/enforcer-tools.server.ts +212 -310
  176. package/src/mcps/estimation.server.ts +62 -122
  177. package/src/mcps/framework-compliance-audit.server.ts +52 -97
  178. package/src/mcps/framework-help.server.ts +64 -114
  179. package/src/mcps/governance.server.ts +2 -2
  180. package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
  181. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
  182. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
  183. package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
  184. package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
  185. package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
  186. package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
  187. package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
  188. package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
  189. package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
  190. package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
  191. package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
  192. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
  193. package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
  194. package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
  195. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
  196. package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
  197. package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
  198. package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
  199. package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
  200. package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
  201. package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
  202. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
  203. package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
  204. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
  205. package/src/mcps/lint.server.ts +53 -107
  206. package/src/mcps/mcp-client.ts +2 -2
  207. package/src/mcps/model-health-check.server.ts +34 -71
  208. package/src/mcps/performance-analysis.server.ts +60 -104
  209. package/src/mcps/processor-pipeline.server.ts +72 -110
  210. package/src/mcps/registry.json +1 -1
  211. package/src/mcps/researcher.server.ts +88 -177
  212. package/src/mcps/security-scan.server.ts +55 -104
  213. package/src/mcps/shared/knowledge-skill-base.ts +62 -0
  214. package/src/mcps/shared/prompt-security-validator.ts +199 -0
  215. package/src/mcps/shared/security-scanner.ts +599 -0
  216. package/src/mcps/state-manager.server.ts +117 -175
  217. package/src/opencode/codex.codex +1 -1
  218. package/src/opencode/commands/dependency-audit.md +3 -3
  219. package/src/opencode/enforcer-config.json +2 -2
  220. package/src/skills/registry.json +1 -1
  221. package/xray/agents_template.md +109 -0
  222. package/xray/codex.json +598 -0
  223. package/xray/config.json +26 -0
  224. package/xray/features.json +132 -0
  225. package/xray/integrations.json +23 -0
  226. package/xray/routing-mappings.json +752 -0
  227. package/xray/workflow_state.json +28 -0
  228. package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
  229. package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
  230. package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
  231. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
  232. package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
  233. package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
  234. package/dist/integrations/hermes-agent/conftest.py +0 -14
  235. package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
  236. package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
  237. package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
  238. package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
  239. package/dist/processors/implementations/session-capture-processor.js +0 -37
  240. package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
  241. package/dist/scripts/activate-kernel-pipeline.js +0 -101
  242. package/dist/security/index.d.ts +0 -13
  243. package/dist/security/index.js +0 -13
  244. package/dist/security/security-agent-coordinator.d.ts +0 -72
  245. package/dist/security/security-agent-coordinator.js +0 -204
  246. package/dist/security/security-auditor.d.ts +0 -56
  247. package/dist/security/security-auditor.js +0 -584
  248. package/dist/security/security-hardening-system.d.ts +0 -239
  249. package/dist/security/security-hardening-system.js +0 -727
  250. package/dist/security/security-orchestration-layer.d.ts +0 -119
  251. package/dist/security/security-orchestration-layer.js +0 -496
  252. /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
  253. /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
  254. /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
@@ -1,11 +1,8 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
1
+ import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
3
2
  import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
4
3
  import { createMcpExpressApp } from "@modelcontextprotocol/sdk/server/express.js";
5
4
  import {
6
- CallToolRequestSchema,
7
5
  ErrorCode,
8
- ListToolsRequestSchema,
9
6
  McpError,
10
7
  } from "@modelcontextprotocol/sdk/types.js";
11
8
  import * as path from "path";
@@ -84,334 +81,187 @@ interface StorytellerArgs {
84
81
  framework?: "three_act_structure" | "hero_journey" | "spiral";
85
82
  }
86
83
 
87
- class SkillInvocationServer {
88
- private server: Server;
84
+ class SkillInvocationServer extends XrayKnowledgeSkillBase {
89
85
 
90
86
  constructor() {
91
- this.server = new Server(
87
+ super("xray/skill-invocation", "2.0.1");
88
+ this.tools = [
92
89
  {
93
- name: "xray/skill-invocation", version: "2.0.1",
90
+ name: "list-skills",
91
+ description: "List all available skills with descriptions",
92
+ inputSchema: {
93
+ type: "object",
94
+ properties: {
95
+ category: { type: "string", enum: ["all", "core", "registry", "knowledge"], description: "Filter by category" },
96
+ },
97
+ },
94
98
  },
95
99
  {
96
- capabilities: {
97
- tools: {},
100
+ name: "invoke-skill",
101
+ description: "Generic skill invocation tool for calling any MCP skill server",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: {
105
+ skillName: { type: "string", description: "Name of the skill to invoke (use list-skills to see available)" },
106
+ toolName: { type: "string", description: "Name of the tool within the skill to execute" },
107
+ args: { type: "object", description: "Arguments to pass to the skill tool" },
108
+ },
109
+ required: ["skillName", "toolName"],
98
110
  },
99
111
  },
100
- );
101
-
102
- this.setupToolHandlers();
103
- }
104
-
105
- private setupToolHandlers() {
106
- // List available tools
107
- this.server.setRequestHandler(ListToolsRequestSchema, async () => {
108
- return {
109
- tools: [
110
- {
111
- name: "list-skills",
112
- description: "List all available skills with descriptions",
113
- inputSchema: {
114
- type: "object",
115
- properties: {
116
- category: {
117
- type: "string",
118
- enum: ["all", "core", "registry", "knowledge"],
119
- description: "Filter by category",
120
- },
121
- },
122
- },
123
- },
124
- {
125
- name: "invoke-skill",
126
- description:
127
- "Generic skill invocation tool for calling any MCP skill server",
128
- inputSchema: {
129
- type: "object",
130
- properties: {
131
- skillName: {
132
- type: "string",
133
- description: "Name of the skill to invoke (use list-skills to see available)",
134
- },
135
- toolName: {
136
- type: "string",
137
- description: "Name of the tool within the skill to execute",
138
- },
139
- args: {
140
- type: "object",
141
- description: "Arguments to pass to the skill tool",
142
- },
143
- },
144
- required: ["skillName", "toolName"],
145
- },
146
- },
147
- {
148
- name: "skill-code-review",
149
- description:
150
- "Invoke code review skill for comprehensive code analysis",
151
- inputSchema: {
152
- type: "object",
153
- properties: {
154
- code: { type: "string", description: "Code to analyze" },
155
- language: {
156
- type: "string",
157
- description: "Programming language",
158
- },
159
- context: { type: "object", description: "Additional context" },
160
- },
161
- required: ["code"],
162
- },
112
+ {
113
+ name: "skill-code-review",
114
+ description: "Invoke code review skill for comprehensive code analysis",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ code: { type: "string", description: "Code to analyze" },
119
+ language: { type: "string", description: "Programming language" },
120
+ context: { type: "object", description: "Additional context" },
163
121
  },
164
- {
165
- name: "skill-security-audit",
166
- description:
167
- "Invoke security audit skill for vulnerability scanning",
168
- inputSchema: {
169
- type: "object",
170
- properties: {
171
- files: {
172
- type: "array",
173
- items: { type: "string" },
174
- description: "Files to audit",
175
- },
176
- severity: {
177
- type: "string",
178
- enum: ["low", "medium", "high", "critical"],
179
- description: "Minimum severity level",
180
- },
181
- },
182
- required: ["files"],
183
- },
122
+ required: ["code"],
123
+ },
124
+ },
125
+ {
126
+ name: "skill-security-audit",
127
+ description: "Invoke security audit skill for vulnerability scanning",
128
+ inputSchema: {
129
+ type: "object",
130
+ properties: {
131
+ files: { type: "array", items: { type: "string" }, description: "Files to audit" },
132
+ severity: { type: "string", enum: ["low", "medium", "high", "critical"], description: "Minimum severity level" },
184
133
  },
185
- {
186
- name: "skill-performance-optimization",
187
- description:
188
- "Invoke performance optimization skill for bottleneck analysis",
189
- inputSchema: {
190
- type: "object",
191
- properties: {
192
- code: { type: "string", description: "Code to analyze" },
193
- language: {
194
- type: "string",
195
- description: "Programming language",
196
- },
197
- metrics: {
198
- type: "array",
199
- items: { type: "string" },
200
- description: "Performance metrics to analyze",
201
- },
202
- },
203
- required: ["code"],
204
- },
134
+ required: ["files"],
135
+ },
136
+ },
137
+ {
138
+ name: "skill-performance-optimization",
139
+ description: "Invoke performance optimization skill for bottleneck analysis",
140
+ inputSchema: {
141
+ type: "object",
142
+ properties: {
143
+ code: { type: "string", description: "Code to analyze" },
144
+ language: { type: "string", description: "Programming language" },
145
+ metrics: { type: "array", items: { type: "string" }, description: "Performance metrics to analyze" },
205
146
  },
206
- {
207
- name: "skill-testing-strategy",
208
- description: "Invoke testing strategy skill for test planning",
209
- inputSchema: {
210
- type: "object",
211
- properties: {
212
- code: {
213
- type: "string",
214
- description: "Code to analyze for testing",
215
- },
216
- existingTests: {
217
- type: "array",
218
- items: { type: "string" },
219
- description: "Existing test files",
220
- },
221
- requirements: {
222
- type: "object",
223
- description: "Testing requirements and constraints",
224
- },
225
- },
226
- required: ["code"],
227
- },
147
+ required: ["code"],
148
+ },
149
+ },
150
+ {
151
+ name: "skill-testing-strategy",
152
+ description: "Invoke testing strategy skill for test planning",
153
+ inputSchema: {
154
+ type: "object",
155
+ properties: {
156
+ code: { type: "string", description: "Code to analyze for testing" },
157
+ existingTests: { type: "array", items: { type: "string" }, description: "Existing test files" },
158
+ requirements: { type: "object", description: "Testing requirements and constraints" },
228
159
  },
229
- {
230
- name: "skill-project-analysis",
231
- description: "Invoke project analysis skill for codebase insights",
232
- inputSchema: {
233
- type: "object",
234
- properties: {
235
- scope: {
236
- type: "string",
237
- enum: ["full", "directory", "file"],
238
- description: "Analysis scope",
239
- },
240
- analysis: {
241
- type: "array",
242
- items: { type: "string" },
243
- description: "Types of analysis to perform",
244
- },
245
- },
246
- },
160
+ required: ["code"],
161
+ },
162
+ },
163
+ {
164
+ name: "skill-project-analysis",
165
+ description: "Invoke project analysis skill for codebase insights",
166
+ inputSchema: {
167
+ type: "object",
168
+ properties: {
169
+ scope: { type: "string", enum: ["full", "directory", "file"], description: "Analysis scope" },
170
+ analysis: { type: "array", items: { type: "string" }, description: "Types of analysis to perform" },
247
171
  },
248
- {
249
- name: "skill-database-design",
250
- description:
251
- "Invoke database design skill for schema design and query optimization",
252
- inputSchema: {
253
- type: "object",
254
- properties: {
255
- schema: {
256
- type: "string",
257
- description: "Database schema or entities",
258
- },
259
- databaseType: {
260
- type: "string",
261
- enum: ["postgresql", "mysql", "mongodb", "dynamodb"],
262
- description: "Target database type",
263
- },
264
- },
265
- required: ["schema"],
266
- },
172
+ },
173
+ },
174
+ {
175
+ name: "skill-database-design",
176
+ description: "Invoke database design skill for schema design and query optimization",
177
+ inputSchema: {
178
+ type: "object",
179
+ properties: {
180
+ schema: { type: "string", description: "Database schema or entities" },
181
+ databaseType: { type: "string", enum: ["postgresql", "mysql", "mongodb", "dynamodb"], description: "Target database type" },
267
182
  },
268
- {
269
- name: "skill-devops-deployment",
270
- description:
271
- "Invoke DevOps deployment skill for CI/CD and infrastructure",
272
- inputSchema: {
273
- type: "object",
274
- properties: {
275
- projectType: { type: "string", description: "Type of project" },
276
- cloudProvider: {
277
- type: "string",
278
- enum: ["aws", "gcp", "azure"],
279
- description: "Target cloud provider",
280
- },
281
- },
282
- required: ["projectType"],
283
- },
183
+ required: ["schema"],
184
+ },
185
+ },
186
+ {
187
+ name: "skill-devops-deployment",
188
+ description: "Invoke DevOps deployment skill for CI/CD and infrastructure",
189
+ inputSchema: {
190
+ type: "object",
191
+ properties: {
192
+ projectType: { type: "string", description: "Type of project" },
193
+ cloudProvider: { type: "string", enum: ["aws", "gcp", "azure"], description: "Target cloud provider" },
284
194
  },
285
- {
286
- name: "skill-api-design",
287
- description: "Invoke API design skill for REST/GraphQL endpoints",
288
- inputSchema: {
289
- type: "object",
290
- properties: {
291
- resources: {
292
- type: "array",
293
- items: { type: "string" },
294
- description: "API resources",
295
- },
296
- style: {
297
- type: "string",
298
- enum: ["rest", "graphql"],
299
- description: "API style",
300
- },
301
- },
302
- required: ["resources"],
303
- },
195
+ required: ["projectType"],
196
+ },
197
+ },
198
+ {
199
+ name: "skill-api-design",
200
+ description: "Invoke API design skill for REST/GraphQL endpoints",
201
+ inputSchema: {
202
+ type: "object",
203
+ properties: {
204
+ resources: { type: "array", items: { type: "string" }, description: "API resources" },
205
+ style: { type: "string", enum: ["rest", "graphql"], description: "API style" },
304
206
  },
305
- {
306
- name: "skill-ui-ux-design",
307
- description: "Invoke UI/UX design skill for component design",
308
- inputSchema: {
309
- type: "object",
310
- properties: {
311
- component: {
312
- type: "string",
313
- description: "Component to design",
314
- },
315
- framework: {
316
- type: "string",
317
- enum: ["react", "vue", "angular", "svelte"],
318
- description: "Target framework",
319
- },
320
- },
321
- required: ["component"],
322
- },
207
+ required: ["resources"],
208
+ },
209
+ },
210
+ {
211
+ name: "skill-ui-ux-design",
212
+ description: "Invoke UI/UX design skill for component design",
213
+ inputSchema: {
214
+ type: "object",
215
+ properties: {
216
+ component: { type: "string", description: "Component to design" },
217
+ framework: { type: "string", enum: ["react", "vue", "angular", "svelte"], description: "Target framework" },
323
218
  },
324
- {
325
- name: "skill-documentation-generation",
326
- description: "Invoke documentation skill for API docs and README",
327
- inputSchema: {
328
- type: "object",
329
- properties: {
330
- type: {
331
- type: "string",
332
- enum: ["api", "readme", "guide"],
333
- description: "Documentation type",
334
- },
335
- code: { type: "string", description: "Code to document" },
336
- },
337
- required: ["type"],
338
- },
219
+ required: ["component"],
220
+ },
221
+ },
222
+ {
223
+ name: "skill-documentation-generation",
224
+ description: "Invoke documentation skill for API docs and README",
225
+ inputSchema: {
226
+ type: "object",
227
+ properties: {
228
+ type: { type: "string", enum: ["api", "readme", "guide"], description: "Documentation type" },
229
+ code: { type: "string", description: "Code to document" },
339
230
  },
340
- {
341
- name: "skill-storyteller",
342
- description:
343
- "Invoke storyteller skill for writing reflections, sagas, and journeys",
344
- inputSchema: {
345
- type: "object",
346
- properties: {
347
- storyType: {
348
- type: "string",
349
- enum: ["reflection", "saga", "journey", "narrative"],
350
- description: "Type of story to write",
351
- },
352
- title: { type: "string", description: "Title for the story" },
353
- context: {
354
- type: "object",
355
- description: "Context including commits, changes, metadata",
356
- },
357
- framework: {
358
- type: "string",
359
- enum: ["three_act_structure", "hero_journey", "spiral"],
360
- description: "Storytelling framework to use",
361
- },
362
- },
363
- required: ["storyType"],
364
- },
231
+ required: ["type"],
232
+ },
233
+ },
234
+ {
235
+ name: "skill-storyteller",
236
+ description: "Invoke storyteller skill for writing reflections, sagas, and journeys",
237
+ inputSchema: {
238
+ type: "object",
239
+ properties: {
240
+ storyType: { type: "string", enum: ["reflection", "saga", "journey", "narrative"], description: "Type of story to write" },
241
+ title: { type: "string", description: "Title for the story" },
242
+ context: { type: "object", description: "Context including commits, changes, metadata" },
243
+ framework: { type: "string", enum: ["three_act_structure", "hero_journey", "spiral"], description: "Storytelling framework to use" },
365
244
  },
366
- ],
367
- };
368
- });
369
-
370
- // Handle tool calls
371
- this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
372
- const { name, arguments: args } = request.params;
373
-
374
- try {
375
- switch (name) {
376
- case "list-skills":
377
- return await this.handleListSkills(args as unknown as ListSkillsArgs);
378
- case "invoke-skill":
379
- return await this.handleInvokeSkill(args as unknown as InvokeSkillArgs);
380
- case "skill-code-review":
381
- return await this.handleSkillCodeReview(args as unknown as CodeReviewArgs);
382
- case "skill-security-audit":
383
- return await this.handleSkillSecurityAudit(args as unknown as SecurityAuditArgs);
384
- case "skill-performance-optimization":
385
- return await this.handleSkillPerformanceOptimization(args as unknown as PerformanceOptimizationArgs);
386
- case "skill-testing-strategy":
387
- return await this.handleSkillTestingStrategy(args as unknown as TestingStrategyArgs);
388
- case "skill-project-analysis":
389
- return await this.handleSkillProjectAnalysis(args as unknown as ProjectAnalysisArgs);
390
- case "skill-database-design":
391
- return await this.handleSkillDatabaseDesign(args as unknown as DatabaseDesignArgs);
392
- case "skill-devops-deployment":
393
- return await this.handleSkillDevopsDeployment(args as unknown as DevopsDeploymentArgs);
394
- case "skill-api-design":
395
- return await this.handleSkillApiDesign(args as unknown as ApiDesignArgs);
396
- case "skill-ui-ux-design":
397
- return await this.handleSkillUiUxDesign(args as unknown as UiUxDesignArgs);
398
- case "skill-documentation-generation":
399
- return await this.handleSkillDocumentationGeneration(args as unknown as DocumentationGenerationArgs);
400
- case "skill-storyteller":
401
- return await this.handleSkillStoryteller(args as unknown as StorytellerArgs);
402
- default:
403
- throw new McpError(
404
- ErrorCode.MethodNotFound,
405
- `Unknown tool: ${name}`,
406
- );
407
- }
408
- } catch (error) {
409
- throw new McpError(
410
- ErrorCode.InternalError,
411
- `Tool execution failed: ${error instanceof Error ? error.message : String(error)}`,
412
- );
413
- }
414
- });
245
+ required: ["storyType"],
246
+ },
247
+ },
248
+ ];
249
+ this.handlers = {
250
+ "list-skills": async (args) => this.handleListSkills(args as unknown as ListSkillsArgs),
251
+ "invoke-skill": async (args) => this.handleInvokeSkill(args as unknown as InvokeSkillArgs),
252
+ "skill-code-review": async (args) => this.handleSkillCodeReview(args as unknown as CodeReviewArgs),
253
+ "skill-security-audit": async (args) => this.handleSkillSecurityAudit(args as unknown as SecurityAuditArgs),
254
+ "skill-performance-optimization": async (args) => this.handleSkillPerformanceOptimization(args as unknown as PerformanceOptimizationArgs),
255
+ "skill-testing-strategy": async (args) => this.handleSkillTestingStrategy(args as unknown as TestingStrategyArgs),
256
+ "skill-project-analysis": async (args) => this.handleSkillProjectAnalysis(args as unknown as ProjectAnalysisArgs),
257
+ "skill-database-design": async (args) => this.handleSkillDatabaseDesign(args as unknown as DatabaseDesignArgs),
258
+ "skill-devops-deployment": async (args) => this.handleSkillDevopsDeployment(args as unknown as DevopsDeploymentArgs),
259
+ "skill-api-design": async (args) => this.handleSkillApiDesign(args as unknown as ApiDesignArgs),
260
+ "skill-ui-ux-design": async (args) => this.handleSkillUiUxDesign(args as unknown as UiUxDesignArgs),
261
+ "skill-documentation-generation": async (args) => this.handleSkillDocumentationGeneration(args as unknown as DocumentationGenerationArgs),
262
+ "skill-storyteller": async (args) => this.handleSkillStoryteller(args as unknown as StorytellerArgs),
263
+ };
264
+ this.setupToolHandlers();
415
265
  }
416
266
 
417
267
  private skillMetrics: Map<string, { success: number; failure: number; avgDuration: number }> = new Map();
@@ -824,63 +674,6 @@ class SkillInvocationServer {
824
674
  };
825
675
  }
826
676
 
827
- async run(): Promise<void> {
828
- const transport = new StdioServerTransport();
829
- await this.server.connect(transport);
830
-
831
- let parentCheckTimer: ReturnType<typeof setTimeout> | null = null;
832
-
833
- const cleanup = async (signal: string) => {
834
- if (parentCheckTimer !== null) {
835
- clearTimeout(parentCheckTimer);
836
- parentCheckTimer = null;
837
- }
838
-
839
- const timeout = setTimeout(() => {
840
- frameworkLogger.log("mcps/skill-invocation", "shutdown", "error", { message: "Graceful shutdown timeout, forcing exit..." });
841
- process.exit(1);
842
- }, 5000);
843
-
844
- try {
845
- if (this.server && typeof this.server.close === "function") {
846
- await this.server.close();
847
- }
848
- clearTimeout(timeout);
849
- process.exit(0);
850
- } catch (error) {
851
- clearTimeout(timeout);
852
- frameworkLogger.log("mcps/skill-invocation", "shutdown", "error", { message: `Error during server shutdown: ${String(error)}` });
853
- process.exit(1);
854
- }
855
- };
856
-
857
- process.on("SIGINT", () => cleanup("SIGINT"));
858
- process.on("SIGTERM", () => cleanup("SIGTERM"));
859
- process.on("SIGHUP", () => cleanup("SIGHUP"));
860
-
861
- const checkParent = () => {
862
- try {
863
- process.kill(process.ppid, 0);
864
- parentCheckTimer = setTimeout(checkParent, 1000);
865
- } catch (error) {
866
- parentCheckTimer = null;
867
- cleanup("parent-process-death");
868
- }
869
- };
870
-
871
- parentCheckTimer = setTimeout(checkParent, 2000);
872
-
873
- process.on("uncaughtException", (error) => {
874
- frameworkLogger.log("mcps/skill-invocation", "uncaughtException", "error", { message: `Uncaught Exception: ${String(error)}` });
875
- cleanup("uncaughtException");
876
- });
877
-
878
- process.on("unhandledRejection", (reason) => {
879
- frameworkLogger.log("mcps/skill-invocation", "unhandledRejection", "error", { message: `Unhandled Rejection: ${String(reason)}` });
880
- cleanup("unhandledRejection");
881
- });
882
- }
883
-
884
677
  /**
885
678
  * Run as HTTP server using Streamable HTTP transport (for Grok CLI compatibility).
886
679
  */
@@ -931,7 +724,7 @@ if (entryPoint && fileURLToPath(import.meta.url) === entryPoint) {
931
724
  });
932
725
  } else {
933
726
  const server = new SkillInvocationServer();
934
- server.run().catch((error) => {
727
+ server.run("skill-invocation").catch((error) => {
935
728
  frameworkLogger.log("skill-invocation", "fatal-startup-error", "error", { error: String(error) });
936
729
  process.exit(1);
937
730
  });