/** * GitHub source configuration types and validation. * * This module defines the configuration schema for GitHub-based content sources, * supporting Docusaurus versioning and repository content fetching. */ import { z } from 'zod'; import type { BaseSourceConfig } from '../types.js'; import type { ChunkFilterOptions } from '../../chunking/types.js'; /** * Markdown preprocessing configuration for GitHub content. */ export interface GitHubPreprocessingConfig { /** Remove import statements (default: true) */ removeImports?: boolean; /** Remove JSX/MDX components (default: true) */ removeJsxComponents?: boolean; /** Remove code blocks (default: false) */ removeCodeBlocks?: boolean; /** Convert Docusaurus admonitions to plain text (default: true) */ convertAdmonitions?: boolean; /** Remove HTML comments (default: true) */ removeHtmlComments?: boolean; /** Normalize whitespace (default: true) */ normalizeWhitespace?: boolean; } /** * Docusaurus versioning configuration for GitHub source. */ export interface DocusaurusVersioningConfig { /** Strategy identifier */ strategy: 'docusaurus'; /** Path to versions.json relative to repo root */ versionsFile: string; /** Path pattern for versioned docs (use {version} placeholder) */ versionedDocsPath: string; /** Which version is "current" (gets clean URLs) */ currentVersion: string; /** Only index these versions (optional) */ includeVersions?: string[]; /** Skip these versions (optional) */ excludeVersions?: string[]; } /** * GitHub source configuration. * * Configuration for fetching and processing content from GitHub repositories. * Supports Docusaurus-style versioned documentation. */ export interface GitHubSourceConfig extends BaseSourceConfig { type: 'github'; /** Repository in "owner/repo" format */ repository: string; /** Default branch (default: "main") */ defaultRef?: string; /** Path to docs directory (default: "docs") */ docsPath?: string; /** Guide identifier */ guide: string; /** URL route base path (e.g., "warranty") */ routeBasePath: string; /** Docusaurus versioning configuration */ versioning?: DocusaurusVersioningConfig; /** File patterns to exclude */ exclude?: string[]; /** Markdown preprocessing options */ preprocessing?: GitHubPreprocessingConfig; /** Chunk filtering options */ chunkFilter?: ChunkFilterOptions; } /** * Zod schema for GitHub source configuration. */ export declare const GitHubSourceConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"github">; repository: z.ZodString; defaultRef: z.ZodOptional; docsPath: z.ZodOptional; guide: z.ZodString; routeBasePath: z.ZodString; categories: z.ZodOptional>; versioning: z.ZodOptional; versionsFile: z.ZodString; versionedDocsPath: z.ZodString; currentVersion: z.ZodString; includeVersions: z.ZodOptional>; excludeVersions: z.ZodOptional>; }, "strip", z.ZodTypeAny, { strategy: "docusaurus"; versionsFile: string; versionedDocsPath: string; currentVersion: string; includeVersions?: string[] | undefined; excludeVersions?: string[] | undefined; }, { strategy: "docusaurus"; versionsFile: string; versionedDocsPath: string; currentVersion: string; includeVersions?: string[] | undefined; excludeVersions?: string[] | undefined; }>>; exclude: z.ZodOptional>; preprocessing: z.ZodOptional; removeJsxComponents: z.ZodOptional; removeCodeBlocks: z.ZodOptional; convertAdmonitions: z.ZodOptional; removeHtmlComments: z.ZodOptional; normalizeWhitespace: z.ZodOptional; }, "strip", z.ZodTypeAny, { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; normalizeWhitespace?: boolean | undefined; }, { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; normalizeWhitespace?: boolean | undefined; }>>; chunkFilter: z.ZodOptional>; minContentLength: z.ZodOptional; maxLinkRatio: z.ZodOptional; stripLeadingH1: z.ZodOptional; }, "strip", z.ZodTypeAny, { skipSections?: string[] | undefined; minContentLength?: number | undefined; maxLinkRatio?: number | undefined; stripLeadingH1?: boolean | undefined; }, { skipSections?: string[] | undefined; minContentLength?: number | undefined; maxLinkRatio?: number | undefined; stripLeadingH1?: boolean | undefined; }>>; }, "strip", z.ZodTypeAny, { type: "github"; guide: string; repository: string; routeBasePath: string; exclude?: string[] | undefined; preprocessing?: { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; normalizeWhitespace?: boolean | undefined; } | undefined; defaultRef?: string | undefined; docsPath?: string | undefined; versioning?: { strategy: "docusaurus"; versionsFile: string; versionedDocsPath: string; currentVersion: string; includeVersions?: string[] | undefined; excludeVersions?: string[] | undefined; } | undefined; categories?: Record | undefined; chunkFilter?: { skipSections?: string[] | undefined; minContentLength?: number | undefined; maxLinkRatio?: number | undefined; stripLeadingH1?: boolean | undefined; } | undefined; }, { type: "github"; guide: string; repository: string; routeBasePath: string; exclude?: string[] | undefined; preprocessing?: { removeImports?: boolean | undefined; removeJsxComponents?: boolean | undefined; removeCodeBlocks?: boolean | undefined; convertAdmonitions?: boolean | undefined; removeHtmlComments?: boolean | undefined; normalizeWhitespace?: boolean | undefined; } | undefined; defaultRef?: string | undefined; docsPath?: string | undefined; versioning?: { strategy: "docusaurus"; versionsFile: string; versionedDocsPath: string; currentVersion: string; includeVersions?: string[] | undefined; excludeVersions?: string[] | undefined; } | undefined; categories?: Record | undefined; chunkFilter?: { skipSections?: string[] | undefined; minContentLength?: number | undefined; maxLinkRatio?: number | undefined; stripLeadingH1?: boolean | undefined; } | undefined; }>; /** * Default values for GitHub source configuration. */ export declare const GITHUB_SOURCE_DEFAULTS: { defaultRef: string; docsPath: string; preprocessing: { removeImports: boolean; removeJsxComponents: boolean; removeCodeBlocks: boolean; convertAdmonitions: boolean; removeHtmlComments: boolean; normalizeWhitespace: boolean; }; }; //# sourceMappingURL=config.d.ts.map