{"version":3,"sources":["../../src/cli/index.ts","../../src/scanner/index.ts","../../src/parser/index.ts","../../src/validators/schema-validator.ts","../../src/schemas/common.ts","../../src/schemas/domain.ts","../../src/schemas/system.ts","../../src/schemas/service.ts","../../src/schemas/message.ts","../../src/schemas/channel.ts","../../src/schemas/flow.ts","../../src/schemas/entity.ts","../../src/schemas/user.ts","../../src/schemas/team.ts","../../src/schemas/agent.ts","../../src/schemas/adr.ts","../../src/schemas/container.ts","../../src/schemas/data-product.ts","../../src/schemas/diagram.ts","../../src/schemas/index.ts","../../src/validators/reference-validator.ts","../../src/validators/best-practices-validator.ts","../../src/validators/index.ts","../../src/reporters/index.ts","../../src/config/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { scanCatalogFiles } from '../scanner';\nimport { parseAllFiles } from '../parser';\nimport { validateCatalog } from '../validators';\nimport { reportErrors } from '../reporters';\nimport { LinterOptions } from '../types';\nimport { loadConfig, loadEventCatalogConfig, shouldIgnoreFile, getEffectiveRules, applyRuleSeverity } from '../config';\n\nconst program = new Command();\n\nprogram\n  .name('eventcatalog-linter')\n  .description('Lint your EventCatalog for frontmatter and reference validation')\n  .version('0.1.0')\n  .argument('[directory]', 'EventCatalog directory to lint', '.')\n  .option('-v, --verbose', 'Show verbose output', false)\n  .option('--fail-on-warning', 'Exit with non-zero code on warnings', false)\n  .action(async (directory: string, options: Partial<LinterOptions>) => {\n    const rootDir = path.resolve(directory);\n    const spinner = ora('Loading configuration...').start();\n\n    try {\n      // Load configuration\n      const config = loadConfig(rootDir);\n      const dependencies = loadEventCatalogConfig(rootDir);\n\n      spinner.text = 'Scanning EventCatalog files...';\n      const allFiles = await scanCatalogFiles(rootDir);\n\n      // Filter out ignored files\n      const files = allFiles.filter((file) => !shouldIgnoreFile(file.relativePath, config.ignorePatterns || []));\n\n      const ignoredCount = allFiles.length - files.length;\n      if (ignoredCount > 0) {\n        spinner.text = `Found ${files.length} catalog files (${ignoredCount} ignored)`;\n      } else {\n        spinner.text = `Found ${files.length} catalog files`;\n      }\n\n      if (files.length === 0) {\n        spinner.warn('No EventCatalog files found');\n        process.exit(0);\n      }\n\n      spinner.text = 'Parsing frontmatter...';\n      const { parsed, errors: parseErrors } = await parseAllFiles(files);\n\n      spinner.text = 'Validating catalog...';\n      const rawValidationErrors = validateCatalog(parsed, dependencies);\n\n      // Apply rule configuration to each file's errors\n      const validationErrors = parsed.flatMap((parsedFile) => {\n        const fileErrors = rawValidationErrors.filter((error) => error.file === parsedFile.file.relativePath);\n        const effectiveRules = getEffectiveRules(parsedFile.file.relativePath, config);\n        return applyRuleSeverity(fileErrors, effectiveRules);\n      });\n\n      spinner.stop();\n\n      const summary = reportErrors(validationErrors, parseErrors, options.verbose);\n\n      // Show scan summary\n      if (summary.totalErrors === 0) {\n        console.log(chalk.dim(`\\n  ${files.length} files checked`));\n      }\n\n      if (summary.totalErrors > 0 || (options.failOnWarning && summary.totalWarnings > 0)) {\n        process.exit(1);\n      }\n    } catch (error) {\n      spinner.fail('An error occurred');\n      console.error(chalk.red(error instanceof Error ? error.message : String(error)));\n      process.exit(1);\n    }\n  });\n\nprogram.parse();\n","import fg from 'fast-glob';\nimport path from 'path';\nimport { ResourceType } from '../schemas';\n\nexport interface CatalogFile {\n  path: string;\n  relativePath: string;\n  resourceType: ResourceType;\n  resourceId: string;\n  version?: string;\n}\n\nconst RESOURCE_DIRECTORY_NAMES: Partial<Record<ResourceType, string>> = {\n  dataProduct: 'data-products',\n  dataStore: 'containers',\n  container: 'containers',\n  adr: 'adrs',\n};\n\nconst RESOURCE_PATTERNS: Partial<Record<ResourceType, string[]>> = {\n  domain: [\n    'domains/*/index.{md,mdx}',\n    'domains/*/versioned/*/index.{md,mdx}',\n    'domains/*/subdomains/*/index.{md,mdx}',\n    'domains/*/subdomains/*/versioned/*/index.{md,mdx}',\n  ],\n  system: [\n    '**/systems/**/index.{md,mdx}',\n    '**/systems/**/versioned/*/index.{md,mdx}',\n    '!**/systems/**/agents/**',\n    '!**/systems/**/services/**',\n    '!**/systems/**/events/**',\n    '!**/systems/**/commands/**',\n    '!**/systems/**/queries/**',\n    '!**/systems/**/flows/**',\n    '!**/systems/**/channels/**',\n    '!**/systems/**/entities/**',\n    '!**/systems/**/containers/**',\n    '!**/systems/**/diagrams/**',\n    '!**/systems/**/data-products/**',\n    '!**/systems/**/adrs/**',\n    '!**/systems/**/docs/**',\n  ],\n  service: [\n    'domains/*/services/*/index.{md,mdx}',\n    'domains/*/services/*/versioned/*/index.{md,mdx}',\n    'domains/*/subdomains/*/services/*/index.{md,mdx}',\n    'domains/*/subdomains/*/services/*/versioned/*/index.{md,mdx}',\n    '**/systems/**/services/*/index.{md,mdx}',\n    '**/systems/**/services/*/versioned/*/index.{md,mdx}',\n    'services/*/index.{md,mdx}',\n    'services/*/versioned/*/index.{md,mdx}',\n  ],\n  agent: ['**/agents/*/index.{md,mdx}', '**/agents/*/versioned/*/index.{md,mdx}'],\n  adr: ['**/adrs/*/index.{md,mdx}', '**/adrs/*/versioned/*/index.{md,mdx}'],\n  event: ['**/events/*/index.{md,mdx}', '**/events/*/versioned/*/index.{md,mdx}'],\n  command: ['**/commands/*/index.{md,mdx}', '**/commands/*/versioned/*/index.{md,mdx}'],\n  query: ['**/queries/*/index.{md,mdx}', '**/queries/*/versioned/*/index.{md,mdx}'],\n  channel: ['**/channels/**/index.{md,mdx}', '**/channels/**/versioned/*/index.{md,mdx}'],\n  flow: ['**/flows/**/index.{md,mdx}', '**/flows/**/versioned/*/index.{md,mdx}'],\n  entity: ['**/entities/*/index.{md,mdx}', '**/entities/*/versioned/*/index.{md,mdx}'],\n  container: ['**/containers/**/index.{md,mdx}', '**/containers/**/versioned/*/index.{md,mdx}'],\n  dataProduct: ['**/data-products/*/index.{md,mdx}', '**/data-products/*/versioned/*/index.{md,mdx}'],\n  diagram: ['**/diagrams/**/index.{md,mdx}', '**/diagrams/**/versioned/*/index.{md,mdx}'],\n  user: ['users/*.{md,mdx}'],\n  team: ['teams/*.{md,mdx}'],\n};\n\nexport const extractResourceInfo = (filePath: string, resourceType: ResourceType): { id: string; version?: string } => {\n  // Normalize path separators to forward slashes for consistent parsing across platforms\n  const normalizedPath = filePath.replace(/\\\\/g, '/');\n  const relativePath = normalizedPath.split('/');\n\n  if (resourceType === 'user' || resourceType === 'team') {\n    const filename = path.basename(filePath, path.extname(filePath));\n    return { id: filename };\n  }\n\n  // Find the resource type directory in the path\n  const resourceTypePattern = RESOURCE_DIRECTORY_NAMES[resourceType] || `${resourceType}s`;\n  const resourceTypeIndex = relativePath.findIndex((part) => part === resourceTypePattern);\n\n  if (resourceTypeIndex === -1) {\n    // Fallback to original logic if pattern not found\n    const parts = relativePath.slice(1, -1);\n    return { id: parts[parts.length - 1] };\n  }\n\n  // Extract parts after the resource type directory, excluding index.mdx\n  const parts = relativePath.slice(resourceTypeIndex + 1, -1);\n\n  if (parts.length === 0) {\n    return { id: 'unknown' };\n  }\n\n  // Check for versioned structure: resourceId/versioned/version/index.mdx\n  if (parts.length >= 3 && parts[parts.length - 2] === 'versioned') {\n    const version = parts[parts.length - 1];\n    const resourceId = parts.slice(0, -2).join('/');\n    return { id: resourceId, version };\n  }\n\n  // Check for domain versioned structure: domains/domainId/versioned/version/index.mdx\n  if (resourceType === 'domain' && parts.length >= 2) {\n    const versionedIndex = parts.findIndex((part) => part === 'versioned');\n    if (versionedIndex !== -1 && versionedIndex < parts.length - 1) {\n      const version = parts[versionedIndex + 1];\n      const resourceId = parts.slice(0, versionedIndex).join('/');\n      return { id: resourceId, version };\n    }\n  }\n\n  // Standard structure: resourceId/index.mdx\n  if (parts.length === 1) {\n    return { id: parts[0] };\n  }\n\n  // Handle subdomain structure or nested resources\n  return { id: parts.join('/') };\n};\n\nexport const scanCatalogFiles = async (rootDir: string): Promise<CatalogFile[]> => {\n  const files: CatalogFile[] = [];\n\n  for (const [resourceType, patterns] of Object.entries(RESOURCE_PATTERNS)) {\n    const foundFiles = await fg(patterns, {\n      cwd: rootDir,\n      absolute: true,\n      onlyFiles: true,\n      followSymbolicLinks: false,\n    });\n\n    for (const filePath of foundFiles) {\n      const relativePath = path.relative(rootDir, filePath);\n      const { id, version } = extractResourceInfo(relativePath, resourceType as ResourceType);\n\n      files.push({\n        path: filePath,\n        relativePath,\n        resourceType: resourceType as ResourceType,\n        resourceId: id,\n        version,\n      });\n    }\n  }\n\n  return files;\n};\n","import fs from 'fs/promises';\nimport matter from 'gray-matter';\nimport { CatalogFile } from '../scanner';\n\nexport interface ParsedFile {\n  file: CatalogFile;\n  frontmatter: Record<string, unknown>;\n  content: string;\n  raw: string;\n}\n\nexport interface ParseError {\n  file: CatalogFile;\n  error: Error;\n}\n\nexport const parseFrontmatter = async (file: CatalogFile): Promise<ParsedFile | ParseError> => {\n  try {\n    const fileContent = await fs.readFile(file.path, 'utf-8');\n    const { data, content } = matter(fileContent);\n\n    return {\n      file,\n      frontmatter: data,\n      content,\n      raw: fileContent,\n    };\n  } catch (error) {\n    return {\n      file,\n      error: error instanceof Error ? error : new Error(String(error)),\n    };\n  }\n};\n\nexport const parseAllFiles = async (\n  files: CatalogFile[]\n): Promise<{\n  parsed: ParsedFile[];\n  errors: ParseError[];\n}> => {\n  const results = await Promise.all(files.map(parseFrontmatter));\n\n  const parsed: ParsedFile[] = [];\n  const errors: ParseError[] = [];\n\n  for (const result of results) {\n    if ('error' in result) {\n      errors.push(result);\n    } else {\n      parsed.push(result);\n    }\n  }\n\n  return { parsed, errors };\n};\n","import { z } from 'zod';\nimport { schemas } from '../schemas';\nimport { ParsedFile } from '../parser';\nimport { ValidationError } from '../types';\n\nexport const validateSchema = (parsedFile: ParsedFile): ValidationError[] => {\n  const { file, frontmatter } = parsedFile;\n  const schema = schemas[file.resourceType];\n  const errors: ValidationError[] = [];\n\n  try {\n    schema.parse(frontmatter);\n  } catch (error) {\n    if (error instanceof z.ZodError) {\n      for (const issue of error.issues) {\n        const field = issue.path.join('.');\n        let message = issue.message;\n\n        if (issue.code === 'invalid_type') {\n          message = `Expected ${issue.expected}, but received ${issue.received}`;\n        }\n\n        let rule = 'schema/required-fields';\n        if (issue.code === 'invalid_type') {\n          rule = 'schema/valid-type';\n        } else if (issue.code === 'invalid_string' && issue.validation === 'email') {\n          rule = 'schema/valid-email';\n        } else if (field && field.includes('version')) {\n          rule = 'schema/valid-semver';\n        }\n\n        errors.push({\n          type: 'schema',\n          resource: `${file.resourceType}/${file.resourceId}`,\n          field: field || undefined,\n          message: field ? `${field}: ${message}` : message,\n          file: file.relativePath,\n          rule,\n        });\n      }\n    } else {\n      errors.push({\n        type: 'schema',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        message: error instanceof Error ? error.message : String(error),\n        file: file.relativePath,\n        rule: 'schema/validation-error',\n      });\n    }\n  }\n\n  return errors;\n};\n\nexport const validateAllSchemas = (parsedFiles: ParsedFile[]): ValidationError[] => {\n  const errors: ValidationError[] = [];\n\n  for (const parsedFile of parsedFiles) {\n    errors.push(...validateSchema(parsedFile));\n  }\n\n  return errors;\n};\n","import { z } from 'zod';\n\nexport const badgeSchema = z.object({\n  content: z.string(),\n  backgroundColor: z.string(),\n  textColor: z.string(),\n  icon: z.string().optional(),\n  url: z.string().optional(),\n});\n\nexport const ownerReferenceSchema = z\n  .union([\n    // The ID of the user or team\n    z.string(),\n    // The full object with the ID and collection (keep compatibility with `reference`)\n    z.object({\n      id: z.string(),\n      collection: z.enum(['users', 'teams']),\n    }),\n  ])\n  .transform(\n    // This transformation is needed to keep compatibility with `reference`.\n    // The utilities `getTeams` and `getUsers` rely on this transformation.\n    (lookup) => ({ id: typeof lookup === 'string' ? lookup : lookup.id })\n  );\n\nexport const specificationSchema = z.union([\n  z.object({\n    openapiPath: z.string().optional(),\n    asyncapiPath: z.string().optional(),\n    graphqlPath: z.string().optional(),\n  }),\n  z.array(\n    z.object({\n      type: z.enum(['openapi', 'asyncapi', 'graphql']),\n      path: z.string(),\n      name: z.string().optional(),\n      headers: z.record(z.string()).optional(),\n    })\n  ),\n]);\n\nexport const repositorySchema = z.object({\n  language: z.string().optional(),\n  url: z.string().optional(),\n});\n\nexport const draftSchema = z.union([\n  z.boolean(),\n  z.object({\n    title: z.string().optional(),\n    message: z.string(),\n  }),\n]);\n\nexport const deprecatedSchema = z.union([\n  z.object({\n    message: z.string().optional(),\n    date: z.union([z.string(), z.date()]).optional(),\n  }),\n  z.boolean().optional(),\n]);\n\nexport const pointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n});\n\nexport const resourcePointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n  type: z.enum([\n    'agent',\n    'service',\n    'event',\n    'command',\n    'query',\n    'flow',\n    'channel',\n    'domain',\n    'system',\n    'user',\n    'team',\n    'container',\n    'entity',\n    'diagram',\n    'data-product',\n    'adr',\n  ]),\n});\n\nexport const channelPointerSchema = z\n  .object({\n    parameters: z.record(z.string()).optional(),\n  })\n  .merge(pointerSchema);\n\nexport const detailPanelPropertySchema = z\n  .object({\n    visible: z.boolean().optional(),\n  })\n  .optional();\n\nexport const sendsPointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n  fields: z.array(z.string()).optional(),\n  group: z.string().optional(),\n  to: z\n    .array(\n      channelPointerSchema.extend({\n        delivery_mode: z.enum(['push', 'pull', 'push-pull']).optional().default('push'),\n      })\n    )\n    .optional(),\n});\n\nexport const receivesPointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n  fields: z.array(z.string()).optional(),\n  group: z.string().optional(),\n  from: z\n    .array(\n      channelPointerSchema.extend({\n        delivery_mode: z.enum(['push', 'pull', 'push-pull']).optional().default('push'),\n      })\n    )\n    .optional(),\n});\n\nexport const resourceReferenceSchema = pointerSchema;\n\nexport const semverSchema = z.string().refine((version) => {\n  // Allow common patterns used in EventCatalog\n  if (version === 'latest') return true;\n\n  // Allow x patterns like 0.0.x, 1.x, 2.1.x but not x.x.x\n  if (version.includes('.x')) {\n    const xPattern = /^\\d+(\\.\\d+)*\\.x$/;\n    return xPattern.test(version);\n  }\n\n  // Allow semver ranges like ^1.0.0, ~1.2.0\n  if (version.startsWith('^') || version.startsWith('~')) {\n    const rangeVersion = version.substring(1);\n    const semverRegex = /^\\d+\\.\\d+\\.\\d+(-[\\w\\d-.]+)?(\\+[\\w\\d-.]+)?$/;\n    return semverRegex.test(rangeVersion);\n  }\n\n  // For strict semver, use a regex that matches the semver spec\n  const semverRegex = /^\\d+\\.\\d+\\.\\d+(-[\\w\\d-.]+)?(\\+[\\w\\d-.]+)?$/;\n  return semverRegex.test(version);\n}, 'Invalid semantic version format');\n\nexport const sidebarSchema = z\n  .object({\n    label: z.string().optional(),\n    badge: z.string().optional(),\n    color: z.string().optional(),\n    backgroundColor: z.string().optional(),\n  })\n  .optional();\n\nexport const stylesSchema = z\n  .object({\n    icon: z.string().optional(),\n    node: z\n      .object({\n        color: z.string().optional(),\n        label: z.string().optional(),\n      })\n      .optional(),\n  })\n  .optional();\n\nexport const resourceGroupSchema = z\n  .array(\n    z.object({\n      id: z.string().optional(),\n      title: z.string().optional(),\n      items: z.array(resourcePointerSchema),\n      limit: z.number().optional().default(10),\n      sidebar: z.boolean().optional().default(true),\n    })\n  )\n  .optional();\n\nexport const catalogMetadataSchema = z\n  .object({\n    path: z.string(),\n    filePath: z.string(),\n    astroContentFilePath: z.string(),\n    publicPath: z.string(),\n    type: z.string(),\n  })\n  .optional();\n\nexport const baseSchema = z.object({\n  id: z.string(),\n  name: z.string(),\n  summary: z.string().optional(),\n  version: semverSchema,\n  draft: z.union([z.boolean(), z.object({ title: z.string().optional(), message: z.string() })]).optional(),\n  badges: z.array(badgeSchema).optional(),\n  owners: z.array(ownerReferenceSchema).optional(),\n  schemaPath: z.string().optional(),\n  sidebar: sidebarSchema,\n  repository: repositorySchema.optional(),\n  specifications: specificationSchema.optional(),\n  hidden: z.boolean().optional(),\n  editUrl: z.string().optional(),\n  resourceGroups: resourceGroupSchema,\n  styles: stylesSchema,\n  deprecated: deprecatedSchema.optional(),\n  visualiser: z.boolean().optional(),\n  attachments: z\n    .array(\n      z.union([\n        z.string().url(),\n        z.object({\n          url: z.string().url(),\n          title: z.string().optional(),\n          type: z.string().optional(),\n          description: z.string().optional(),\n          icon: z.string().optional(),\n        }),\n      ])\n    )\n    .optional(),\n  diagrams: z.array(pointerSchema).optional(),\n  versions: z.array(z.string()).optional(),\n  latestVersion: z.string().optional(),\n  catalog: catalogMetadataSchema,\n});\n","import { z } from 'zod';\nimport { baseSchema, pointerSchema, receivesPointerSchema, sendsPointerSchema, detailPanelPropertySchema } from './common';\n\nexport const domainSchema = z\n  .object({\n    services: z.array(pointerSchema).optional(),\n    agents: z.array(pointerSchema).optional(),\n    domains: z.array(pointerSchema).optional(),\n    systems: z.array(pointerSchema).optional(),\n    entities: z.array(pointerSchema).optional(),\n    'data-products': z.array(pointerSchema).optional(),\n    dataProducts: z.array(pointerSchema).optional(),\n    flows: z.array(pointerSchema).optional(),\n    sends: z.array(sendsPointerSchema).optional(),\n    receives: z.array(receivesPointerSchema).optional(),\n    detailsPanel: z\n      .object({\n        parentDomains: detailPanelPropertySchema,\n        subdomains: detailPanelPropertySchema,\n        systems: detailPanelPropertySchema,\n        services: detailPanelPropertySchema,\n        agents: detailPanelPropertySchema,\n        entities: detailPanelPropertySchema,\n        messages: detailPanelPropertySchema,\n        ubiquitousLanguage: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema, pointerSchema } from './common';\n\nconst systemRelationshipPointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n  label: z.string().optional(),\n});\n\nconst systemActorRelationshipSchema = z.object({\n  id: z.string(),\n  name: z.string().optional(),\n  label: z.string().optional(),\n  direction: z.enum(['inbound', 'outbound']).optional().default('inbound'),\n});\n\nexport const systemSchema = z\n  .object({\n    scope: z.enum(['internal', 'external']).optional().default('internal'),\n    services: z.array(pointerSchema).optional(),\n    flows: z.array(pointerSchema).optional(),\n    entities: z.array(pointerSchema).optional(),\n    containers: z.array(pointerSchema).optional(),\n    relationships: z.array(systemRelationshipPointerSchema).optional(),\n    actors: z.array(systemActorRelationshipSchema).optional(),\n    detailsPanel: z\n      .object({\n        versions: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n        services: detailPanelPropertySchema,\n        flows: detailPanelPropertySchema,\n        entities: detailPanelPropertySchema,\n        containers: detailPanelPropertySchema,\n        diagrams: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, pointerSchema, receivesPointerSchema, sendsPointerSchema, detailPanelPropertySchema } from './common';\n\nexport const serviceSchema = z\n  .object({\n    sends: z.array(sendsPointerSchema).optional(),\n    receives: z.array(receivesPointerSchema).optional(),\n    entities: z.array(pointerSchema).optional(),\n    writesTo: z.array(pointerSchema).optional(),\n    readsFrom: z.array(pointerSchema).optional(),\n    flows: z.array(pointerSchema).optional(),\n    externalSystem: z.boolean().optional(),\n    detailsPanel: z\n      .object({\n        domains: detailPanelPropertySchema,\n        messages: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        specifications: detailPanelPropertySchema,\n        entities: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        containers: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, channelPointerSchema, detailPanelPropertySchema } from './common';\n\nconst operationSchema = z\n  .object({\n    method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).optional(),\n    path: z.string().optional(),\n    statusCodes: z.array(z.string()).optional(),\n  })\n  .optional();\n\nconst messageDetailsPanelSchema = z\n  .object({\n    producers: detailPanelPropertySchema,\n    consumers: detailPanelPropertySchema,\n    channels: detailPanelPropertySchema,\n    versions: detailPanelPropertySchema,\n    repository: detailPanelPropertySchema,\n    owners: detailPanelPropertySchema,\n    changelog: detailPanelPropertySchema,\n    attachments: detailPanelPropertySchema,\n  })\n  .optional();\n\nconst baseMessageSchema = z\n  .object({\n    operation: operationSchema,\n    producers: z.array(z.any()).optional(), // reference('services')\n    consumers: z.array(z.any()).optional(), // reference('services')\n    channels: z.array(channelPointerSchema).optional(),\n    schemas: z\n      .array(\n        z.object({\n          id: z.string().optional(),\n          ref: z.string().optional(),\n          file: z.string().optional(),\n          path: z.string().optional(),\n          name: z.string().optional(),\n          format: z.string().optional(),\n          environments: z.array(z.string()).optional(),\n          default: z.boolean().optional(),\n        })\n      )\n      .optional(),\n    messageChannels: z.array(z.any()).optional(), // reference('channels')\n    detailsPanel: messageDetailsPanelSchema,\n  })\n  .merge(baseSchema);\n\nexport const eventSchema = baseMessageSchema;\nexport const commandSchema = baseMessageSchema;\nexport const querySchema = baseMessageSchema;\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema, pointerSchema, channelPointerSchema } from './common';\n\nconst parameterSchema = z.object({\n  enum: z.array(z.string()).optional(),\n  default: z.string().optional(),\n  examples: z.array(z.string()).optional(),\n  description: z.string().optional(),\n});\n\nexport const channelSchema = z\n  .object({\n    channels: z.array(channelPointerSchema).optional(),\n    address: z.string().optional(),\n    protocols: z.array(z.string()).optional(),\n    deliveryGuarantee: z.enum(['at-most-once', 'at-least-once', 'exactly-once']).optional(),\n    routes: z.array(channelPointerSchema).optional(),\n    parameters: z.record(parameterSchema).optional(),\n    messages: z.array(z.object({ collection: z.string(), name: z.string(), ...pointerSchema.shape })).optional(),\n    detailsPanel: z\n      .object({\n        producers: detailPanelPropertySchema,\n        consumers: detailPanelPropertySchema,\n        messages: detailPanelPropertySchema,\n        protocols: detailPanelPropertySchema,\n        parameters: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, pointerSchema } from './common';\n\nconst flowStep = z\n  .union([\n    z.union([z.string(), z.number()]),\n    z\n      .object({\n        id: z.union([z.string(), z.number()]),\n        label: z.string().optional(),\n      })\n      .optional(),\n  ])\n  .optional();\n\nconst flowStepSchema = z\n  .object({\n    id: z.union([z.string(), z.number()]),\n    type: z.enum(['node', 'message', 'agent', 'user', 'actor']).optional(),\n    title: z.string(),\n    summary: z.string().optional(),\n    message: pointerSchema.optional(),\n    agent: pointerSchema.optional(),\n    service: pointerSchema.optional(),\n    flow: pointerSchema.optional(),\n    container: pointerSchema.optional(),\n    dataProduct: pointerSchema.optional(),\n    actor: z\n      .object({\n        name: z.string(),\n        summary: z.string().optional(),\n      })\n      .optional(),\n    custom: z\n      .object({\n        title: z.string(),\n        icon: z.string().optional(),\n        type: z.string().optional(),\n        summary: z.string().optional(),\n        url: z.string().url().optional(),\n        color: z.string().optional(),\n        properties: z.record(z.union([z.string(), z.number()])).optional(),\n        height: z.number().optional(),\n        menu: z\n          .array(\n            z.object({\n              label: z.string(),\n              url: z.string().url().optional(),\n            })\n          )\n          .optional(),\n      })\n      .optional(),\n    externalSystem: z\n      .object({\n        name: z.string(),\n        summary: z.string().optional(),\n        url: z.string().url().optional(),\n      })\n      .optional(),\n    next_step: flowStep,\n    next_steps: z.array(flowStep).optional(),\n  })\n  .refine((data) => {\n    if (data.next_step && data.next_steps) return false;\n    const typesUsed = [\n      data.message,\n      data.agent,\n      data.service,\n      data.flow,\n      data.container,\n      data.dataProduct,\n      data.actor,\n      data.custom,\n    ].filter((v) => v).length;\n    return typesUsed === 0 || typesUsed === 1;\n  });\n\nexport const flowSchema = z\n  .object({\n    steps: z.array(flowStepSchema),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema } from './common';\n\nexport interface EntityPropertySchema {\n  name: string;\n  type: string;\n  required?: boolean;\n  description?: string;\n  references?: string;\n  referencesIdentifier?: string;\n  referenceTarget?: 'entity';\n  relationType?: string;\n  enum?: string[];\n  properties?: EntityPropertySchema[];\n  items?: {\n    type: string;\n    properties?: EntityPropertySchema[];\n  };\n}\n\nconst propertySchema: z.ZodType<EntityPropertySchema> = z.lazy(() =>\n  z.object({\n    name: z.string(),\n    type: z.string(),\n    required: z.boolean().optional(),\n    description: z.string().optional(),\n    references: z.string().optional(),\n    referencesIdentifier: z.string().optional(),\n    referenceTarget: z.literal('entity').optional(),\n    relationType: z.string().optional(),\n    enum: z.array(z.string()).optional(),\n    properties: z.array(propertySchema).optional(),\n    items: z\n      .object({\n        type: z.string(),\n        properties: z.array(propertySchema).optional(),\n      })\n      .optional(),\n  })\n);\n\nexport const entitySchema = z\n  .object({\n    aggregateRoot: z.boolean().optional(),\n    identifier: z.string().optional(),\n    properties: z.array(propertySchema).optional(),\n    services: z.array(z.any()).optional(), // reference('services')\n    domains: z.array(z.any()).optional(), // reference('domains')\n    detailsPanel: z\n      .object({\n        domains: detailPanelPropertySchema,\n        services: detailPanelPropertySchema,\n        messages: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\n\nexport const userSchema = z.object({\n  id: z.string(),\n  name: z.string(),\n  avatarUrl: z.string().optional(),\n  role: z.string().optional(),\n  hidden: z.boolean().optional(),\n  source: z\n    .object({\n      provider: z.string(),\n      id: z.string().optional(),\n      url: z.string().optional(),\n    })\n    .optional(),\n  readOnly: z.boolean().optional(),\n  email: z.string().email().optional(),\n  slackDirectMessageUrl: z.string().optional(),\n  msTeamsDirectMessageUrl: z.string().optional(),\n  ownedAgents: z.array(z.any()).optional(), // reference('agents')\n  ownedDomains: z.array(z.any()).optional(), // reference('domains')\n  ownedSystems: z.array(z.any()).optional(), // reference('systems')\n  ownedServices: z.array(z.any()).optional(), // reference('services')\n  ownedEvents: z.array(z.any()).optional(), // reference('events')\n  ownedCommands: z.array(z.any()).optional(), // reference('commands')\n  ownedQueries: z.array(z.any()).optional(), // reference('queries')\n  associatedTeams: z.array(z.any()).optional(), // reference('teams')\n});\n","import { z } from 'zod';\n\nexport const teamSchema = z.object({\n  id: z.string(),\n  name: z.string(),\n  summary: z.string().optional(),\n  email: z.string().email().optional(),\n  hidden: z.boolean().optional(),\n  source: z\n    .object({\n      provider: z.string(),\n      id: z.string().optional(),\n      url: z.string().optional(),\n    })\n    .optional(),\n  readOnly: z.boolean().optional(),\n  slackDirectMessageUrl: z.string().optional(),\n  msTeamsDirectMessageUrl: z.string().optional(),\n  members: z.array(z.any()).optional(), // reference('users')\n  ownedAgents: z.array(z.any()).optional(), // reference('agents')\n  ownedCommands: z.array(z.any()).optional(), // reference('commands')\n  ownedQueries: z.array(z.any()).optional(), // reference('queries')\n  ownedDomains: z.array(z.any()).optional(), // reference('domains')\n  ownedSystems: z.array(z.any()).optional(), // reference('systems')\n  ownedServices: z.array(z.any()).optional(), // reference('services')\n  ownedEvents: z.array(z.any()).optional(), // reference('events')\n});\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema, pointerSchema, receivesPointerSchema, sendsPointerSchema } from './common';\n\nconst agentToolSchema = z.object({\n  name: z.string(),\n  type: z.string(),\n  icon: z.string().optional(),\n  url: z.string().optional(),\n  description: z.string().optional(),\n});\n\nconst agentModelSchema = z.object({\n  provider: z.string().optional(),\n  name: z.string().optional(),\n  version: z.string().optional(),\n});\n\nexport const agentSchema = z\n  .object({\n    sends: z.array(sendsPointerSchema).optional(),\n    receives: z.array(receivesPointerSchema).optional(),\n    writesTo: z.array(pointerSchema).optional(),\n    readsFrom: z.array(pointerSchema).optional(),\n    flows: z.array(pointerSchema).optional(),\n    model: agentModelSchema.optional(),\n    tools: z.array(agentToolSchema).optional(),\n    specifications: z.undefined().optional(),\n    detailsPanel: z\n      .object({\n        domains: detailPanelPropertySchema,\n        messages: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        containers: detailPanelPropertySchema,\n        tools: detailPanelPropertySchema,\n        model: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema.omit({ specifications: true }));\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema, pointerSchema, resourcePointerSchema } from './common';\n\nexport const adrSchema = z\n  .object({\n    status: z.enum(['proposed', 'accepted', 'rejected', 'deprecated', 'superseded']),\n    date: z.coerce.date(),\n    decisionMakers: z.array(z.any()).optional(),\n    appliesTo: z.array(resourcePointerSchema).optional(),\n    supersedes: z.array(pointerSchema).optional(),\n    supersededBy: z.array(pointerSchema).optional(),\n    amends: z.array(pointerSchema).optional(),\n    amendedBy: z.array(pointerSchema).optional(),\n    related: z.array(pointerSchema).optional(),\n    detailsPanel: z\n      .object({\n        status: detailPanelPropertySchema,\n        date: detailPanelPropertySchema,\n        decisionMakers: detailPanelPropertySchema,\n        appliesTo: detailPanelPropertySchema,\n        relationships: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema } from './common';\n\nexport const containerSchema = z\n  .object({\n    container_type: z.enum([\n      'database',\n      'cache',\n      'objectStore',\n      'searchIndex',\n      'dataWarehouse',\n      'dataLake',\n      'externalSaaS',\n      'other',\n    ]),\n    technology: z.string().optional(),\n    authoritative: z.boolean().optional().default(false),\n    access_mode: z.enum(['read', 'write', 'readWrite', 'appendOnly']).optional(),\n    classification: z.enum(['public', 'internal', 'confidential', 'regulated']).optional(),\n    residency: z.string().optional(),\n    retention: z.string().optional(),\n    detailsPanel: z\n      .object({\n        versions: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n        services: detailPanelPropertySchema,\n        flows: detailPanelPropertySchema,\n      })\n      .optional(),\n    services: z.array(z.any()).optional(),\n    servicesThatWriteToContainer: z.array(z.any()).optional(),\n    servicesThatReadFromContainer: z.array(z.any()).optional(),\n    dataProductsThatWriteToContainer: z.array(z.any()).optional(),\n    dataProductsThatReadFromContainer: z.array(z.any()).optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema, pointerSchema } from './common';\n\nconst dataProductOutputPointerSchema = z.object({\n  id: z.string(),\n  version: z.string().optional().default('latest'),\n  contract: z\n    .object({\n      path: z.string(),\n      name: z.string(),\n      type: z.string().optional(),\n    })\n    .optional(),\n});\n\nexport const dataProductSchema = z\n  .object({\n    inputs: z.array(pointerSchema).optional(),\n    outputs: z.array(dataProductOutputPointerSchema).optional(),\n    detailsPanel: z\n      .object({\n        domains: detailPanelPropertySchema,\n        inputs: detailPanelPropertySchema,\n        outputs: detailPanelPropertySchema,\n        versions: detailPanelPropertySchema,\n        repository: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        flows: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","import { z } from 'zod';\nimport { baseSchema, detailPanelPropertySchema } from './common';\n\nexport const diagramSchema = z\n  .object({\n    detailsPanel: z\n      .object({\n        versions: detailPanelPropertySchema,\n        owners: detailPanelPropertySchema,\n        changelog: detailPanelPropertySchema,\n        attachments: detailPanelPropertySchema,\n      })\n      .optional(),\n  })\n  .merge(baseSchema);\n","export * from './common';\nexport * from './domain';\nexport * from './system';\nexport * from './service';\nexport * from './message';\nexport * from './channel';\nexport * from './flow';\nexport * from './entity';\nexport * from './user';\nexport * from './team';\nexport * from './agent';\nexport * from './adr';\nexport * from './container';\nexport * from './data-product';\nexport * from './diagram';\nexport * from './data-store';\n\nimport { domainSchema } from './domain';\nimport { systemSchema } from './system';\nimport { serviceSchema } from './service';\nimport { eventSchema, commandSchema, querySchema } from './message';\nimport { channelSchema } from './channel';\nimport { flowSchema } from './flow';\nimport { entitySchema } from './entity';\nimport { userSchema } from './user';\nimport { teamSchema } from './team';\nimport { agentSchema } from './agent';\nimport { adrSchema } from './adr';\nimport { containerSchema } from './container';\nimport { dataProductSchema } from './data-product';\nimport { diagramSchema } from './diagram';\nimport { dataStoreSchema } from './data-store';\n\nexport const schemas = {\n  domain: domainSchema,\n  system: systemSchema,\n  service: serviceSchema,\n  agent: agentSchema,\n  adr: adrSchema,\n  event: eventSchema,\n  command: commandSchema,\n  query: querySchema,\n  channel: channelSchema,\n  flow: flowSchema,\n  entity: entitySchema,\n  container: containerSchema,\n  dataProduct: dataProductSchema,\n  diagram: diagramSchema,\n  user: userSchema,\n  team: teamSchema,\n  // Backwards-compatible alias for older linter integrations.\n  dataStore: dataStoreSchema,\n} as const;\n\nexport type ResourceType = keyof typeof schemas;\n","import { ParsedFile } from '../parser';\nimport { ValidationError, ResourceReference } from '../types';\nimport { ResourceType } from '../schemas';\nimport { CatalogDependencies } from '../config';\nimport semver from 'semver';\n\ninterface ResourceIndex {\n  [resourceType: string]: {\n    [resourceId: string]: Set<string>;\n  };\n}\n\nconst MESSAGE_TYPES: ResourceType[] = ['event', 'command', 'query'];\n\nconst RESOURCE_TYPE_ALIASES: Partial<Record<ResourceType, ResourceType[]>> = {\n  container: ['container', 'dataStore'],\n  dataStore: ['container', 'dataStore'],\n};\n\nconst normalizeResourceType = (type: unknown): ResourceType | undefined => {\n  if (typeof type !== 'string') return undefined;\n\n  const normalizedTypes: Record<string, ResourceType> = {\n    agent: 'agent',\n    agents: 'agent',\n    adr: 'adr',\n    adrs: 'adr',\n    service: 'service',\n    services: 'service',\n    event: 'event',\n    events: 'event',\n    command: 'command',\n    commands: 'command',\n    query: 'query',\n    queries: 'query',\n    flow: 'flow',\n    flows: 'flow',\n    channel: 'channel',\n    channels: 'channel',\n    domain: 'domain',\n    domains: 'domain',\n    system: 'system',\n    systems: 'system',\n    user: 'user',\n    users: 'user',\n    team: 'team',\n    teams: 'team',\n    container: 'container',\n    containers: 'container',\n    dataStore: 'container',\n    dataStores: 'container',\n    'data-product': 'dataProduct',\n    'data-products': 'dataProduct',\n    dataProduct: 'dataProduct',\n    dataProducts: 'dataProduct',\n    entity: 'entity',\n    entities: 'entity',\n    diagram: 'diagram',\n    diagrams: 'diagram',\n  };\n\n  return normalizedTypes[type];\n};\n\nconst getReference = (value: unknown): ResourceReference | undefined => {\n  if (typeof value === 'string') {\n    return { id: value };\n  }\n\n  if (!value || typeof value !== 'object') {\n    return undefined;\n  }\n\n  const ref = value as Record<string, unknown>;\n  if (typeof ref.id !== 'string') {\n    return undefined;\n  }\n\n  return {\n    id: ref.id,\n    version: typeof ref.version === 'string' ? ref.version : undefined,\n  };\n};\n\nconst addReference = (references: ReferenceInfo[], value: unknown, possibleTypes: ResourceType[], field: string): void => {\n  const ref = getReference(value);\n  if (ref) {\n    references.push({ ref, possibleTypes, field });\n  }\n};\n\nconst addReferences = (references: ReferenceInfo[], values: unknown, possibleTypes: ResourceType[], field: string): void => {\n  if (!Array.isArray(values)) return;\n  values.forEach((value) => {\n    addReference(references, value, possibleTypes, field);\n  });\n};\n\nconst addTypedReference = (references: ReferenceInfo[], value: unknown, field: string): void => {\n  if (!value || typeof value !== 'object') return;\n  const resourceType = normalizeResourceType((value as Record<string, unknown>).type);\n  if (!resourceType) return;\n  addReference(references, value, [resourceType], field);\n};\n\nexport const buildResourceIndex = (parsedFiles: ParsedFile[], dependencies?: CatalogDependencies): ResourceIndex => {\n  const index: ResourceIndex = {};\n\n  for (const parsedFile of parsedFiles) {\n    const { file, frontmatter } = parsedFile;\n    const { resourceType } = file;\n\n    // Use the frontmatter id field if present, otherwise fall back to filename/directory\n    // This handles cases where:\n    // - Filename is \"aSmith.mdx\" but frontmatter has id: \"asmith\"\n    // - Directory is \"e-commerce\" but frontmatter has id: \"E-Commerce\"\n    // - Directory is \"UserService\" but frontmatter has id: \"user-service\" (SentenceCase vs kebab-case)\n    let resourceId = file.resourceId;\n    if (frontmatter.id && typeof frontmatter.id === 'string') {\n      resourceId = frontmatter.id;\n    }\n\n    if (!index[resourceType]) {\n      index[resourceType] = {};\n    }\n\n    if (!index[resourceType][resourceId]) {\n      index[resourceType][resourceId] = new Set();\n    }\n\n    if (frontmatter.version && typeof frontmatter.version === 'string') {\n      index[resourceType][resourceId].add(frontmatter.version);\n    } else {\n      index[resourceType][resourceId].add('latest');\n    }\n  }\n\n  // Add dependency entries to the index\n  if (dependencies) {\n    for (const [resourceType, entries] of Object.entries(dependencies)) {\n      if (!index[resourceType]) {\n        index[resourceType] = {};\n      }\n      for (const entry of entries) {\n        if (!index[resourceType][entry.id]) {\n          index[resourceType][entry.id] = new Set();\n        }\n        index[resourceType][entry.id].add(entry.version || 'latest');\n      }\n    }\n  }\n\n  return index;\n};\n\nconst checkResourceExists = (ref: ResourceReference, resourceType: ResourceType, index: ResourceIndex): boolean => {\n  const resourceTypes = RESOURCE_TYPE_ALIASES[resourceType] || [resourceType];\n  const resourceVersions = new Set<string>();\n\n  for (const type of resourceTypes) {\n    const versions = index[type]?.[ref.id];\n    if (versions) {\n      versions.forEach((version) => resourceVersions.add(version));\n    }\n  }\n\n  if (!resourceVersions || resourceVersions.size === 0) {\n    return false;\n  }\n\n  if (!ref.version) {\n    return true;\n  }\n\n  const refVersion = ref.version === 'latest' ? ref.version : ref.version;\n  const availableVersions = Array.from(resourceVersions);\n\n  // Handle 'latest' specifically\n  if (refVersion === 'latest') {\n    return availableVersions.includes('latest') || availableVersions.length > 0;\n  }\n\n  // Check for exact match first\n  if (availableVersions.includes(refVersion)) {\n    return true;\n  }\n\n  // Handle semver patterns like '0.0.x', '^1.0.0', '~1.2.0', etc.\n  try {\n    // Filter out 'latest' from available versions for semver matching\n    const semverVersions = availableVersions.filter((v) => v !== 'latest' && semver.valid(v));\n\n    // Check if any available version satisfies the requested version pattern\n    for (const availableVersion of semverVersions) {\n      if (semver.satisfies(availableVersion, refVersion)) {\n        return true;\n      }\n    }\n\n    // Special handling for patterns like '0.0.x' which aren't standard semver ranges\n    if (refVersion.includes('.x')) {\n      const pattern = refVersion.replace(/\\.x/g, '');\n      for (const availableVersion of semverVersions) {\n        if (availableVersion.startsWith(pattern)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  } catch (error) {\n    // If semver parsing fails, fall back to exact string match\n    return availableVersions.includes(refVersion);\n  }\n};\n\ninterface ReferenceInfo {\n  ref: ResourceReference;\n  possibleTypes: ResourceType[];\n  field: string;\n}\n\nconst extractReferences = (parsedFile: ParsedFile): ReferenceInfo[] => {\n  const { file, frontmatter } = parsedFile;\n  const references: ReferenceInfo[] = [];\n\n  if (frontmatter.owners && Array.isArray(frontmatter.owners)) {\n    frontmatter.owners.forEach((owner: unknown, index: number) => {\n      if (owner && typeof owner === 'object' && 'collection' in owner) {\n        const ownerType = normalizeResourceType((owner as Record<string, unknown>).collection);\n        if (ownerType) {\n          addReference(references, owner, [ownerType], `owners[${index}]`);\n          return;\n        }\n      }\n      addReference(references, owner, ['user', 'team'], `owners[${index}]`);\n    });\n  }\n\n  addReferences(references, frontmatter.diagrams, ['diagram'], 'diagrams');\n\n  if (frontmatter.resourceGroups && Array.isArray(frontmatter.resourceGroups)) {\n    frontmatter.resourceGroups.forEach((group: unknown, groupIndex: number) => {\n      if (!group || typeof group !== 'object') return;\n      const items = (group as Record<string, unknown>).items;\n      if (!Array.isArray(items)) return;\n      items.forEach((item, itemIndex) =>\n        addTypedReference(references, item, `resourceGroups[${groupIndex}].items[${itemIndex}]`)\n      );\n    });\n  }\n\n  if (file.resourceType === 'domain') {\n    addReferences(references, frontmatter.services, ['service'], 'services');\n    addReferences(references, frontmatter.agents, ['agent'], 'agents');\n    addReferences(references, frontmatter.domains, ['domain'], 'domains');\n    addReferences(references, frontmatter.systems, ['system'], 'systems');\n    addReferences(references, frontmatter.entities, ['entity'], 'entities');\n    addReferences(references, frontmatter['data-products'], ['dataProduct'], 'data-products');\n    addReferences(references, frontmatter.dataProducts, ['dataProduct'], 'dataProducts');\n    addReferences(references, frontmatter.flows, ['flow'], 'flows');\n    addReferences(references, frontmatter.sends, MESSAGE_TYPES, 'sends');\n    addReferences(references, frontmatter.receives, MESSAGE_TYPES, 'receives');\n  }\n\n  if (file.resourceType === 'service' || file.resourceType === 'agent') {\n    addReferences(references, frontmatter.sends, MESSAGE_TYPES, 'sends');\n    addReferences(references, frontmatter.receives, MESSAGE_TYPES, 'receives');\n    if (frontmatter.writesTo && Array.isArray(frontmatter.writesTo)) {\n      frontmatter.writesTo.forEach((ref: unknown) => addReference(references, ref, ['container'], 'writesTo'));\n    }\n    if (frontmatter.readsFrom && Array.isArray(frontmatter.readsFrom)) {\n      frontmatter.readsFrom.forEach((ref: unknown) => addReference(references, ref, ['container'], 'readsFrom'));\n    }\n    addReferences(references, frontmatter.flows, ['flow'], 'flows');\n  }\n\n  if (file.resourceType === 'service') {\n    addReferences(references, frontmatter.entities, ['entity'], 'entities');\n  }\n\n  if (file.resourceType === 'system') {\n    addReferences(references, frontmatter.services, ['service'], 'services');\n    addReferences(references, frontmatter.flows, ['flow'], 'flows');\n    addReferences(references, frontmatter.entities, ['entity'], 'entities');\n    addReferences(references, frontmatter.containers, ['container'], 'containers');\n    addReferences(references, frontmatter.relationships, ['system'], 'relationships');\n  }\n\n  if (file.resourceType === 'flow' && frontmatter.steps && Array.isArray(frontmatter.steps)) {\n    frontmatter.steps.forEach((step: Record<string, unknown>, index: number) => {\n      if (step.message) {\n        addReference(references, step.message, MESSAGE_TYPES, `steps[${index}].message`);\n      }\n      if (step.service) {\n        addReference(references, step.service, ['service'], `steps[${index}].service`);\n      }\n      if (step.agent) {\n        addReference(references, step.agent, ['agent'], `steps[${index}].agent`);\n      }\n      if (step.flow) {\n        addReference(references, step.flow, ['flow'], `steps[${index}].flow`);\n      }\n      if (step.container) {\n        addReference(references, step.container, ['container'], `steps[${index}].container`);\n      }\n      if (step.dataProduct) {\n        addReference(references, step.dataProduct, ['dataProduct'], `steps[${index}].dataProduct`);\n      }\n    });\n  }\n\n  if (file.resourceType === 'entity' && frontmatter.properties && Array.isArray(frontmatter.properties)) {\n    frontmatter.properties.forEach((prop: Record<string, unknown>, index: number) => {\n      if (prop.references) {\n        references.push({\n          ref: { id: prop.references as string },\n          possibleTypes: ['entity'],\n          field: `properties[${index}].references`,\n        });\n      }\n    });\n    addReferences(references, frontmatter.services, ['service'], 'services');\n    addReferences(references, frontmatter.domains, ['domain'], 'domains');\n  }\n\n  if (MESSAGE_TYPES.includes(file.resourceType)) {\n    addReferences(references, frontmatter.producers, ['service'], 'producers');\n    addReferences(references, frontmatter.consumers, ['service'], 'consumers');\n    addReferences(references, frontmatter.channels, ['channel'], 'channels');\n    addReferences(references, frontmatter.messageChannels, ['channel'], 'messageChannels');\n  }\n\n  if (file.resourceType === 'channel') {\n    addReferences(references, frontmatter.channels, ['channel'], 'channels');\n    addReferences(references, frontmatter.routes, ['channel'], 'routes');\n    if (frontmatter.messages && Array.isArray(frontmatter.messages)) {\n      frontmatter.messages.forEach((message: unknown, index: number) => {\n        if (!message || typeof message !== 'object') return;\n        const messageType = normalizeResourceType((message as Record<string, unknown>).collection);\n        if (messageType && MESSAGE_TYPES.includes(messageType)) {\n          addReference(references, message, [messageType], `messages[${index}]`);\n        }\n      });\n    }\n  }\n\n  if (file.resourceType === 'container' || file.resourceType === 'dataStore') {\n    addReferences(references, frontmatter.services, ['service'], 'services');\n    addReferences(references, frontmatter.servicesThatWriteToContainer, ['service'], 'servicesThatWriteToContainer');\n    addReferences(references, frontmatter.servicesThatReadFromContainer, ['service'], 'servicesThatReadFromContainer');\n    addReferences(references, frontmatter.dataProductsThatWriteToContainer, ['dataProduct'], 'dataProductsThatWriteToContainer');\n    addReferences(\n      references,\n      frontmatter.dataProductsThatReadFromContainer,\n      ['dataProduct'],\n      'dataProductsThatReadFromContainer'\n    );\n  }\n\n  if (file.resourceType === 'dataProduct') {\n    const dataProductLinkTypes: ResourceType[] = [\n      'event',\n      'command',\n      'query',\n      'service',\n      'agent',\n      'system',\n      'container',\n      'channel',\n      'dataProduct',\n    ];\n    addReferences(references, frontmatter.inputs, dataProductLinkTypes, 'inputs');\n    addReferences(references, frontmatter.outputs, dataProductLinkTypes, 'outputs');\n  }\n\n  if (file.resourceType === 'adr') {\n    if (frontmatter.decisionMakers && Array.isArray(frontmatter.decisionMakers)) {\n      frontmatter.decisionMakers.forEach((owner: unknown, index: number) => {\n        addReference(references, owner, ['user', 'team'], `decisionMakers[${index}]`);\n      });\n    }\n    if (frontmatter.appliesTo && Array.isArray(frontmatter.appliesTo)) {\n      frontmatter.appliesTo.forEach((target: unknown, index: number) => {\n        addTypedReference(references, target, `appliesTo[${index}]`);\n      });\n    }\n    addReferences(references, frontmatter.supersedes, ['adr'], 'supersedes');\n    addReferences(references, frontmatter.supersededBy, ['adr'], 'supersededBy');\n    addReferences(references, frontmatter.amends, ['adr'], 'amends');\n    addReferences(references, frontmatter.amendedBy, ['adr'], 'amendedBy');\n    addReferences(references, frontmatter.related, ['adr'], 'related');\n  }\n\n  if (file.resourceType === 'team' && frontmatter.members && Array.isArray(frontmatter.members)) {\n    frontmatter.members.forEach((member: unknown, index: number) => {\n      addReference(references, member, ['user'], `members[${index}]`);\n    });\n  }\n\n  if (file.resourceType === 'user' || file.resourceType === 'team') {\n    addReferences(references, frontmatter.ownedAgents, ['agent'], 'ownedAgents');\n    addReferences(references, frontmatter.ownedDomains, ['domain'], 'ownedDomains');\n    addReferences(references, frontmatter.ownedSystems, ['system'], 'ownedSystems');\n    addReferences(references, frontmatter.ownedServices, ['service'], 'ownedServices');\n    addReferences(references, frontmatter.ownedEvents, ['event'], 'ownedEvents');\n    addReferences(references, frontmatter.ownedCommands, ['command'], 'ownedCommands');\n    addReferences(references, frontmatter.ownedQueries, ['query'], 'ownedQueries');\n  }\n\n  if (file.resourceType === 'user') {\n    addReferences(references, frontmatter.associatedTeams, ['team'], 'associatedTeams');\n  }\n\n  return references;\n};\n\n// Extract channel references from sends/receives to/from arrays\nconst extractChannelReferences = (parsedFile: ParsedFile): ReferenceInfo[] => {\n  const { file, frontmatter } = parsedFile;\n  const references: ReferenceInfo[] = [];\n\n  if (file.resourceType !== 'service' && file.resourceType !== 'domain' && file.resourceType !== 'agent') {\n    return references;\n  }\n\n  const extractFromPointers = (pointers: any[], parentField: string) => {\n    if (!Array.isArray(pointers)) return;\n    pointers.forEach((pointer: any, idx: number) => {\n      if (pointer.to && Array.isArray(pointer.to)) {\n        pointer.to.forEach((channelRef: any, cIdx: number) => {\n          if (channelRef && channelRef.id) {\n            references.push({\n              ref: { id: channelRef.id, version: channelRef.version },\n              possibleTypes: ['channel'],\n              field: `${parentField}[${idx}].to[${cIdx}]`,\n            });\n          }\n        });\n      }\n      if (pointer.from && Array.isArray(pointer.from)) {\n        pointer.from.forEach((channelRef: any, cIdx: number) => {\n          if (channelRef && channelRef.id) {\n            references.push({\n              ref: { id: channelRef.id, version: channelRef.version },\n              possibleTypes: ['channel'],\n              field: `${parentField}[${idx}].from[${cIdx}]`,\n            });\n          }\n        });\n      }\n    });\n  };\n\n  if (frontmatter.sends && Array.isArray(frontmatter.sends)) {\n    extractFromPointers(frontmatter.sends, 'sends');\n  }\n  if (frontmatter.receives && Array.isArray(frontmatter.receives)) {\n    extractFromPointers(frontmatter.receives, 'receives');\n  }\n\n  return references;\n};\n\nexport const validateReferences = (parsedFiles: ParsedFile[], dependencies?: CatalogDependencies): ValidationError[] => {\n  const index = buildResourceIndex(parsedFiles, dependencies);\n  const errors: ValidationError[] = [];\n\n  for (const parsedFile of parsedFiles) {\n    const references = extractReferences(parsedFile);\n\n    for (const { ref, possibleTypes, field } of references) {\n      const found = possibleTypes.some((type) => checkResourceExists(ref, type, index));\n\n      if (!found) {\n        const versionStr = ref.version ? ` (version: ${ref.version})` : '';\n        const typeStr = possibleTypes.length === 1 ? possibleTypes[0] : possibleTypes.join('/');\n\n        let rule = 'refs/resource-exists';\n        if (field === 'owners' || field.startsWith('owners[') || field.startsWith('decisionMakers[')) {\n          rule = 'refs/owner-exists';\n        } else if (field === 'writesTo' || field === 'readsFrom' || field.includes('container') || field.includes('Container')) {\n          rule = 'refs/container-exists';\n        } else if (\n          field.includes('channel') ||\n          field.includes('Channel') ||\n          field.includes('.to[') ||\n          field.includes('.from[') ||\n          field === 'routes' ||\n          field.startsWith('routes[')\n        ) {\n          rule = 'refs/channel-exists';\n        } else if (ref.version) {\n          rule = 'refs/valid-version-range';\n        }\n\n        errors.push({\n          type: 'reference',\n          resource: `${parsedFile.file.resourceType}/${parsedFile.file.resourceId}`,\n          field,\n          message: `Referenced ${typeStr} \"${ref.id}\"${versionStr} does not exist`,\n          file: parsedFile.file.relativePath,\n          rule,\n        });\n      }\n    }\n\n    // Validate channel references from sends/receives to/from\n    const channelRefs = extractChannelReferences(parsedFile);\n    for (const { ref, possibleTypes, field } of channelRefs) {\n      const found = possibleTypes.some((type) => checkResourceExists(ref, type, index));\n\n      if (!found) {\n        const versionStr = ref.version ? ` (version: ${ref.version})` : '';\n        errors.push({\n          type: 'reference',\n          resource: `${parsedFile.file.resourceType}/${parsedFile.file.resourceId}`,\n          field,\n          message: `Referenced channel \"${ref.id}\"${versionStr} does not exist`,\n          file: parsedFile.file.relativePath,\n          rule: 'refs/channel-exists',\n        });\n      }\n    }\n  }\n\n  return errors;\n};\n\n// Detect messages (events/commands/queries) with no producer and no consumer\nexport const validateOrphanMessages = (parsedFiles: ParsedFile[], dependencies?: CatalogDependencies): ValidationError[] => {\n  const errors: ValidationError[] = [];\n  const messageTypes: ResourceType[] = ['event', 'command', 'query'];\n\n  // Collect all message IDs\n  const messageFiles = parsedFiles.filter((pf) => messageTypes.includes(pf.file.resourceType));\n\n  if (messageFiles.length === 0) return errors;\n\n  // Build sets of produced and consumed message IDs\n  const producedMessages = new Set<string>();\n  const consumedMessages = new Set<string>();\n\n  for (const parsedFile of parsedFiles) {\n    const { file, frontmatter } = parsedFile;\n\n    if (file.resourceType === 'service' || file.resourceType === 'domain' || file.resourceType === 'agent') {\n      if (frontmatter.sends && Array.isArray(frontmatter.sends)) {\n        frontmatter.sends.forEach((ref: any) => {\n          if (ref && ref.id) producedMessages.add(ref.id);\n        });\n      }\n      if (frontmatter.receives && Array.isArray(frontmatter.receives)) {\n        frontmatter.receives.forEach((ref: any) => {\n          if (ref && ref.id) consumedMessages.add(ref.id);\n        });\n      }\n    }\n\n    // Also check producers/consumers fields on messages themselves\n    if (messageTypes.includes(file.resourceType)) {\n      if (frontmatter.producers && Array.isArray(frontmatter.producers) && frontmatter.producers.length > 0) {\n        const msgId = (frontmatter.id as string) || file.resourceId;\n        producedMessages.add(msgId);\n      }\n      if (frontmatter.consumers && Array.isArray(frontmatter.consumers) && frontmatter.consumers.length > 0) {\n        const msgId = (frontmatter.id as string) || file.resourceId;\n        consumedMessages.add(msgId);\n      }\n    }\n  }\n\n  // Also consider dependency messages as having producers/consumers\n  if (dependencies) {\n    for (const [type, entries] of Object.entries(dependencies)) {\n      if (messageTypes.includes(type as ResourceType)) {\n        entries.forEach((entry) => {\n          // Dependencies are external, treat them as having both producers and consumers\n          producedMessages.add(entry.id);\n          consumedMessages.add(entry.id);\n        });\n      }\n    }\n  }\n\n  // Check each message for orphan status\n  for (const parsedFile of messageFiles) {\n    const msgId = (parsedFile.frontmatter.id as string) || parsedFile.file.resourceId;\n    const isProduced = producedMessages.has(msgId);\n    const isConsumed = consumedMessages.has(msgId);\n\n    if (!isProduced && !isConsumed) {\n      errors.push({\n        type: 'reference',\n        resource: `${parsedFile.file.resourceType}/${parsedFile.file.resourceId}`,\n        field: 'id',\n        message: `${parsedFile.file.resourceType} \"${msgId}\" has no producer and no consumer`,\n        file: parsedFile.file.relativePath,\n        rule: 'refs/orphan-messages',\n      });\n    }\n  }\n\n  return errors;\n};\n\n// Detect references to deprecated resources\nexport const validateDeprecatedReferences = (parsedFiles: ParsedFile[]): ValidationError[] => {\n  const errors: ValidationError[] = [];\n\n  // Build an index of deprecated resources\n  const deprecatedIndex: Record<string, Set<string>> = {};\n  for (const parsedFile of parsedFiles) {\n    const { file, frontmatter } = parsedFile;\n    if (frontmatter.deprecated && frontmatter.deprecated !== false) {\n      const resourceId = (frontmatter.id as string) || file.resourceId;\n      const key = `${file.resourceType}:${resourceId}`;\n      if (!deprecatedIndex[key]) {\n        deprecatedIndex[key] = new Set();\n      }\n      if (frontmatter.version && typeof frontmatter.version === 'string') {\n        deprecatedIndex[key].add(frontmatter.version);\n      } else {\n        deprecatedIndex[key].add('*'); // All versions deprecated\n      }\n    }\n  }\n\n  if (Object.keys(deprecatedIndex).length === 0) return errors;\n\n  const isDeprecated = (type: string, id: string, version?: string): boolean => {\n    const key = `${type}:${id}`;\n    const versions = deprecatedIndex[key];\n    if (!versions) return false;\n    if (versions.has('*')) return true;\n    if (version && versions.has(version)) return true;\n    // For 'latest' or no version, check if any version is deprecated\n    if (!version || version === 'latest') return versions.size > 0;\n    return false;\n  };\n\n  for (const parsedFile of parsedFiles) {\n    const references = extractReferences(parsedFile);\n\n    for (const { ref, possibleTypes, field } of references) {\n      // Skip owner references for this check\n      if (field === 'owners' || field.startsWith('owners[') || field === 'members' || field.startsWith('members[')) continue;\n\n      for (const type of possibleTypes) {\n        if (isDeprecated(type, ref.id, ref.version)) {\n          const versionStr = ref.version ? ` (version: ${ref.version})` : '';\n          errors.push({\n            type: 'reference',\n            resource: `${parsedFile.file.resourceType}/${parsedFile.file.resourceId}`,\n            field,\n            message: `Referenced ${type} \"${ref.id}\"${versionStr} is deprecated`,\n            file: parsedFile.file.relativePath,\n            rule: 'versions/no-deprecated-references',\n          });\n          break; // Only report once per reference\n        }\n      }\n    }\n  }\n\n  return errors;\n};\n\n// Detect duplicate resource IDs (same type, same id, same version)\nexport const validateDuplicateResourceIds = (parsedFiles: ParsedFile[]): ValidationError[] => {\n  const errors: ValidationError[] = [];\n\n  // Track seen resources: key = \"type:id:version\", value = file path\n  const seen: Record<string, string> = {};\n\n  for (const parsedFile of parsedFiles) {\n    const { file, frontmatter } = parsedFile;\n    const resourceId = (frontmatter.id as string) || file.resourceId;\n    const version = (frontmatter.version as string) || 'latest';\n    const key = `${file.resourceType}:${resourceId}:${version}`;\n\n    if (seen[key]) {\n      errors.push({\n        type: 'reference',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        field: 'id',\n        message: `Duplicate ${file.resourceType} \"${resourceId}\" (version: ${version}) — also defined in ${seen[key]}`,\n        file: file.relativePath,\n        rule: 'structure/duplicate-resource-ids',\n      });\n    } else {\n      seen[key] = file.relativePath;\n    }\n  }\n\n  return errors;\n};\n","import { ParsedFile } from '../parser';\nimport { ValidationError } from '../types';\n\nexport const validateBestPractices = (parsedFiles: ParsedFile[]): ValidationError[] => {\n  const errors: ValidationError[] = [];\n\n  for (const parsedFile of parsedFiles) {\n    const { file, frontmatter, content } = parsedFile;\n\n    // Check for required summary\n    if (!frontmatter.summary || (typeof frontmatter.summary === 'string' && frontmatter.summary.trim() === '')) {\n      errors.push({\n        type: 'schema',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        field: 'summary',\n        message: 'Summary is required for better documentation',\n        file: file.relativePath,\n        severity: 'error',\n        rule: 'best-practices/summary-required',\n      });\n    }\n\n    // Check for required owners (skip users and teams - they are owners, not owned)\n    if (\n      file.resourceType !== 'user' &&\n      file.resourceType !== 'team' &&\n      (!frontmatter.owners || !Array.isArray(frontmatter.owners) || frontmatter.owners.length === 0)\n    ) {\n      errors.push({\n        type: 'schema',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        field: 'owners',\n        message: 'At least one owner is required',\n        file: file.relativePath,\n        severity: 'error',\n        rule: 'best-practices/owner-required',\n      });\n    }\n\n    // Check for required description (markdown body content)\n    if (!content || content.trim() === '') {\n      errors.push({\n        type: 'schema',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        field: 'description',\n        message: 'Resource should have a markdown description (body content) beyond just frontmatter',\n        file: file.relativePath,\n        severity: 'warning',\n        rule: 'best-practices/description-required',\n      });\n    }\n\n    // Check for required schemaPath on messages (events, commands, queries)\n    if (\n      (file.resourceType === 'event' || file.resourceType === 'command' || file.resourceType === 'query') &&\n      !frontmatter.schemaPath\n    ) {\n      errors.push({\n        type: 'schema',\n        resource: `${file.resourceType}/${file.resourceId}`,\n        field: 'schemaPath',\n        message: `${file.resourceType} should have a schemaPath defined for consumers to understand the contract`,\n        file: file.relativePath,\n        severity: 'warning',\n        rule: 'best-practices/schema-required',\n      });\n    }\n  }\n\n  return errors;\n};\n","export * from './schema-validator';\nexport * from './reference-validator';\nexport * from './best-practices-validator';\n\nimport { ParsedFile } from '../parser';\nimport { ValidationError } from '../types';\nimport { CatalogDependencies } from '../config';\nimport { validateAllSchemas } from './schema-validator';\nimport {\n  validateReferences,\n  validateOrphanMessages,\n  validateDeprecatedReferences,\n  validateDuplicateResourceIds,\n} from './reference-validator';\nimport { validateBestPractices } from './best-practices-validator';\n\nexport const validateCatalog = (parsedFiles: ParsedFile[], dependencies?: CatalogDependencies): ValidationError[] => {\n  const schemaErrors = validateAllSchemas(parsedFiles);\n  const referenceErrors = validateReferences(parsedFiles, dependencies);\n  const orphanErrors = validateOrphanMessages(parsedFiles, dependencies);\n  const deprecatedRefErrors = validateDeprecatedReferences(parsedFiles);\n  const duplicateErrors = validateDuplicateResourceIds(parsedFiles);\n  const bestPracticeErrors = validateBestPractices(parsedFiles);\n\n  return [\n    ...schemaErrors,\n    ...referenceErrors,\n    ...orphanErrors,\n    ...deprecatedRefErrors,\n    ...duplicateErrors,\n    ...bestPracticeErrors,\n  ];\n};\n","import chalk from 'chalk';\nimport { ValidationError } from '../types';\nimport { ParseError } from '../parser';\n\nexport interface ReportSummary {\n  totalErrors: number;\n  totalWarnings: number;\n  schemaErrors: number;\n  referenceErrors: number;\n  parseErrors: number;\n  filesChecked: number;\n  filesWithErrors: number;\n}\n\nexport const formatError = (error: ValidationError, showFilename: boolean = true): string => {\n  const lineInfo = error.line ? chalk.dim(`:${error.line}:1`) : '';\n  const filename = showFilename ? `${chalk.dim(error.file)}${lineInfo}` : '';\n\n  const isWarning = error.severity === 'warning';\n  const severity = isWarning ? chalk.yellow('warning') : chalk.red('error');\n  const icon = isWarning ? chalk.yellow('⚠') : chalk.red('✖');\n  const errorCode = getErrorCode(error);\n  const field = error.field ? chalk.dim(`[${error.field}]`) : '';\n\n  const parts = [];\n  if (filename) parts.push(filename);\n  parts.push(icon, severity, error.message, field, chalk.dim(errorCode));\n\n  return parts.filter(Boolean).join(' ');\n};\n\nconst getErrorCode = (error: ValidationError): string => {\n  if (error.rule) {\n    return `(${error.rule})`;\n  }\n\n  // Fallback to generic error codes\n  if (error.type === 'schema') {\n    if (error.field) {\n      if (error.message.includes('Required')) return '(@eventcatalog/required-field)';\n      if (error.message.includes('Expected')) return '(@eventcatalog/invalid-type)';\n      return '(@eventcatalog/schema-validation)';\n    }\n    return '(@eventcatalog/schema)';\n  }\n  if (error.type === 'reference') {\n    return '(@eventcatalog/invalid-reference)';\n  }\n  return '(@eventcatalog/unknown)';\n};\n\nexport const formatParseError = (error: ParseError, showFilename: boolean = true): string => {\n  const filename = showFilename ? chalk.dim(error.file.relativePath) : '';\n  const severity = chalk.red('error');\n  const message = `Parse error: ${error.error.message}`;\n  const errorCode = chalk.dim('(@eventcatalog/parse-error)');\n\n  const parts = [];\n  if (filename) parts.push(filename);\n  parts.push(chalk.red('✖'), severity, message, errorCode);\n\n  return parts.filter(Boolean).join(' ');\n};\n\nexport const groupErrorsByFile = (errors: ValidationError[]): Map<string, ValidationError[]> => {\n  const grouped = new Map<string, ValidationError[]>();\n\n  for (const error of errors) {\n    if (!grouped.has(error.file)) {\n      grouped.set(error.file, []);\n    }\n    grouped.get(error.file)!.push(error);\n  }\n\n  return grouped;\n};\n\nexport const reportErrors = (\n  validationErrors: ValidationError[],\n  parseErrors: ParseError[],\n  verbose: boolean = false\n): ReportSummary => {\n  const allErrors = [\n    ...validationErrors,\n    ...parseErrors.map((pe) => ({\n      type: 'parse' as const,\n      resource: pe.file.resourceType || 'unknown',\n      message: pe.error.message,\n      file: pe.file.relativePath,\n      line: undefined,\n    })),\n  ];\n\n  const schemaErrors = validationErrors.filter((e) => e.type === 'schema');\n  const referenceErrors = validationErrors.filter((e) => e.type === 'reference');\n  const warnings = validationErrors.filter((e) => e.severity === 'warning');\n  const errors = [...validationErrors.filter((e) => e.severity !== 'warning'), ...parseErrors];\n  const totalErrors = errors.length;\n  const totalWarnings = warnings.length;\n\n  if (totalErrors === 0 && totalWarnings === 0) {\n    console.log(chalk.green('✔ No problems found!'));\n    return {\n      totalErrors: 0,\n      totalWarnings: 0,\n      schemaErrors: 0,\n      referenceErrors: 0,\n      parseErrors: 0,\n      filesChecked: 0,\n      filesWithErrors: 0,\n    };\n  }\n\n  const grouped = groupErrorsByFile(validationErrors);\n  const parseErrorsGrouped = groupParseErrorsByFile(parseErrors);\n  const allFiles = new Set([...grouped.keys(), ...parseErrorsGrouped.keys()]);\n\n  console.log(); // Empty line\n\n  // Report by file for better readability\n  for (const file of Array.from(allFiles).sort()) {\n    const fileErrors = grouped.get(file) || [];\n    const fileParseErrors = parseErrorsGrouped.get(file) || [];\n    const fileErrorCount = fileErrors.length + fileParseErrors.length;\n\n    if (fileErrorCount === 0) continue;\n\n    // File header (ESLint-style)\n    console.log(chalk.underline(file));\n\n    // Parse errors first\n    for (const error of fileParseErrors) {\n      console.log(`  ${formatParseError(error, false)}`);\n    }\n\n    // Then validation errors\n    for (const error of fileErrors) {\n      console.log(`  ${formatError(error, false)}`);\n    }\n\n    // File summary\n    const fileWarnings = fileErrors.filter((e) => e.severity === 'warning').length;\n    const fileActualErrors = fileErrorCount - fileWarnings;\n    const problemText = fileErrorCount === 1 ? 'problem' : 'problems';\n    const summaryColor = fileActualErrors > 0 ? chalk.red : chalk.yellow;\n    const summaryIcon = fileActualErrors > 0 ? '✖' : '⚠';\n    console.log(summaryColor(`\\n${summaryIcon} ${fileErrorCount} ${problemText}\\n`));\n  }\n\n  // Overall summary (ESLint-style)\n  const filesWithErrors = allFiles.size;\n  const totalProblems = totalErrors + totalWarnings;\n  const problemText = totalProblems === 1 ? 'problem' : 'problems';\n  const fileText = filesWithErrors === 1 ? 'file' : 'files';\n\n  const summaryColor = totalErrors > 0 ? chalk.red.bold : chalk.yellow.bold;\n  const summaryIcon = totalErrors > 0 ? '✖' : '⚠';\n\n  console.log(summaryColor(`${summaryIcon} ${totalProblems} ${problemText} (${totalErrors} errors, ${totalWarnings} warnings)`));\n  console.log(chalk.dim(`  ${filesWithErrors} ${fileText} checked`));\n\n  return {\n    totalErrors,\n    totalWarnings,\n    schemaErrors: schemaErrors.length,\n    referenceErrors: referenceErrors.length,\n    parseErrors: parseErrors.length,\n    filesChecked: allFiles.size,\n    filesWithErrors,\n  };\n};\n\nconst groupParseErrorsByFile = (errors: ParseError[]): Map<string, ParseError[]> => {\n  const grouped = new Map<string, ParseError[]>();\n\n  for (const error of errors) {\n    const file = error.file.relativePath;\n    if (!grouped.has(file)) {\n      grouped.set(file, []);\n    }\n    grouped.get(file)!.push(error);\n  }\n\n  return grouped;\n};\n","import fs from 'fs';\nimport path from 'path';\nimport { ValidationError } from '../types';\n\nexport type RuleSeverity = 'error' | 'warn' | 'off';\n\nexport interface RuleConfig {\n  severity: RuleSeverity;\n  options?: Record<string, any>;\n}\n\nexport interface ConfigOverride {\n  files: string[];\n  rules: Record<string, RuleSeverity | [RuleSeverity, Record<string, any>]>;\n}\n\nexport interface LinterConfig {\n  rules: Record<string, RuleSeverity | [RuleSeverity, Record<string, any>]>;\n  ignorePatterns?: string[];\n  overrides?: ConfigOverride[];\n}\n\nexport const DEFAULT_IGNORE_PATTERNS: string[] = ['dependencies/**'];\n\nexport const DEFAULT_RULES: Record<string, RuleSeverity> = {\n  'schema/required-fields': 'error',\n  'schema/valid-semver': 'error',\n  'schema/valid-email': 'error',\n  'refs/owner-exists': 'error',\n  'refs/valid-version-range': 'error',\n  'refs/resource-exists': 'error',\n  'refs/channel-exists': 'error',\n  'refs/container-exists': 'error',\n  'refs/orphan-messages': 'warn',\n  'best-practices/summary-required': 'error',\n  'best-practices/owner-required': 'error',\n  'best-practices/description-required': 'warn',\n  'best-practices/schema-required': 'warn',\n  'naming/service-id-format': 'error',\n  'naming/event-id-format': 'error',\n  'versions/consistent-format': 'error',\n  'versions/no-deprecated': 'error',\n  'versions/no-deprecated-references': 'warn',\n  'structure/duplicate-resource-ids': 'error',\n};\n\nexport interface DependencyEntry {\n  id: string;\n  version?: string;\n}\n\nexport type CatalogDependencies = Record<string, DependencyEntry[]>;\n\nconst PLURAL_TO_SINGULAR: Record<string, string> = {\n  events: 'event',\n  commands: 'command',\n  queries: 'query',\n  services: 'service',\n  agents: 'agent',\n  adrs: 'adr',\n  domains: 'domain',\n  systems: 'system',\n  entities: 'entity',\n  channels: 'channel',\n  flows: 'flow',\n  users: 'user',\n  teams: 'team',\n  containers: 'container',\n  'data-products': 'dataProduct',\n  diagrams: 'diagram',\n};\n\nconst unwrapDefaultExport = (config: unknown): Record<string, any> => {\n  if (config && typeof config === 'object' && 'default' in config) {\n    const defaultExport = (config as Record<string, unknown>).default;\n    if (defaultExport && typeof defaultExport === 'object') {\n      return defaultExport as Record<string, any>;\n    }\n  }\n\n  return config as Record<string, any>;\n};\n\nexport const loadEventCatalogConfig = (rootDir: string): CatalogDependencies => {\n  const configPath = path.join(rootDir, 'eventcatalog.config.js');\n\n  if (!fs.existsSync(configPath)) {\n    return {};\n  }\n\n  try {\n    delete require.cache[require.resolve(configPath)];\n    const config = unwrapDefaultExport(require(configPath));\n\n    if (!config.dependencies || typeof config.dependencies !== 'object') {\n      return {};\n    }\n\n    const dependencies: CatalogDependencies = {};\n\n    for (const [pluralKey, entries] of Object.entries(config.dependencies)) {\n      const singularType = PLURAL_TO_SINGULAR[pluralKey];\n      if (!singularType || !Array.isArray(entries)) continue;\n\n      dependencies[singularType] = (entries as any[])\n        .filter((entry) => entry && typeof entry.id === 'string')\n        .map((entry) => ({ id: entry.id, version: entry.version }));\n    }\n\n    return dependencies;\n  } catch (error) {\n    console.warn(`Warning: Could not load eventcatalog.config.js: ${error instanceof Error ? error.message : String(error)}`);\n    return {};\n  }\n};\n\nexport const loadConfig = (rootDir: string): LinterConfig => {\n  const configPath = path.join(rootDir, '.eventcatalogrc.js');\n\n  if (!fs.existsSync(configPath)) {\n    // Return default config if no config file exists\n    return {\n      rules: DEFAULT_RULES,\n      ignorePatterns: DEFAULT_IGNORE_PATTERNS,\n      overrides: [],\n    };\n  }\n\n  try {\n    // Clear module cache to ensure fresh load\n    delete require.cache[require.resolve(configPath)];\n    const config = unwrapDefaultExport(require(configPath));\n\n    // Merge with defaults\n    const mergedConfig: LinterConfig = {\n      rules: { ...DEFAULT_RULES, ...config.rules },\n      ignorePatterns: [...DEFAULT_IGNORE_PATTERNS, ...(config.ignorePatterns || [])],\n      overrides: config.overrides || [],\n    };\n\n    return mergedConfig;\n  } catch (error) {\n    console.warn(`Warning: Could not load .eventcatalogrc.js: ${error instanceof Error ? error.message : String(error)}`);\n    return {\n      rules: DEFAULT_RULES,\n      ignorePatterns: DEFAULT_IGNORE_PATTERNS,\n      overrides: [],\n    };\n  }\n};\n\nexport const parseRuleConfig = (rule: RuleSeverity | [RuleSeverity, Record<string, any>]): RuleConfig => {\n  if (Array.isArray(rule)) {\n    return {\n      severity: rule[0],\n      options: rule[1],\n    };\n  }\n  return {\n    severity: rule,\n    options: {},\n  };\n};\n\nexport const shouldIgnoreFile = (filePath: string, ignorePatterns: string[]): boolean => {\n  if (!ignorePatterns || ignorePatterns.length === 0) {\n    return false;\n  }\n\n  const normalizedPath = filePath.replace(/\\\\/g, '/');\n\n  for (const pattern of ignorePatterns) {\n    // Simple glob matching for now\n    const regex = new RegExp(pattern.replace(/\\*\\*/g, '.*').replace(/\\*/g, '[^/]*'));\n    if (regex.test(normalizedPath)) {\n      return true;\n    }\n  }\n\n  return false;\n};\n\nexport const getEffectiveRules = (filePath: string, config: LinterConfig): Record<string, RuleConfig> => {\n  let effectiveRules = { ...config.rules };\n\n  // Apply overrides\n  if (config.overrides) {\n    for (const override of config.overrides) {\n      const matchesFile = override.files.some((pattern) => {\n        const regex = new RegExp(pattern.replace(/\\*\\*/g, '.*').replace(/\\*/g, '[^/]*'));\n        return regex.test(filePath);\n      });\n\n      if (matchesFile) {\n        effectiveRules = { ...effectiveRules, ...override.rules };\n      }\n    }\n  }\n\n  // Parse rules into RuleConfig objects\n  const parsedRules: Record<string, RuleConfig> = {};\n  for (const [ruleName, ruleValue] of Object.entries(effectiveRules)) {\n    parsedRules[ruleName] = parseRuleConfig(ruleValue);\n  }\n\n  return parsedRules;\n};\n\nexport const applyRuleSeverity = (errors: ValidationError[], rules: Record<string, RuleConfig>): ValidationError[] => {\n  const result: ValidationError[] = [];\n\n  for (const error of errors) {\n    // Map validation errors to rule names\n    const ruleName = mapErrorToRuleName(error);\n    const rule = rules[ruleName];\n\n    if (!rule || rule.severity === 'off') {\n      continue; // Skip disabled rules\n    }\n\n    result.push({\n      ...error,\n      severity: rule.severity === 'warn' ? ('warning' as const) : ('error' as const),\n    });\n  }\n\n  return result;\n};\n\nconst mapErrorToRuleName = (error: ValidationError): string => {\n  // Use explicit rule if set by the validator\n  if (error.rule) {\n    return error.rule;\n  }\n\n  // Map validation errors to rule names based on the error type and content\n  if (error.type === 'schema') {\n    // Check field-specific rules first\n    if (error.field === 'summary') {\n      return 'best-practices/summary-required';\n    }\n    if (error.field === 'owners') {\n      return 'best-practices/owner-required';\n    }\n\n    // Check message content for specific validation types\n    if (error.message.includes('email') || error.message.includes('Invalid email')) {\n      return 'schema/valid-email';\n    }\n    if (error.message.includes('version') || error.message.includes('semantic')) {\n      return 'schema/valid-semver';\n    }\n    if (error.message.includes('Required') || error.message.includes('Expected')) {\n      return 'schema/required-fields';\n    }\n\n    return 'schema/required-fields';\n  }\n\n  if (error.type === 'reference') {\n    if (error.message.includes('user') || error.message.includes('team')) {\n      return 'refs/owner-exists';\n    }\n    if (error.message.includes('version')) {\n      return 'refs/valid-version-range';\n    }\n    return 'refs/resource-exists';\n  }\n\n  return 'schema/required-fields';\n};\n"],"mappings":";;;;;;;;;AAEA,SAAS,eAAe;AACxB,OAAOA,YAAW;AAClB,OAAO,SAAS;AAChB,OAAOC,WAAU;;;ACLjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAWjB,IAAM,2BAAkE;AAAA,EACtE,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,KAAK;AACP;AAEA,IAAM,oBAA6D;AAAA,EACjE,QAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAO,CAAC,8BAA8B,wCAAwC;AAAA,EAC9E,KAAK,CAAC,4BAA4B,sCAAsC;AAAA,EACxE,OAAO,CAAC,8BAA8B,wCAAwC;AAAA,EAC9E,SAAS,CAAC,gCAAgC,0CAA0C;AAAA,EACpF,OAAO,CAAC,+BAA+B,yCAAyC;AAAA,EAChF,SAAS,CAAC,iCAAiC,2CAA2C;AAAA,EACtF,MAAM,CAAC,8BAA8B,wCAAwC;AAAA,EAC7E,QAAQ,CAAC,gCAAgC,0CAA0C;AAAA,EACnF,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AAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,CAAC;AAC/E,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QAAQ,MAAM;","names":["chalk","path","parts","z","semverRegex","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","problemText","summaryColor","summaryIcon","fs","path","path","fs","path","chalk"]}