0xray 3.1.1 → 3.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.
- package/.opencode/codex.codex +1 -1
- package/.opencode/commands/auto-format.md +3 -3
- package/.opencode/commands/auto-summary-capture.md +2 -2
- package/.opencode/commands/enforcer-daily-scan.md +3 -3
- package/.opencode/commands/framework-compliance-audit.md +4 -4
- package/.opencode/commands/interactive-validator.md +2 -2
- package/.opencode/commands/job-summary-logger.md +2 -2
- package/.opencode/commands/mode-switch.md +1 -1
- package/.opencode/commands/model-health-check.md +2 -2
- package/.opencode/commands/performance-analysis.md +2 -2
- package/.opencode/commands/pre-commit-introspection.md +3 -3
- package/.opencode/commands/security-scan.md +3 -3
- package/.opencode/commands/sisyphus-validation.md +3 -3
- package/.opencode/commands/summary-logger.md +2 -2
- package/AGENTS.md +3 -13
- package/README.md +3 -3
- package/dist/AGENTS.md +3 -13
- package/dist/CHANGELOG.md +29 -0
- package/dist/README.md +3 -3
- package/dist/analytics/consent-manager.js +0 -1
- package/dist/analytics/emerging-pattern-detector.js +0 -1
- package/dist/analytics/pattern-learning-engine.js +0 -1
- package/dist/analytics/pattern-performance-tracker.js +0 -1
- package/dist/analytics/predictive-analytics.js +0 -1
- package/dist/analytics/prompt-pattern-analyzer.js +0 -1
- package/dist/analytics/routing-performance-analyzer.js +0 -1
- package/dist/analytics/routing-refiner.js +0 -1
- package/dist/analytics/simple-pattern-analyzer.js +0 -1
- package/dist/cli/commands/archive-logs.js +0 -1
- package/dist/cli/commands/opencode-install.js +13 -0
- package/dist/cli/commands/plugin-commands.js +0 -1
- package/dist/cli/commands/status.js +11 -13
- package/dist/cli/index.js +2 -7
- package/dist/core/activity-logger.js +0 -1
- package/dist/core/adaptive-kernel.js +0 -1
- package/dist/core/boot-orchestrator.js +2 -12
- package/dist/core/bridge.mjs +0 -1
- package/dist/core/codex-formatter.js +0 -1
- package/dist/core/codex-injector.js +0 -1
- package/dist/core/config-loader.js +36 -28
- package/dist/core/context-loader.js +0 -1
- package/dist/core/context-validator.js +0 -1
- package/dist/core/features-config.js +37 -1
- package/dist/core/kernel-patterns.js +0 -1
- package/dist/core/model-router.js +23 -64
- package/dist/core/system-prompt-generator.js +0 -1
- package/dist/delegation/agent-delegator.js +0 -1
- package/dist/delegation/agent-expertise.js +0 -1
- package/dist/delegation/analytics/index.js +0 -1
- package/dist/delegation/analytics/learning-engine.js +0 -1
- package/dist/delegation/analytics/outcome-tracker.js +0 -1
- package/dist/delegation/analytics/routing-analytics.js +0 -1
- package/dist/delegation/ast-code-parser.js +0 -1
- package/dist/delegation/complexity-analyzer.js +0 -1
- package/dist/delegation/dependency-graph-builder.js +0 -1
- package/dist/delegation/index.js +0 -1
- package/dist/delegation/metrics-aggregator.js +0 -1
- package/dist/delegation/session-coordinator.js +0 -1
- package/dist/delegation/strategy-selector.js +0 -1
- package/dist/delegation/voting-coordinator.js +0 -1
- package/dist/delegation/voting-types.js +0 -1
- package/dist/delegation/weighted-voting-aggregator.js +0 -1
- package/dist/enforcement/core/index.js +0 -1
- package/dist/enforcement/core/rule-executor.js +0 -1
- package/dist/enforcement/core/rule-hierarchy.js +0 -1
- package/dist/enforcement/core/rule-registry.js +0 -1
- package/dist/enforcement/core/violation-fixer.js +0 -1
- package/dist/enforcement/index.js +0 -1
- package/dist/enforcement/loaders/agent-triage-loader.js +0 -1
- package/dist/enforcement/loaders/agents-md-validation-loader.js +0 -1
- package/dist/enforcement/loaders/base-loader.js +0 -1
- package/dist/enforcement/loaders/codex-loader.js +0 -1
- package/dist/enforcement/loaders/index.js +0 -1
- package/dist/enforcement/loaders/loader-orchestrator.js +0 -1
- package/dist/enforcement/loaders/processor-loader.js +0 -1
- package/dist/enforcement/types.js +0 -1
- package/dist/enforcement/validators/architecture-validators.js +0 -1
- package/dist/enforcement/validators/base-validator.js +0 -1
- package/dist/enforcement/validators/code-quality-validators.js +0 -1
- package/dist/enforcement/validators/index.js +0 -1
- package/dist/enforcement/validators/security-validators.js +0 -1
- package/dist/enforcement/validators/testing-validators.js +0 -1
- package/dist/enforcement/validators/validator-registry.js +0 -1
- package/dist/governance/codex-policy.service.js +0 -1
- package/dist/inference/inference-agent-invoker.js +67 -0
- package/dist/inference/inference-applier.js +178 -0
- package/dist/inference/inference-cycle.js +51 -827
- package/dist/inference/inference-proposal-generator.js +149 -0
- package/dist/infrastructure/iac-validator.js +465 -0
- package/dist/infrastructure/schemas/cloud-schemas.js +488 -0
- package/dist/integrations/base/ExampleIntegration.js +0 -1
- package/dist/integrations/base/Integration.js +0 -1
- package/dist/integrations/base/index.js +0 -1
- package/dist/integrations/base/registry.js +0 -1
- package/dist/integrations/base/types.js +0 -1
- package/dist/integrations/enforcement-gate.js +3 -3
- package/dist/integrations/governance/governance-client.js +0 -1
- package/dist/integrations/governance/index.js +11 -19
- package/dist/integrations/governance/types.js +0 -1
- package/dist/integrations/hermes-agent/__init__.py +4 -0
- package/dist/integrations/hermes-agent/bridge.mjs +37 -0
- package/dist/integrations/openclaw/api-server.js +0 -1
- package/dist/integrations/openclaw/client.js +0 -1
- package/dist/integrations/openclaw/config.js +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +0 -1
- package/dist/integrations/openclaw/index.js +0 -1
- package/dist/integrations/openclaw/types.js +0 -1
- package/dist/integrations/plugins/index.js +0 -1
- package/dist/integrations/plugins/plugin-integration.js +0 -1
- package/dist/integrations/plugins/plugin-registry.js +0 -1
- package/dist/mcps/agent-resolver.js +0 -1
- package/dist/mcps/architect-tools.server.js +119 -185
- package/dist/mcps/auto-format.server.js +56 -74
- package/dist/mcps/boot-orchestrator.server.js +67 -85
- package/dist/mcps/config/config-loader.js +6 -0
- package/dist/mcps/config/plugin-server-registry.js +0 -1
- package/dist/mcps/enforcer-tools.server.js +207 -273
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.js +52 -81
- package/dist/mcps/framework-help.server.js +71 -89
- package/dist/mcps/governance.server.js +97 -149
- package/dist/mcps/knowledge-skills/api-design.server.js +33 -65
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +33 -65
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +123 -163
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +210 -237
- package/dist/mcps/knowledge-skills/code-review.server.js +108 -142
- package/dist/mcps/knowledge-skills/content-creator.server.js +203 -225
- package/dist/mcps/knowledge-skills/database-design.server.js +116 -150
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +123 -157
- package/dist/mcps/knowledge-skills/git-workflow.server.js +34 -67
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +301 -323
- package/dist/mcps/knowledge-skills/log-monitor.server.js +139 -159
- package/dist/mcps/knowledge-skills/mobile-development.server.js +170 -200
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +122 -158
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +88 -138
- package/dist/mcps/knowledge-skills/project-analysis.server.js +131 -218
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +115 -150
- package/dist/mcps/knowledge-skills/security-audit.server.js +16 -143
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +20 -213
- package/dist/mcps/knowledge-skills/session-management.server.js +13 -90
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +43 -421
- package/dist/mcps/knowledge-skills/strategist.server.js +10 -55
- package/dist/mcps/knowledge-skills/tech-writer.server.js +16 -191
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +18 -191
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +18 -156
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +22 -296
- package/dist/mcps/lint.server.js +50 -91
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/orchestrator/aside-context.js +207 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +5 -1
- package/dist/mcps/orchestrator/handlers/status-handler.js +8 -1
- package/dist/mcps/orchestrator/handlers/task-handler.js +5 -0
- package/dist/mcps/orchestrator/index.js +5 -0
- package/dist/mcps/orchestrator/server.js +63 -8
- package/dist/mcps/performance-analysis.server.js +56 -87
- package/dist/mcps/processor-pipeline.server.js +68 -99
- package/dist/mcps/researcher.server.js +80 -153
- package/dist/mcps/security-scan.server.js +56 -70
- package/dist/mcps/shared/knowledge-skill-base.js +11 -4
- package/dist/mcps/state-manager.server.js +124 -152
- package/dist/monitoring/nudge-watchdog.js +0 -1
- package/dist/nucleus/default-plugins.js +13 -19
- package/dist/nucleus/index.js +0 -1
- package/dist/orchestrator/agent-spawn-governor.js +0 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +2 -10
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +0 -1
- package/dist/orchestrator/orchestrator.js +8 -18
- package/dist/orchestrator/self-direction-activation.js +0 -1
- package/dist/orchestrator/universal-registry-bridge.js +0 -1
- package/dist/performance/performance-budget-enforcer.js +0 -1
- package/dist/performance/performance-regression-tester.js +0 -1
- package/dist/plugin/plugin-codex-context.js +87 -0
- package/dist/plugin/plugin-helpers.js +155 -0
- package/dist/plugin/plugin-logger.js +46 -0
- package/dist/plugin/plugin-modules.js +144 -0
- package/dist/plugin/plugin-quality-gate.js +88 -0
- package/dist/plugin/plugin-types.js +1 -0
- package/dist/plugin/xray-codex-injection.js +338 -0
- package/dist/postprocessor/PostProcessor.js +3 -9
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +16 -0
- package/dist/postprocessor/integration.js +194 -0
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +472 -0
- package/dist/postprocessor/metamorphosis/index.js +1 -0
- package/dist/postprocessor/redeploy/RetryHandler.js +118 -0
- package/dist/postprocessor/services/RegressionAnalysisService.js +0 -1
- package/dist/postprocessor/triggers/APITrigger.js +0 -1
- package/dist/postprocessor/triggers/WebhookTrigger.js +0 -1
- package/dist/processors/implementations/agents-md-validation-processor.js +0 -1
- package/dist/processors/implementations/async-pattern-processor.js +0 -1
- package/dist/processors/implementations/console-log-guard-processor.js +0 -1
- package/dist/processors/implementations/coverage-analysis-processor.js +0 -1
- package/dist/processors/implementations/inference-improvement-processor.js +2 -9
- package/dist/processors/implementations/log-protection-processor.js +0 -1
- package/dist/processors/implementations/nudge-processor.js +0 -1
- package/dist/processors/implementations/performance-budget-processor.js +0 -1
- package/dist/processors/implementations/postprocessor-chain-validator.js +0 -1
- package/dist/processors/implementations/publish-preflight-processor.js +4 -12
- package/dist/processors/implementations/session-summary-processor.js +8 -16
- package/dist/processors/implementations/spawn-governance-processor.js +0 -1
- package/dist/processors/implementations/storytelling-trigger-processor.js +3 -28
- package/dist/processors/implementations/test-auto-creation-processor.js +0 -1
- package/dist/processors/implementations/typescript-compilation-processor.js +0 -1
- package/dist/processors/implementations/version-compliance-processor.js +0 -1
- package/dist/processors/processor-interfaces.js +0 -1
- package/dist/processors/processor-types.js +0 -1
- package/dist/scripts/integration.js +0 -1
- package/dist/security/comprehensive-security-audit.js +0 -1
- package/dist/security/security-agent-coordinator.js +0 -1
- package/dist/security/security-auditor.js +0 -1
- package/dist/security/security-hardener.js +0 -1
- package/dist/security/security-hardening-system.js +0 -1
- package/dist/security/security-headers.js +0 -1
- package/dist/security/security-orchestration-layer.js +0 -1
- package/dist/services/inference-tuner.js +0 -1
- package/dist/session/session-cleanup-manager.js +0 -1
- package/dist/session/session-monitor.js +0 -1
- package/dist/session/session-state-manager.js +0 -1
- package/dist/skills/xray-orchestrator/index.js +0 -1
- package/dist/utils/codex-parser.js +0 -1
- package/dist/utils/language-detector.js +0 -1
- package/dist/utils/shutdown-handler.js +0 -1
- package/dist/validation/agent-config-validator.js +280 -0
- package/dist/validation/orchestration-flow-validator.js +606 -0
- package/package.json +1 -1
- package/scripts/node/release.mjs +2 -2
- package/scripts/node/setup.cjs +28 -0
- package/scripts/node/universal-version-manager.js +1 -1
- package/src/mcps/agent-resolver.ts +0 -1
- package/src/mcps/architect-tools.server.ts +129 -211
- package/src/mcps/auto-format.server.ts +74 -103
- package/src/mcps/boot-orchestrator.server.ts +71 -96
- package/src/mcps/config/__tests__/config-loader.test.ts +6 -6
- package/src/mcps/config/config-loader.ts +7 -0
- package/src/mcps/config/plugin-server-registry.ts +0 -1
- package/src/mcps/enforcer-tools.server.ts +217 -294
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +53 -95
- package/src/mcps/framework-help.server.ts +74 -96
- package/src/mcps/governance.server.ts +97 -162
- package/src/mcps/knowledge-skills/api-design.server.ts +33 -72
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +33 -72
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +148 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +222 -254
- package/src/mcps/knowledge-skills/code-review.server.ts +115 -157
- package/src/mcps/knowledge-skills/content-creator.server.ts +219 -246
- package/src/mcps/knowledge-skills/database-design.server.ts +119 -160
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +126 -167
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +322 -360
- package/src/mcps/knowledge-skills/log-monitor.server.ts +68 -95
- package/src/mcps/knowledge-skills/mobile-development.server.ts +16 -56
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +13 -59
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +13 -74
- package/src/mcps/knowledge-skills/project-analysis.server.ts +13 -120
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +13 -60
- package/src/mcps/knowledge-skills/security-audit.server.ts +19 -157
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +23 -227
- package/src/mcps/knowledge-skills/session-management.server.ts +17 -106
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +45 -446
- package/src/mcps/knowledge-skills/strategist.server.ts +13 -63
- package/src/mcps/knowledge-skills/tech-writer.server.ts +19 -204
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +21 -204
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +21 -165
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +25 -342
- package/src/mcps/lint.server.ts +52 -105
- package/src/mcps/model-health-check.server.ts +34 -70
- package/src/mcps/orchestrator/aside-context.ts +245 -0
- package/src/mcps/orchestrator/handlers/complexity-handler.ts +9 -3
- package/src/mcps/orchestrator/handlers/status-handler.ts +11 -1
- package/src/mcps/orchestrator/handlers/task-handler.ts +8 -1
- package/src/mcps/orchestrator/index.ts +29 -0
- package/src/mcps/orchestrator/server.ts +79 -24
- package/src/mcps/orchestrator/types.ts +37 -0
- package/src/mcps/performance-analysis.server.ts +59 -102
- package/src/mcps/processor-pipeline.server.ts +70 -108
- package/src/mcps/researcher.server.ts +87 -175
- package/src/mcps/security-scan.server.ts +57 -76
- package/src/mcps/shared/knowledge-skill-base.ts +12 -4
- package/src/mcps/state-manager.server.ts +129 -169
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/auto-format.md +3 -3
- package/src/opencode/commands/auto-summary-capture.md +2 -2
- package/src/opencode/commands/enforcer-daily-scan.md +3 -3
- package/src/opencode/commands/framework-compliance-audit.md +4 -4
- package/src/opencode/commands/interactive-validator.md +2 -2
- package/src/opencode/commands/job-summary-logger.md +2 -2
- package/src/opencode/commands/mode-switch.md +1 -1
- package/src/opencode/commands/model-health-check.md +2 -2
- package/src/opencode/commands/performance-analysis.md +2 -2
- package/src/opencode/commands/pre-commit-introspection.md +3 -3
- package/src/opencode/commands/security-scan.md +3 -3
- package/src/opencode/commands/sisyphus-validation.md +3 -3
- package/src/opencode/commands/summary-logger.md +2 -2
- package/src/skills/xray-orchestrator/index.ts +0 -1
- package/dist/nucleus/orchestrator.js +0 -479
|
@@ -5,215 +5,30 @@
|
|
|
5
5
|
* Provides schema markup, robots.txt, Core Web Vitals, AI search optimization,
|
|
6
6
|
* sitemap generation, and deep technical SEO audits.
|
|
7
7
|
*/
|
|
8
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
11
8
|
import * as fs from "fs";
|
|
12
|
-
import {
|
|
13
|
-
class SEOSpecialistServer {
|
|
14
|
-
server;
|
|
9
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
10
|
+
class SEOSpecialistServer extends XrayKnowledgeSkillBase {
|
|
15
11
|
constructor() {
|
|
16
|
-
|
|
12
|
+
super("seo-consultant", "3.1.0");
|
|
13
|
+
this.tools = [
|
|
14
|
+
{ name: "audit-technical-seo", description: "Perform deep technical SEO audit: schema markup, meta tags, heading structure, internal linking, performance, accessibility, mobile-friendliness", inputSchema: { type: "object", properties: { targetUrl: { type: "string", description: "Target URL to audit" }, focusAreas: { type: "array", items: { type: "string" }, description: "Areas to focus on (schema, performance, structure, links, accessibility)" } } } },
|
|
15
|
+
{ name: "generate-schema-markup", description: "Generate JSON-LD schema markup for: Organization, Product, Article, FAQPage, BreadcrumbList, LocalBusiness, WebSite, HowTo, Recipe, Video, Audio, Course, Event, Person, Book, SoftwareApplication", inputSchema: { type: "object", properties: { schemaType: { type: "string", enum: ["Organization", "Product", "Article", "FAQPage", "BreadcrumbList", "LocalBusiness", "WebSite", "HowTo", "Recipe", "VideoObject", "AudioObject", "Course", "Event", "Person", "Book", "SoftwareApplication"] }, data: { type: "object", description: "Data to populate schema (varies by type)" }, includeMicrodata: { type: "boolean", description: "Also generate HTML microdata format", default: false } }, required: ["schemaType", "data"] } },
|
|
16
|
+
{ name: "optimize-core-web-vitals", description: "Analyze and provide optimization recommendations for LCP (Largest Contentful Paint), INP (Interaction to Next Paint), CLS (Cumulative Layout Shift)", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to analyze" }, pageType: { type: "string", enum: ["homepage", "article", "product", "category", "landing"], description: "Type of page for context-specific recommendations" }, currentMetrics: { type: "object", description: "Current Core Web Vitals values if known", properties: { LCP: { type: "number" }, INP: { type: "number" }, CLS: { type: "number" } } } }, required: ["url"] } },
|
|
17
|
+
{ name: "analyze-ai-search", description: "Optimize content for AI search engines (ChatGPT, Perplexity, Grok, Gemini, Claude). Analyze E-E-A-T signals, structure content for citation", inputSchema: { type: "object", properties: { content: { type: "string", description: "Content to optimize" }, targetAI: { type: "array", items: { type: "string" }, description: "Target AI engines (chatgpt, perplexity, grok, gemini, claude)" }, pageContext: { type: "string", description: "Page context (documentation, blog, product, api)" } }, required: ["content"] } },
|
|
18
|
+
{ name: "generate-sitemap", description: "Generate XML sitemap for SEO with proper structure, priorities, and changefreq", inputSchema: { type: "object", properties: { baseUrl: { type: "string", description: "Base URL for sitemap" }, pages: { type: "array", items: { type: "object", properties: { path: { type: "string" }, lastmod: { type: "string" }, changefreq: { type: "string", enum: ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"] }, priority: { type: "number", minimum: 0, maximum: 1 } } } }, includeImages: { type: "boolean", default: false }, includeVideos: { type: "boolean", default: false } }, required: ["baseUrl", "pages"] } },
|
|
19
|
+
{ name: "optimize-robots-txt", description: "Optimize robots.txt for SEO best practices, AI crawler optimization, and proper directive structure", inputSchema: { type: "object", properties: { baseUrl: { type: "string", description: "Site base URL" }, options: { type: "object", properties: { allowAI: { type: "boolean", description: "Allow AI crawlers", default: true }, allowSearchBots: { type: "boolean", description: "Allow standard search bots", default: true }, blockPaths: { type: "array", items: { type: "string" }, description: "Paths to disallow" }, crawlDelay: { type: "number", description: "Crawl delay in seconds" }, generateSitemapDirective: { type: "boolean", default: true } } } }, required: ["baseUrl"] } },
|
|
20
|
+
];
|
|
21
|
+
this.handlers = {
|
|
22
|
+
"audit-technical-seo": async (args) => this.auditTechnicalSEO(args),
|
|
23
|
+
"generate-schema-markup": async (args) => this.generateSchemaMarkup(args),
|
|
24
|
+
"optimize-core-web-vitals": async (args) => this.optimizeCoreWebVitals(args),
|
|
25
|
+
"analyze-ai-search": async (args) => this.analyzeAISearch(args),
|
|
26
|
+
"generate-sitemap": async (args) => this.generateSitemap(args),
|
|
27
|
+
"optimize-robots-txt": async (args) => this.optimizeRobotsTxt(args),
|
|
28
|
+
};
|
|
17
29
|
this.setupToolHandlers();
|
|
18
30
|
}
|
|
19
|
-
setupToolHandlers
|
|
20
|
-
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
21
|
-
tools: [
|
|
22
|
-
{
|
|
23
|
-
name: "audit-technical-seo",
|
|
24
|
-
description: "Perform deep technical SEO audit: schema markup, meta tags, heading structure, internal linking, performance, accessibility, mobile-friendliness",
|
|
25
|
-
inputSchema: {
|
|
26
|
-
type: "object",
|
|
27
|
-
properties: {
|
|
28
|
-
targetUrl: { type: "string", description: "Target URL to audit" },
|
|
29
|
-
focusAreas: {
|
|
30
|
-
type: "array",
|
|
31
|
-
items: { type: "string" },
|
|
32
|
-
description: "Areas to focus on (schema, performance, structure, links, accessibility)",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "generate-schema-markup",
|
|
39
|
-
description: "Generate JSON-LD schema markup for: Organization, Product, Article, FAQPage, BreadcrumbList, LocalBusiness, WebSite, HowTo, Recipe, Video, Audio, Course, Event, Person, Book, SoftwareApplication",
|
|
40
|
-
inputSchema: {
|
|
41
|
-
type: "object",
|
|
42
|
-
properties: {
|
|
43
|
-
schemaType: {
|
|
44
|
-
type: "string",
|
|
45
|
-
enum: [
|
|
46
|
-
"Organization",
|
|
47
|
-
"Product",
|
|
48
|
-
"Article",
|
|
49
|
-
"FAQPage",
|
|
50
|
-
"BreadcrumbList",
|
|
51
|
-
"LocalBusiness",
|
|
52
|
-
"WebSite",
|
|
53
|
-
"HowTo",
|
|
54
|
-
"Recipe",
|
|
55
|
-
"VideoObject",
|
|
56
|
-
"AudioObject",
|
|
57
|
-
"Course",
|
|
58
|
-
"Event",
|
|
59
|
-
"Person",
|
|
60
|
-
"Book",
|
|
61
|
-
"SoftwareApplication",
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
data: {
|
|
65
|
-
type: "object",
|
|
66
|
-
description: "Data to populate schema (varies by type)",
|
|
67
|
-
},
|
|
68
|
-
includeMicrodata: {
|
|
69
|
-
type: "boolean",
|
|
70
|
-
description: "Also generate HTML microdata format",
|
|
71
|
-
default: false,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
required: ["schemaType", "data"],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "optimize-core-web-vitals",
|
|
79
|
-
description: "Analyze and provide optimization recommendations for LCP (Largest Contentful Paint), INP (Interaction to Next Paint), CLS (Cumulative Layout Shift)",
|
|
80
|
-
inputSchema: {
|
|
81
|
-
type: "object",
|
|
82
|
-
properties: {
|
|
83
|
-
url: { type: "string", description: "URL to analyze" },
|
|
84
|
-
pageType: {
|
|
85
|
-
type: "string",
|
|
86
|
-
enum: ["homepage", "article", "product", "category", "landing"],
|
|
87
|
-
description: "Type of page for context-specific recommendations",
|
|
88
|
-
},
|
|
89
|
-
currentMetrics: {
|
|
90
|
-
type: "object",
|
|
91
|
-
description: "Current Core Web Vitals values if known",
|
|
92
|
-
properties: {
|
|
93
|
-
LCP: { type: "number" },
|
|
94
|
-
INP: { type: "number" },
|
|
95
|
-
CLS: { type: "number" },
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
required: ["url"],
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: "analyze-ai-search",
|
|
104
|
-
description: "Optimize content for AI search engines (ChatGPT, Perplexity, Grok, Gemini, Claude). Analyze E-E-A-T signals, structure content for citation",
|
|
105
|
-
inputSchema: {
|
|
106
|
-
type: "object",
|
|
107
|
-
properties: {
|
|
108
|
-
content: { type: "string", description: "Content to optimize" },
|
|
109
|
-
targetAI: {
|
|
110
|
-
type: "array",
|
|
111
|
-
items: { type: "string" },
|
|
112
|
-
description: "Target AI engines (chatgpt, perplexity, grok, gemini, claude)",
|
|
113
|
-
},
|
|
114
|
-
pageContext: {
|
|
115
|
-
type: "string",
|
|
116
|
-
description: "Page context (documentation, blog, product, api)",
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
required: ["content"],
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: "generate-sitemap",
|
|
124
|
-
description: "Generate XML sitemap for SEO with proper structure, priorities, and changefreq",
|
|
125
|
-
inputSchema: {
|
|
126
|
-
type: "object",
|
|
127
|
-
properties: {
|
|
128
|
-
baseUrl: { type: "string", description: "Base URL for sitemap" },
|
|
129
|
-
pages: {
|
|
130
|
-
type: "array",
|
|
131
|
-
items: {
|
|
132
|
-
type: "object",
|
|
133
|
-
properties: {
|
|
134
|
-
path: { type: "string" },
|
|
135
|
-
lastmod: { type: "string" },
|
|
136
|
-
changefreq: {
|
|
137
|
-
type: "string",
|
|
138
|
-
enum: [
|
|
139
|
-
"always",
|
|
140
|
-
"hourly",
|
|
141
|
-
"daily",
|
|
142
|
-
"weekly",
|
|
143
|
-
"monthly",
|
|
144
|
-
"yearly",
|
|
145
|
-
"never",
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
priority: { type: "number", minimum: 0, maximum: 1 },
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
includeImages: { type: "boolean", default: false },
|
|
153
|
-
includeVideos: { type: "boolean", default: false },
|
|
154
|
-
},
|
|
155
|
-
required: ["baseUrl", "pages"],
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: "optimize-robots-txt",
|
|
160
|
-
description: "Optimize robots.txt for SEO best practices, AI crawler optimization, and proper directive structure",
|
|
161
|
-
inputSchema: {
|
|
162
|
-
type: "object",
|
|
163
|
-
properties: {
|
|
164
|
-
baseUrl: { type: "string", description: "Site base URL" },
|
|
165
|
-
options: {
|
|
166
|
-
type: "object",
|
|
167
|
-
properties: {
|
|
168
|
-
allowAI: { type: "boolean", description: "Allow AI crawlers", default: true },
|
|
169
|
-
allowSearchBots: {
|
|
170
|
-
type: "boolean",
|
|
171
|
-
description: "Allow standard search bots",
|
|
172
|
-
default: true,
|
|
173
|
-
},
|
|
174
|
-
blockPaths: {
|
|
175
|
-
type: "array",
|
|
176
|
-
items: { type: "string" },
|
|
177
|
-
description: "Paths to disallow",
|
|
178
|
-
},
|
|
179
|
-
crawlDelay: { type: "number", description: "Crawl delay in seconds" },
|
|
180
|
-
generateSitemapDirective: { type: "boolean", default: true },
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
required: ["baseUrl"],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
}));
|
|
189
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
190
|
-
const { name, arguments: args = {} } = request.params;
|
|
191
|
-
try {
|
|
192
|
-
switch (name) {
|
|
193
|
-
case "audit-technical-seo":
|
|
194
|
-
return this.auditTechnicalSEO(args);
|
|
195
|
-
case "generate-schema-markup":
|
|
196
|
-
return this.generateSchemaMarkup(args);
|
|
197
|
-
case "optimize-core-web-vitals":
|
|
198
|
-
return this.optimizeCoreWebVitals(args);
|
|
199
|
-
case "analyze-ai-search":
|
|
200
|
-
return this.analyzeAISearch(args);
|
|
201
|
-
case "generate-sitemap":
|
|
202
|
-
return this.generateSitemap(args);
|
|
203
|
-
case "optimize-robots-txt":
|
|
204
|
-
return this.optimizeRobotsTxt(args);
|
|
205
|
-
default:
|
|
206
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
catch (error) {
|
|
210
|
-
return {
|
|
211
|
-
content: [{ type: "text", text: `Error: ${error}` }],
|
|
212
|
-
isError: true,
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}
|
|
31
|
+
// setupToolHandlers removed — handled by XrayKnowledgeSkillBase via this.tools + this.handlers
|
|
217
32
|
auditTechnicalSEO(args) {
|
|
218
33
|
const targetUrl = args.targetUrl || "https://example.com";
|
|
219
34
|
const focusAreas = args.focusAreas || [
|
|
@@ -922,14 +737,6 @@ Sitemap: ${baseUrl}/sitemap.xml`;
|
|
|
922
737
|
}
|
|
923
738
|
return issues.join("\n");
|
|
924
739
|
}
|
|
925
|
-
async run() {
|
|
926
|
-
const transport = new StdioServerTransport();
|
|
927
|
-
await this.server.connect(transport);
|
|
928
|
-
createGracefulShutdown({
|
|
929
|
-
serverName: "seo-consultant.server",
|
|
930
|
-
server: this.server,
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
740
|
}
|
|
934
741
|
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
935
742
|
const server = new SEOSpecialistServer();
|
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
* Tools for managing user sessions and persistent state.
|
|
5
5
|
* Provides session lifecycle management, state persistence, and cleanup utilities.
|
|
6
6
|
*/
|
|
7
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
8
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
7
|
import * as fs from "fs";
|
|
11
8
|
import { frameworkLogger } from "../../core/framework-logger.js";
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { XrayKnowledgeSkillBase } from "../shared/knowledge-skill-base.js";
|
|
10
|
+
class SessionManagementServer extends XrayKnowledgeSkillBase {
|
|
14
11
|
sessions = new Map();
|
|
15
12
|
tools = [
|
|
16
13
|
{
|
|
@@ -133,44 +130,17 @@ class SessionManagementServer {
|
|
|
133
130
|
},
|
|
134
131
|
];
|
|
135
132
|
constructor() {
|
|
136
|
-
|
|
137
|
-
this.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return this.handleGetSession(args);
|
|
148
|
-
case "update_session":
|
|
149
|
-
return this.handleUpdateSession(args);
|
|
150
|
-
case "delete_session":
|
|
151
|
-
return this.handleDeleteSession(args);
|
|
152
|
-
case "list_sessions":
|
|
153
|
-
return this.handleListSessions(args);
|
|
154
|
-
case "session_exists":
|
|
155
|
-
return this.handleSessionExists(args);
|
|
156
|
-
case "cleanup_expired_sessions":
|
|
157
|
-
return this.handleCleanupExpiredSessions(args);
|
|
158
|
-
default:
|
|
159
|
-
throw new Error(`Unknown tool: ${name}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
return {
|
|
164
|
-
content: [
|
|
165
|
-
{
|
|
166
|
-
type: "text",
|
|
167
|
-
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
isError: true,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
});
|
|
133
|
+
super("session-management", "3.1.0");
|
|
134
|
+
this.handlers = {
|
|
135
|
+
create_session: async (args) => this.handleCreateSession(args),
|
|
136
|
+
get_session: async (args) => this.handleGetSession(args),
|
|
137
|
+
update_session: async (args) => this.handleUpdateSession(args),
|
|
138
|
+
delete_session: async (args) => this.handleDeleteSession(args),
|
|
139
|
+
list_sessions: async (args) => this.handleListSessions(args),
|
|
140
|
+
session_exists: async (args) => this.handleSessionExists(args),
|
|
141
|
+
cleanup_expired_sessions: async (args) => this.handleCleanupExpiredSessions(args),
|
|
142
|
+
};
|
|
143
|
+
this.setupToolHandlers();
|
|
174
144
|
}
|
|
175
145
|
generateSessionId() {
|
|
176
146
|
return `session_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
@@ -416,53 +386,6 @@ class SessionManagementServer {
|
|
|
416
386
|
],
|
|
417
387
|
};
|
|
418
388
|
}
|
|
419
|
-
async run() {
|
|
420
|
-
const transport = new StdioServerTransport();
|
|
421
|
-
await this.server.connect(transport);
|
|
422
|
-
await frameworkLogger.log("mcp-session-management", "server-started", "success");
|
|
423
|
-
const cleanup = async (signal) => {
|
|
424
|
-
frameworkLogger.log("mcps/session-management", "shutdown", "info", { signal });
|
|
425
|
-
const timeout = setTimeout(() => {
|
|
426
|
-
frameworkLogger.log("mcps/session-management", "shutdown", "error", { message: "Graceful shutdown timeout, forcing exit..." });
|
|
427
|
-
process.exit(1);
|
|
428
|
-
}, 5000);
|
|
429
|
-
try {
|
|
430
|
-
if (this.server && typeof this.server.close === "function") {
|
|
431
|
-
await this.server.close();
|
|
432
|
-
}
|
|
433
|
-
clearTimeout(timeout);
|
|
434
|
-
frameworkLogger.log("mcps/session-management", "shutdown", "success");
|
|
435
|
-
process.exit(0);
|
|
436
|
-
}
|
|
437
|
-
catch (error) {
|
|
438
|
-
clearTimeout(timeout);
|
|
439
|
-
frameworkLogger.log("mcps/session-management", "shutdown", "error", { message: `Error during server shutdown: ${String(error)}` });
|
|
440
|
-
process.exit(1);
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
process.on("SIGINT", () => cleanup("SIGINT"));
|
|
444
|
-
process.on("SIGTERM", () => cleanup("SIGTERM"));
|
|
445
|
-
process.on("SIGHUP", () => cleanup("SIGHUP"));
|
|
446
|
-
const checkParent = () => {
|
|
447
|
-
try {
|
|
448
|
-
process.kill(process.ppid, 0);
|
|
449
|
-
setTimeout(checkParent, 1000);
|
|
450
|
-
}
|
|
451
|
-
catch {
|
|
452
|
-
frameworkLogger.log("mcps/session-management", "parent-death", "info");
|
|
453
|
-
cleanup("parent-process-death");
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
setTimeout(checkParent, 2000);
|
|
457
|
-
process.on("uncaughtException", (error) => {
|
|
458
|
-
frameworkLogger.log("mcps/session-management", "uncaughtException", "error", { error: String(error) });
|
|
459
|
-
cleanup("uncaughtException");
|
|
460
|
-
});
|
|
461
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
462
|
-
frameworkLogger.log("mcps/session-management", "unhandledRejection", "error", { error: String(reason) });
|
|
463
|
-
cleanup("unhandledRejection");
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
389
|
}
|
|
467
390
|
if (import.meta.url === `file://${fs.realpathSync(process.argv[1])}`) {
|
|
468
391
|
const server = new SessionManagementServer();
|