0xray 2.1.3 → 2.2.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 (178) 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/README.md +3 -3
  5. package/dist/CHANGELOG.md +43 -0
  6. package/dist/README.md +3 -3
  7. package/dist/analytics/routing-refiner.js +1 -1
  8. package/dist/cli/commands/govern.d.ts +29 -0
  9. package/dist/cli/commands/govern.js +152 -0
  10. package/dist/cli/index.js +29 -216
  11. package/dist/core/boot-orchestrator.js +1 -1
  12. package/dist/core/features-config.js +1 -1
  13. package/dist/core/framework-logger.js +30 -1
  14. package/dist/delegation/index.d.ts +1 -2
  15. package/dist/delegation/index.js +1 -2
  16. package/dist/enforcement/enforcer-tools.js +1 -1
  17. package/dist/execution/proposal-applier.d.ts +1 -9
  18. package/dist/execution/proposal-applier.js +18 -173
  19. package/dist/governance/codex-policy.service.d.ts +7 -25
  20. package/dist/governance/codex-policy.service.js +8 -26
  21. package/dist/governance/governance-core.d.ts +22 -28
  22. package/dist/governance/governance-core.js +31 -101
  23. package/dist/governance/governance-service.d.ts +1 -0
  24. package/dist/governance/governance-service.js +67 -4
  25. package/dist/governance/governance-types.d.ts +5 -2
  26. package/dist/inference/index.d.ts +3 -4
  27. package/dist/inference/inference-accumulator.js +1 -1
  28. package/dist/inference/inference-cycle.d.ts +12 -18
  29. package/dist/inference/inference-cycle.js +120 -335
  30. package/dist/integrations/base/index.d.ts +0 -1
  31. package/dist/integrations/base/index.js +0 -2
  32. package/dist/integrations/grok/hooks/pre-tool-use.js +4 -18
  33. package/dist/integrations/hermes-agent/bridge.mjs +10 -1
  34. package/dist/mcps/config/server-config-registry.js +1 -1
  35. package/dist/mcps/governance.server.js +4 -5
  36. package/dist/mcps/knowledge-skills/api-design.server.js +10 -0
  37. package/dist/mcps/knowledge-skills/architecture-patterns.server.js +10 -0
  38. package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +10 -0
  39. package/dist/mcps/knowledge-skills/code-analyzer.server.js +10 -0
  40. package/dist/mcps/knowledge-skills/code-review.server.js +10 -0
  41. package/dist/mcps/knowledge-skills/content-creator.server.js +10 -0
  42. package/dist/mcps/knowledge-skills/database-design.server.js +10 -0
  43. package/dist/mcps/knowledge-skills/devops-deployment.server.js +10 -0
  44. package/dist/mcps/knowledge-skills/git-workflow.server.js +10 -0
  45. package/dist/mcps/knowledge-skills/growth-strategist.server.js +10 -0
  46. package/dist/mcps/knowledge-skills/log-monitor.server.js +10 -0
  47. package/dist/mcps/knowledge-skills/mobile-development.server.js +10 -0
  48. package/dist/mcps/knowledge-skills/multimodal-looker.server.js +10 -0
  49. package/dist/mcps/knowledge-skills/performance-optimization.server.js +10 -0
  50. package/dist/mcps/knowledge-skills/project-analysis.server.js +10 -0
  51. package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +10 -0
  52. package/dist/mcps/knowledge-skills/security-audit.server.js +10 -0
  53. package/dist/mcps/knowledge-skills/seo-consultant.server.js +10 -0
  54. package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +4 -0
  55. package/dist/mcps/knowledge-skills/skill-invocation.server.js +33 -14
  56. package/dist/mcps/knowledge-skills/strategist.server.js +10 -0
  57. package/dist/mcps/knowledge-skills/tech-writer.server.js +11 -1
  58. package/dist/mcps/knowledge-skills/testing-strategy.server.js +10 -0
  59. package/dist/mcps/knowledge-skills/ui-ux-design.server.js +10 -0
  60. package/dist/mcps/registry.json +1 -1
  61. package/dist/metrics/agent-metrics.d.ts +2 -1
  62. package/dist/nucleus/govern-http.d.ts +59 -0
  63. package/dist/nucleus/govern-http.js +172 -0
  64. package/dist/nucleus/index.d.ts +14 -0
  65. package/dist/nucleus/index.js +9 -0
  66. package/dist/nucleus/kernel.d.ts +51 -0
  67. package/dist/nucleus/kernel.js +62 -0
  68. package/dist/nucleus/plugin-registry.d.ts +104 -0
  69. package/dist/nucleus/plugin-registry.js +147 -0
  70. package/dist/orchestrator/orchestrator.d.ts +0 -1
  71. package/dist/orchestrator/orchestrator.js +0 -21
  72. package/dist/postprocessor/PostProcessor.d.ts +13 -1
  73. package/dist/postprocessor/PostProcessor.js +41 -1
  74. package/dist/postprocessor/autofix/AutoFixEngine.d.ts +0 -8
  75. package/dist/postprocessor/autofix/AutoFixEngine.js +0 -54
  76. package/dist/postprocessor/metamorphosis/MetamorphosisEngine.d.ts +25 -0
  77. package/dist/postprocessor/metamorphosis/MetamorphosisEngine.js +10 -0
  78. package/dist/postprocessor/metamorphosis/SelfProposalEngine.d.ts +68 -0
  79. package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +371 -0
  80. package/dist/skills/orchestrator/SKILL.md +1 -1
  81. package/dist/skills/registry.json +1 -1
  82. package/dist/state/index.d.ts +0 -2
  83. package/package.json +4 -3
  84. package/scripts/node/universal-version-manager.js +3 -3
  85. package/src/mcps/config/__tests__/server-config-registry.test.ts +6 -15
  86. package/src/mcps/config/server-config-registry.ts +1 -1
  87. package/src/mcps/governance.server.ts +4 -6
  88. package/src/mcps/knowledge-skills/api-design.server.ts +9 -0
  89. package/src/mcps/knowledge-skills/architecture-patterns.server.ts +9 -0
  90. package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +9 -0
  91. package/src/mcps/knowledge-skills/code-analyzer.server.ts +9 -0
  92. package/src/mcps/knowledge-skills/code-review.server.ts +9 -0
  93. package/src/mcps/knowledge-skills/content-creator.server.ts +9 -0
  94. package/src/mcps/knowledge-skills/database-design.server.ts +9 -0
  95. package/src/mcps/knowledge-skills/devops-deployment.server.ts +9 -0
  96. package/src/mcps/knowledge-skills/git-workflow.server.ts +9 -0
  97. package/src/mcps/knowledge-skills/growth-strategist.server.ts +9 -0
  98. package/src/mcps/knowledge-skills/log-monitor.server.ts +9 -0
  99. package/src/mcps/knowledge-skills/mobile-development.server.ts +9 -0
  100. package/src/mcps/knowledge-skills/multimodal-looker.server.ts +9 -0
  101. package/src/mcps/knowledge-skills/performance-optimization.server.ts +9 -0
  102. package/src/mcps/knowledge-skills/project-analysis.server.ts +9 -0
  103. package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +9 -0
  104. package/src/mcps/knowledge-skills/security-audit.server.ts +9 -0
  105. package/src/mcps/knowledge-skills/seo-consultant.server.ts +9 -0
  106. package/src/mcps/knowledge-skills/session-management.server.ts +1 -0
  107. package/src/mcps/knowledge-skills/skill-invocation.server.ts +44 -29
  108. package/src/mcps/knowledge-skills/strategist.server.ts +9 -0
  109. package/src/mcps/knowledge-skills/tech-writer.server.ts +10 -1
  110. package/src/mcps/knowledge-skills/testing-strategy.server.ts +9 -0
  111. package/src/mcps/knowledge-skills/ui-ux-design.server.ts +9 -0
  112. package/src/mcps/registry.json +1 -1
  113. package/src/opencode/codex.codex +1 -1
  114. package/src/opencode/commands/dependency-audit.md +3 -3
  115. package/src/opencode/enforcer-config.json +2 -2
  116. package/src/skills/orchestrator/SKILL.md +1 -1
  117. package/src/skills/registry.json +1 -1
  118. package/xray/codex.json +1 -1
  119. package/xray/config.json +1 -1
  120. package/xray/features.json +1 -1
  121. package/xray/integrations.json +3 -3
  122. package/.opencode/agents/testing-best-practices.yml +0 -12
  123. package/dist/analytics/consent-manager.d.ts +0 -93
  124. package/dist/analytics/consent-manager.js +0 -258
  125. package/dist/analytics/simple-pattern-analyzer.d.ts +0 -80
  126. package/dist/analytics/simple-pattern-analyzer.js +0 -297
  127. package/dist/cli/commands/analytics-disable.d.ts +0 -9
  128. package/dist/cli/commands/analytics-disable.js +0 -72
  129. package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
  130. package/dist/cli/commands/analytics-enable-action.js +0 -82
  131. package/dist/cli/commands/analytics-preview.d.ts +0 -9
  132. package/dist/cli/commands/analytics-preview.js +0 -106
  133. package/dist/cli/commands/analytics-status.d.ts +0 -9
  134. package/dist/cli/commands/analytics-status.js +0 -68
  135. package/dist/cli/server.d.ts +0 -1
  136. package/dist/cli/server.js +0 -147
  137. package/dist/core/errors.d.ts +0 -3
  138. package/dist/core/errors.js +0 -10
  139. package/dist/core/logging-config.d.ts +0 -11
  140. package/dist/core/logging-config.js +0 -43
  141. package/dist/core/trace-context.d.ts +0 -12
  142. package/dist/core/trace-context.js +0 -33
  143. package/dist/delegation/voting-coordinator.d.ts +0 -49
  144. package/dist/delegation/voting-coordinator.js +0 -375
  145. package/dist/enforcement/test-auto-healing.d.ts +0 -83
  146. package/dist/enforcement/test-auto-healing.js +0 -325
  147. package/dist/integrations/base/ExampleIntegration.d.ts +0 -47
  148. package/dist/integrations/base/ExampleIntegration.js +0 -181
  149. package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +0 -34
  150. package/dist/mcps/knowledge-skills/testing-best-practices.server.js +0 -831
  151. package/dist/mcps/orchestrator.server.d.ts +0 -10
  152. package/dist/mcps/orchestrator.server.js +0 -19
  153. package/dist/orchestrator/self-direction-activation.d.ts +0 -109
  154. package/dist/orchestrator/self-direction-activation.js +0 -245
  155. package/dist/orchestrator/universal-librarian-consultation.d.ts +0 -98
  156. package/dist/orchestrator/universal-librarian-consultation.js +0 -216
  157. package/dist/orchestrator/universal-registry-bridge.d.ts +0 -85
  158. package/dist/orchestrator/universal-registry-bridge.js +0 -247
  159. package/dist/performance/performance-budget-enforcer.d.ts +0 -158
  160. package/dist/performance/performance-budget-enforcer.js +0 -434
  161. package/dist/performance/performance-regression-tester.d.ts +0 -108
  162. package/dist/performance/performance-regression-tester.js +0 -342
  163. package/dist/skills/testing-best-practices/SKILL.md +0 -37
  164. package/dist/state/context-providers.d.ts +0 -4
  165. package/dist/state/context-providers.js +0 -1
  166. package/dist/state/state-types.d.ts +0 -5
  167. package/dist/state/state-types.js +0 -1
  168. package/dist/utils/batch-operations.d.ts +0 -25
  169. package/dist/utils/batch-operations.js +0 -292
  170. package/dist/utils/test-template-generator.d.ts +0 -25
  171. package/dist/utils/test-template-generator.js +0 -178
  172. package/dist/utils/token-manager.d.ts +0 -48
  173. package/dist/utils/token-manager.js +0 -163
  174. package/src/mcps/knowledge-skills/testing-best-practices.server.test.ts +0 -136
  175. package/src/mcps/knowledge-skills/testing-best-practices.server.ts +0 -1183
  176. package/src/mcps/orchestrator.server.ts +0 -34
  177. package/src/opencode/agents/testing-best-practices.yml +0 -12
  178. package/src/skills/testing-best-practices/SKILL.md +0 -37
@@ -21,7 +21,7 @@ import * as fs from "fs";
21
21
  import * as path from "path";
22
22
  import { fileURLToPath } from "url";
23
23
  import { randomUUID } from "crypto";
24
- import { getGovernanceService } from "../governance/governance-service.js";
24
+ import { handleGovernRequest } from "../nucleus/index.js";
25
25
  import { getCodexPolicyService } from "../governance/codex-policy.service.js";
26
26
  import { initializeGovernanceIntegration } from "../integrations/governance/index.js";
27
27
  import { featuresConfigLoader } from "../core/features-config.js";
@@ -29,7 +29,7 @@ class GovernanceServer {
29
29
  server;
30
30
  constructor() {
31
31
  this.server = new Server({
32
- name: "governance", version: "2.1.1",
32
+ name: "governance", version: "2.1.3",
33
33
  }, {
34
34
  capabilities: {
35
35
  tools: {},
@@ -192,7 +192,6 @@ class GovernanceServer {
192
192
  });
193
193
  }
194
194
  async handleGovernProposals(args) {
195
- const service = getGovernanceService();
196
195
  const request = {
197
196
  proposals: args.proposals.map((p, i) => ({
198
197
  id: p.id || `prop-${Date.now()}-${i}`,
@@ -208,10 +207,10 @@ class GovernanceServer {
208
207
  requireExternalDynamo: args.options?.require_external ?? !process.env.XRAY_LOCAL_MODE,
209
208
  },
210
209
  };
211
- frameworkLogger.log("governance-mcp", "delegating-to-governance-service", "info", {
210
+ frameworkLogger.log("governance-mcp", "delegating-to-kernel", "info", {
212
211
  proposalCount: request.proposals.length,
213
212
  });
214
- const response = await service.govern(request);
213
+ const response = await handleGovernRequest(request);
215
214
  return {
216
215
  content: [
217
216
  {
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  class XrayApiDesignServer extends XrayKnowledgeSkillBase {
10
11
  constructor() {
11
12
  super("api-design", "2.0.1");
@@ -41,6 +42,15 @@ class XrayApiDesignServer extends XrayKnowledgeSkillBase {
41
42
  "validate-api-design": async (args) => this.validateApiDesign(args),
42
43
  };
43
44
  this.setupToolHandlers();
45
+ pluginRegistry.registerToolPlugin({
46
+ name: "api-design",
47
+ callTool: async (toolName, args) => {
48
+ const handler = this.handlers[toolName];
49
+ if (!handler)
50
+ throw new Error(`Unknown tool: ${toolName}`);
51
+ return handler(args);
52
+ },
53
+ });
44
54
  }
45
55
  async designApiEndpoints(args) {
46
56
  const { resource, operations, relationships } = args;
@@ -1,5 +1,6 @@
1
1
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
2
2
  import { frameworkLogger } from "../../core/framework-logger.js";
3
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
3
4
  class XrayArchitecturePatternsServer extends XrayKnowledgeSkillBase {
4
5
  constructor() {
5
6
  super("architecture-patterns", "2.0.1");
@@ -35,6 +36,15 @@ class XrayArchitecturePatternsServer extends XrayKnowledgeSkillBase {
35
36
  "recommend-patterns": async (args) => this.recommendPatterns(args),
36
37
  };
37
38
  this.setupToolHandlers();
39
+ pluginRegistry.registerToolPlugin({
40
+ name: "architecture-patterns",
41
+ callTool: async (toolName, args) => {
42
+ const handler = this.handlers[toolName];
43
+ if (!handler)
44
+ throw new Error(`Unknown tool: ${toolName}`);
45
+ return handler(args);
46
+ },
47
+ });
38
48
  }
39
49
  async analyzeArchitecture(args) {
40
50
  const { projectRoot, focusPatterns } = args;
@@ -9,6 +9,7 @@ import * as path from "path";
9
9
  import { fileURLToPath } from "url";
10
10
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
11
11
  import { frameworkLogger } from "../../core/framework-logger.js";
12
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
12
13
  class BugTriageSpecialistServer extends XrayKnowledgeSkillBase {
13
14
  constructor() {
14
15
  super("bug-triage-specialist", "2.0.1");
@@ -169,6 +170,15 @@ class BugTriageSpecialistServer extends XrayKnowledgeSkillBase {
169
170
  },
170
171
  };
171
172
  this.setupToolHandlers();
173
+ pluginRegistry.registerToolPlugin({
174
+ name: "bug-triage-specialist",
175
+ callTool: async (toolName, args) => {
176
+ const handler = this.handlers[toolName];
177
+ if (!handler)
178
+ throw new Error(`Unknown tool: ${toolName}`);
179
+ return handler(args);
180
+ },
181
+ });
172
182
  }
173
183
  triageBugs(errorLogs, context) {
174
184
  const bugs = errorLogs.map((log, idx) => {
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
13
13
  import { frameworkLogger } from "../../core/framework-logger.js";
14
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
14
15
  import * as fs from "fs";
15
16
  import * as path from "path";
16
17
  class CodeAnalyzerServer extends XrayKnowledgeSkillBase {
@@ -254,6 +255,15 @@ class CodeAnalyzerServer extends XrayKnowledgeSkillBase {
254
255
  "find_duplicates": async (args) => this.handleFindDuplicates(args),
255
256
  };
256
257
  this.setupToolHandlers();
258
+ pluginRegistry.registerToolPlugin({
259
+ name: "code-analyzer",
260
+ callTool: async (toolName, args) => {
261
+ const handler = this.handlers[toolName];
262
+ if (!handler)
263
+ throw new Error(`Unknown tool: ${toolName}`);
264
+ return handler(args);
265
+ },
266
+ });
257
267
  }
258
268
  handleAnalyzeCode(args) {
259
269
  const { files = [], language = "typescript" } = args;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  import * as fs from "fs";
10
11
  import * as path from "path";
11
12
  class XrayCodeReviewServer extends XrayKnowledgeSkillBase {
@@ -124,6 +125,15 @@ class XrayCodeReviewServer extends XrayKnowledgeSkillBase {
124
125
  "analyze_proposal": async (args) => this.analyzeProposal(args),
125
126
  };
126
127
  this.setupToolHandlers();
128
+ pluginRegistry.registerToolPlugin({
129
+ name: "code-review",
130
+ callTool: async (toolName, args) => {
131
+ const handler = this.handlers[toolName];
132
+ if (!handler)
133
+ throw new Error(`Unknown tool: ${toolName}`);
134
+ return handler(args);
135
+ },
136
+ });
127
137
  }
128
138
  async analyzeCodeQuality(args) {
129
139
  const { filePath, includeMetrics = true, focusAreas } = args;
@@ -8,6 +8,7 @@ import * as path from "path";
8
8
  import { fileURLToPath } from "url";
9
9
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
10
10
  import { frameworkLogger } from "../../core/framework-logger.js";
11
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
11
12
  class SEOCopywriterServer extends XrayKnowledgeSkillBase {
12
13
  constructor() {
13
14
  super("content-creator", "2.0.1");
@@ -225,6 +226,15 @@ class SEOCopywriterServer extends XrayKnowledgeSkillBase {
225
226
  },
226
227
  };
227
228
  this.setupToolHandlers();
229
+ pluginRegistry.registerToolPlugin({
230
+ name: "content-creator",
231
+ callTool: async (toolName, args) => {
232
+ const handler = this.handlers[toolName];
233
+ if (!handler)
234
+ throw new Error(`Unknown tool: ${toolName}`);
235
+ return handler(args);
236
+ },
237
+ });
228
238
  }
229
239
  }
230
240
  const entryPoint = path.resolve(process.argv[1] ?? "");
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  import * as fs from "fs";
10
11
  import * as path from "path";
11
12
  class XrayDatabaseDesignServer extends XrayKnowledgeSkillBase {
@@ -134,6 +135,15 @@ class XrayDatabaseDesignServer extends XrayKnowledgeSkillBase {
134
135
  "migrate_schema": async (args) => this.migrateSchema(args),
135
136
  };
136
137
  this.setupToolHandlers();
138
+ pluginRegistry.registerToolPlugin({
139
+ name: "database-design",
140
+ callTool: async (toolName, args) => {
141
+ const handler = this.handlers[toolName];
142
+ if (!handler)
143
+ throw new Error(`Unknown tool: ${toolName}`);
144
+ return handler(args);
145
+ },
146
+ });
137
147
  }
138
148
  async analyzeSchema(args) {
139
149
  const { schemaFile, databaseType = "postgresql", includeIndexes = true, } = args;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  class XrayDevOpsDeploymentServer extends XrayKnowledgeSkillBase {
10
11
  constructor() {
11
12
  super("devops-deployment", "2.0.1");
@@ -87,6 +88,15 @@ class XrayDevOpsDeploymentServer extends XrayKnowledgeSkillBase {
87
88
  "optimize_deployment_performance": async (args) => this.optimizeDeploymentPerformance(args),
88
89
  };
89
90
  this.setupToolHandlers();
91
+ pluginRegistry.registerToolPlugin({
92
+ name: "devops-deployment",
93
+ callTool: async (toolName, args) => {
94
+ const handler = this.handlers[toolName];
95
+ if (!handler)
96
+ throw new Error(`Unknown tool: ${toolName}`);
97
+ return handler(args);
98
+ },
99
+ });
90
100
  }
91
101
  async analyzeCICDPipeline(args) {
92
102
  const { pipelineConfig, platform, includeSecurity = true } = args;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  class XrayGitWorkflowServer extends XrayKnowledgeSkillBase {
10
11
  constructor() {
11
12
  super("git-workflow", "2.0.1");
@@ -42,6 +43,15 @@ class XrayGitWorkflowServer extends XrayKnowledgeSkillBase {
42
43
  "recommend-branching-strategy": async (args) => this.recommendBranchingStrategy(args),
43
44
  };
44
45
  this.setupToolHandlers();
46
+ pluginRegistry.registerToolPlugin({
47
+ name: "git-workflow",
48
+ callTool: async (toolName, args) => {
49
+ const handler = this.handlers[toolName];
50
+ if (!handler)
51
+ throw new Error(`Unknown tool: ${toolName}`);
52
+ return handler(args);
53
+ },
54
+ });
45
55
  }
46
56
  async analyzeGitHistory(args) {
47
57
  const { projectRoot, since, author } = args;
@@ -8,6 +8,7 @@ import * as path from "path";
8
8
  import { fileURLToPath } from "url";
9
9
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
10
10
  import { frameworkLogger } from "../../core/framework-logger.js";
11
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
11
12
  class MarketingExpertServer extends XrayKnowledgeSkillBase {
12
13
  constructor() {
13
14
  super("growth-strategist", "2.0.1");
@@ -330,6 +331,15 @@ class MarketingExpertServer extends XrayKnowledgeSkillBase {
330
331
  },
331
332
  };
332
333
  this.setupToolHandlers();
334
+ pluginRegistry.registerToolPlugin({
335
+ name: "growth-strategist",
336
+ callTool: async (toolName, args) => {
337
+ const handler = this.handlers[toolName];
338
+ if (!handler)
339
+ throw new Error(`Unknown tool: ${toolName}`);
340
+ return handler(args);
341
+ },
342
+ });
333
343
  }
334
344
  }
335
345
  const entryPoint = path.resolve(process.argv[1] ?? "");
@@ -9,6 +9,7 @@ import * as path from "path";
9
9
  import { fileURLToPath } from "url";
10
10
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
11
11
  import { frameworkLogger } from "../../core/framework-logger.js";
12
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
12
13
  class LogMonitorServer extends XrayKnowledgeSkillBase {
13
14
  patternLibrary = [
14
15
  {
@@ -219,6 +220,15 @@ class LogMonitorServer extends XrayKnowledgeSkillBase {
219
220
  },
220
221
  };
221
222
  this.setupToolHandlers();
223
+ pluginRegistry.registerToolPlugin({
224
+ name: "log-monitor",
225
+ callTool: async (toolName, args) => {
226
+ const handler = this.handlers[toolName];
227
+ if (!handler)
228
+ throw new Error(`Unknown tool: ${toolName}`);
229
+ return handler(args);
230
+ },
231
+ });
222
232
  }
223
233
  analyzeLogs(logs, options) {
224
234
  const entries = logs.map(this.parseLogEntry);
@@ -8,6 +8,7 @@ import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import * as path from "path";
9
9
  import { fileURLToPath } from "url";
10
10
  import { frameworkLogger } from "../../core/framework-logger.js";
11
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
11
12
  class XrayMobileDevelopmentServer extends XrayKnowledgeSkillBase {
12
13
  constructor() {
13
14
  super("mobile-development", "2.0.1");
@@ -104,6 +105,15 @@ class XrayMobileDevelopmentServer extends XrayKnowledgeSkillBase {
104
105
  "app_store_metadata": async (args) => this.generateAppStoreMetadata(args),
105
106
  };
106
107
  this.setupToolHandlers();
108
+ pluginRegistry.registerToolPlugin({
109
+ name: "mobile-development",
110
+ callTool: async (toolName, args) => {
111
+ const handler = this.handlers[toolName];
112
+ if (!handler)
113
+ throw new Error(`Unknown tool: ${toolName}`);
114
+ return handler(args);
115
+ },
116
+ });
107
117
  }
108
118
  async generateIOSBlueprint(args) {
109
119
  const { projectName, language = "swiftui", architecture = "mvvm", features = [] } = args;
@@ -10,6 +10,7 @@
10
10
  import * as path from "path";
11
11
  import { fileURLToPath } from "url";
12
12
  import { frameworkLogger } from "../../core/framework-logger.js";
13
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
13
14
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
14
15
  /* ============================================================================
15
16
  * Analysis Engine
@@ -151,6 +152,15 @@ class MultimodalLookerServer extends XrayKnowledgeSkillBase {
151
152
  "compare-designs": async (args) => this.handleCompareDesigns(args),
152
153
  };
153
154
  this.setupToolHandlers();
155
+ pluginRegistry.registerToolPlugin({
156
+ name: "multimodal-looker",
157
+ callTool: async (toolName, args) => {
158
+ const handler = this.handlers[toolName];
159
+ if (!handler)
160
+ throw new Error(`Unknown tool: ${toolName}`);
161
+ return handler(args);
162
+ },
163
+ });
154
164
  }
155
165
  /* --------------------------------------------------------------------------
156
166
  * Tool Handlers
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger, generateJobId } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  import fs from "fs";
10
11
  import path from "path";
11
12
  class XrayPerformanceOptimizationServer extends XrayKnowledgeSkillBase {
@@ -103,6 +104,15 @@ class XrayPerformanceOptimizationServer extends XrayKnowledgeSkillBase {
103
104
  "measure-core-web-vitals": async (args) => this.handleMeasureCoreWebVitals(args),
104
105
  };
105
106
  this.setupToolHandlers();
107
+ pluginRegistry.registerToolPlugin({
108
+ name: "performance-optimization",
109
+ callTool: async (toolName, args) => {
110
+ const handler = this.handlers[toolName];
111
+ if (!handler)
112
+ throw new Error(`Unknown tool: ${toolName}`);
113
+ return handler(args);
114
+ },
115
+ });
106
116
  }
107
117
  async handleProfileApplication(args) {
108
118
  const { projectRoot, scope = "full", duration = 30, includeHotPaths = true } = args;
@@ -8,6 +8,7 @@ import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import * as fs from "fs";
9
9
  import * as path from "path";
10
10
  import { frameworkLogger } from "../../core/framework-logger.js";
11
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
11
12
  class ProjectAnalysisServer extends XrayKnowledgeSkillBase {
12
13
  constructor() {
13
14
  super("project-analysis", "2.0.1");
@@ -87,6 +88,15 @@ class ProjectAnalysisServer extends XrayKnowledgeSkillBase {
87
88
  "analyze_proposal": async (args) => this.analyzeProposal(args),
88
89
  };
89
90
  this.setupToolHandlers();
91
+ pluginRegistry.registerToolPlugin({
92
+ name: "project-analysis",
93
+ callTool: async (toolName, args) => {
94
+ const handler = this.handlers[toolName];
95
+ if (!handler)
96
+ throw new Error(`Unknown tool: ${toolName}`);
97
+ return handler(args);
98
+ },
99
+ });
90
100
  }
91
101
  async analyzeProjectStructure(args) {
92
102
  const { projectRoot, includeMetrics = true, maxDepth = 10 } = args;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  class XrayRefactoringStrategiesServer extends XrayKnowledgeSkillBase {
10
11
  constructor() {
11
12
  super("refactoring-strategies", "2.0.1");
@@ -71,6 +72,15 @@ class XrayRefactoringStrategiesServer extends XrayKnowledgeSkillBase {
71
72
  "modernize_codebase": async (args) => this.modernizeCodebase(args),
72
73
  };
73
74
  this.setupToolHandlers();
75
+ pluginRegistry.registerToolPlugin({
76
+ name: "refactoring-strategies",
77
+ callTool: async (toolName, args) => {
78
+ const handler = this.handlers[toolName];
79
+ if (!handler)
80
+ throw new Error(`Unknown tool: ${toolName}`);
81
+ return handler(args);
82
+ },
83
+ });
74
84
  }
75
85
  async analyzeTechnicalDebt(args) {
76
86
  const { codePath, includeModernization = true, debtThreshold = 20 } = args;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  import * as fs from "fs";
10
11
  import * as path from "path";
11
12
  class XraySecurityAuditServer extends XrayKnowledgeSkillBase {
@@ -117,6 +118,15 @@ class XraySecurityAuditServer extends XrayKnowledgeSkillBase {
117
118
  "analyze_proposal": async (args) => this.analyzeProposal(args),
118
119
  };
119
120
  this.setupToolHandlers();
121
+ pluginRegistry.registerToolPlugin({
122
+ name: "security-audit",
123
+ callTool: async (toolName, args) => {
124
+ const handler = this.handlers[toolName];
125
+ if (!handler)
126
+ throw new Error(`Unknown tool: ${toolName}`);
127
+ return handler(args);
128
+ },
129
+ });
120
130
  }
121
131
  async auditSecurity(args) {
122
132
  const { files, includeDependencies = true, complianceFrameworks = ["owasp-top-10"], } = args;
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
9
9
  import { frameworkLogger } from "../../core/framework-logger.js";
10
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
10
11
  class SEOSpecialistServer extends XrayKnowledgeSkillBase {
11
12
  constructor() {
12
13
  super("seo-consultant", "2.0.1");
@@ -97,6 +98,15 @@ class SEOSpecialistServer extends XrayKnowledgeSkillBase {
97
98
  "optimize-robots-txt": async (args) => this.optimizeRobotsTxt(args),
98
99
  };
99
100
  this.setupToolHandlers();
101
+ pluginRegistry.registerToolPlugin({
102
+ name: "seo-consultant",
103
+ callTool: async (toolName, args) => {
104
+ const handler = this.handlers[toolName];
105
+ if (!handler)
106
+ throw new Error(`Unknown tool: ${toolName}`);
107
+ return handler(args);
108
+ },
109
+ });
100
110
  }
101
111
  auditTechnicalSEO(args) {
102
112
  const targetUrl = args.targetUrl || "https://example.com";
@@ -7,6 +7,10 @@ declare class SkillInvocationServer extends XrayKnowledgeSkillBase {
7
7
  */
8
8
  private recordSkillOutcome;
9
9
  private handleListSkills;
10
+ /**
11
+ * Dispatch a skill tool call: prefer in-process pluginRegistry, fall back to external MCP process.
12
+ */
13
+ private callSkillTool;
10
14
  private handleInvokeSkill;
11
15
  private handleSkillCodeReview;
12
16
  private handleSkillSecurityAudit;
@@ -6,6 +6,7 @@ import { fileURLToPath } from "url";
6
6
  import { randomUUID } from "crypto";
7
7
  import { mcpClientManager } from "../mcp-client.js";
8
8
  import { frameworkLogger } from "../../core/framework-logger.js";
9
+ import { pluginRegistry } from "../../nucleus/plugin-registry.js";
9
10
  class SkillInvocationServer extends XrayKnowledgeSkillBase {
10
11
  constructor() {
11
12
  super("xray/skill-invocation", "2.0.1");
@@ -186,6 +187,15 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
186
187
  "skill-storyteller": async (args) => this.handleSkillStoryteller(args),
187
188
  };
188
189
  this.setupToolHandlers();
190
+ pluginRegistry.registerToolPlugin({
191
+ name: "xray/skill-invocation",
192
+ callTool: async (toolName, args) => {
193
+ const handler = this.handlers[toolName];
194
+ if (!handler)
195
+ throw new Error(`Unknown tool: ${toolName}`);
196
+ return handler(args);
197
+ },
198
+ });
189
199
  }
190
200
  skillMetrics = new Map();
191
201
  /**
@@ -228,7 +238,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
228
238
  "bug-triage-specialist", "log-monitor",
229
239
  "mobile-development", "git-workflow", "session-management",
230
240
  "code-analyzer", "refactoring-strategies", "project-analysis",
231
- "testing-best-practices", "database-design", "devops-deployment",
241
+ "database-design", "devops-deployment",
232
242
  "api-design", "ui-ux-design", "database-engineer",
233
243
  ];
234
244
  let skills;
@@ -252,6 +262,15 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
252
262
  ];
253
263
  return { content: [{ type: "text", text: lines.join("\n") }] };
254
264
  }
265
+ /**
266
+ * Dispatch a skill tool call: prefer in-process pluginRegistry, fall back to external MCP process.
267
+ */
268
+ async callSkillTool(skillName, toolName, args) {
269
+ if (pluginRegistry.hasToolPlugin(skillName)) {
270
+ return pluginRegistry.callSkillTool(skillName, toolName, args);
271
+ }
272
+ return mcpClientManager.callServerTool(skillName, toolName, args);
273
+ }
255
274
  async handleInvokeSkill(args) {
256
275
  const { skillName, toolName, args: toolArgs = {} } = args;
257
276
  const skillAliases = {
@@ -282,7 +301,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
282
301
  "mobile-development", "seo-consultant",
283
302
  "git-workflow", "content-creator", "ui-ux-design",
284
303
  "multimodal-looker", "refactoring-strategies",
285
- "project-analysis", "testing-best-practices",
304
+ "project-analysis",
286
305
  "architecture-patterns",
287
306
  ];
288
307
  if (!availableServers.includes(resolvedSkill)) {
@@ -299,7 +318,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
299
318
  try {
300
319
  // Track skill usage for adaptive learning
301
320
  const skillStartTime = Date.now();
302
- const result = await mcpClientManager.callServerTool(resolvedSkill, toolName, toolArgs);
321
+ const result = await this.callSkillTool(resolvedSkill, toolName, toolArgs);
303
322
  // Record outcome for adaptive learning (success = no error)
304
323
  const duration = Date.now() - skillStartTime;
305
324
  this.recordSkillOutcome(skillName, resolvedSkill, toolName, duration, result);
@@ -331,7 +350,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
331
350
  }
332
351
  }
333
352
  async handleSkillCodeReview(args) {
334
- const result = await mcpClientManager.callServerTool("code-review", "analyze_code_quality", args);
353
+ const result = await this.callSkillTool("code-review", "analyze_code_quality", args);
335
354
  return {
336
355
  content: [
337
356
  {
@@ -346,7 +365,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
346
365
  };
347
366
  }
348
367
  async handleSkillSecurityAudit(args) {
349
- const result = await mcpClientManager.callServerTool("security-audit", "scan_vulnerabilities", args);
368
+ const result = await this.callSkillTool("security-audit", "scan_vulnerabilities", args);
350
369
  return {
351
370
  content: [
352
371
  {
@@ -361,7 +380,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
361
380
  };
362
381
  }
363
382
  async handleSkillPerformanceOptimization(args) {
364
- const result = await mcpClientManager.callServerTool("performance-optimization", "analyze_performance", args);
383
+ const result = await this.callSkillTool("performance-optimization", "analyze_performance", args);
365
384
  return {
366
385
  content: [
367
386
  {
@@ -376,7 +395,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
376
395
  };
377
396
  }
378
397
  async handleSkillTestingStrategy(args) {
379
- const result = await mcpClientManager.callServerTool("testing-strategy", "analyze_test_coverage", args);
398
+ const result = await this.callSkillTool("testing-strategy", "analyze_test_coverage", args);
380
399
  return {
381
400
  content: [
382
401
  {
@@ -391,7 +410,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
391
410
  };
392
411
  }
393
412
  async handleSkillProjectAnalysis(args) {
394
- const result = await mcpClientManager.callServerTool("researcher", "analyze-project-health", args);
413
+ const result = await this.callSkillTool("researcher", "analyze-project-health", args);
395
414
  return {
396
415
  content: [
397
416
  {
@@ -406,7 +425,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
406
425
  };
407
426
  }
408
427
  async handleSkillDatabaseDesign(args) {
409
- const result = await mcpClientManager.callServerTool("database-design", "schema_analysis", args);
428
+ const result = await this.callSkillTool("database-design", "schema_analysis", args);
410
429
  return {
411
430
  content: [
412
431
  {
@@ -421,7 +440,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
421
440
  };
422
441
  }
423
442
  async handleSkillDevopsDeployment(args) {
424
- const result = await mcpClientManager.callServerTool("devops-deployment", "pipeline_generation", args);
443
+ const result = await this.callSkillTool("devops-deployment", "pipeline_generation", args);
425
444
  return {
426
445
  content: [
427
446
  {
@@ -436,7 +455,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
436
455
  };
437
456
  }
438
457
  async handleSkillApiDesign(args) {
439
- const result = await mcpClientManager.callServerTool("api-design", "endpoint_design", args);
458
+ const result = await this.callSkillTool("api-design", "endpoint_design", args);
440
459
  return {
441
460
  content: [
442
461
  {
@@ -451,7 +470,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
451
470
  };
452
471
  }
453
472
  async handleSkillUiUxDesign(args) {
454
- const result = await mcpClientManager.callServerTool("ui-ux-design", "design_component", args);
473
+ const result = await this.callSkillTool("ui-ux-design", "design_component", args);
455
474
  return {
456
475
  content: [
457
476
  {
@@ -466,7 +485,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
466
485
  };
467
486
  }
468
487
  async handleSkillDocumentationGeneration(args) {
469
- const result = await mcpClientManager.callServerTool("documentation-generation", "generate_documentation", args);
488
+ const result = await this.callSkillTool("documentation-generation", "generate_documentation", args);
470
489
  return {
471
490
  content: [
472
491
  {
@@ -482,7 +501,7 @@ class SkillInvocationServer extends XrayKnowledgeSkillBase {
482
501
  }
483
502
  async handleSkillStoryteller(args) {
484
503
  const { storyType, title, context, framework } = args;
485
- const result = await mcpClientManager.callServerTool("storyteller", `write_${storyType}`, { title, context, framework });
504
+ const result = await this.callSkillTool("storyteller", `write_${storyType}`, { title, context, framework });
486
505
  return {
487
506
  content: [
488
507
  {