bc-code-intelligence-mcp
Version:
BC Code Intelligence MCP Server - Complete Specialist Bundle with AI-driven expert consultation, seamless handoffs, and context-preserving workflows
69 lines • 3.52 kB
JavaScript
import { z } from 'zod';
/**
* Business Central Knowledge Base Types
*
* These types define the structure of our atomic BC knowledge topics,
* indexes, and relationships for intelligent AI consumption.
*/
// YAML Frontmatter Schema - Extended for structured knowledge types
export const AtomicTopicFrontmatterSchema = z.object({
title: z.string().optional().describe("Human-readable topic title"),
domain: z.union([
z.string(),
z.array(z.string())
]).optional().describe("Knowledge domain(s) - single domain or array for shared topics"),
difficulty: z.enum(["beginner", "intermediate", "advanced", "expert"]).optional().describe("Complexity level"),
bc_versions: z.string().optional().describe("Supported BC versions (e.g., '14+', '18+')"),
tags: z.array(z.string()).optional().describe("Searchable tags for topic discovery"),
prerequisites: z.array(z.string()).optional().describe("Required prerequisite topics"),
related_topics: z.array(z.string()).optional().describe("Related and complementary topics"),
samples: z.string().optional().describe("Path to companion sample file"),
estimated_time: z.string().optional().describe("Time to read/implement (e.g., '15 minutes')"),
// Extended properties for structured knowledge types
type: z.string().optional().describe("Knowledge type (code-pattern, workflow, etc.)"),
name: z.string().optional().describe("Unique name for structured types"),
pattern_type: z.enum(["good", "bad", "unknown"]).optional().describe("Pattern classification"),
regex_patterns: z.array(z.string()).optional().describe("Regex patterns for code detection"),
description: z.string().optional().describe("Brief description for structured types"),
category: z.string().optional().describe("Category classification"),
severity: z.enum(["low", "medium", "high", "critical"]).optional().describe("Severity level"),
impact_level: z.enum(["low", "medium", "high"]).optional().describe("Impact level"),
detection_confidence: z.enum(["low", "medium", "high"]).optional().describe("Detection confidence"),
// Workflow-specific properties
workflow_type: z.string().optional().describe("Type of workflow (checklist, procedure, etc.)"),
phases: z.array(z.any()).optional().describe("Workflow phases"),
// Conditional MCP integration
conditional_mcp: z.string().optional().describe("MCP server ID required for this topic (show only if MCP present)"),
conditional_mcp_missing: z.string().optional().describe("MCP server ID that excludes this topic (show only if MCP absent)"),
});
// Domain Catalog Structure
export const DomainInfoSchema = z.object({
title: z.string(),
description: z.string(),
topic_count: z.number(),
subdirectories: z.array(z.string()),
key_topics: z.array(z.string()),
difficulty_levels: z.record(z.number()),
tags: z.array(z.string()),
sample_files: z.number().optional(),
});
// Utility functions for domain handling
export function isDomainMatch(topicDomain, targetDomain) {
if (!topicDomain)
return false;
if (typeof topicDomain === 'string') {
return topicDomain === targetDomain;
}
if (Array.isArray(topicDomain)) {
return topicDomain.includes(targetDomain);
}
return false;
}
export function getDomainList(domain) {
if (!domain)
return [];
if (typeof domain === 'string')
return [domain];
return domain;
}
//# sourceMappingURL=bc-knowledge.js.map