0xray 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/codex.codex +1 -1
- package/.opencode/commands/dependency-audit.md +3 -3
- package/.opencode/enforcer-config.json +2 -2
- package/AGENTS.md +2 -1
- package/README.md +12 -11
- package/dist/AGENTS.md +2 -1
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +12 -11
- package/dist/agents/code-reviewer.js +1 -1
- package/dist/analytics/routing-refiner.js +1 -1
- package/dist/cli/index.js +11 -1
- package/dist/cli/server.js +3 -3
- package/dist/core/activity-logger.d.ts +2 -2
- package/dist/core/activity-logger.js +4 -4
- package/dist/core/boot-orchestrator.d.ts +1 -1
- package/dist/core/boot-orchestrator.js +13 -28
- package/dist/core/bridge.mjs +3 -3
- package/dist/core/codex-formatter.js +2 -2
- package/dist/core/codex-injector.d.ts +0 -1
- package/dist/core/codex-injector.js +2 -3
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.js +1 -1
- package/dist/core/config-paths.d.ts +0 -2
- package/dist/core/config-paths.js +7 -8
- package/dist/core/context-loader.d.ts +1 -1
- package/dist/core/context-loader.js +1 -1
- package/dist/core/errors.d.ts +3 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/features-config.js +1 -1
- package/dist/core/framework-logger.d.ts +3 -3
- package/dist/core/framework-logger.js +17 -9
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +4 -2
- package/dist/core/logging-config.d.ts +2 -1
- package/dist/core/logging-config.js +7 -7
- package/dist/enforcement/loaders/codex-loader.js +1 -1
- package/dist/execution/opencode-cli-invoker.js +5 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/inference/inference-cycle.d.ts +1 -1
- package/dist/inference/inference-cycle.js +10 -10
- package/dist/integrations/base/Integration.js +1 -1
- package/dist/integrations/base/registry.js +19 -19
- package/dist/integrations/grok/grok-cli.js +17 -17
- package/dist/integrations/grok/hooks/pre-tool-use.js +1 -1
- package/dist/integrations/hermes-agent/bridge.mjs +1 -1
- package/dist/integrations/openclaw/api-server.d.ts +0 -1
- package/dist/integrations/openclaw/api-server.js +7 -10
- package/dist/integrations/openclaw/client.d.ts +0 -1
- package/dist/integrations/openclaw/client.js +22 -24
- package/dist/integrations/openclaw/hooks/xray-hooks.d.ts +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +17 -18
- package/dist/integrations/plugins/plugin-registry.js +5 -5
- package/dist/mcps/architect-tools.server.d.ts +2 -4
- package/dist/mcps/architect-tools.server.js +112 -195
- package/dist/mcps/auto-format.server.d.ts +2 -4
- package/dist/mcps/auto-format.server.js +49 -95
- package/dist/mcps/boot-orchestrator.server.d.ts +2 -4
- package/dist/mcps/boot-orchestrator.server.js +73 -105
- package/dist/mcps/config/server-config-registry.js +3 -3
- package/dist/mcps/enforcer-tools.server.d.ts +2 -4
- package/dist/mcps/enforcer-tools.server.js +202 -285
- package/dist/mcps/estimation.server.d.ts +2 -4
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.d.ts +2 -4
- package/dist/mcps/framework-compliance-audit.server.js +53 -82
- package/dist/mcps/framework-help.server.d.ts +2 -4
- package/dist/mcps/framework-help.server.js +63 -101
- package/dist/mcps/governance.server.js +2 -2
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/api-design.server.js +35 -67
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +2 -10
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +35 -74
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +143 -162
- package/dist/mcps/knowledge-skills/code-analyzer.server.d.ts +3 -4
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +20 -45
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/code-review.server.js +109 -143
- package/dist/mcps/knowledge-skills/content-creator.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/content-creator.server.js +205 -226
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/database-design.server.js +117 -151
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +71 -160
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/git-workflow.server.js +36 -68
- package/dist/mcps/knowledge-skills/growth-strategist.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +303 -324
- package/dist/mcps/knowledge-skills/log-monitor.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/log-monitor.server.js +141 -160
- package/dist/mcps/knowledge-skills/mobile-development.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/mobile-development.server.js +92 -209
- package/dist/mcps/knowledge-skills/multimodal-looker.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +123 -159
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +155 -296
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/project-analysis.server.js +75 -226
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +63 -156
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/security-audit.server.js +102 -136
- package/dist/mcps/knowledge-skills/seo-consultant.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +80 -203
- package/dist/mcps/knowledge-skills/session-management.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/session-management.server.js +50 -203
- package/dist/mcps/knowledge-skills/skill-invocation.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +168 -347
- package/dist/mcps/knowledge-skills/strategist.server.d.ts +2 -11
- package/dist/mcps/knowledge-skills/strategist.server.js +72 -122
- package/dist/mcps/knowledge-skills/tech-writer.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/tech-writer.server.js +87 -300
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +147 -182
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +2 -4
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +78 -153
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +2 -5
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +90 -399
- package/dist/mcps/lint.server.d.ts +2 -4
- package/dist/mcps/lint.server.js +51 -92
- package/dist/mcps/mcp-client.js +2 -2
- package/dist/mcps/model-health-check.server.d.ts +2 -4
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/performance-analysis.server.d.ts +2 -4
- package/dist/mcps/performance-analysis.server.js +57 -88
- package/dist/mcps/processor-pipeline.server.d.ts +2 -4
- package/dist/mcps/processor-pipeline.server.js +69 -100
- package/dist/mcps/registry.json +1 -1
- package/dist/mcps/researcher.server.d.ts +3 -5
- package/dist/mcps/researcher.server.js +81 -154
- package/dist/mcps/security-scan.server.d.ts +2 -4
- package/dist/mcps/security-scan.server.js +54 -96
- package/dist/mcps/shared/knowledge-skill-base.d.ts +14 -0
- package/dist/mcps/shared/knowledge-skill-base.js +45 -0
- package/dist/{security → mcps/shared}/security-scanner.js +1 -1
- package/dist/mcps/state-manager.server.d.ts +2 -4
- package/dist/mcps/state-manager.server.js +115 -160
- package/dist/orchestrator/orchestrator.d.ts +1 -1
- package/dist/orchestrator/orchestrator.js +1 -1
- package/dist/orchestrator/universal-registry-bridge.js +1 -1
- package/dist/plugin/xray-codex-injection.d.ts +1 -1
- package/dist/plugin/xray-codex-injection.js +1 -1
- package/dist/postprocessor/PostProcessor.d.ts +4 -44
- package/dist/postprocessor/PostProcessor.js +39 -553
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +11 -0
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.d.ts +11 -0
- package/dist/postprocessor/compliance/ArchitecturalComplianceChecker.js +356 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +44 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +21 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.d.ts +19 -0
- package/dist/postprocessor/reporting/PostProcessorReporter.js +96 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js +11 -11
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.d.ts +32 -0
- package/dist/processors/implementations/refactoring-logging-processor-wrapper.js +95 -1
- package/dist/processors/processor-manager.js +346 -314
- package/dist/reporting/report-formatter.js +1 -1
- package/dist/security/security-hardener.d.ts +69 -2
- package/dist/security/security-hardener.js +129 -1
- package/dist/skills/registry.json +1 -1
- package/dist/state/index.d.ts +3 -5
- package/dist/state/index.js +1 -7
- package/dist/state/state-manager.d.ts +1 -1
- package/dist/state/state-manager.js +2 -3
- package/package.json +13 -10
- package/scripts/node/universal-version-manager.js +11 -11
- package/src/mcps/architect-tools.server.ts +112 -215
- package/src/mcps/auto-format.server.ts +50 -110
- package/src/mcps/boot-orchestrator.server.ts +75 -121
- package/src/mcps/config/__tests__/server-config-registry.test.ts +21 -12
- package/src/mcps/config/server-config-registry.ts +3 -3
- package/src/mcps/enforcer-tools.server.ts +212 -310
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +52 -97
- package/src/mcps/framework-help.server.ts +64 -114
- package/src/mcps/governance.server.ts +2 -2
- package/src/mcps/knowledge-skills/api-design.server.ts +32 -77
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +31 -87
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +165 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +20 -55
- package/src/mcps/knowledge-skills/code-review.server.ts +114 -161
- package/src/mcps/knowledge-skills/content-creator.server.ts +218 -255
- package/src/mcps/knowledge-skills/database-design.server.ts +118 -165
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +67 -172
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +324 -361
- package/src/mcps/knowledge-skills/log-monitor.server.ts +160 -187
- package/src/mcps/knowledge-skills/mobile-development.server.ts +89 -223
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +128 -175
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +156 -329
- package/src/mcps/knowledge-skills/project-analysis.server.ts +72 -248
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +59 -171
- package/src/mcps/knowledge-skills/security-audit.server.ts +104 -151
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +80 -220
- package/src/mcps/knowledge-skills/session-management.server.ts +51 -232
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +165 -372
- package/src/mcps/knowledge-skills/strategist.server.ts +72 -143
- package/src/mcps/knowledge-skills/tech-writer.server.ts +85 -350
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +146 -195
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +75 -161
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +93 -487
- package/src/mcps/lint.server.ts +53 -107
- package/src/mcps/mcp-client.ts +2 -2
- package/src/mcps/model-health-check.server.ts +34 -71
- package/src/mcps/performance-analysis.server.ts +60 -104
- package/src/mcps/processor-pipeline.server.ts +72 -110
- package/src/mcps/registry.json +1 -1
- package/src/mcps/researcher.server.ts +88 -177
- package/src/mcps/security-scan.server.ts +55 -104
- package/src/mcps/shared/knowledge-skill-base.ts +62 -0
- package/src/mcps/shared/prompt-security-validator.ts +199 -0
- package/src/mcps/shared/security-scanner.ts +599 -0
- package/src/mcps/state-manager.server.ts +117 -175
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/dependency-audit.md +3 -3
- package/src/opencode/enforcer-config.json +2 -2
- package/src/skills/registry.json +1 -1
- package/xray/codex.json +1 -1
- package/xray/config.json +1 -1
- package/xray/features.json +1 -1
- package/xray/integrations.json +3 -3
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/conftest.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313-pytest-9.0.2.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/test_plugin.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/conftest.py +0 -14
- package/dist/integrations/hermes-agent/test_plugin.py +0 -1103
- package/dist/processors/implementations/refactoring-logging-processor.d.ts +0 -31
- package/dist/processors/implementations/refactoring-logging-processor.js +0 -96
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/scripts/activate-kernel-pipeline.d.ts +0 -7
- package/dist/scripts/activate-kernel-pipeline.js +0 -101
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -72
- package/dist/security/security-agent-coordinator.js +0 -204
- package/dist/security/security-auditor.d.ts +0 -56
- package/dist/security/security-auditor.js +0 -584
- package/dist/security/security-hardening-system.d.ts +0 -239
- package/dist/security/security-hardening-system.js +0 -727
- package/dist/security/security-orchestration-layer.d.ts +0 -119
- package/dist/security/security-orchestration-layer.js +0 -496
- /package/dist/{security → mcps/shared}/prompt-security-validator.d.ts +0 -0
- /package/dist/{security → mcps/shared}/prompt-security-validator.js +0 -0
- /package/dist/{security → mcps/shared}/security-scanner.d.ts +0 -0
|
@@ -5,16 +5,10 @@
|
|
|
5
5
|
* query performance analysis, and data modeling best practices
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
CallToolRequestSchema,
|
|
12
|
-
ListToolsRequestSchema,
|
|
13
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
9
|
+
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
14
10
|
import * as fs from "fs";
|
|
15
11
|
import * as path from "path";
|
|
16
|
-
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
17
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
18
12
|
|
|
19
13
|
interface DatabaseSchema {
|
|
20
14
|
tables: TableSchema[];
|
|
@@ -111,167 +105,136 @@ interface SchemaComparison {
|
|
|
111
105
|
hasDataLoss: boolean;
|
|
112
106
|
}
|
|
113
107
|
|
|
114
|
-
class XrayDatabaseDesignServer {
|
|
115
|
-
private server: Server;
|
|
116
|
-
|
|
108
|
+
class XrayDatabaseDesignServer extends XrayKnowledgeSkillBase {
|
|
117
109
|
constructor() {
|
|
118
|
-
|
|
110
|
+
super("database-design", "2.0.1");
|
|
111
|
+
this.tools = [
|
|
119
112
|
{
|
|
120
|
-
name: "
|
|
113
|
+
name: "analyze_schema",
|
|
114
|
+
description:
|
|
115
|
+
"Analyze database schema for optimization opportunities and best practices",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
schemaFile: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description:
|
|
122
|
+
"Path to schema definition file (SQL, migration, or ORM model)",
|
|
123
|
+
},
|
|
124
|
+
databaseType: {
|
|
125
|
+
type: "string",
|
|
126
|
+
enum: ["postgresql", "mysql", "sqlite", "mongodb", "redis"],
|
|
127
|
+
description: "Database type for specific optimizations",
|
|
128
|
+
},
|
|
129
|
+
includeIndexes: {
|
|
130
|
+
type: "boolean",
|
|
131
|
+
description: "Include index recommendations in analysis",
|
|
132
|
+
default: true,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ["schemaFile"],
|
|
136
|
+
},
|
|
121
137
|
},
|
|
122
138
|
{
|
|
123
|
-
|
|
124
|
-
|
|
139
|
+
name: "optimize_query",
|
|
140
|
+
description:
|
|
141
|
+
"Analyze and optimize SQL queries for better performance",
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: "object",
|
|
144
|
+
properties: {
|
|
145
|
+
query: {
|
|
146
|
+
type: "string",
|
|
147
|
+
description: "SQL query to analyze and optimize",
|
|
148
|
+
},
|
|
149
|
+
schemaContext: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description:
|
|
152
|
+
"Schema context or file path for better analysis",
|
|
153
|
+
},
|
|
154
|
+
databaseType: {
|
|
155
|
+
type: "string",
|
|
156
|
+
enum: ["postgresql", "mysql", "sqlite"],
|
|
157
|
+
description: "Database type for query optimization",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
required: ["query"],
|
|
125
161
|
},
|
|
126
162
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
tools: [
|
|
137
|
-
{
|
|
138
|
-
name: "analyze_schema",
|
|
139
|
-
description:
|
|
140
|
-
"Analyze database schema for optimization opportunities and best practices",
|
|
141
|
-
inputSchema: {
|
|
142
|
-
type: "object",
|
|
143
|
-
properties: {
|
|
144
|
-
schemaFile: {
|
|
145
|
-
type: "string",
|
|
146
|
-
description:
|
|
147
|
-
"Path to schema definition file (SQL, migration, or ORM model)",
|
|
148
|
-
},
|
|
149
|
-
databaseType: {
|
|
150
|
-
type: "string",
|
|
151
|
-
enum: ["postgresql", "mysql", "sqlite", "mongodb", "redis"],
|
|
152
|
-
description: "Database type for specific optimizations",
|
|
153
|
-
},
|
|
154
|
-
includeIndexes: {
|
|
155
|
-
type: "boolean",
|
|
156
|
-
description: "Include index recommendations in analysis",
|
|
157
|
-
default: true,
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
required: ["schemaFile"],
|
|
163
|
+
{
|
|
164
|
+
name: "design_data_model",
|
|
165
|
+
description: "Design optimal data model for given requirements",
|
|
166
|
+
inputSchema: {
|
|
167
|
+
type: "object",
|
|
168
|
+
properties: {
|
|
169
|
+
requirements: {
|
|
170
|
+
type: "string",
|
|
171
|
+
description: "Business requirements and data access patterns",
|
|
161
172
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
"Analyze and optimize SQL queries for better performance",
|
|
167
|
-
inputSchema: {
|
|
168
|
-
type: "object",
|
|
169
|
-
properties: {
|
|
170
|
-
query: {
|
|
171
|
-
type: "string",
|
|
172
|
-
description: "SQL query to analyze and optimize",
|
|
173
|
-
},
|
|
174
|
-
schemaContext: {
|
|
175
|
-
type: "string",
|
|
176
|
-
description:
|
|
177
|
-
"Schema context or file path for better analysis",
|
|
178
|
-
},
|
|
179
|
-
databaseType: {
|
|
180
|
-
type: "string",
|
|
181
|
-
enum: ["postgresql", "mysql", "sqlite"],
|
|
182
|
-
description: "Database type for query optimization",
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
required: ["query"],
|
|
173
|
+
entities: {
|
|
174
|
+
type: "array",
|
|
175
|
+
items: { type: "string" },
|
|
176
|
+
description: "List of main entities/business objects",
|
|
186
177
|
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
entities: {
|
|
199
|
-
type: "array",
|
|
200
|
-
items: { type: "string" },
|
|
201
|
-
description: "List of main entities/business objects",
|
|
202
|
-
},
|
|
203
|
-
relationships: {
|
|
204
|
-
type: "array",
|
|
205
|
-
items: {
|
|
206
|
-
type: "object",
|
|
207
|
-
properties: {
|
|
208
|
-
from: { type: "string" },
|
|
209
|
-
to: { type: "string" },
|
|
210
|
-
type: {
|
|
211
|
-
type: "string",
|
|
212
|
-
enum: ["one-to-one", "one-to-many", "many-to-many"],
|
|
213
|
-
},
|
|
214
|
-
},
|
|
178
|
+
relationships: {
|
|
179
|
+
type: "array",
|
|
180
|
+
items: {
|
|
181
|
+
type: "object",
|
|
182
|
+
properties: {
|
|
183
|
+
from: { type: "string" },
|
|
184
|
+
to: { type: "string" },
|
|
185
|
+
type: {
|
|
186
|
+
type: "string",
|
|
187
|
+
enum: ["one-to-one", "one-to-many", "many-to-many"],
|
|
215
188
|
},
|
|
216
|
-
description: "Entity relationships",
|
|
217
|
-
},
|
|
218
|
-
databaseType: {
|
|
219
|
-
type: "string",
|
|
220
|
-
enum: ["postgresql", "mysql", "mongodb", "redis"],
|
|
221
|
-
description: "Target database type",
|
|
222
189
|
},
|
|
223
190
|
},
|
|
224
|
-
|
|
191
|
+
description: "Entity relationships",
|
|
192
|
+
},
|
|
193
|
+
databaseType: {
|
|
194
|
+
type: "string",
|
|
195
|
+
enum: ["postgresql", "mysql", "mongodb", "redis"],
|
|
196
|
+
description: "Target database type",
|
|
225
197
|
},
|
|
226
198
|
},
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
199
|
+
required: ["requirements", "entities"],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "migrate_schema",
|
|
204
|
+
description: "Generate migration scripts for schema changes",
|
|
205
|
+
inputSchema: {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: {
|
|
208
|
+
currentSchema: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "Current schema definition",
|
|
211
|
+
},
|
|
212
|
+
targetSchema: {
|
|
213
|
+
type: "string",
|
|
214
|
+
description: "Target schema definition",
|
|
215
|
+
},
|
|
216
|
+
databaseType: {
|
|
217
|
+
type: "string",
|
|
218
|
+
enum: ["postgresql", "mysql", "sqlite"],
|
|
219
|
+
description: "Database type for migration",
|
|
220
|
+
},
|
|
221
|
+
safeMode: {
|
|
222
|
+
type: "boolean",
|
|
223
|
+
description: "Generate rollback scripts and safety checks",
|
|
224
|
+
default: true,
|
|
253
225
|
},
|
|
254
226
|
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
this.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
return await this.optimizeQuery(args);
|
|
267
|
-
case "design_data_model":
|
|
268
|
-
return await this.designDataModel(args);
|
|
269
|
-
case "migrate_schema":
|
|
270
|
-
return await this.migrateSchema(args);
|
|
271
|
-
default:
|
|
272
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
227
|
+
required: ["currentSchema", "targetSchema"],
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
this.handlers = {
|
|
232
|
+
"analyze_schema": async (args) => this.analyzeSchema(args as Record<string, unknown> | undefined),
|
|
233
|
+
"optimize_query": async (args) => this.optimizeQuery(args as Record<string, unknown> | undefined),
|
|
234
|
+
"design_data_model": async (args) => this.designDataModel(args as Record<string, unknown> | undefined),
|
|
235
|
+
"migrate_schema": async (args) => this.migrateSchema(args as Record<string, unknown> | undefined),
|
|
236
|
+
};
|
|
237
|
+
this.setupToolHandlers();
|
|
275
238
|
}
|
|
276
239
|
|
|
277
240
|
private async analyzeSchema(args: Record<string, unknown> | undefined) {
|
|
@@ -1179,22 +1142,12 @@ class XrayDatabaseDesignServer {
|
|
|
1179
1142
|
return icons[severity as keyof typeof icons] || "❓";
|
|
1180
1143
|
}
|
|
1181
1144
|
|
|
1182
|
-
async run(): Promise<void> {
|
|
1183
|
-
const transport = new StdioServerTransport();
|
|
1184
|
-
await this.server.connect(transport);
|
|
1185
|
-
|
|
1186
|
-
// Use centralized shutdown handler
|
|
1187
|
-
createGracefulShutdown({
|
|
1188
|
-
serverName: "database-design.server",
|
|
1189
|
-
server: this.server,
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
1145
|
}
|
|
1193
1146
|
|
|
1194
1147
|
// Run the server if this file is executed directly
|
|
1195
1148
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1196
1149
|
const server = new XrayDatabaseDesignServer();
|
|
1197
|
-
server.run().catch(() => {});
|
|
1150
|
+
server.run("database-design").catch((err) => { frameworkLogger.log("database-design", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1198
1151
|
}
|
|
1199
1152
|
|
|
1200
1153
|
export { XrayDatabaseDesignServer };
|
|
@@ -5,14 +5,8 @@
|
|
|
5
5
|
* CI/CD pipeline design, and infrastructure automation
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
10
9
|
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
11
|
-
import { createGracefulShutdown } from "../../utils/shutdown-handler.js";
|
|
12
|
-
import {
|
|
13
|
-
CallToolRequestSchema,
|
|
14
|
-
ListToolsRequestSchema,
|
|
15
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
16
10
|
|
|
17
11
|
interface DeploymentStrategy {
|
|
18
12
|
name: string;
|
|
@@ -206,177 +200,88 @@ interface OptimizationRoadmap {
|
|
|
206
200
|
finalMetrics: DeploymentMetricsInput;
|
|
207
201
|
}
|
|
208
202
|
|
|
209
|
-
class XrayDevOpsDeploymentServer {
|
|
210
|
-
private server: Server;
|
|
203
|
+
class XrayDevOpsDeploymentServer extends XrayKnowledgeSkillBase {
|
|
211
204
|
|
|
212
205
|
constructor() {
|
|
213
|
-
|
|
206
|
+
super("devops-deployment", "2.0.1");
|
|
207
|
+
this.tools = [
|
|
214
208
|
{
|
|
215
|
-
name: "
|
|
209
|
+
name: "analyze_ci_cd_pipeline",
|
|
210
|
+
description: "Analyze CI/CD pipeline configuration and suggest optimizations",
|
|
211
|
+
inputSchema: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
pipelineConfig: { type: "string", description: "CI/CD pipeline configuration (YAML/JSON)" },
|
|
215
|
+
platform: { type: "string", enum: ["github-actions", "gitlab-ci", "jenkins", "circle-ci", "azure-devops"], description: "CI/CD platform being used" },
|
|
216
|
+
includeSecurity: { type: "boolean", description: "Include security gate analysis", default: true },
|
|
217
|
+
},
|
|
218
|
+
required: ["pipelineConfig", "platform"],
|
|
219
|
+
},
|
|
216
220
|
},
|
|
217
221
|
{
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
name: "design_deployment_strategy",
|
|
223
|
+
description: "Design optimal deployment strategy for application requirements",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
applicationType: { type: "string", enum: ["web-app", "api", "mobile", "microservices", "monolith"], description: "Type of application" },
|
|
228
|
+
scale: { type: "string", enum: ["small", "medium", "large", "enterprise"], description: "Expected scale/traffic" },
|
|
229
|
+
availability: { type: "string", enum: ["basic", "high", "critical"], description: "Required availability level" },
|
|
230
|
+
budget: { type: "string", enum: ["cost-optimized", "balanced", "performance-optimized"], description: "Budget considerations" },
|
|
231
|
+
},
|
|
232
|
+
required: ["applicationType", "scale"],
|
|
220
233
|
},
|
|
221
234
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
{
|
|
233
|
-
name: "analyze_ci_cd_pipeline",
|
|
234
|
-
description:
|
|
235
|
-
"Analyze CI/CD pipeline configuration and suggest optimizations",
|
|
236
|
-
inputSchema: {
|
|
237
|
-
type: "object",
|
|
238
|
-
properties: {
|
|
239
|
-
pipelineConfig: {
|
|
240
|
-
type: "string",
|
|
241
|
-
description: "CI/CD pipeline configuration (YAML/JSON)",
|
|
242
|
-
},
|
|
243
|
-
platform: {
|
|
244
|
-
type: "string",
|
|
245
|
-
enum: [
|
|
246
|
-
"github-actions",
|
|
247
|
-
"gitlab-ci",
|
|
248
|
-
"jenkins",
|
|
249
|
-
"circle-ci",
|
|
250
|
-
"azure-devops",
|
|
251
|
-
],
|
|
252
|
-
description: "CI/CD platform being used",
|
|
253
|
-
},
|
|
254
|
-
includeSecurity: {
|
|
255
|
-
type: "boolean",
|
|
256
|
-
description: "Include security gate analysis",
|
|
257
|
-
default: true,
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
required: ["pipelineConfig", "platform"],
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: "design_deployment_strategy",
|
|
265
|
-
description:
|
|
266
|
-
"Design optimal deployment strategy for application requirements",
|
|
267
|
-
inputSchema: {
|
|
268
|
-
type: "object",
|
|
269
|
-
properties: {
|
|
270
|
-
applicationType: {
|
|
271
|
-
type: "string",
|
|
272
|
-
enum: [
|
|
273
|
-
"web-app",
|
|
274
|
-
"api",
|
|
275
|
-
"mobile",
|
|
276
|
-
"microservices",
|
|
277
|
-
"monolith",
|
|
278
|
-
],
|
|
279
|
-
description: "Type of application",
|
|
280
|
-
},
|
|
281
|
-
scale: {
|
|
282
|
-
type: "string",
|
|
283
|
-
enum: ["small", "medium", "large", "enterprise"],
|
|
284
|
-
description: "Expected scale/traffic",
|
|
285
|
-
},
|
|
286
|
-
availability: {
|
|
287
|
-
type: "string",
|
|
288
|
-
enum: ["basic", "high", "critical"],
|
|
289
|
-
description: "Required availability level",
|
|
290
|
-
},
|
|
291
|
-
budget: {
|
|
292
|
-
type: "string",
|
|
293
|
-
enum: ["cost-optimized", "balanced", "performance-optimized"],
|
|
294
|
-
description: "Budget considerations",
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
required: ["applicationType", "scale"],
|
|
298
|
-
},
|
|
235
|
+
{
|
|
236
|
+
name: "generate_infrastructure_code",
|
|
237
|
+
description: "Generate infrastructure as code for deployment",
|
|
238
|
+
inputSchema: {
|
|
239
|
+
type: "object",
|
|
240
|
+
properties: {
|
|
241
|
+
platform: { type: "string", enum: ["aws", "azure", "gcp", "kubernetes"], description: "Target cloud platform" },
|
|
242
|
+
services: { type: "array", items: { type: "string" }, description: "Required services (database, cache, storage, etc.)" },
|
|
243
|
+
environment: { type: "string", enum: ["development", "staging", "production"], description: "Deployment environment" },
|
|
244
|
+
scaling: { type: "boolean", description: "Include auto-scaling configuration", default: true },
|
|
299
245
|
},
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
246
|
+
required: ["platform", "services"],
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "optimize_deployment_performance",
|
|
251
|
+
description: "Analyze and optimize deployment performance and reliability",
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
currentMetrics: {
|
|
304
256
|
type: "object",
|
|
305
257
|
properties: {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
description: "Target cloud platform",
|
|
310
|
-
},
|
|
311
|
-
services: {
|
|
312
|
-
type: "array",
|
|
313
|
-
items: { type: "string" },
|
|
314
|
-
description:
|
|
315
|
-
"Required services (database, cache, storage, etc.)",
|
|
316
|
-
},
|
|
317
|
-
environment: {
|
|
318
|
-
type: "string",
|
|
319
|
-
enum: ["development", "staging", "production"],
|
|
320
|
-
description: "Deployment environment",
|
|
321
|
-
},
|
|
322
|
-
scaling: {
|
|
323
|
-
type: "boolean",
|
|
324
|
-
description: "Include auto-scaling configuration",
|
|
325
|
-
default: true,
|
|
326
|
-
},
|
|
258
|
+
deployTime: { type: "number" },
|
|
259
|
+
failureRate: { type: "number" },
|
|
260
|
+
rollbackTime: { type: "number" },
|
|
327
261
|
},
|
|
328
|
-
|
|
262
|
+
description: "Current deployment metrics",
|
|
329
263
|
},
|
|
330
|
-
|
|
331
|
-
{
|
|
332
|
-
name: "optimize_deployment_performance",
|
|
333
|
-
description:
|
|
334
|
-
"Analyze and optimize deployment performance and reliability",
|
|
335
|
-
inputSchema: {
|
|
264
|
+
constraints: {
|
|
336
265
|
type: "object",
|
|
337
266
|
properties: {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
deployTime: { type: "number" },
|
|
342
|
-
failureRate: { type: "number" },
|
|
343
|
-
rollbackTime: { type: "number" },
|
|
344
|
-
},
|
|
345
|
-
description: "Current deployment metrics",
|
|
346
|
-
},
|
|
347
|
-
constraints: {
|
|
348
|
-
type: "object",
|
|
349
|
-
properties: {
|
|
350
|
-
maxDowntime: { type: "number" },
|
|
351
|
-
budget: { type: "number" },
|
|
352
|
-
teamSize: { type: "number" },
|
|
353
|
-
},
|
|
354
|
-
description: "Business and technical constraints",
|
|
355
|
-
},
|
|
267
|
+
maxDowntime: { type: "number" },
|
|
268
|
+
budget: { type: "number" },
|
|
269
|
+
teamSize: { type: "number" },
|
|
356
270
|
},
|
|
357
|
-
|
|
271
|
+
description: "Business and technical constraints",
|
|
358
272
|
},
|
|
359
273
|
},
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
this.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return await this.designDeploymentStrategy(args as unknown as DeploymentStrategyArgs);
|
|
372
|
-
case "generate_infrastructure_code":
|
|
373
|
-
return await this.generateInfrastructureCode(args as unknown as InfrastructureCodeArgs);
|
|
374
|
-
case "optimize_deployment_performance":
|
|
375
|
-
return await this.optimizeDeploymentPerformance(args as unknown as DeploymentPerformanceArgs);
|
|
376
|
-
default:
|
|
377
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
378
|
-
}
|
|
379
|
-
});
|
|
274
|
+
required: ["currentMetrics"],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
];
|
|
278
|
+
this.handlers = {
|
|
279
|
+
"analyze_ci_cd_pipeline": async (args) => this.analyzeCICDPipeline(args as unknown as CICDPipelineArgs),
|
|
280
|
+
"design_deployment_strategy": async (args) => this.designDeploymentStrategy(args as unknown as DeploymentStrategyArgs),
|
|
281
|
+
"generate_infrastructure_code": async (args) => this.generateInfrastructureCode(args as unknown as InfrastructureCodeArgs),
|
|
282
|
+
"optimize_deployment_performance": async (args) => this.optimizeDeploymentPerformance(args as unknown as DeploymentPerformanceArgs),
|
|
283
|
+
};
|
|
284
|
+
this.setupToolHandlers();
|
|
380
285
|
}
|
|
381
286
|
|
|
382
287
|
private async analyzeCICDPipeline(args: CICDPipelineArgs) {
|
|
@@ -1601,22 +1506,12 @@ spec:
|
|
|
1601
1506
|
}
|
|
1602
1507
|
}
|
|
1603
1508
|
|
|
1604
|
-
async run(): Promise<void> {
|
|
1605
|
-
const transport = new StdioServerTransport();
|
|
1606
|
-
await this.server.connect(transport);
|
|
1607
|
-
|
|
1608
|
-
// Use centralized shutdown handler
|
|
1609
|
-
createGracefulShutdown({
|
|
1610
|
-
serverName: "devops-deployment.server",
|
|
1611
|
-
server: this.server,
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
1509
|
}
|
|
1615
1510
|
|
|
1616
1511
|
// Run the server if this file is executed directly
|
|
1617
1512
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1618
1513
|
const server = new XrayDevOpsDeploymentServer();
|
|
1619
|
-
server.run().catch(() => {});
|
|
1514
|
+
server.run("devops-deployment").catch((err) => { frameworkLogger.log("devops-deployment", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1620
1515
|
}
|
|
1621
1516
|
|
|
1622
1517
|
export { XrayDevOpsDeploymentServer };
|