0xray 2.1.2 → 2.1.4
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 +38 -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
|
@@ -4,192 +4,77 @@
|
|
|
4
4
|
* Knowledge skill for automated documentation creation, API docs generation,
|
|
5
5
|
* code documentation maintenance, and technical writing assistance
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
8
|
+
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
10
9
|
import * as fs from "fs";
|
|
11
10
|
import * as path from "path";
|
|
12
|
-
|
|
13
|
-
class XrayDocumentationGenerationServer {
|
|
14
|
-
server;
|
|
11
|
+
class XrayDocumentationGenerationServer extends XrayKnowledgeSkillBase {
|
|
15
12
|
constructor() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
28
|
-
return {
|
|
29
|
-
tools: [
|
|
30
|
-
{
|
|
31
|
-
name: "analyze_documentation",
|
|
32
|
-
description: "Analyze existing documentation for completeness, quality, and gaps",
|
|
33
|
-
inputSchema: {
|
|
34
|
-
type: "object",
|
|
35
|
-
properties: {
|
|
36
|
-
docsPath: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "Path to documentation directory or files",
|
|
39
|
-
},
|
|
40
|
-
codePath: {
|
|
41
|
-
type: "string",
|
|
42
|
-
description: "Path to corresponding code for comparison",
|
|
43
|
-
},
|
|
44
|
-
docTypes: {
|
|
45
|
-
type: "array",
|
|
46
|
-
items: {
|
|
47
|
-
type: "string",
|
|
48
|
-
enum: [
|
|
49
|
-
"readme",
|
|
50
|
-
"api",
|
|
51
|
-
"code",
|
|
52
|
-
"architecture",
|
|
53
|
-
"deployment",
|
|
54
|
-
"user-guide",
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
description: "Types of documentation to analyze",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
required: ["docsPath"],
|
|
61
|
-
},
|
|
13
|
+
super("documentation-generation", "2.0.1");
|
|
14
|
+
this.tools = [
|
|
15
|
+
{
|
|
16
|
+
name: "analyze_documentation",
|
|
17
|
+
description: "Analyze existing documentation for completeness, quality, and gaps",
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
docsPath: { type: "string", description: "Path to documentation directory or files" },
|
|
22
|
+
codePath: { type: "string", description: "Path to corresponding code for comparison" },
|
|
23
|
+
docTypes: { type: "array", items: { type: "string", enum: ["readme", "api", "code", "architecture", "deployment", "user-guide"] }, description: "Types of documentation to analyze" },
|
|
62
24
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"express",
|
|
77
|
-
"fastify",
|
|
78
|
-
"koa",
|
|
79
|
-
"nestjs",
|
|
80
|
-
"spring",
|
|
81
|
-
"django",
|
|
82
|
-
"flask",
|
|
83
|
-
"fastapi",
|
|
84
|
-
],
|
|
85
|
-
description: "API framework being used",
|
|
86
|
-
},
|
|
87
|
-
format: {
|
|
88
|
-
type: "string",
|
|
89
|
-
enum: ["openapi", "markdown", "html", "postman"],
|
|
90
|
-
description: "Output documentation format",
|
|
91
|
-
default: "openapi",
|
|
92
|
-
},
|
|
93
|
-
includeExamples: {
|
|
94
|
-
type: "boolean",
|
|
95
|
-
description: "Include request/response examples",
|
|
96
|
-
default: true,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
required: ["codePath", "framework"],
|
|
100
|
-
},
|
|
25
|
+
required: ["docsPath"],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "generate_api_docs",
|
|
30
|
+
description: "Generate comprehensive API documentation from code analysis",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
codePath: { type: "string", description: "Path to API code files" },
|
|
35
|
+
framework: { type: "string", enum: ["express", "fastify", "koa", "nestjs", "spring", "django", "flask", "fastapi"], description: "API framework being used" },
|
|
36
|
+
format: { type: "string", enum: ["openapi", "markdown", "html", "postman"], description: "Output documentation format", default: "openapi" },
|
|
37
|
+
includeExamples: { type: "boolean", description: "Include request/response examples", default: true },
|
|
101
38
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"typescript",
|
|
116
|
-
"javascript",
|
|
117
|
-
"python",
|
|
118
|
-
"java",
|
|
119
|
-
"csharp",
|
|
120
|
-
"go",
|
|
121
|
-
"rust",
|
|
122
|
-
],
|
|
123
|
-
description: "Programming language",
|
|
124
|
-
},
|
|
125
|
-
style: {
|
|
126
|
-
type: "string",
|
|
127
|
-
enum: ["jsdoc", "docstring", "xml", "markdown"],
|
|
128
|
-
description: "Documentation comment style",
|
|
129
|
-
default: "jsdoc",
|
|
130
|
-
},
|
|
131
|
-
includePrivate: {
|
|
132
|
-
type: "boolean",
|
|
133
|
-
description: "Include documentation for private members",
|
|
134
|
-
default: false,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
required: ["codePath", "language"],
|
|
138
|
-
},
|
|
39
|
+
required: ["codePath", "framework"],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "generate_code_documentation",
|
|
44
|
+
description: "Generate inline code documentation and improve existing docs",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
codePath: { type: "string", description: "Path to code files to document" },
|
|
49
|
+
language: { type: "string", enum: ["typescript", "javascript", "python", "java", "csharp", "go", "rust"], description: "Programming language" },
|
|
50
|
+
style: { type: "string", enum: ["jsdoc", "docstring", "xml", "markdown"], description: "Documentation comment style", default: "jsdoc" },
|
|
51
|
+
includePrivate: { type: "boolean", description: "Include documentation for private members", default: false },
|
|
139
52
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
description: "Type of project",
|
|
154
|
-
},
|
|
155
|
-
includeSections: {
|
|
156
|
-
type: "array",
|
|
157
|
-
items: { type: "string" },
|
|
158
|
-
description: "Specific sections to include",
|
|
159
|
-
default: [
|
|
160
|
-
"installation",
|
|
161
|
-
"usage",
|
|
162
|
-
"api",
|
|
163
|
-
"contributing",
|
|
164
|
-
"license",
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
existingReadme: {
|
|
168
|
-
type: "string",
|
|
169
|
-
description: "Path to existing README to improve",
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
required: ["projectPath", "projectType"],
|
|
173
|
-
},
|
|
53
|
+
required: ["codePath", "language"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "generate_readme",
|
|
58
|
+
description: "Generate or improve project README documentation",
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: "object",
|
|
61
|
+
properties: {
|
|
62
|
+
projectPath: { type: "string", description: "Path to project root directory" },
|
|
63
|
+
projectType: { type: "string", enum: ["library", "application", "api", "cli", "framework"], description: "Type of project" },
|
|
64
|
+
includeSections: { type: "array", items: { type: "string" }, description: "Specific sections to include", default: ["installation", "usage", "api", "contributing", "license"] },
|
|
65
|
+
existingReadme: { type: "string", description: "Path to existing README to improve" },
|
|
174
66
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return await this.generateCodeDocumentation(args);
|
|
187
|
-
case "generate_readme":
|
|
188
|
-
return await this.generateReadme(args);
|
|
189
|
-
default:
|
|
190
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
191
|
-
}
|
|
192
|
-
});
|
|
67
|
+
required: ["projectPath", "projectType"],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
this.handlers = {
|
|
72
|
+
"analyze_documentation": async (args) => this.analyzeDocumentation(args),
|
|
73
|
+
"generate_api_docs": async (args) => this.generateAPIDocs(args),
|
|
74
|
+
"generate_code_documentation": async (args) => this.generateCodeDocumentation(args),
|
|
75
|
+
"generate_readme": async (args) => this.generateReadme(args),
|
|
76
|
+
};
|
|
77
|
+
this.setupToolHandlers();
|
|
193
78
|
}
|
|
194
79
|
async analyzeDocumentation(args) {
|
|
195
80
|
const { docsPath, codePath, docTypes = ["readme", "api", "code"] } = args;
|
|
@@ -386,51 +271,24 @@ class XrayDocumentationGenerationServer {
|
|
|
386
271
|
return analysis;
|
|
387
272
|
}
|
|
388
273
|
async analyzeDocTypeCoverage(docsPath, docType) {
|
|
389
|
-
|
|
274
|
+
const keywordMap = {
|
|
275
|
+
readme: ["readme"],
|
|
276
|
+
api: ["api", "swagger", "openapi"],
|
|
277
|
+
code: ["code"],
|
|
278
|
+
architecture: ["arch", "design"],
|
|
279
|
+
deployment: ["deploy"],
|
|
280
|
+
"user-guide": ["guide", "tutorial"],
|
|
281
|
+
};
|
|
282
|
+
const keywords = keywordMap[docType];
|
|
283
|
+
if (!keywords)
|
|
284
|
+
return 0;
|
|
390
285
|
try {
|
|
391
286
|
const files = fs.readdirSync(docsPath, { recursive: true });
|
|
392
|
-
|
|
393
|
-
case "readme":
|
|
394
|
-
coverage = files.some((f) => typeof f === "string" && f.toLowerCase().includes("readme"))
|
|
395
|
-
? 100
|
|
396
|
-
: 0;
|
|
397
|
-
break;
|
|
398
|
-
case "api":
|
|
399
|
-
coverage = files.some((f) => typeof f === "string" &&
|
|
400
|
-
(f.includes("api") ||
|
|
401
|
-
f.includes("swagger") ||
|
|
402
|
-
f.includes("openapi")))
|
|
403
|
-
? 100
|
|
404
|
-
: 0;
|
|
405
|
-
break;
|
|
406
|
-
case "code":
|
|
407
|
-
coverage = files.some((f) => typeof f === "string" && f.includes("code"))
|
|
408
|
-
? 100
|
|
409
|
-
: 0;
|
|
410
|
-
break;
|
|
411
|
-
case "architecture":
|
|
412
|
-
coverage = files.some((f) => typeof f === "string" &&
|
|
413
|
-
(f.includes("arch") || f.includes("design")))
|
|
414
|
-
? 100
|
|
415
|
-
: 0;
|
|
416
|
-
break;
|
|
417
|
-
case "deployment":
|
|
418
|
-
coverage = files.some((f) => typeof f === "string" && f.includes("deploy"))
|
|
419
|
-
? 100
|
|
420
|
-
: 0;
|
|
421
|
-
break;
|
|
422
|
-
case "user-guide":
|
|
423
|
-
coverage = files.some((f) => typeof f === "string" &&
|
|
424
|
-
(f.includes("guide") || f.includes("tutorial")))
|
|
425
|
-
? 100
|
|
426
|
-
: 0;
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
287
|
+
return files.some((f) => typeof f === "string" && keywords.some((k) => f.toLowerCase().includes(k))) ? 100 : 0;
|
|
429
288
|
}
|
|
430
289
|
catch {
|
|
431
|
-
|
|
290
|
+
return 0;
|
|
432
291
|
}
|
|
433
|
-
return coverage;
|
|
434
292
|
}
|
|
435
293
|
async compareDocsWithCode(docsPath, codePath, docTypes) {
|
|
436
294
|
const issues = [];
|
|
@@ -727,7 +585,7 @@ class XrayDocumentationGenerationServer {
|
|
|
727
585
|
openapi: "3.0.0",
|
|
728
586
|
info: {
|
|
729
587
|
title: "API Documentation",
|
|
730
|
-
version: "2.
|
|
588
|
+
version: "2.1.3",
|
|
731
589
|
description: "Generated API documentation",
|
|
732
590
|
},
|
|
733
591
|
servers: [
|
|
@@ -996,17 +854,8 @@ class XrayDocumentationGenerationServer {
|
|
|
996
854
|
const comments = [];
|
|
997
855
|
// This would generate actual documentation comments based on code analysis
|
|
998
856
|
// For now, return sample comments
|
|
999
|
-
comments.push(
|
|
1000
|
-
|
|
1001
|
-
* @param {string} param1 - First parameter
|
|
1002
|
-
* @param {number} param2 - Second parameter
|
|
1003
|
-
* @returns {boolean} Result of operation
|
|
1004
|
-
*/`);
|
|
1005
|
-
comments.push(`/**
|
|
1006
|
-
* Sample class documentation
|
|
1007
|
-
* @class
|
|
1008
|
-
* @description Represents a sample class
|
|
1009
|
-
*/`);
|
|
857
|
+
comments.push("/** Sample function documentation */");
|
|
858
|
+
comments.push("/** Sample class documentation */");
|
|
1010
859
|
return comments;
|
|
1011
860
|
}
|
|
1012
861
|
async analyzeProjectStructure(projectPath, projectType) {
|
|
@@ -1093,76 +942,23 @@ class XrayDocumentationGenerationServer {
|
|
|
1093
942
|
return content;
|
|
1094
943
|
}
|
|
1095
944
|
generateInstallationSection(projectAnalysis) {
|
|
1096
|
-
let content = "## Installation\n\n";
|
|
1097
|
-
if (projectAnalysis.languages.includes("JavaScript") ||
|
|
1098
|
-
projectAnalysis.languages.includes("TypeScript")) {
|
|
1099
|
-
content += "```bash\n";
|
|
1100
|
-
content += "# Clone the repository\n";
|
|
1101
|
-
content += "git clone <repository-url>\n";
|
|
1102
|
-
content += "cd <project-directory>\n\n";
|
|
1103
|
-
content += "# Install dependencies\n";
|
|
1104
|
-
content += "npm install\n";
|
|
1105
|
-
content += "# or\n";
|
|
1106
|
-
content += "yarn install\n";
|
|
1107
|
-
content += "```\n\n";
|
|
1108
|
-
}
|
|
945
|
+
let content = "## Installation\n\n```bash\n# Install dependencies\nnpm install\n```\n\n";
|
|
1109
946
|
if (projectAnalysis.languages.includes("Python")) {
|
|
1110
|
-
content += "```bash\n";
|
|
1111
|
-
content += "# Install with pip\n";
|
|
1112
|
-
content += "pip install <package-name>\n\n";
|
|
1113
|
-
content += "# Or install from source\n";
|
|
1114
|
-
content += "git clone <repository-url>\n";
|
|
1115
|
-
content += "cd <project-directory>\n";
|
|
1116
|
-
content += "pip install -e .\n";
|
|
1117
|
-
content += "```\n\n";
|
|
947
|
+
content += "```bash\npip install <package-name>\n```\n\n";
|
|
1118
948
|
}
|
|
1119
949
|
return content;
|
|
1120
950
|
}
|
|
1121
951
|
generateUsageSection(projectAnalysis) {
|
|
1122
|
-
|
|
1123
|
-
content += "```javascript\n";
|
|
1124
|
-
content += "// Basic usage example\n";
|
|
1125
|
-
content += "const result = await performOperation();\n";
|
|
1126
|
-
content += "console.log(result);\n";
|
|
1127
|
-
content += "```\n\n";
|
|
1128
|
-
content += "### Advanced Usage\n\n";
|
|
1129
|
-
content +=
|
|
1130
|
-
"For more advanced features, see the [API documentation](./docs/api.md).\n\n";
|
|
1131
|
-
return content;
|
|
952
|
+
return "## Usage\n\n```javascript\n// Example usage\nconst result = await performOperation();\n```\n\nFor advanced usage, see [API docs](./docs/api.md).\n\n";
|
|
1132
953
|
}
|
|
1133
954
|
generateAPISection(projectAnalysis) {
|
|
1134
|
-
|
|
1135
|
-
content += "### Core Functions\n\n";
|
|
1136
|
-
content += "- `performOperation()` - Performs the main operation\n";
|
|
1137
|
-
content += "- `configure(options)` - Configures the library\n";
|
|
1138
|
-
content += "- `validateInput(input)` - Validates input data\n\n";
|
|
1139
|
-
content +=
|
|
1140
|
-
"For detailed API documentation, see [API Reference](./docs/api.md).\n\n";
|
|
1141
|
-
return content;
|
|
955
|
+
return "## API\n\nSee [API Reference](./docs/api.md) for complete documentation.\n\n";
|
|
1142
956
|
}
|
|
1143
957
|
generateContributingSection() {
|
|
1144
|
-
|
|
1145
|
-
content +=
|
|
1146
|
-
"We welcome contributions! Please see our [Contributing Guide](./CONTRIBUTING.md) for details.\n\n";
|
|
1147
|
-
content += "### Development Setup\n\n";
|
|
1148
|
-
content += "```bash\n";
|
|
1149
|
-
content += "git clone <repository-url>\n";
|
|
1150
|
-
content += "cd <project-directory>\n";
|
|
1151
|
-
content += "npm install\n";
|
|
1152
|
-
content += "npm run dev\n";
|
|
1153
|
-
content += "```\n\n";
|
|
1154
|
-
content += "### Testing\n\n";
|
|
1155
|
-
content += "```bash\n";
|
|
1156
|
-
content += "npm test\n";
|
|
1157
|
-
content += "npm run test:coverage\n";
|
|
1158
|
-
content += "```\n\n";
|
|
1159
|
-
return content;
|
|
958
|
+
return "## Contributing\n\nSee [Contributing Guide](./CONTRIBUTING.md).\n\n";
|
|
1160
959
|
}
|
|
1161
960
|
generateLicenseSection() {
|
|
1162
|
-
|
|
1163
|
-
content +=
|
|
1164
|
-
"This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n";
|
|
1165
|
-
return content;
|
|
961
|
+
return "## License\n\nMIT License - see [LICENSE](LICENSE).\n\n";
|
|
1166
962
|
}
|
|
1167
963
|
getSeverityIcon(severity) {
|
|
1168
964
|
const icons = {
|
|
@@ -1173,19 +969,10 @@ class XrayDocumentationGenerationServer {
|
|
|
1173
969
|
};
|
|
1174
970
|
return icons[severity] || "❓";
|
|
1175
971
|
}
|
|
1176
|
-
async run() {
|
|
1177
|
-
const transport = new StdioServerTransport();
|
|
1178
|
-
await this.server.connect(transport);
|
|
1179
|
-
// Use centralized shutdown handler
|
|
1180
|
-
createGracefulShutdown({
|
|
1181
|
-
serverName: "tech-writer.server",
|
|
1182
|
-
server: this.server,
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
972
|
}
|
|
1186
973
|
// Run the server if this file is executed directly
|
|
1187
974
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
1188
975
|
const server = new XrayDocumentationGenerationServer();
|
|
1189
|
-
server.run().catch(() => { });
|
|
976
|
+
server.run("documentation-generation.server").catch((err) => { frameworkLogger.log("tech-writer", "run", "error", { error: err instanceof Error ? err.message : String(err) }); });
|
|
1190
977
|
}
|
|
1191
978
|
export { XrayDocumentationGenerationServer };
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* Knowledge skill for comprehensive testing strategies, TDD/BDD implementation,
|
|
5
5
|
* test coverage optimization, and automated testing workflows
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
8
|
+
declare class XrayTestingBestPracticesServer extends XrayKnowledgeSkillBase {
|
|
9
9
|
constructor();
|
|
10
|
-
private setupToolHandlers;
|
|
11
10
|
private analyzeTestCoverage;
|
|
12
11
|
private designTestStrategy;
|
|
13
12
|
private implementTDDWorkflow;
|
|
@@ -31,6 +30,5 @@ declare class XrayTestingBestPracticesServer {
|
|
|
31
30
|
private getPriorityIcon;
|
|
32
31
|
private getImpactIcon;
|
|
33
32
|
private getTestTypeIcon;
|
|
34
|
-
run(): Promise<void>;
|
|
35
33
|
}
|
|
36
34
|
export { XrayTestingBestPracticesServer };
|