/** * Markdown source configuration types and validation. * * This module defines the configuration schema for markdown/MDX file sources, * supporting local file discovery, versioning, and preprocessing options. */ import { z } from 'zod'; import type { BaseSourceConfig } from '../types.js'; /** * Markdown preprocessing configuration. * * Options for cleaning and normalizing markdown content * before chunking and embedding. */ export interface MarkdownPreprocessingConfig { /** Remove import statements (default: true) */ removeImports?: boolean; /** Remove JSX/MDX components, keeping inner text content (default: true) */ removeJsxComponents?: boolean; /** Remove code blocks entirely (default: false - code can be useful context) */ removeCodeBlocks?: boolean; /** Remove inline code markers (default: false) */ removeInlineCode?: boolean; /** Convert Docusaurus admonitions (:::note, etc.) to plain text (default: true) */ convertAdmonitions?: boolean; /** Remove HTML comments (default: true) */ removeHtmlComments?: boolean; /** Remove link/image reference definitions (default: true) */ removeReferenceDefinitions?: boolean; /** Normalize Unicode characters (default: true) */ normalizeUnicode?: boolean; /** Normalize whitespace (default: true) */ normalizeWhitespace?: boolean; /** Custom regex patterns to remove */ customRemovePatterns?: string[]; } /** * Versioning configuration for Docusaurus-style versioned docs. */ export interface VersioningConfig { /** Path to versions.json file */ versionsFile?: string; /** Path to versioned_docs directory */ versionedDocsPath?: string; /** Explicit list of versions to index */ versions?: string[]; /** * Version label to stamp on the current (live) content instead of "next". * Use when the working tree already equals the latest release (e.g. lockstep * versioning) so chunks carry a real version like "2026.07.01". Falls back to * context.version, then to "next". */ currentVersion?: string; } /** * Markdown source configuration. * * Configuration for processing local markdown/MDX files. * Supports Docusaurus-style versioned docs. */ export interface MarkdownSourceConfig extends BaseSourceConfig { type: 'markdown'; /** Path to content directory */ path: string; /** Guide name for this source (e.g., "warranty") */ guide?: string; /** Route base path for URL generation (e.g., "warranty" -> /warranty/...) */ routeBasePath?: string; /** File patterns to include (default: **\/*.md) */ include?: string[]; /** File patterns to exclude */ exclude?: string[]; /** Also include .mdx files (default: true) */ includeMdx?: boolean; /** Markdown preprocessing options */ preprocessing?: MarkdownPreprocessingConfig; /** Versioning configuration */ versioning?: VersioningConfig; } /** * Zod schema for markdown source configuration. */ export declare const MarkdownSourceConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"markdown">; path: z.ZodString; guide: z.ZodOptional; routeBasePath: z.ZodOptional; include: z.ZodOptional>; exclude: z.ZodOptional>; includeMdx: z.ZodOptional; categories: z.ZodOptional>; preprocessing: z.ZodOptional; removeJsxComponents: z.ZodOptional; removeCodeBlocks: z.ZodOptional; removeInlineCode: z.ZodOptional; convertAdmonitions: z.ZodOptional; removeHtmlComments: z.ZodOptional; removeReferenceDefinitions: z.ZodOptional; normalizeUnicode: z.ZodOptional; normalizeWhitespace: z.ZodOptional; customRemovePatterns: z.ZodOptional>; }, "strip", z.ZodTypeAny, { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; removeInlineCode?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; removeReferenceDefinitions?: boolean | undefined; normalizeUnicode?: boolean | undefined; normalizeWhitespace?: boolean | undefined; customRemovePatterns?: string[] | undefined; }, { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; removeInlineCode?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; removeReferenceDefinitions?: boolean | undefined; normalizeUnicode?: boolean | undefined; normalizeWhitespace?: boolean | undefined; customRemovePatterns?: string[] | undefined; }>>; versioning: z.ZodOptional; versionedDocsPath: z.ZodOptional; versions: z.ZodOptional>; currentVersion: z.ZodOptional; }, "strip", z.ZodTypeAny, { versionsFile?: string | undefined; versionedDocsPath?: string | undefined; currentVersion?: string | undefined; versions?: string[] | undefined; }, { versionsFile?: string | undefined; versionedDocsPath?: string | undefined; currentVersion?: string | undefined; versions?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { type: "markdown"; path: string; guide?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; includeMdx?: boolean | undefined; preprocessing?: { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; removeInlineCode?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; removeReferenceDefinitions?: boolean | undefined; normalizeUnicode?: boolean | undefined; normalizeWhitespace?: boolean | undefined; customRemovePatterns?: string[] | undefined; } | undefined; routeBasePath?: string | undefined; versioning?: { versionsFile?: string | undefined; versionedDocsPath?: string | undefined; currentVersion?: string | undefined; versions?: string[] | undefined; } | undefined; categories?: Record | undefined; }, { type: "markdown"; path: string; guide?: string | undefined; include?: string[] | undefined; exclude?: string[] | undefined; includeMdx?: boolean | undefined; preprocessing?: { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; removeInlineCode?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; removeReferenceDefinitions?: boolean | undefined; normalizeUnicode?: boolean | undefined; normalizeWhitespace?: boolean | undefined; customRemovePatterns?: string[] | undefined; } | undefined; routeBasePath?: string | undefined; versioning?: { versionsFile?: string | undefined; versionedDocsPath?: string | undefined; currentVersion?: string | undefined; versions?: string[] | undefined; } | undefined; categories?: Record | undefined; }>; /** * Default values for markdown source configuration. */ export declare const MARKDOWN_SOURCE_DEFAULTS: { includeMdx: boolean; preprocessing: { removeImports: boolean; removeJsxComponents: boolean; removeCodeBlocks: boolean; removeInlineCode: boolean; convertAdmonitions: boolean; removeHtmlComments: boolean; removeReferenceDefinitions: boolean; normalizeUnicode: boolean; normalizeWhitespace: boolean; }; }; //# sourceMappingURL=config.d.ts.map