import { BINARY_FILE_EXTENSIONS, BINARY_MEDIA_TYPES_BY_EXTENSION, binaryMediaTypeForPath, sourceFileExtension, } from "./binary-content"; export const MAX_WIKI_SOURCE_COUNT = 20; export const MAX_WIKI_SOURCE_CONTENT_BYTES = 2_000_000; export const MAX_WIKI_SOURCE_BATCH_BYTES = 4_000_000; export const WIKI_SOURCE_MEDIA_TYPES = BINARY_MEDIA_TYPES_BY_EXTENSION; export const WIKI_TEXT_SOURCE_EXTENSIONS: ReadonlySet = new Set([ ".md", ".txt", ]); export const WIKI_SOURCE_EXTENSIONS: ReadonlySet = new Set([ ...WIKI_TEXT_SOURCE_EXTENSIONS, ...BINARY_FILE_EXTENSIONS, ]); export const WIKI_SOURCE_ACCEPT = [...WIKI_SOURCE_EXTENSIONS].join(","); export function wikiSourceExtension(path: string): string { return sourceFileExtension(path); } export function isSupportedWikiSourcePath(path: string): boolean { return WIKI_SOURCE_EXTENSIONS.has(wikiSourceExtension(path)); } export function isTextWikiSourcePath(path: string): boolean { return WIKI_TEXT_SOURCE_EXTENSIONS.has(wikiSourceExtension(path)); } export function wikiSourceMediaType(path: string): string | undefined { return binaryMediaTypeForPath(path); }