@exhaustive-ui/mcp 22.0.1 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts","../src/errors.ts","../src/text.ts","../src/catalog.ts","../src/source.ts","../src/search.ts","../src/template.ts","../src/v22.ts","../src/validate.ts","../src/tools.ts","../src/server.ts","../src/index.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url';\n\nexport const DEFAULT_DOCS_URL = 'https://exhaustive-ui.com';\nexport const DEFAULT_CACHE_TTL_SECONDS = 15 * 60;\nexport const DEFAULT_FETCH_TIMEOUT_MS = 10_000;\nexport const RESOURCE_BASE_URI = 'exhaustive-ui://docs';\n\n/** Package-relative path of the offline snapshot written by scripts/prebuild.mjs (works from src/ and from dist/). */\nexport const DEFAULT_SNAPSHOT_DIR = fileURLToPath(new URL('../data', import.meta.url));\n\nexport interface ServerConfig {\n /** Base URL of the docs site; the machine-readable docs live under `${docsUrl}/llms/`. */\n docsUrl: string;\n /** How long a fetched document is reused before it is fetched again. */\n cacheTtlMs: number;\n /** Per-request timeout for the docs site. */\n fetchTimeoutMs: number;\n /** When true the live site is never contacted and only the snapshot is used. */\n offline: boolean;\n /** Directory holding the offline snapshot; undefined disables the fallback. */\n snapshotDir: string | undefined;\n}\n\nexport type Env = Record<string, string | undefined>;\n\nexport function resolveConfig(env: Env = process.env, overrides: Partial<ServerConfig> = {}): ServerConfig {\n return {\n docsUrl: (overrides.docsUrl ?? env.EXHAUSTIVE_UI_DOCS_URL ?? DEFAULT_DOCS_URL).replace(/\\/+$/, ''),\n cacheTtlMs: overrides.cacheTtlMs ?? parseNumber(env.EXHAUSTIVE_UI_MCP_CACHE_TTL, DEFAULT_CACHE_TTL_SECONDS) * 1000,\n fetchTimeoutMs: overrides.fetchTimeoutMs ?? parseNumber(env.EXHAUSTIVE_UI_MCP_FETCH_TIMEOUT, DEFAULT_FETCH_TIMEOUT_MS),\n offline: overrides.offline ?? parseBoolean(env.EXHAUSTIVE_UI_MCP_OFFLINE),\n snapshotDir: 'snapshotDir' in overrides ? overrides.snapshotDir : (env.EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR ?? DEFAULT_SNAPSHOT_DIR)\n };\n}\n\nfunction parseNumber(value: string | undefined, fallback: number): number {\n if (value === undefined || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback;\n}\n\nfunction parseBoolean(value: string | undefined): boolean {\n return value !== undefined && ['1', 'true', 'yes', 'on'].includes(value.trim().toLowerCase());\n}\n","/** A tool request that cannot be fulfilled; the structured content is returned to the client next to the message. */\nexport class ToolError extends Error {\n constructor(\n message: string,\n public readonly structuredContent: Record<string, unknown> = {}\n ) {\n super(message);\n this.name = 'ToolError';\n }\n}\n\n/** The docs source has no such document (HTTP 404, SPA fallback page, or missing snapshot file). */\nexport class DocsNotFoundError extends Error {\n constructor(\n public readonly path: string,\n message = `Document \"${path}\" not found`\n ) {\n super(message);\n this.name = 'DocsNotFoundError';\n }\n}\n\n/** The docs source could not be reached or answered with an error. */\nexport class DocsFetchError extends Error {\n constructor(\n public readonly path: string,\n message: string,\n options?: { cause?: unknown }\n ) {\n super(message, options);\n this.name = 'DocsFetchError';\n }\n}\n\n/** First line of an error message, with local filesystem paths redacted. */\nexport function describeError(error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n\n return (\n message\n .split(/\\r?\\n/, 1)[0]!\n .trim()\n .replace(/(?:[A-Za-z]:\\\\|\\/(?:Users|private|tmp|var|home|root)\\/)[^\\s]+/g, '[redacted path]') || 'Tool request failed unexpectedly.'\n );\n}\n","/** Lower-case, dash-separated form of a name, route or title (\"Angular Button Component\" -> \"angular-button-component\"). */\nexport function slugify(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\n/** Letters and digits only (\"Angular CLI\" -> \"angularcli\"); used to compare environment names and selectors loosely. */\nexport function compact(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '');\n}\n\nexport function unique<T>(values: Iterable<T>): T[] {\n return [...new Set(values)];\n}\n\nconst STOP_WORDS = new Set(['a', 'an', 'and', 'as', 'by', 'for', 'from', 'how', 'i', 'in', 'is', 'of', 'on', 'or', 'the', 'to', 'use', 'with']);\n\n/** Significant search terms of a query. */\nexport function tokenize(value: string): string[] {\n return unique(\n slugify(value)\n .split('-')\n .filter((term) => term.length > 1 && !STOP_WORDS.has(term))\n );\n}\n\nconst SYNONYMS: Record<string, string[]> = {\n busy: ['loading', 'spinner'],\n calendar: ['datepicker', 'date'],\n chips: ['autocomplete', 'multiple'],\n danger: ['severity', 'error'],\n date: ['datepicker', 'calendar'],\n datatable: ['table'],\n dialog: ['modal', 'popup'],\n dropdown: ['select'],\n error: ['danger', 'severity', 'invalid'],\n filter: ['filtering', 'filters', 'filtered', 'search'],\n filtering: ['filter'],\n filters: ['filter'],\n form: ['forms', 'ngmodel', 'reactive'],\n forms: ['form'],\n icon: ['icons'],\n icons: ['icon'],\n inputswitch: ['toggleswitch'],\n lazy: ['virtual', 'scroller', 'loading'],\n load: ['loading'],\n loading: ['load', 'spinner', 'busy'],\n menu: ['menubar', 'tieredmenu', 'contextmenu', 'panelmenu'],\n modal: ['dialog'],\n notification: ['toast', 'message'],\n overlaypanel: ['popover'],\n page: ['paginator', 'pagination', 'pages'],\n pages: ['paginator', 'pagination'],\n paginate: ['paginator', 'pagination'],\n pagination: ['paginator', 'page'],\n paginator: ['pagination', 'page'],\n popup: ['popover', 'dialog', 'overlay'],\n pt: ['passthrough', 'pass'],\n passthrough: ['pt'],\n select: ['selection', 'selected', 'dropdown'],\n selected: ['selection', 'select'],\n selection: ['select', 'selected'],\n severity: ['danger', 'error', 'success', 'warn', 'info'],\n sidebar: ['drawer'],\n sort: ['sorting', 'sortable', 'sorted'],\n sortable: ['sort'],\n sorting: ['sort'],\n spinner: ['loading', 'progressspinner'],\n switch: ['toggleswitch'],\n tab: ['tabs'],\n tabview: ['tabs'],\n template: ['templates', 'templating', 'ng-template'],\n templates: ['template'],\n templating: ['template'],\n theme: ['theming', 'themes', 'tokens', 'preset'],\n themes: ['theme'],\n theming: ['theme'],\n toggle: ['togglebutton', 'toggleswitch'],\n token: ['tokens', 'theming'],\n tokens: ['token', 'theming'],\n tooltip: ['tooltips'],\n validation: ['invalid', 'forms'],\n virtual: ['scroller', 'virtualscroll', 'lazy']\n};\n\n/** Crude English stemmer, good enough to match \"sorting\" against \"sortable\". */\nexport function stem(term: string): string {\n return term\n .replace(/(?:ing|ers|er|ed|es|s)$/i, '')\n .replace(/(?:tion|ions)$/i, 't')\n .replace(/(?:able)$/i, '');\n}\n\n/** A term together with its synonyms and stem; every entry is at least two characters long. */\nexport function expandTerm(term: string): string[] {\n const base = slugify(term);\n const variants = new Set<string>([base]);\n\n for (const synonym of SYNONYMS[base] ?? []) {\n variants.add(synonym);\n }\n\n const stemmed = stem(base);\n\n if (stemmed !== base) {\n variants.add(stemmed);\n }\n\n return [...variants].filter((variant) => variant.length > 1);\n}\n\n/** Whether one of the (expanded) terms occurs in the text; prefix matches count for terms longer than three characters. */\nexport function matchesTerm(term: string, lowerText: string, textTerms: readonly string[]): boolean {\n return expandTerm(term).some((variant) => lowerText.includes(variant) || textTerms.includes(variant) || textTerms.some((textTerm) => variant.length > 3 && textTerm.length > 3 && (textTerm.startsWith(variant) || variant.startsWith(textTerm))));\n}\n\n/** Up to five short excerpts around the occurrences of the needle. */\nexport function snippets(text: string, needle: string, limit = 5): string[] {\n const lower = text.toLowerCase();\n const target = needle.toLowerCase();\n const results: string[] = [];\n let index = lower.indexOf(target);\n\n while (index !== -1 && results.length < limit) {\n const start = Math.max(0, index - 45);\n const end = Math.min(text.length, index + target.length + 45);\n\n results.push(text.slice(start, end).replace(/\\s+/g, ' ').trim());\n index = lower.indexOf(target, index + target.length);\n }\n\n return results;\n}\n\n/** The best snippets for a term, trying its synonyms when the term itself does not occur. */\nexport function snippetsForTerm(text: string, term: string): string[] {\n for (const variant of expandTerm(term)) {\n const found = snippets(text, variant);\n\n if (found.length > 0) {\n return found;\n }\n }\n\n return [];\n}\n\n/** Human readable title without the \"Angular ... Component\" wrapper of the generated docs (\"Angular Button Component\" -> \"Button\"). */\nexport function shortTitle(title: string): string {\n return title.replace(/^Angular\\s+/i, '').replace(/\\s+(Component|Directive|API)$/i, '');\n}\n","import { RESOURCE_BASE_URI } from './config';\nimport { ToolError } from './errors';\nimport type { DocsSource } from './source';\nimport { compact, expandTerm, shortTitle, slugify, unique } from './text';\nimport type { Catalog, CodeLanguage, ComponentEntry, ComponentsJson, DirectiveEntry, GuideEntry, ManifestEntryPoint, ManifestJson, RawSection, SectionEntry } from './types';\n\n/** Names PrimeNG users (and older ExhaustiveUI versions) may still use for a component. */\nexport const COMPONENT_ALIASES: Record<string, string> = {\n calendar: 'datepicker',\n chips: 'autocomplete',\n 'data-table': 'table',\n datatable: 'table',\n dropdown: 'select',\n 'inplace-editor': 'inplace',\n inputswitch: 'toggleswitch',\n overlaypanel: 'popover',\n sidebar: 'drawer',\n tabview: 'tabs',\n virtualscroller: 'scroller'\n};\n\nexport interface BuildCatalogOptions {\n resourceBaseUri?: string;\n}\n\n/** Normalize the two generated indexes into one catalog. */\nexport function buildCatalog(componentsJson: ComponentsJson, manifest: ManifestJson, options: BuildCatalogOptions = {}): Catalog {\n const base = (options.resourceBaseUri ?? RESOURCE_BASE_URI).replace(/\\/+$/, '');\n const site = manifest.site.replace(/\\/+$/, '');\n const entryPoints = new Map<string, ManifestEntryPoint>(manifest.entryPoints.map((entryPoint) => [entryPoint.name, entryPoint]));\n const guideNames = new Set(componentsJson.pages.map((page) => page.name));\n\n const guides: GuideEntry[] = componentsJson.pages.map((page) => ({\n kind: 'guide',\n name: page.name,\n title: page.title,\n description: page.description ?? '',\n route: `/${page.path}`,\n publicUrl: `${site}/${page.path}`,\n markdownUrl: `${site}/llms/pages/${page.name}.md`,\n docPath: `pages/${page.name}.md`,\n resourceUri: `${base}/pages/${page.name}.md`,\n sections: page.sections.map(normalizeSection)\n }));\n\n const components: ComponentEntry[] = componentsJson.components\n // The generator lists every docs route as a component, including the LLMs page itself: a route with no compiled\n // entry point and no code example documents nothing from the library.\n .filter((component) => entryPoints.has(component.name) || (!guideNames.has(component.name) && component.sections.some((section) => section.examples?.typescript || section.examples?.html)))\n .map((component) => {\n const entryPoint = entryPoints.get(component.name);\n const declarations = entryPoint?.declarations ?? [];\n\n return {\n kind: 'component',\n name: component.name,\n title: component.title,\n description: component.description ?? '',\n route: `/${component.name}`,\n publicUrl: `${site}/${component.name}`,\n markdownUrl: `${site}/llms/components/${component.name}.md`,\n docPath: `components/${component.name}.md`,\n resourceUri: `${base}/components/${component.name}.md`,\n apiResourceUri: `${base}/components/${component.name}/api.json`,\n import: entryPoint?.import,\n modules: entryPoint?.modules ?? [],\n selectors: unique(declarations.flatMap((declaration) => splitSelectors(declaration.selector))),\n declarations,\n sections: component.sections.map(normalizeSection),\n api: component.api ?? {}\n };\n });\n\n const componentNames = new Set(components.map((component) => component.name));\n const directives: DirectiveEntry[] = manifest.entryPoints.flatMap((entryPoint) =>\n (entryPoint.declarations ?? [])\n .filter((declaration) => declaration.kind === 'directive' && declaration.selector)\n .map((declaration) => ({\n className: declaration.className,\n selector: declaration.selector!,\n entryPoint: entryPoint.name,\n import: entryPoint.import,\n description: declaration.description,\n component: componentNames.has(entryPoint.name) ? entryPoint.name : undefined\n }))\n );\n\n return {\n libraryVersion: manifest.version,\n docsVersion: componentsJson.version,\n generatedAt: componentsJson.generatedAt,\n site,\n components,\n guides,\n directives\n };\n}\n\nfunction normalizeSection(section: RawSection): SectionEntry {\n const examples = section.examples ?? undefined;\n const [code, codeLanguage] = pickCode(examples);\n\n return {\n id: section.id,\n label: section.label,\n description: section.description || undefined,\n hasCode: code !== undefined,\n codeLanguage,\n code\n };\n}\n\nfunction pickCode(examples: RawSection['examples']): [string | undefined, CodeLanguage | undefined] {\n if (examples?.typescript?.trim()) {\n return [examples.typescript, 'typescript'];\n }\n\n if (examples?.html?.trim()) {\n return [examples.html, 'html'];\n }\n\n if (examples?.command?.trim()) {\n return [examples.command, 'bash'];\n }\n\n return [undefined, undefined];\n}\n\n/** \"p-autoComplete, p-autocomplete, p-auto-complete\" -> three selectors. */\nexport function splitSelectors(selector: string | undefined): string[] {\n return (selector ?? '')\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\n\n/** Attribute name of an attribute selector (\"[pTooltip]\" -> \"pTooltip\"), or undefined for element selectors. */\nexport function attributeSelectorName(selector: string): string | undefined {\n const match = /^\\[([^\\]=]+)(?:=[^\\]]*)?\\]$/.exec(selector.trim());\n\n return match?.[1];\n}\n\n/** Every spelling under which a component can be requested. */\nfunction componentKeys(component: ComponentEntry): string[] {\n const keys = [component.name, shortTitle(component.title), component.import?.split('/').pop() ?? ''];\n\n for (const selector of component.selectors) {\n const attribute = attributeSelectorName(selector);\n\n keys.push(attribute ?? selector, (attribute ?? selector).replace(/^p-?/i, ''));\n }\n\n for (const declaration of component.declarations) {\n keys.push(declaration.className);\n }\n\n return unique(keys.map(compact).filter(Boolean));\n}\n\n/** Resolve a component by name, title, selector, class name, alias, route or URL. */\nexport function findComponent(catalog: Catalog, query: string): ComponentEntry {\n const raw = query.trim();\n const lastSegment = raw\n .replace(/^https?:\\/\\/[^/]+/, '')\n .replace(/^exhaustive-ui:\\/\\/docs/, '')\n .replace(/\\.md$/, '')\n .replace(/\\/api\\.json$/, '')\n .split('/')\n .filter(Boolean)\n .pop();\n const candidates = unique([raw, lastSegment ?? raw].map(compact).filter(Boolean));\n const aliased = candidates.map((candidate) => COMPONENT_ALIASES[candidate]).filter((name): name is string => !!name);\n\n for (const candidate of [...candidates, ...aliased.map(compact)]) {\n const exact = catalog.components.find((component) => component.name === candidate) ?? catalog.components.find((component) => componentKeys(component).includes(candidate));\n\n if (exact) {\n return exact;\n }\n }\n\n const suggestions = suggestComponents(catalog, raw);\n\n throw new ToolError(`Component \"${query}\" not found.${suggestions.length ? ` Did you mean: ${suggestions.join(', ')}?` : ''}`, {\n component: query,\n suggestions,\n nextCall: { tool: 'list', arguments: { kind: 'components' } }\n });\n}\n\nexport function suggestComponents(catalog: Catalog, query: string, limit = 5): string[] {\n const needle = compact(query);\n const terms = expandTerm(query).map(compact);\n const scored = catalog.components\n .map((component) => {\n const keys = componentKeys(component);\n let score = 0;\n\n if (needle && keys.some((key) => key.startsWith(needle) || needle.startsWith(key))) {\n score += 10;\n }\n\n if (needle && keys.some((key) => editDistance(key, needle) <= Math.max(1, Math.floor(needle.length / 4)))) {\n score += 8;\n }\n\n if (needle && keys.some((key) => key.includes(needle) || needle.includes(key))) {\n score += 5;\n }\n\n if (needle.length >= 4 && keys.some((key) => key.slice(0, 4) === needle.slice(0, 4))) {\n score += 3;\n }\n\n if (terms.some((term) => keys.some((key) => key.includes(term)))) {\n score += 2;\n }\n\n return { name: component.name, score };\n })\n .filter((entry) => entry.score > 0)\n .sort((a, b) => b.score - a.score || a.name.localeCompare(b.name));\n\n return scored.slice(0, limit).map((entry) => entry.name);\n}\n\n/** Levenshtein distance, for \"did you mean\" suggestions on short names. */\nfunction editDistance(a: string, b: string): number {\n if (a === b) {\n return 0;\n }\n\n let previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n\n for (let j = 1; j <= b.length; j++) {\n current[j] = Math.min(previous[j]! + 1, current[j - 1]! + 1, previous[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n\n previous = current;\n }\n\n return previous[b.length]!;\n}\n\n/** Resolve a guide by name (\"installation\"), route (\"theming/styled\"), title, markdown path or URL. */\nexport function findGuide(catalog: Catalog, query: string): GuideEntry {\n const normalized = normalizeGuidePath(query);\n const last = normalized.split('/').pop() ?? normalized;\n const byPath = catalog.guides.filter((guide) => guideKeys(guide).includes(normalized));\n\n if (byPath.length === 1) {\n return byPath[0]!;\n }\n\n const byName = catalog.guides.filter((guide) => [guide.name, slugify(guide.title), compact(guide.title)].includes(last) || compact(guide.name) === compact(last));\n\n if (byName.length === 1) {\n return byName[0]!;\n }\n\n const candidates = byPath.length > 1 ? byPath : byName;\n\n if (candidates.length > 1) {\n throw new ToolError(`Guide \"${query}\" is ambiguous. Use the full route of one of the candidates.`, {\n guide: query,\n candidates: candidates.map((guide) => ({ name: guide.name, title: guide.title, route: guide.route, resourceUri: guide.resourceUri }))\n });\n }\n\n throw new ToolError(`Guide \"${query}\" not found.`, {\n guide: query,\n availableGuides: catalog.guides.map((guide) => guide.route.slice(1)),\n nextCall: { tool: 'list', arguments: { kind: 'guides' } }\n });\n}\n\nfunction guideKeys(guide: GuideEntry): string[] {\n return unique([guide.name, guide.route.slice(1), guide.docPath.replace(/\\.md$/, ''), slugify(guide.title)].map(normalizeGuidePath));\n}\n\nfunction normalizeGuidePath(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/^exhaustive-ui:\\/\\/docs\\//, '')\n .replace(/^https?:\\/\\/[^/]+\\//, '')\n .replace(/^llms\\/pages\\//, '')\n .replace(/^pages\\//, '')\n .replace(/\\.md$/, '')\n .split('/')\n .map(slugify)\n .filter(Boolean)\n .join('/');\n}\n\n/** Resolve a section of a component or guide by id or label; undefined when nothing matches. */\nexport function findSection(sections: readonly SectionEntry[], query: string): SectionEntry | undefined {\n const needle = compact(query);\n\n return sections.find((section) => compact(section.id) === needle || compact(section.label) === needle) ?? sections.find((section) => slugify(section.label).includes(slugify(query)));\n}\n\nexport function requireSection(sections: readonly SectionEntry[], query: string): SectionEntry {\n const section = findSection(sections, query);\n\n if (!section) {\n throw new ToolError(`Section \"${query}\" not found.`, { section: query, availableSections: sections.map((entry) => entry.id) });\n }\n\n return section;\n}\n\n/** Loads and caches the catalog; a rebuild only happens when the source hands back different index documents. */\nexport class CatalogLoader {\n private cached: { components: string; manifest: string; catalog: Catalog } | undefined;\n\n constructor(\n private readonly source: DocsSource,\n private readonly options: BuildCatalogOptions = {}\n ) {}\n\n async load(): Promise<Catalog> {\n const [components, manifest] = await Promise.all([this.source.readText('components.json'), this.source.readText('manifest.json')]);\n\n if (this.cached && this.cached.components === components && this.cached.manifest === manifest) {\n return this.cached.catalog;\n }\n\n const catalog = buildCatalog(parseJson<ComponentsJson>(components, 'components.json'), parseJson<ManifestJson>(manifest, 'manifest.json'), this.options);\n\n this.cached = { components, manifest, catalog };\n\n return catalog;\n }\n}\n\nfunction parseJson<T>(text: string, name: string): T {\n try {\n return JSON.parse(text) as T;\n } catch (error) {\n throw new Error(`${name} is not valid JSON: ${(error as Error).message}`);\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport type { ServerConfig } from './config';\nimport { DocsFetchError, DocsNotFoundError, describeError } from './errors';\n\n/**\n * Where the machine-readable docs come from. Paths are relative to the `/llms/` directory of the docs site:\n * `components.json`, `manifest.json`, `llms.txt`, `llms-full.txt`, `components/<name>.md`, `pages/<name>.md`.\n */\nexport interface DocsSource {\n readonly kind: string;\n readText(docsPath: string): Promise<string>;\n}\n\nconst DOCS_PATH_PATTERN = /^(?:components\\.json|manifest\\.json|llms\\.txt|llms-full\\.txt|(?:components|pages)\\/[a-z0-9][a-z0-9._-]*\\.md)$/;\n\n/** Reject anything that is not one of the generated docs files, so a crafted resource URI cannot read elsewhere. */\nexport function assertDocsPath(docsPath: string): string {\n if (!DOCS_PATH_PATTERN.test(docsPath)) {\n throw new DocsNotFoundError(docsPath, `\"${docsPath}\" is not a generated docs file`);\n }\n\n return docsPath;\n}\n\n/** In-memory documents, for tests and embedding. */\nexport class MemorySource implements DocsSource {\n readonly kind = 'memory';\n\n constructor(private readonly documents: Map<string, string> = new Map()) {}\n\n async readText(docsPath: string): Promise<string> {\n const text = this.documents.get(assertDocsPath(docsPath));\n\n if (text === undefined) {\n throw new DocsNotFoundError(docsPath);\n }\n\n return text;\n }\n}\n\n/** The offline snapshot produced at build time by scripts/prebuild.mjs. */\nexport class SnapshotSource implements DocsSource {\n readonly kind = 'snapshot';\n\n constructor(readonly directory: string) {}\n\n async readText(docsPath: string): Promise<string> {\n const file = path.join(this.directory, assertDocsPath(docsPath));\n\n try {\n return await readFile(file, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n throw new DocsNotFoundError(docsPath, `Document \"${docsPath}\" is not in the offline snapshot`);\n }\n\n throw new DocsFetchError(docsPath, `Cannot read \"${docsPath}\" from the offline snapshot: ${describeError(error)}`, { cause: error });\n }\n }\n}\n\nexport type FetchLike = (input: string, init?: { signal?: AbortSignal; headers?: Record<string, string> }) => Promise<{ ok: boolean; status: number; headers: { get(name: string): string | null }; text(): Promise<string> }>;\n\nexport interface RemoteSourceOptions {\n baseUrl: string;\n timeoutMs: number;\n fetchImpl?: FetchLike;\n userAgent?: string;\n}\n\n/** The live docs site. A not-found path is served as the SPA shell with HTTP 200, so HTML answers are treated as misses. */\nexport class RemoteSource implements DocsSource {\n readonly kind = 'remote';\n private readonly fetchImpl: FetchLike;\n\n constructor(private readonly options: RemoteSourceOptions) {\n this.fetchImpl = options.fetchImpl ?? (globalThis.fetch as unknown as FetchLike);\n }\n\n urlFor(docsPath: string): string {\n return `${this.options.baseUrl.replace(/\\/+$/, '')}/llms/${assertDocsPath(docsPath)}`;\n }\n\n async readText(docsPath: string): Promise<string> {\n const url = this.urlFor(docsPath);\n let response: Awaited<ReturnType<FetchLike>>;\n\n try {\n response = await this.fetchImpl(url, {\n signal: AbortSignal.timeout(this.options.timeoutMs),\n headers: {\n accept: 'text/markdown, text/plain, application/json;q=0.9, */*;q=0.1',\n 'user-agent': this.options.userAgent ?? '@exhaustive-ui/mcp'\n }\n });\n } catch (error) {\n throw new DocsFetchError(docsPath, `Cannot reach ${url}: ${describeError(error)}`, { cause: error });\n }\n\n if (response.status === 404) {\n throw new DocsNotFoundError(docsPath, `${url} answered HTTP 404`);\n }\n\n if (!response.ok) {\n throw new DocsFetchError(docsPath, `${url} answered HTTP ${response.status}`);\n }\n\n const text = await response.text();\n\n if (/text\\/html/i.test(response.headers.get('content-type') ?? '') || /^\\s*<(?:!doctype|html)/i.test(text)) {\n throw new DocsNotFoundError(docsPath, `${url} is not published (the site answered with its HTML shell)`);\n }\n\n return text;\n }\n}\n\ninterface CacheEntry {\n value: string;\n expiresAt: number;\n}\n\nexport interface CachedSourceOptions {\n ttlMs: number;\n now?: () => number;\n}\n\n/** Remembers documents for a TTL, dedupes concurrent reads, and serves a stale copy when a refresh fails. */\nexport class CachedSource implements DocsSource {\n readonly kind: string;\n private readonly entries = new Map<string, CacheEntry>();\n private readonly pending = new Map<string, Promise<string>>();\n private readonly now: () => number;\n private hits = 0;\n private misses = 0;\n\n constructor(\n private readonly inner: DocsSource,\n private readonly options: CachedSourceOptions\n ) {\n this.kind = inner.kind;\n this.now = options.now ?? Date.now;\n }\n\n async readText(docsPath: string): Promise<string> {\n const cached = this.entries.get(docsPath);\n\n if (cached && cached.expiresAt > this.now()) {\n this.hits++;\n\n return cached.value;\n }\n\n const inFlight = this.pending.get(docsPath);\n\n if (inFlight) {\n return inFlight;\n }\n\n this.misses++;\n\n const request = this.inner\n .readText(docsPath)\n .then((value) => {\n this.entries.set(docsPath, { value, expiresAt: this.now() + this.options.ttlMs });\n\n return value;\n })\n .catch((error: unknown) => {\n if (cached) {\n // Keep serving what we have rather than failing: the docs change rarely.\n this.entries.set(docsPath, { value: cached.value, expiresAt: this.now() + this.options.ttlMs });\n\n return cached.value;\n }\n\n throw error;\n })\n .finally(() => {\n this.pending.delete(docsPath);\n });\n\n this.pending.set(docsPath, request);\n\n return request;\n }\n\n invalidate(): void {\n this.entries.clear();\n }\n\n stats(): { entries: number; hits: number; misses: number; ttlMs: number } {\n return { entries: this.entries.size, hits: this.hits, misses: this.misses, ttlMs: this.options.ttlMs };\n }\n}\n\nexport interface FallbackStatus {\n primary: string;\n fallback: string;\n fallbackReads: number;\n lastFallbackAt?: string;\n lastFallbackReason?: string;\n /** Set while the primary is skipped after a connection failure. */\n primarySkippedUntil?: string;\n}\n\nexport interface FallbackSourceOptions {\n /** After a connection failure the primary is not retried for this long, so an offline session stays responsive. */\n cooldownMs?: number;\n now?: () => number;\n}\n\nexport const DEFAULT_FALLBACK_COOLDOWN_MS = 60_000;\n\n/** Reads from the primary source and falls back to the secondary one when the primary fails for any reason. */\nexport class FallbackSource implements DocsSource {\n readonly kind: string;\n private readonly cooldownMs: number;\n private readonly now: () => number;\n private fallbackReads = 0;\n private lastFallbackAt: string | undefined;\n private lastFallbackReason: string | undefined;\n private primarySkippedUntil = 0;\n\n constructor(\n private readonly primary: DocsSource,\n private readonly fallback: DocsSource,\n options: FallbackSourceOptions = {}\n ) {\n this.kind = `${primary.kind}+${fallback.kind}`;\n this.cooldownMs = options.cooldownMs ?? DEFAULT_FALLBACK_COOLDOWN_MS;\n this.now = options.now ?? Date.now;\n }\n\n async readText(docsPath: string): Promise<string> {\n if (this.primarySkippedUntil > this.now()) {\n try {\n return await this.readFallback(docsPath, undefined);\n } catch {\n // The snapshot lacks it: the live site is the only hope, cool-down or not.\n }\n }\n\n try {\n return await this.primary.readText(docsPath);\n } catch (primaryError) {\n if (primaryError instanceof DocsFetchError) {\n this.primarySkippedUntil = this.now() + this.cooldownMs;\n }\n\n try {\n return await this.readFallback(docsPath, primaryError);\n } catch (fallbackError) {\n // A document missing from both places is a not-found; otherwise report why the live site failed.\n throw primaryError instanceof DocsNotFoundError && fallbackError instanceof DocsNotFoundError ? fallbackError : primaryError;\n }\n }\n }\n\n private async readFallback(docsPath: string, primaryError: unknown): Promise<string> {\n const text = await this.fallback.readText(docsPath);\n\n this.fallbackReads++;\n this.lastFallbackAt = new Date().toISOString();\n\n if (primaryError !== undefined) {\n this.lastFallbackReason = describeError(primaryError);\n }\n\n return text;\n }\n\n status(): FallbackStatus {\n return {\n primary: this.primary.kind,\n fallback: this.fallback.kind,\n fallbackReads: this.fallbackReads,\n lastFallbackAt: this.lastFallbackAt,\n lastFallbackReason: this.lastFallbackReason,\n primarySkippedUntil: this.primarySkippedUntil > this.now() ? new Date(this.primarySkippedUntil).toISOString() : undefined\n };\n }\n}\n\nexport interface SourceStatus {\n mode: 'remote' | 'offline';\n docsUrl: string;\n cacheTtlSeconds: number;\n snapshotDir?: string;\n fallback?: FallbackStatus;\n cache?: { entries: number; hits: number; misses: number };\n}\n\nexport interface ConfiguredSource {\n source: DocsSource;\n status(): SourceStatus;\n}\n\n/** The runtime source: the live site behind a TTL cache, falling back to the offline snapshot (or the snapshot alone when offline). */\nexport function createDocsSource(config: ServerConfig, fetchImpl?: FetchLike): ConfiguredSource {\n const snapshot = config.snapshotDir ? new SnapshotSource(config.snapshotDir) : undefined;\n\n if (config.offline) {\n if (!snapshot) {\n throw new Error('Offline mode needs an offline snapshot directory (EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR).');\n }\n\n return {\n source: snapshot,\n status: () => ({ mode: 'offline', docsUrl: config.docsUrl, cacheTtlSeconds: 0, snapshotDir: snapshot.directory })\n };\n }\n\n const remote = new CachedSource(new RemoteSource({ baseUrl: config.docsUrl, timeoutMs: config.fetchTimeoutMs, fetchImpl }), { ttlMs: config.cacheTtlMs });\n const fallback = snapshot ? new FallbackSource(remote, snapshot) : undefined;\n\n return {\n source: fallback ?? remote,\n status: () => ({\n mode: 'remote',\n docsUrl: config.docsUrl,\n cacheTtlSeconds: Math.round(config.cacheTtlMs / 1000),\n snapshotDir: snapshot?.directory,\n fallback: fallback?.status(),\n cache: remote.stats()\n })\n };\n}\n","import { shortTitle, slugify, snippets, snippetsForTerm, matchesTerm, tokenize, unique } from './text';\nimport type { Catalog, ComponentEntry, GuideEntry } from './types';\n\nexport type SearchScope = 'all' | 'components' | 'guides' | 'api' | 'examples';\n\ninterface IndexedField {\n text: string;\n lower: string;\n terms: readonly string[];\n weight: number;\n}\n\ninterface IndexEntry {\n scope: Exclude<SearchScope, 'all'>;\n result: Record<string, unknown>;\n fields: IndexedField[];\n}\n\nexport interface SearchHit extends Record<string, unknown> {\n type: string;\n score: number;\n matchedTerms: string[];\n matches: string[];\n}\n\nconst indexes = new WeakMap<Catalog, IndexEntry[]>();\n\n/** Search components, guides, API members and examples of the catalog. Results are sorted by relevance. */\nexport function searchCatalog(catalog: Catalog, query: string, scope: SearchScope = 'all'): SearchHit[] {\n const phrase = query.trim().toLowerCase();\n const terms = tokenize(query);\n const entries = indexFor(catalog).filter((entry) => (scope === 'all' ? entry.scope === 'components' || entry.scope === 'guides' : entry.scope === scope));\n const hits: SearchHit[] = [];\n\n for (const entry of entries) {\n const match = scoreEntry(entry.fields, phrase, terms);\n\n if (match) {\n hits.push({ ...entry.result, type: String(entry.result.type), score: match.score, matchedTerms: match.matchedTerms, matches: match.matches });\n }\n }\n\n return hits.sort((a, b) => b.score - a.score || b.matchedTerms.length - a.matchedTerms.length || String(a.title ?? a.name).localeCompare(String(b.title ?? b.name)));\n}\n\nfunction scoreEntry(fields: IndexedField[], phrase: string, terms: string[]): { score: number; matchedTerms: string[]; matches: string[] } | undefined {\n const matchedTerms = new Set<string>();\n const matches: string[] = [];\n let score = 0;\n let phraseMatched = false;\n\n for (const field of fields) {\n if (!field.text) {\n continue;\n }\n\n if (phrase && field.lower.includes(phrase)) {\n phraseMatched = true;\n score += 100 * field.weight;\n matches.push(...snippets(field.text, phrase));\n }\n\n for (const term of terms) {\n if (matchesTerm(term, field.lower, field.terms)) {\n matchedTerms.add(term);\n score += field.weight;\n matches.push(...snippetsForTerm(field.text, term));\n }\n }\n }\n\n const required = terms.length <= 2 ? 1 : Math.max(2, Math.ceil(terms.length * 0.4));\n\n if (!phraseMatched && matchedTerms.size < required) {\n return undefined;\n }\n\n return { score, matchedTerms: [...matchedTerms], matches: unique(matches).slice(0, 5) };\n}\n\nfunction indexFor(catalog: Catalog): IndexEntry[] {\n let index = indexes.get(catalog);\n\n if (!index) {\n index = buildIndex(catalog);\n indexes.set(catalog, index);\n }\n\n return index;\n}\n\nfunction buildIndex(catalog: Catalog): IndexEntry[] {\n const entries: IndexEntry[] = [];\n\n for (const component of catalog.components) {\n entries.push(componentEntry(component));\n entries.push(...apiEntries(component));\n entries.push(...exampleEntries(component));\n }\n\n for (const guide of catalog.guides) {\n entries.push(guideEntry(guide));\n }\n\n return entries;\n}\n\nfunction componentEntry(component: ComponentEntry): IndexEntry {\n const api = component.api;\n const apiText = [...(api.props ?? []), ...(api.emits ?? []), ...(api.templates ?? []), ...(api.methods ?? []), ...(api.pt ?? [])].map((member) => `${member.name} ${member.description ?? ''}`).join(' ');\n const sectionsText = component.sections.map((section) => `${section.label} ${section.description ?? ''}`).join(' ');\n const codeText = component.sections.map((section) => section.code ?? '').join('\\n');\n\n return {\n scope: 'components',\n result: {\n type: 'component',\n name: component.name,\n title: component.title,\n description: component.description,\n selectors: component.selectors,\n import: component.import,\n resourceUri: component.resourceUri,\n publicUrl: component.publicUrl,\n nextCall: { tool: 'get_component', arguments: { component: component.name } }\n },\n fields: [\n field([component.name, shortTitle(component.title), ...component.selectors, component.import ?? '', ...component.declarations.map((declaration) => declaration.className)].join(' '), 8),\n field(component.description, 4),\n field(sectionsText, 3),\n field(apiText, 3),\n field(codeText, 1)\n ]\n };\n}\n\nfunction guideEntry(guide: GuideEntry): IndexEntry {\n return {\n scope: 'guides',\n result: {\n type: 'guide',\n name: guide.name,\n title: guide.title,\n description: guide.description,\n route: guide.route,\n resourceUri: guide.resourceUri,\n publicUrl: guide.publicUrl,\n nextCall: { tool: 'get_guide', arguments: { guide: guide.name } }\n },\n fields: [\n field([guide.name, guide.route, guide.title].join(' '), 8),\n field(guide.description, 4),\n field(guide.sections.map((section) => `${section.label} ${section.description ?? ''}`).join(' '), 3),\n field(guide.sections.map((section) => section.code ?? '').join('\\n'), 1)\n ]\n };\n}\n\nfunction apiEntries(component: ComponentEntry): IndexEntry[] {\n const api = component.api;\n const members: { member: string; name: string; type?: string; description?: string }[] = [\n ...(api.props ?? []).map((prop) => ({ member: 'prop', name: prop.name, type: prop.type, description: prop.description })),\n ...(api.emits ?? []).map((emit) => ({ member: 'emit', name: emit.name, type: emit.parameters?.map((parameter) => `${parameter.name}: ${parameter.type ?? 'unknown'}`).join(', '), description: emit.description })),\n ...(api.templates ?? []).map((template) => ({ member: 'template', name: template.name, type: template.type, description: template.description })),\n ...(api.methods ?? []).map((method) => ({ member: 'method', name: method.name, type: method.returnType, description: method.description })),\n ...(api.pt ?? []).map((pt) => ({ member: 'pt', name: pt.name, type: pt.type, description: pt.description })),\n ...(api.styles ?? []).map((style) => ({ member: 'style', name: style.class, description: style.description })),\n ...(api.tokens ?? []).map((token) => ({ member: 'token', name: token.token, type: token.variable, description: token.description }))\n ];\n\n return members.map((member) => ({\n scope: 'api',\n result: {\n type: 'api',\n component: component.name,\n member: member.member,\n name: member.name,\n memberType: member.type,\n description: member.description,\n apiResourceUri: component.apiResourceUri,\n nextCall: { tool: 'get_component', arguments: { component: component.name, includeApi: true } }\n },\n fields: [field(`${component.name} ${member.name} ${slugify(member.name).replace(/-/g, ' ')}`, 8), field(`${member.type ?? ''} ${member.description ?? ''}`, 3)]\n }));\n}\n\nfunction exampleEntries(component: ComponentEntry): IndexEntry[] {\n return component.sections\n .filter((section) => section.hasCode)\n .map((section) => ({\n scope: 'examples',\n result: {\n type: 'example',\n component: component.name,\n section: section.id,\n title: section.label,\n description: section.description,\n codeLanguage: section.codeLanguage,\n resourceUri: component.resourceUri,\n nextCall: { tool: 'get_example', arguments: { component: component.name, section: section.id } }\n },\n fields: [field(`${component.name} ${section.label} ${section.id}`, 8), field(section.description ?? '', 3), field(section.code ?? '', 1)]\n }));\n}\n\nfunction field(text: string | undefined, weight: number): IndexedField {\n const value = text ?? '';\n\n return { text: value, lower: value.toLowerCase(), terms: tokenize(value), weight };\n}\n","/**\n * A deliberately small scanner for Angular templates and component sources: enough to find the elements a component\n * is used on and the bindings written on them, without pulling the Angular compiler into an MCP server.\n */\n\nexport type AttributeKind = 'static' | 'property' | 'event' | 'twoWay' | 'structural' | 'reference' | 'other';\n\nexport interface TemplateAttribute {\n raw: string;\n kind: AttributeKind;\n /** Binding target without its sigils: `[severity]` -> `severity`, `(onClick)` -> `onClick`. */\n name: string;\n value?: string;\n}\n\nexport interface TemplateElement {\n name: string;\n attributes: TemplateAttribute[];\n raw: string;\n}\n\nexport interface ImportStatement {\n source: string;\n names: string[];\n}\n\nconst TAG_PATTERN = /<([A-Za-z][\\w.-]*)((?:\\s+(?:[^\\s<>\"'=/]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'<>]+))?))*)\\s*\\/?>/g;\nconst ATTRIBUTE_PATTERN = /([^\\s\"'=<>/]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'<>]+)))?/g;\nconst IMPORT_PATTERN = /import\\s+(?:type\\s+)?(?:([\\w$]+)\\s*,?\\s*)?(?:\\{([^}]*)\\}|\\*\\s+as\\s+([\\w$]+))?\\s*from\\s*['\"]([^'\"]+)['\"]/g;\n\n/** Every opening element of the template with its attributes. */\nexport function scanElements(code: string): TemplateElement[] {\n const elements: TemplateElement[] = [];\n\n for (const match of code.matchAll(TAG_PATTERN)) {\n const attributes: TemplateAttribute[] = [];\n\n for (const attribute of (match[2] ?? '').matchAll(ATTRIBUTE_PATTERN)) {\n const raw = attribute[1]!;\n const value = attribute[2] ?? attribute[3] ?? attribute[4];\n\n attributes.push({ raw, value, ...classifyAttribute(raw) });\n }\n\n elements.push({ name: match[1]!, attributes, raw: match[0] });\n }\n\n return elements;\n}\n\nexport function classifyAttribute(raw: string): { kind: AttributeKind; name: string } {\n let match = /^\\[\\((.+)\\)\\]$/.exec(raw);\n\n if (match) {\n return { kind: 'twoWay', name: match[1]! };\n }\n\n match = /^bindon-(.+)$/.exec(raw);\n\n if (match) {\n return { kind: 'twoWay', name: match[1]! };\n }\n\n match = /^\\[(.+)\\]$/.exec(raw) ?? /^bind-(.+)$/.exec(raw);\n\n if (match) {\n const target = match[1]!;\n\n return /^(?:attr|class|style)\\./.test(target) ? { kind: 'other', name: target } : { kind: 'property', name: target };\n }\n\n match = /^\\((.+)\\)$/.exec(raw) ?? /^on-(.+)$/.exec(raw);\n\n if (match) {\n return { kind: 'event', name: match[1]! };\n }\n\n if (raw.startsWith('*')) {\n return { kind: 'structural', name: raw.slice(1) };\n }\n\n if (raw.startsWith('#') || raw.startsWith('ref-')) {\n return { kind: 'reference', name: raw.replace(/^#|^ref-/, '') };\n }\n\n if (raw.startsWith('@') || raw.startsWith('i18n') || raw.includes('.')) {\n return { kind: 'other', name: raw };\n }\n\n return { kind: 'static', name: raw };\n}\n\n/** ES import statements of a component source. */\nexport function scanImports(code: string): ImportStatement[] {\n const imports: ImportStatement[] = [];\n\n for (const match of code.matchAll(IMPORT_PATTERN)) {\n const names = [\n match[1],\n match[3],\n ...(match[2] ?? '').split(',').map(\n (name) =>\n name\n .trim()\n .split(/\\s+as\\s+/)\n .pop() ?? ''\n )\n ].filter((name): name is string => !!name);\n\n imports.push({ source: match[4]!, names });\n }\n\n return imports;\n}\n\n/** Whether an attribute value is a template expression rather than a literal. */\nexport function isInterpolated(value: string | undefined): boolean {\n return value !== undefined && value.includes('{{');\n}\n\n/** The string literal a property binding assigns (`[severity]=\"'danger'\"` -> `danger`), or undefined when it is an expression. */\nexport function literalOfBinding(value: string | undefined): string | undefined {\n const match = value === undefined ? null : /^\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*$/.exec(value);\n\n return match ? (match[1] ?? match[2]) : undefined;\n}\n","import { compact } from './text';\n\n/**\n * Inputs and outputs removed or renamed in ExhaustiveUI v22, keyed by component tag (`p-` prefix,\n * case and hyphens ignored). Mirrors the `ng update` migrations of @exhaustive-ui/core\n * (styleclass-to-class, renamed-inputs, renamed-outputs, remove-dead-inputs, remove-dead-outputs) so that\n * validate_usage can name the replacement instead of only reporting an unknown binding.\n */\n\nexport const STYLE_CLASS_REMOVED: readonly string[] = [\n 'accordion',\n 'autocomplete',\n 'avatar',\n 'avatargroup',\n 'badge',\n 'blockui',\n 'card',\n 'carousel',\n 'cascadeselect',\n 'checkbox',\n 'chip',\n 'colorpicker',\n 'dataview',\n 'datepicker',\n 'divider',\n 'dock',\n 'editor',\n 'iconfield',\n 'image',\n 'inplace',\n 'inputgroup',\n 'inputgroupaddon',\n 'inputicon',\n 'inputnumber',\n 'knob',\n 'listbox',\n 'megamenu',\n 'menubar',\n 'message',\n 'metergroup',\n 'multiselect',\n 'orderlist',\n 'organizationchart',\n 'paginator',\n 'panel',\n 'panelmenu',\n 'password',\n 'progressbar',\n 'progressspinner',\n 'radiobutton',\n 'scrollpanel',\n 'select',\n 'skeleton',\n 'slider',\n 'splitbutton',\n 'splitter',\n 'table',\n 'tag',\n 'terminal',\n 'timeline',\n 'toast',\n 'togglebutton',\n 'toggleswitch',\n 'toolbar',\n 'tree',\n 'treetable'\n];\n\nexport const RENAMED: Record<string, Record<string, string>> = {\n drawer: { showcloseicon: 'closable', ariacloselabel: 'closeAriaLabel' },\n paginator: { dropdownappendto: 'appendTo' },\n dialog: { content: 'headerTemplate' },\n autocomplete: { minlength: 'minQueryLength' },\n treeselect: { containerstyleclass: 'class', containerstyle: 'style' },\n treetable: { virtualrowheight: 'virtualScrollItemSize' },\n // attribute directives, keyed by their attribute selector\n pbutton: { ptbuttondirective: 'pButtonPT' },\n pbuttonlabel: { ptbuttonlabel: 'pButtonLabelPT' },\n pbuttonicon: { ptbuttonicon: 'pButtonIconPT' },\n pbadge: { ptbadgedirective: 'pBadgePT', size: 'badgeSize' },\n pinputtext: { ptinputtext: 'pInputTextPT' },\n ptooltip: { pttooltip: 'pTooltipPT' }\n};\n\nexport const DEAD_INPUTS: Record<string, readonly string[]> = {\n toast: ['showTransformOptions', 'hideTransformOptions', 'showTransitionOptions', 'hideTransitionOptions'],\n toastitem: ['showTransformOptions', 'hideTransformOptions', 'showTransitionOptions', 'hideTransitionOptions'],\n message: ['showTransitionOptions', 'hideTransitionOptions'],\n overlay: ['showTransitionOptions', 'hideTransitionOptions'],\n colorpicker: ['showTransitionOptions', 'hideTransitionOptions'],\n overlaybadge: ['size'],\n fieldset: ['transitionOptions'],\n panel: ['transitionOptions'],\n accordion: ['transitionOptions'],\n scrolltop: ['showTransitionOptions', 'hideTransitionOptions'],\n togglebutton: ['inputId'],\n popover: ['showTransitionOptions', 'hideTransitionOptions', 'ariaCloseLabel'],\n image: ['showTransitionOptions', 'hideTransitionOptions', 'modalEnterAnimation', 'modalLeaveAnimation'],\n drawer: ['transitionOptions'],\n menu: ['showTransitionOptions', 'hideTransitionOptions'],\n splitbutton: ['showTransitionOptions', 'hideTransitionOptions', 'plain'],\n password: ['showTransitionOptions', 'hideTransitionOptions'],\n button: ['badgeClass'],\n contextmenusub: ['autoZIndex', 'baseZIndex', 'popup'],\n tieredmenu: ['showTransitionOptions', 'hideTransitionOptions'],\n menubar: ['autoZIndex', 'baseZIndex'],\n menubarsub: ['autoZIndex', 'baseZIndex', 'mobileActive', 'ariaLabel', 'ariaLabelledBy'],\n panelmenu: ['transitionOptions', 'tabindex'],\n megamenusub: ['disabled', 'queryMatches'],\n galleria: ['showTransitionOptions', 'hideTransitionOptions', 'containerClass'],\n fileupload: ['removeStyleClass'],\n cascadeselect: ['inputLabel', 'emptyMessage'],\n datepicker: ['showTransitionOptions', 'hideTransitionOptions'],\n dialog: ['transitionOptions', 'rtl'],\n confirmdialog: ['closeAriaLabel', 'acceptAriaLabel', 'rejectAriaLabel', 'rtl', 'transitionOptions', 'focusTrap', 'defaultFocus'],\n treenode: ['rowNode', 'root', 'firstChild', 'lastChild'],\n selectitem: ['visible', 'itemSize'],\n table: ['frozenColumns', 'frozenWidth'],\n autocomplete: ['autoZIndex', 'baseZIndex', 'showTransitionOptions', 'hideTransitionOptions', 'autoHighlight'],\n multiselect: ['filterFields'],\n stepper: ['transitionOptions'],\n listbox: ['searchLocale'],\n dataview: ['gridStyleClass', 'trackBy'],\n orderlist: ['trackBy', 'header'],\n picklist: ['trackBy', 'sourceTrackBy', 'targetTrackBy'],\n toggleswitch: ['size'],\n selectbutton: ['tabindex'],\n confirmpopup: ['showTransitionOptions', 'hideTransitionOptions', 'baseZIndex'],\n treetablesorticon: ['ariaLabelAsc', 'ariaLabelDesc']\n};\n\nexport const RENAMED_OUTPUTS: Record<string, Record<string, string>> = {\n orderlist: { onFilterEvent: 'onFilter' },\n table: { selectAllChange: 'onSelectAllChange' },\n multiselect: { onPanelShow: 'onShow', onPanelHide: 'onHide' }\n};\n\nexport const DEAD_OUTPUTS: Record<string, readonly string[]> = {\n overlay: ['onAnimationStart', 'onAnimationDone'],\n menubarsub: ['menuFocus', 'menuBlur', 'menuKeydown']\n};\n\nfunction tagKey(tag: string): string {\n return compact(tag.replace(/^p-/i, ''));\n}\n\nfunction has(list: readonly string[] | undefined, name: string): boolean {\n return !!list?.some((entry) => entry.toLowerCase() === name.toLowerCase());\n}\n\n/**\n * Replacement guidance for an input that no longer exists on `tag` (an element name, or an attribute\n * directive selector such as `[pTooltip]`), or undefined when it was not removed in v22.\n */\nexport function removedInputHint(tag: string, name: string): { message: string; suggestion?: string } | undefined {\n const key = tagKey(tag);\n const lower = name.toLowerCase();\n\n if (lower === 'styleclass' && STYLE_CLASS_REMOVED.includes(key)) {\n return { message: 'styleClass was removed in v22: use the native class attribute (ng update applies the styleclass-to-class migration).', suggestion: 'class' };\n }\n\n const renamed = RENAMED[key]?.[lower];\n\n if (renamed) {\n return { message: `${name} was renamed to ${renamed} in v22 (ng update applies the renamed-inputs migration).`, suggestion: renamed };\n }\n\n if (has(DEAD_INPUTS[key], name)) {\n return { message: `${name} was removed in v22: it had no effect anymore, delete the binding (ng update applies the remove-dead-inputs migration).` };\n }\n\n return undefined;\n}\n\n/** Replacement guidance for an output that no longer exists on `tag`, or undefined when it was not removed in v22. */\nexport function removedOutputHint(tag: string, name: string): { message: string; suggestion?: string } | undefined {\n const key = tagKey(tag);\n const renamed = RENAMED_OUTPUTS[key]?.[name];\n\n if (renamed) {\n return { message: `${name} was renamed to ${renamed} in v22, with the same event payload (ng update applies the renamed-outputs migration).`, suggestion: renamed };\n }\n\n if (!has(DEAD_OUTPUTS[key], name)) {\n return undefined;\n }\n\n const replacement = key === 'overlay' ? 'use onOverlayBeforeEnter/onOverlayAfterEnter (show) or onOverlayBeforeLeave/onOverlayAfterLeave (hide) instead' : 'it never fired, bind the native focus/blur/keydown events of the element instead';\n\n return { message: `${name} was removed in v22: ${replacement} (ng update applies the remove-dead-outputs migration).` };\n}\n","import { COMPONENT_ALIASES, attributeSelectorName, splitSelectors } from './catalog';\nimport { isInterpolated, literalOfBinding, scanElements, scanImports, type TemplateElement } from './template';\nimport { compact, slugify } from './text';\nimport { removedInputHint, removedOutputHint } from './v22';\nimport type { Catalog, ComponentEntry, ManifestDeclaration, ManifestInput } from './types';\n\nexport type IssueSeverity = 'error' | 'warning';\n\nexport interface UsageIssue {\n kind: string;\n severity: IssueSeverity;\n name?: string;\n message: string;\n allowedProps?: string;\n allowedValues?: string;\n allowedEvents?: string;\n suggestion?: string;\n}\n\n/** Attributes any element may carry; never reported as unknown inputs. */\nconst GLOBAL_ATTRIBUTES = new Set([\n 'id',\n 'class',\n 'style',\n 'title',\n 'hidden',\n 'tabindex',\n 'role',\n 'lang',\n 'dir',\n 'slot',\n 'part',\n 'autofocus',\n 'draggable',\n 'contenteditable',\n 'spellcheck',\n 'translate',\n 'accesskey',\n 'inert',\n 'popover',\n 'ngmodel',\n 'ngclass',\n 'ngstyle',\n 'ngmodeloptions',\n 'formcontrol',\n 'formcontrolname',\n 'formgroup',\n 'formgroupname',\n 'formarrayname',\n 'ngmodelgroup',\n 'ngform',\n 'ngnativevalidate',\n 'ngnonbindable',\n 'ngtemplateoutlet',\n 'ngtemplateoutletcontext',\n 'ngcomponentoutlet',\n 'ngprojectas',\n 'routerlink',\n 'routerlinkactive',\n 'routerlinkactiveoptions',\n 'queryparams',\n 'cdkdrag',\n 'cdkdroplist',\n 'ptooltip'\n]);\n\n/** Attributes and properties of native elements a directive like pButton or pInputText is applied to. */\nconst NATIVE_ATTRIBUTES = new Set([\n 'type',\n 'name',\n 'value',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'required',\n 'checked',\n 'selected',\n 'multiple',\n 'min',\n 'max',\n 'step',\n 'minlength',\n 'maxlength',\n 'pattern',\n 'size',\n 'rows',\n 'cols',\n 'wrap',\n 'autocomplete',\n 'inputmode',\n 'enterkeyhint',\n 'src',\n 'srcset',\n 'alt',\n 'href',\n 'target',\n 'rel',\n 'download',\n 'for',\n 'form',\n 'list',\n 'label',\n 'width',\n 'height',\n 'loading',\n 'innerhtml',\n 'innertext',\n 'textcontent',\n 'scrolltop',\n 'scrollleft'\n]);\n\nconst LEGACY_IMPORT_PATTERN = /^(?:primeng(?:\\/.*)?|@primeng\\/.*|@openng\\/optimus-ui(?:\\/.*)?|optimus-ui(?:\\/.*)?)$/;\n\ninterface SelectorIndex {\n /** Lower-cased element selector -> declaration. */\n elements: Map<string, DeclarationRef>;\n /** Lower-cased attribute selector name -> declaration. */\n attributes: Map<string, DeclarationRef>;\n}\n\ninterface DeclarationRef {\n component: ComponentEntry;\n declaration: ManifestDeclaration;\n}\n\nconst selectorIndexes = new WeakMap<Catalog, SelectorIndex>();\n\nfunction selectorIndex(catalog: Catalog): SelectorIndex {\n let index = selectorIndexes.get(catalog);\n\n if (!index) {\n index = { elements: new Map(), attributes: new Map() };\n\n for (const component of catalog.components) {\n for (const declaration of component.declarations) {\n for (const selector of splitSelectors(declaration.selector)) {\n const attribute = attributeSelectorName(selector);\n\n if (attribute) {\n index.attributes.set(attribute.toLowerCase(), { component, declaration });\n } else if (/^[a-z][\\w-]*$/i.test(selector)) {\n index.elements.set(selector.toLowerCase(), { component, declaration });\n }\n }\n }\n }\n\n selectorIndexes.set(catalog, index);\n }\n\n return index;\n}\n\n/** Validate a template or component source against the generated API of one component. */\nexport function validateComponentUsage(catalog: Catalog, component: ComponentEntry, code: string): UsageIssue[] {\n const issues: UsageIssue[] = [...checkImports(component, code)];\n\n if (component.declarations.length === 0) {\n issues.push({\n kind: 'api-unavailable',\n severity: 'warning',\n name: component.name,\n message: `No compiled API metadata is available for ${component.title}; bindings could not be checked.`\n });\n\n return issues;\n }\n\n const index = selectorIndex(catalog);\n const ownSelectors = new Set(component.selectors.map((selector) => (attributeSelectorName(selector) ?? selector).toLowerCase()));\n const elements = scanElements(code);\n const usages = elements.map((element) => ({ element, matches: declarationsOn(element, index) })).filter(({ matches }) => matches.some((ref) => ref.component === component));\n\n if (usages.length === 0) {\n issues.push(...checkSelectorMismatch(component, elements, index));\n\n if (!issues.some((issue) => issue.kind === 'selector-mismatch' || issue.kind === 'unknown-selector')) {\n issues.push({\n kind: 'selector-not-found',\n severity: 'warning',\n name: component.name,\n message: `The code does not use ${component.title}: none of its selectors (${component.selectors.join(', ')}) appear in it.`\n });\n }\n\n return issues;\n }\n\n for (const { element, matches } of usages) {\n issues.push(...checkElement(component, element, matches, ownSelectors.has(element.name.toLowerCase())));\n }\n\n return dedupe(issues);\n}\n\nfunction checkImports(component: ComponentEntry, code: string): UsageIssue[] {\n const issues: UsageIssue[] = [];\n\n for (const statement of scanImports(code)) {\n if (LEGACY_IMPORT_PATTERN.test(statement.source)) {\n const target = statement.source.split('/').slice(1).join('/');\n const suggestion = target && target === component.name ? component.import : target ? `@exhaustive-ui/core/${target}` : '@exhaustive-ui/core';\n\n issues.push({\n kind: 'import-mismatch',\n severity: 'error',\n name: statement.source,\n message: `\"${statement.source}\" is a PrimeNG / Optimus UI import; ExhaustiveUI components are imported from @exhaustive-ui/core.`,\n suggestion: suggestion ? `import { ${statement.names.join(', ') || component.modules[0] || component.declarations[0]?.className || ''} } from '${suggestion}';` : undefined\n });\n }\n }\n\n return issues;\n}\n\nfunction declarationsOn(element: TemplateElement, index: SelectorIndex): DeclarationRef[] {\n const refs: DeclarationRef[] = [];\n const byElement = index.elements.get(element.name.toLowerCase());\n\n if (byElement) {\n refs.push(byElement);\n }\n\n for (const attribute of element.attributes) {\n if (attribute.kind !== 'static' && attribute.kind !== 'property') {\n continue;\n }\n\n const byAttribute = index.attributes.get(attribute.name.toLowerCase());\n\n if (byAttribute && !refs.includes(byAttribute)) {\n refs.push(byAttribute);\n }\n }\n\n return refs;\n}\n\nfunction checkSelectorMismatch(component: ComponentEntry, elements: TemplateElement[], index: SelectorIndex): UsageIssue[] {\n const issues: UsageIssue[] = [];\n const names = new Set([component.name, ...component.declarations.map((declaration) => compact(declaration.className))]);\n\n for (const element of elements) {\n const tag = element.name;\n const key = compact(tag.replace(/^p-/i, ''));\n const aliasTarget = COMPONENT_ALIASES[slugify(tag.replace(/^p-/i, ''))];\n\n if (/^[A-Z]/.test(tag) && names.has(compact(tag))) {\n issues.push({\n kind: 'selector-mismatch',\n severity: 'error',\n name: tag,\n message: `ExhaustiveUI ${component.title} is used through its selector (${component.selectors.join(', ')}), not the PascalCase <${tag}> tag.`,\n suggestion: component.selectors[0]\n });\n } else if (/^p-/i.test(tag) && !index.elements.has(tag.toLowerCase())) {\n const renamed = aliasTarget === component.name;\n const related = renamed || names.has(key) || slugify(tag).startsWith(`p-${component.name}`);\n\n issues.push({\n kind: 'unknown-selector',\n severity: 'error',\n name: tag,\n message: renamed\n ? `<${tag}> is the PrimeNG name of this component; in ExhaustiveUI ${component.title} uses ${component.selectors.join(' or ')}.`\n : `<${tag}> is not a selector of any ExhaustiveUI component${related ? '' : ` (expected ${component.title} here)`}; use ${component.selectors.join(' or ')}.`,\n suggestion: component.selectors[0]\n });\n }\n }\n\n return issues;\n}\n\nfunction checkElement(component: ComponentEntry, element: TemplateElement, matches: DeclarationRef[], isOwnElement: boolean): UsageIssue[] {\n const issues: UsageIssue[] = [];\n const own = matches.filter((ref) => ref.component === component).map((ref) => ref.declaration);\n const inputs = new Map<string, ManifestInput>();\n const outputs = new Set<string>();\n const everyInput = new Set<string>();\n\n for (const ref of matches) {\n // The attribute that applies a directive (pButton, pTooltip...) is a selector, not an input.\n for (const selector of splitSelectors(ref.declaration.selector)) {\n const attribute = attributeSelectorName(selector);\n\n if (attribute) {\n everyInput.add(attribute.toLowerCase());\n }\n }\n\n for (const input of ref.declaration.inputs ?? []) {\n everyInput.add(input.name.toLowerCase());\n\n if (ref.component === component) {\n inputs.set(input.name.toLowerCase(), input);\n }\n }\n\n for (const output of ref.declaration.outputs ?? []) {\n outputs.add(output.name);\n }\n }\n\n // the attribute directives of this component applied on the element (pButton, pTooltip...)\n const directiveAttributes = own\n .flatMap((declaration) => splitSelectors(declaration.selector).map(attributeSelectorName))\n .filter((attribute): attribute is string => !!attribute && element.attributes.some((candidate) => candidate.name.toLowerCase() === attribute.toLowerCase()));\n const removedHint = (name: string) => (isOwnElement ? removedInputHint(element.name, name) : directiveAttributes.map((attribute) => removedInputHint(`[${attribute}]`, name)).find(Boolean));\n const allowedProps = [...inputs.keys()].sort().join(', ');\n const allowedEvents = [...outputs].sort().join(', ');\n const supportsForms = own.some((declaration) => declaration.forms);\n const label = own[0]?.className ?? component.title;\n\n for (const attribute of element.attributes) {\n const lowerName = attribute.name.toLowerCase();\n\n switch (attribute.kind) {\n case 'static':\n case 'property': {\n if (everyInput.has(lowerName) && !inputs.has(lowerName)) {\n // Belongs to another ExhaustiveUI directive on the same element (e.g. pTooltip on a p-button).\n break;\n }\n\n const input = inputs.get(lowerName);\n\n if (!input) {\n const removed = removedHint(attribute.name);\n\n if (!removed && (GLOBAL_ATTRIBUTES.has(lowerName) || lowerName.startsWith('aria-') || lowerName.startsWith('data-') || lowerName.startsWith('ng') || (!isOwnElement && NATIVE_ATTRIBUTES.has(lowerName)))) {\n break;\n }\n\n issues.push({\n kind: 'unknown-prop',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an input of ${label}.${removed ? ` ${removed.message}` : ''}`,\n allowedProps,\n ...(removed?.suggestion ? { suggestion: removed.suggestion } : {})\n });\n break;\n }\n\n if (input.deprecated) {\n issues.push({\n kind: 'deprecated-prop',\n severity: 'warning',\n name: input.name,\n message: `Input \"${input.name}\" of ${label} is deprecated: ${input.deprecated}`\n });\n }\n\n const literal = attribute.kind === 'static' ? (isInterpolated(attribute.value) ? undefined : attribute.value) : literalOfBinding(attribute.value);\n\n if (literal !== undefined && input.values && input.values.length > 0 && !input.values.includes(literal)) {\n issues.push({\n kind: 'invalid-enum-value',\n severity: 'error',\n name: input.name,\n message: `\"${literal}\" is not an allowed value of ${label} input \"${input.name}\".`,\n allowedValues: input.values.join(', ')\n });\n }\n\n break;\n }\n case 'event': {\n if (outputs.has(attribute.name)) {\n break;\n }\n\n const input = inputs.get(lowerName.replace(/change$/, ''));\n\n if (input?.twoWay && /change$/i.test(attribute.name)) {\n break;\n }\n\n const removed = isOwnElement ? removedOutputHint(element.name, attribute.name) : undefined;\n\n if (removed || /^on[A-Z]/.test(attribute.name)) {\n issues.push({\n kind: 'unknown-output',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an output of ${label}.${removed ? ` ${removed.message}` : ''}`,\n allowedEvents,\n ...(removed?.suggestion ? { suggestion: removed.suggestion } : {})\n });\n }\n\n break;\n }\n case 'twoWay': {\n if (lowerName === 'ngmodel') {\n if (isOwnElement && !supportsForms && !inputs.has('ngmodel')) {\n issues.push({\n kind: 'forms-unsupported',\n severity: 'warning',\n name: 'ngModel',\n message: `${label} does not implement ControlValueAccessor, so [(ngModel)] has no effect on it.`\n });\n }\n\n break;\n }\n\n const input = inputs.get(lowerName);\n\n if (!input) {\n if (everyInput.has(lowerName) || GLOBAL_ATTRIBUTES.has(lowerName)) {\n break;\n }\n\n issues.push({\n kind: 'unknown-prop',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an input of ${label}, so it cannot be bound two-way.`,\n allowedProps\n });\n } else if (!input.twoWay && !outputs.has(`${input.name}Change`)) {\n issues.push({\n kind: 'two-way-binding-unsupported',\n severity: 'error',\n name: input.name,\n message: `Input \"${input.name}\" of ${label} has no \"${input.name}Change\" output; bind it one-way with [${input.name}].`\n });\n }\n\n break;\n }\n default:\n break;\n }\n }\n\n return issues;\n}\n\nfunction dedupe(issues: UsageIssue[]): UsageIssue[] {\n const seen = new Set<string>();\n\n return issues.filter((issue) => {\n const key = `${issue.kind}:${issue.name ?? ''}:${issue.message}`;\n\n if (seen.has(key)) {\n return false;\n }\n\n seen.add(key);\n\n return true;\n });\n}\n\nexport function formatIssues(componentTitle: string, issues: UsageIssue[]): string {\n const lines = issues.map((issue) => {\n const extras = [\n issue.allowedProps ? ` Allowed inputs: ${issue.allowedProps}.` : '',\n issue.allowedValues ? ` Allowed values: ${issue.allowedValues}.` : '',\n issue.allowedEvents ? ` Allowed outputs: ${issue.allowedEvents}.` : '',\n issue.suggestion ? ` Suggestion: ${issue.suggestion}` : ''\n ].join('');\n\n return `- [${issue.severity}] ${issue.kind}${issue.name ? ` ${issue.name}` : ''}: ${issue.message}${extras}`;\n });\n\n return [`Usage has ${issues.length} validation issue${issues.length === 1 ? '' : 's'} for ${componentTitle}.`, ...lines].join('\\n');\n}\n","import { z } from 'zod';\nimport { findComponent, findGuide, findSection, requireSection } from './catalog';\nimport { RESOURCE_BASE_URI } from './config';\nimport { ToolError, describeError } from './errors';\nimport { searchCatalog } from './search';\nimport type { DocsSource, SourceStatus } from './source';\nimport { compact, expandTerm, slugify, unique } from './text';\nimport type { Catalog, ComponentEntry, GuideEntry, SectionEntry } from './types';\nimport { formatIssues, validateComponentUsage } from './validate';\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Results\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ToolResult {\n [key: string]: unknown;\n content: { type: 'text'; text: string }[];\n structuredContent: Record<string, unknown>;\n isError?: boolean;\n}\n\n/**\n * Every tool answers with structured content plus its JSON serialization as text, so clients that only forward text\n * content still see the whole answer. `summary` is a one-line description of the result.\n */\nexport function ok(structured: Record<string, unknown>, summary: string): ToolResult {\n const structuredContent = { summary, ...structured };\n\n return { content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }], structuredContent };\n}\n\nexport function fail(message: string, structured: Record<string, unknown> = {}): ToolResult {\n const structuredContent = { summary: message, error: message, ...structured };\n\n return { content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }], structuredContent, isError: true };\n}\n\n/** Turn thrown errors into error results instead of protocol failures. */\nexport async function guard(run: () => Promise<ToolResult>): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n return error instanceof ToolError ? fail(error.message, error.structuredContent) : fail(describeError(error));\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ToolContext {\n serverName: string;\n serverVersion: string;\n source: DocsSource;\n catalog(): Promise<Catalog>;\n sourceStatus(): SourceStatus;\n}\n\nexport const TOOL_NAMES = ['list', 'search', 'get_component', 'get_guide', 'get_example', 'get_setup', 'validate_usage', 'version'] as const;\n\nexport const STATIC_RESOURCE_URIS = [`${RESOURCE_BASE_URI}/llms.txt`, `${RESOURCE_BASE_URI}/llms-full.txt`, `${RESOURCE_BASE_URI}/manifest.json`, `${RESOURCE_BASE_URI}/components.json`];\n\nexport const RESOURCE_TEMPLATE_NAMES = ['component-docs', 'component-api', 'guide-docs', 'example-docs'];\n\nexport const PROMPT_NAMES = ['use_component', 'build_form', 'theme_component', 'migrate_from_primeng', 'update_to_v22', 'audit_component_usage'] as const;\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Input schemas\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const listInput = {\n kind: z.enum(['components', 'directives', 'guides', 'examples', 'resources']).default('components').describe('What to list.'),\n limit: z.number().int().min(1).max(200).default(50),\n offset: z.number().int().min(0).default(0)\n};\n\nexport const searchInput = {\n query: z.string().min(1).describe('Free text: component names, features (\"lazy loading\"), API members (\"onRowSelect\"), guide topics.'),\n scope: z\n .enum(['all', 'components', 'guides', 'api', 'examples'])\n .default('all')\n .describe('\"all\" searches components and guides; \"api\" searches inputs, outputs, templates, methods, PT keys, CSS classes and tokens; \"examples\" searches code examples.'),\n limit: z.number().int().min(1).max(50).default(10),\n offset: z.number().int().min(0).default(0)\n};\n\nconst componentRequest = z.object({\n component: z.string().min(1).describe('Component name, selector, class name or docs URL (e.g. \"button\", \"p-button\", \"Table\", \"dropdown\").'),\n sections: z.array(z.string()).optional().describe('Restrict to these section ids or labels.'),\n includeApi: z.boolean().default(false).describe('Include the API (inputs, outputs, templates, methods, PT keys, CSS classes, tokens) and compiled declarations.'),\n includeExamples: z.boolean().default(false).describe('Include the code of every example section.'),\n detail: z.enum(['compact', 'full']).default('compact').describe('\"full\" also returns the complete Markdown document.')\n});\n\nexport const getComponentInput = {\n ...componentRequest.shape,\n component: componentRequest.shape.component.optional(),\n components: z.array(z.unknown()).max(10).optional().describe('Batch form: up to 10 single-component requests.')\n};\n\nexport const getGuideInput = {\n guide: z.string().min(1).describe('Guide name or route: \"installation\", \"configuration\", \"theming/styled\", \"tailwind\", \"guides/accessibility\"...'),\n section: z.string().optional().describe('Section id or label to focus on.'),\n detail: z.enum(['compact', 'full']).default('compact').describe('\"full\" also returns the complete Markdown document.')\n};\n\nexport const getExampleInput = {\n component: z.string().min(1),\n section: z.string().optional().describe('Section id or label (\"basic\", \"lazy\", \"Template\"...). Defaults to the first section with code.'),\n variant: z.string().optional().describe('Feature hint used when no section matches (\"outlined\", \"severity\", \"icons\"...).')\n};\n\nexport const getSetupInput = {\n environment: z.string().optional().describe('What to set up: \"angular-cli\" (default), \"configuration\", \"styled\", \"unstyled\", \"tailwind\", \"icons\", \"custom-icons\", \"passthrough\".')\n};\n\nconst usageRequest = z.object({\n component: z.string().min(1),\n code: z.string().min(1).describe('Angular template or component source using the component.')\n});\n\nexport const validateUsageInput = {\n component: usageRequest.shape.component.optional(),\n code: usageRequest.shape.code.optional(),\n usages: z.array(z.unknown()).max(10).optional().describe('Batch form: up to 10 { component, code } items.')\n};\n\nexport const versionInput = {};\n\ntype ListInput = z.infer<z.ZodObject<typeof listInput>>;\ntype SearchInput = z.infer<z.ZodObject<typeof searchInput>>;\ntype ComponentRequest = z.infer<typeof componentRequest>;\ntype GetComponentInput = z.infer<z.ZodObject<typeof getComponentInput>>;\ntype GetGuideInput = z.infer<z.ZodObject<typeof getGuideInput>>;\ntype GetExampleInput = z.infer<z.ZodObject<typeof getExampleInput>>;\ntype GetSetupInput = z.infer<z.ZodObject<typeof getSetupInput>>;\ntype UsageRequest = z.infer<typeof usageRequest>;\ntype ValidateUsageInput = z.infer<z.ZodObject<typeof validateUsageInput>>;\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Summaries shared by several tools\n// ---------------------------------------------------------------------------------------------------------------------\n\nfunction componentSummary(component: ComponentEntry): Record<string, unknown> {\n return {\n name: component.name,\n title: component.title,\n description: component.description,\n selectors: component.selectors,\n import: component.import,\n modules: component.modules,\n resourceUri: component.resourceUri,\n apiResourceUri: component.apiResourceUri,\n publicUrl: component.publicUrl,\n markdownUrl: component.markdownUrl\n };\n}\n\nfunction guideSummary(guide: GuideEntry): Record<string, unknown> {\n return {\n name: guide.name,\n title: guide.title,\n description: guide.description,\n route: guide.route,\n resourceUri: guide.resourceUri,\n publicUrl: guide.publicUrl,\n markdownUrl: guide.markdownUrl\n };\n}\n\nfunction sectionSummary(section: SectionEntry): Record<string, unknown> {\n return { id: section.id, label: section.label, description: section.description, hasCode: section.hasCode, codeLanguage: section.codeLanguage };\n}\n\nfunction exampleCall(component: ComponentEntry, section: SectionEntry): Record<string, unknown> {\n return { tool: 'get_example', arguments: { component: component.name, section: section.id } };\n}\n\nexport function resourceEntries(catalog: Catalog): Record<string, unknown>[] {\n const base = RESOURCE_BASE_URI;\n const entries: Record<string, unknown>[] = [\n { uri: `${base}/llms.txt`, type: 'index', name: 'llms.txt', title: 'ExhaustiveUI llms.txt', mimeType: 'text/plain', publicUrl: `${catalog.site}/llms/llms.txt` },\n { uri: `${base}/llms-full.txt`, type: 'index', name: 'llms-full.txt', title: 'ExhaustiveUI llms-full.txt', mimeType: 'text/plain', publicUrl: `${catalog.site}/llms/llms-full.txt` },\n { uri: `${base}/manifest.json`, type: 'manifest', name: 'manifest.json', title: 'ExhaustiveUI API manifest', mimeType: 'application/json', publicUrl: `${catalog.site}/llms/manifest.json` },\n { uri: `${base}/components.json`, type: 'index', name: 'components.json', title: 'ExhaustiveUI components index', mimeType: 'application/json', publicUrl: `${catalog.site}/llms/components.json` }\n ];\n\n for (const component of catalog.components) {\n entries.push({ uri: component.resourceUri, type: 'component', name: component.name, title: component.title, mimeType: 'text/markdown', publicUrl: component.markdownUrl });\n entries.push({ uri: component.apiResourceUri, type: 'component-api', name: component.name, title: `${component.title} API`, mimeType: 'application/json' });\n }\n\n for (const guide of catalog.guides) {\n entries.push({ uri: guide.resourceUri, type: 'guide', name: guide.name, title: guide.title, mimeType: 'text/markdown', publicUrl: guide.markdownUrl });\n }\n\n return entries;\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// list\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function listTool(ctx: ToolContext, input: ListInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n let items: Record<string, unknown>[];\n\n switch (input.kind) {\n case 'components':\n items = catalog.components.map(componentSummary);\n break;\n case 'directives':\n items = catalog.directives.map((directive) => ({ ...directive }));\n break;\n case 'guides':\n items = catalog.guides.map(guideSummary);\n break;\n case 'examples':\n items = catalog.components.flatMap((component) =>\n component.sections.filter((section) => section.hasCode).map((section) => ({ component: component.name, section: section.id, title: section.label, codeLanguage: section.codeLanguage, nextCall: exampleCall(component, section) }))\n );\n break;\n case 'resources':\n items = resourceEntries(catalog);\n break;\n }\n\n const page = items.slice(input.offset, input.offset + input.limit);\n\n return ok({ kind: input.kind, total: items.length, limit: input.limit, offset: input.offset, items: page }, `${page.length} of ${items.length} ${input.kind} returned.`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// search\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function searchTool(ctx: ToolContext, input: SearchInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const hits = searchCatalog(catalog, input.query, input.scope);\n const page = hits.slice(input.offset, input.offset + input.limit);\n\n return ok({ query: input.query, scope: input.scope, total: hits.length, limit: input.limit, offset: input.offset, results: page }, `${page.length} of ${hits.length} result${hits.length === 1 ? '' : 's'} for \"${input.query}\".`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_component\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function getComponentTool(ctx: ToolContext, input: GetComponentInput): Promise<ToolResult> {\n if (input.components !== undefined) {\n if (input.component !== undefined || input.sections !== undefined || input.includeApi || input.includeExamples || input.detail !== 'compact') {\n throw new ToolError('Use either the single-component fields or \"components\", not both.');\n }\n\n return batch(input.components, componentRequest, 'component', (item) => getSingleComponent(ctx, item));\n }\n\n if (!input.component) {\n throw new ToolError('\"component\" is required.');\n }\n\n return getSingleComponent(ctx, { ...input, component: input.component });\n}\n\nasync function getSingleComponent(ctx: ToolContext, input: ComponentRequest): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const sections = input.sections?.length ? input.sections.map((query) => requireSection(component.sections, query)) : component.sections;\n const withCode = sections.filter((section) => section.hasCode);\n const document = input.detail === 'full' ? await ctx.source.readText(component.docPath) : undefined;\n\n const result: Record<string, unknown> = {\n ...componentSummary(component),\n route: component.route,\n declarations: component.declarations.map((declaration) => ({ kind: declaration.kind, className: declaration.className, selector: declaration.selector, forms: declaration.forms, standalone: declaration.standalone })),\n sections: sections.map(sectionSummary),\n examplesAvailable: withCode.map((section) => ({ section: section.id, title: section.label, codeLanguage: section.codeLanguage, nextCall: exampleCall(component, section) }))\n };\n\n if (input.includeExamples) {\n result.examples = withCode.map((section) => ({ section: section.id, title: section.label, description: section.description, codeLanguage: section.codeLanguage, code: section.code }));\n }\n\n if (input.includeApi) {\n result.api = component.api;\n result.compiled = component.declarations;\n }\n\n if (document !== undefined) {\n result.document = document;\n }\n\n const next = withCode[0] ? ` Next: get_example ${JSON.stringify({ component: component.name, section: withCode[0].id })}.` : '';\n\n return ok({ component: result }, `${component.title}: ${sections.length} section${sections.length === 1 ? '' : 's'}, ${withCode.length} with code; source ${component.resourceUri}.${next}`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_guide\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function getGuideTool(ctx: ToolContext, input: GetGuideInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const guide = findGuide(catalog, input.guide);\n const section = input.section ? requireSection(guide.sections, input.section) : undefined;\n const document = input.detail === 'full' ? await ctx.source.readText(guide.docPath) : undefined;\n\n return ok(\n {\n guide: {\n ...guideSummary(guide),\n section: section ? { ...sectionSummary(section), code: section.code } : undefined,\n sections: guide.sections.map(sectionSummary),\n document\n }\n },\n `${guide.title} guide: ${guide.sections.length} section${guide.sections.length === 1 ? '' : 's'}; source ${guide.resourceUri}.`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_example\n// ---------------------------------------------------------------------------------------------------------------------\n\n/** Section ids the usual feature words map to. */\nconst VARIANT_SECTIONS: Record<string, string[]> = {\n basic: ['basic'],\n default: ['basic'],\n primary: ['basic'],\n danger: ['severity'],\n error: ['severity', 'invalid'],\n warning: ['severity'],\n success: ['severity'],\n busy: ['loading'],\n spinner: ['loading'],\n outline: ['outlined'],\n icon: ['icons', 'icon'],\n size: ['sizes'],\n small: ['sizes'],\n large: ['sizes'],\n pagination: ['paginator', 'page'],\n page: ['paginator'],\n paging: ['paginator'],\n sorting: ['sort', 'singlecolumnsort', 'multiplecolumnssort'],\n sortable: ['sort', 'singlecolumnsort'],\n filtering: ['filter', 'filterbasic', 'filteradvanced'],\n filters: ['filter', 'filterbasic'],\n select: ['selection', 'singleselection', 'multipleselection', 'checkboxselection', 'radiobuttonselection'],\n selected: ['selection'],\n checkbox: ['checkboxselection', 'checkbox'],\n form: ['reactiveforms', 'forms', 'templatedrivenforms'],\n forms: ['reactiveforms', 'forms', 'templatedrivenforms'],\n reactive: ['reactiveforms'],\n ngmodel: ['templatedrivenforms', 'forms'],\n lazy: ['lazy', 'lazyload', 'virtualscroll'],\n virtual: ['virtualscroll', 'lazy'],\n template: ['template', 'templates', 'customtemplate'],\n templating: ['template'],\n disabled: ['disabled'],\n invalid: ['invalid'],\n accessible: ['accessibility']\n};\n\nexport async function getExampleTool(ctx: ToolContext, input: GetExampleInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const withCode = component.sections.filter((section) => section.hasCode);\n\n if (withCode.length === 0) {\n throw new ToolError(`No code example is available for ${component.title}.`, exampleFailure(component, input, undefined));\n }\n\n const query = input.section ?? input.variant;\n let section: SectionEntry | undefined;\n\n if (query) {\n section = findSection(component.sections, query) ?? bestSection(component.sections, [input.section, input.variant]);\n } else {\n section = withCode.find((entry) => compact(entry.id) === 'basic') ?? withCode[0];\n }\n\n if (!section) {\n throw new ToolError(`No section of ${component.title} matches ${describeRequest(input)}.`, exampleFailure(component, input, undefined));\n }\n\n if (!section.hasCode) {\n const alternative = input.variant ? bestSection(withCode, [input.variant]) : undefined;\n\n if (alternative) {\n section = alternative;\n } else {\n throw new ToolError(`Section \"${section.id}\" of ${component.title} has no code example.`, exampleFailure(component, input, section));\n }\n }\n\n return ok(\n {\n component: component.name,\n title: component.title,\n section: section.id,\n sectionTitle: section.label,\n requestedSection: input.section,\n requestedVariant: input.variant,\n description: section.description,\n codeLanguage: section.codeLanguage,\n code: section.code,\n import: component.import,\n resourceUri: component.resourceUri,\n publicUrl: component.publicUrl\n },\n `${component.title} \"${section.label}\" example (${section.codeLanguage}).`\n );\n}\n\nfunction describeRequest(input: GetExampleInput): string {\n return [input.section ? `section \"${input.section}\"` : '', input.variant ? `variant \"${input.variant}\"` : ''].filter(Boolean).join(' and ') || 'the request';\n}\n\nfunction bestSection(sections: readonly SectionEntry[], hints: (string | undefined)[]): SectionEntry | undefined {\n const terms = unique(\n hints\n .filter((hint): hint is string => !!hint)\n .flatMap((hint) => {\n const slug = slugify(hint);\n\n return [slug, ...(VARIANT_SECTIONS[slug] ?? []), ...slug.split('-').flatMap((part) => [part, ...(VARIANT_SECTIONS[part] ?? []), ...expandTerm(part)])];\n })\n .map(compact)\n .filter((term) => term.length > 1)\n );\n\n const scored = sections\n .map((section, index) => {\n const keys = [compact(section.id), compact(section.label)];\n const text = `${section.label} ${section.description ?? ''}`.toLowerCase();\n let score = 0;\n\n if (keys.some((key) => terms.includes(key))) {\n score += 100;\n }\n\n if (keys.some((key) => terms.some((term) => term.length > 3 && (key.includes(term) || term.includes(key))))) {\n score += 60;\n }\n\n if (terms.some((term) => term.length > 3 && text.includes(term))) {\n score += 30;\n }\n\n if (score > 0 && section.hasCode) {\n score += 10;\n }\n\n return { section, index, score };\n })\n .filter((entry) => entry.score > 0)\n .sort((a, b) => b.score - a.score || a.index - b.index);\n\n return scored[0]?.section;\n}\n\nfunction exampleFailure(component: ComponentEntry, input: GetExampleInput, selected: SectionEntry | undefined): Record<string, unknown> {\n const withCode = component.sections.filter((section) => section.hasCode);\n const suggested = bestSection(withCode, [input.section, input.variant]);\n const props = (component.api.props ?? []).filter((prop) => !/^aria/i.test(prop.name));\n const hints = unique([input.section, input.variant].filter((hint): hint is string => !!hint).flatMap((hint) => expandTerm(hint)));\n\n return {\n component: component.name,\n requestedSection: input.section ?? selected?.id,\n requestedVariant: input.variant,\n availableSections: component.sections.map((section) => section.id),\n sectionsWithCode: withCode.map((section) => section.id),\n suggestedSections: unique([suggested?.id, ...withCode.slice(0, 5).map((section) => section.id)].filter((id): id is string => !!id)),\n suggestedApiProps: props\n .filter((prop) => hints.some((hint) => slugify(prop.name).includes(hint) || (prop.description ?? '').toLowerCase().includes(hint)))\n .slice(0, 8)\n .map((prop) => ({ name: prop.name, type: prop.type, description: prop.description })),\n apiAvailable: props.length > 0,\n sourceBackedCodeAvailable: withCode.length > 0,\n componentResourceUri: component.resourceUri,\n apiResourceUri: component.apiResourceUri,\n nextCall: suggested ? exampleCall(component, suggested) : { tool: 'get_component', arguments: { component: component.name, includeApi: true } }\n };\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_setup\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst SETUP_ENVIRONMENTS: { environment: string; guide: string; aliases: string[] }[] = [\n { environment: 'angular-cli', guide: 'installation', aliases: ['angular', 'cli', 'ng', 'npm', 'pnpm', 'yarn', 'install', 'installation', 'setup', 'getting-started', 'quickstart', 'start', 'default'] },\n { environment: 'configuration', guide: 'configuration', aliases: ['config', 'configure', 'provideexhaustiveui', 'providers', 'app-config', 'ripple', 'zindex', 'locale', 'translation'] },\n { environment: 'styled', guide: 'theming/styled', aliases: ['theme', 'themes', 'theming', 'preset', 'presets', 'aura', 'lara', 'nora', 'material', 'design-tokens', 'tokens', 'dark-mode', 'css-variables'] },\n { environment: 'unstyled', guide: 'theming/unstyled', aliases: ['headless', 'no-theme'] },\n { environment: 'tailwind', guide: 'tailwind', aliases: ['tailwindcss', 'tailwind-css', 'tw'] },\n { environment: 'icons', guide: 'icons', aliases: ['icon', 'openng-icons', 'primeicons'] },\n { environment: 'custom-icons', guide: 'customicons', aliases: ['customicons', 'custom-icon', 'font-awesome', 'material-icons', 'svg-icons'] },\n { environment: 'passthrough', guide: 'passthrough', aliases: ['pass-through', 'pt'] }\n];\n\nexport async function getSetupTool(ctx: ToolContext, input: GetSetupInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const requested = input.environment?.trim();\n const key = compact(requested ?? 'angular-cli');\n const match = SETUP_ENVIRONMENTS.find((entry) => compact(entry.environment) === key || entry.aliases.some((alias) => compact(alias) === key));\n let guide: GuideEntry | undefined;\n\n if (match) {\n guide = findGuide(catalog, match.guide);\n } else if (requested) {\n try {\n guide = findGuide(catalog, requested);\n } catch {\n guide = undefined;\n }\n }\n\n if (!guide) {\n throw new ToolError(`Setup environment \"${requested}\" is unsupported. Valid environments: ${SETUP_ENVIRONMENTS.map((entry) => entry.environment).join(', ')}.`, {\n environment: requested,\n validEnvironments: SETUP_ENVIRONMENTS.map((entry) => entry.environment),\n candidates: SETUP_ENVIRONMENTS.map((entry) => ({ environment: entry.environment, guide: entry.guide, aliases: entry.aliases }))\n });\n }\n\n const document = await ctx.source.readText(guide.docPath);\n\n return ok(\n {\n environment: match?.environment ?? guide.name,\n guide: { ...guideSummary(guide), sections: guide.sections.map(sectionSummary), document },\n relatedGuides: SETUP_ENVIRONMENTS.filter((entry) => entry.guide !== match?.guide).map((entry) => ({ environment: entry.environment, nextCall: { tool: 'get_setup', arguments: { environment: entry.environment } } }))\n },\n `${guide.title} setup docs returned (${match?.environment ?? guide.name}).`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// validate_usage\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function validateUsageTool(ctx: ToolContext, input: ValidateUsageInput): Promise<ToolResult> {\n if (input.usages !== undefined) {\n if (input.component !== undefined || input.code !== undefined) {\n throw new ToolError('Use either the single usage fields or \"usages\", not both.');\n }\n\n return batch(input.usages, usageRequest, 'usage', (item) => validateSingleUsage(ctx, item));\n }\n\n if (!input.component || !input.code) {\n throw new ToolError('\"component\" and \"code\" are required.');\n }\n\n return validateSingleUsage(ctx, { component: input.component, code: input.code });\n}\n\nasync function validateSingleUsage(ctx: ToolContext, input: UsageRequest): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const issues = validateComponentUsage(catalog, component, input.code);\n const errors = issues.filter((issue) => issue.severity === 'error');\n const structured = { component: component.name, title: component.title, selectors: component.selectors, valid: errors.length === 0, issues, apiResourceUri: component.apiResourceUri };\n\n if (errors.length > 0) {\n return fail(formatIssues(component.title, issues), structured);\n }\n\n return ok(structured, issues.length > 0 ? `${component.title} usage is valid, with ${issues.length} warning${issues.length === 1 ? '' : 's'}.` : `${component.title} usage is valid against the compiled API.`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// version\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function versionTool(ctx: ToolContext): Promise<ToolResult> {\n const status = ctx.sourceStatus();\n let data: Record<string, unknown>;\n\n try {\n const catalog = await ctx.catalog();\n\n data = {\n libraryVersion: catalog.libraryVersion,\n docsVersion: catalog.docsVersion,\n generatedAt: catalog.generatedAt,\n site: catalog.site,\n counts: {\n components: catalog.components.length,\n directives: catalog.directives.length,\n guides: catalog.guides.length,\n examples: catalog.components.reduce((sum, component) => sum + component.sections.filter((section) => section.hasCode).length, 0)\n }\n };\n } catch (error) {\n data = { error: describeError(error) };\n }\n\n return ok(\n {\n server: { name: ctx.serverName, version: ctx.serverVersion },\n data,\n source: status,\n tools: [...TOOL_NAMES],\n resources: { static: STATIC_RESOURCE_URIS, templates: RESOURCE_TEMPLATE_NAMES },\n prompts: [...PROMPT_NAMES]\n },\n `${ctx.serverName} ${ctx.serverVersion}; ${TOOL_NAMES.length} tools; docs from ${status.mode === 'offline' ? 'the offline snapshot' : status.docsUrl}.`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Batch helper\n// ---------------------------------------------------------------------------------------------------------------------\n\nasync function batch<T>(items: unknown[], schema: z.ZodType<T>, label: string, run: (item: T) => Promise<ToolResult>): Promise<ToolResult> {\n if (items.length === 0) {\n throw new ToolError(`\"${label}s\" must contain at least one item.`);\n }\n\n const results: Record<string, unknown>[] = [];\n\n for (const [index, item] of items.entries()) {\n const parsed = schema.safeParse(item);\n\n if (!parsed.success) {\n results.push({ index, status: 'error', error: `Invalid ${label} item: ${parsed.error.issues.map((issue) => `${issue.path.join('.') || label}: ${issue.message}`).join('; ')}.` });\n continue;\n }\n\n const result = await guard(() => run(parsed.data));\n\n results.push({ index, status: result.isError ? 'error' : 'success', ...result.structuredContent });\n }\n\n const succeeded = results.filter((result) => result.status === 'success').length;\n\n return ok({ total: results.length, succeeded, failed: results.length - succeeded, results }, `${succeeded} of ${results.length} ${label} request${results.length === 1 ? '' : 's'} succeeded.`);\n}\n","import { readFileSync } from 'node:fs';\nimport { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { CatalogLoader, findComponent, findGuide, requireSection } from './catalog';\nimport { RESOURCE_BASE_URI, resolveConfig, type Env, type ServerConfig } from './config';\nimport { createDocsSource, type DocsSource, type FetchLike, type SourceStatus } from './source';\nimport {\n PROMPT_NAMES,\n getComponentInput,\n getComponentTool,\n getExampleInput,\n getExampleTool,\n getGuideInput,\n getGuideTool,\n getSetupInput,\n getSetupTool,\n guard,\n listInput,\n listTool,\n searchInput,\n searchTool,\n validateUsageInput,\n validateUsageTool,\n versionInput,\n versionTool,\n type ToolContext\n} from './tools';\nimport type { Catalog, ComponentEntry } from './types';\n\nexport const SERVER_NAME = '@exhaustive-ui/mcp';\n\nexport interface CreateServerOptions {\n /** Environment to read EXHAUSTIVE_UI_* variables from; defaults to process.env. */\n env?: Env;\n /** Explicit configuration, taking precedence over the environment. */\n config?: Partial<ServerConfig>;\n /** Replace the configured docs source entirely (tests, embedding). */\n source?: DocsSource;\n /** Custom fetch for the live site (tests). */\n fetchImpl?: FetchLike;\n version?: string;\n}\n\nconst readOnly = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } as const;\n\nexport function readPackageVersion(): string {\n try {\n const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as { version?: string };\n\n return pkg.version ?? '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\n/** Build the tool context: configured docs source, catalog loader and status reporting. */\nexport function createToolContext(options: CreateServerOptions = {}): ToolContext {\n const config = resolveConfig(options.env ?? process.env, options.config);\n const configured = options.source ? { source: options.source, status: (): SourceStatus => ({ mode: 'offline', docsUrl: config.docsUrl, cacheTtlSeconds: 0 }) } : createDocsSource(config, options.fetchImpl);\n const loader = new CatalogLoader(configured.source);\n\n return {\n serverName: SERVER_NAME,\n serverVersion: options.version ?? readPackageVersion(),\n source: configured.source,\n catalog: () => loader.load(),\n sourceStatus: () => configured.status()\n };\n}\n\nexport async function createExhaustiveUiMcpServer(options: CreateServerOptions = {}): Promise<McpServer> {\n const ctx = createToolContext(options);\n const server = new McpServer({ name: SERVER_NAME, version: ctx.serverVersion, title: 'ExhaustiveUI docs' }, { capabilities: { tools: {}, resources: {}, prompts: {} } });\n\n registerTools(server, ctx);\n registerResources(server, ctx);\n registerPrompts(server);\n\n return server;\n}\n\nexport async function runExhaustiveUiMcpServer(options: CreateServerOptions = {}): Promise<void> {\n const server = await createExhaustiveUiMcpServer(options);\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n console.error(`${SERVER_NAME} running on stdio`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Tools\n// ---------------------------------------------------------------------------------------------------------------------\n\nfunction registerTools(server: McpServer, ctx: ToolContext): void {\n server.registerTool(\n 'list',\n {\n title: 'List ExhaustiveUI docs',\n description: 'List the ExhaustiveUI components, directives, guides, code examples or MCP resources.',\n inputSchema: listInput,\n annotations: readOnly\n },\n (input) => guard(() => listTool(ctx, input))\n );\n\n server.registerTool(\n 'search',\n {\n title: 'Search ExhaustiveUI docs',\n description: 'Search the ExhaustiveUI component docs, guides, API members (inputs, outputs, templates, PT keys, tokens) and code examples.',\n inputSchema: searchInput,\n annotations: readOnly\n },\n (input) => guard(() => searchTool(ctx, input))\n );\n\n server.registerTool(\n 'get_component',\n {\n title: 'Get component docs',\n description: 'Read the docs of an ExhaustiveUI component: sections, available examples, and optionally its API, compiled declarations and full Markdown document. Accepts a batch of up to 10 components.',\n inputSchema: getComponentInput,\n annotations: readOnly\n },\n (input) => guard(() => getComponentTool(ctx, input))\n );\n\n server.registerTool(\n 'get_guide',\n {\n title: 'Get guide docs',\n description: 'Read an ExhaustiveUI guide (installation, configuration, theming, Tailwind, icons, pass through, accessibility, migration...).',\n inputSchema: getGuideInput,\n annotations: readOnly\n },\n (input) => guard(() => getGuideTool(ctx, input))\n );\n\n server.registerTool(\n 'get_example',\n {\n title: 'Get a code example',\n description: 'Return one complete, source-backed code example of a component (a standalone Angular component with its template and imports).',\n inputSchema: getExampleInput,\n annotations: readOnly\n },\n (input) => guard(() => getExampleTool(ctx, input))\n );\n\n server.registerTool(\n 'get_setup',\n {\n title: 'Get setup docs',\n description: 'Return the installation and setup guidance for ExhaustiveUI in an Angular project (Angular CLI by default; also configuration, styled/unstyled theming, Tailwind, icons, pass through).',\n inputSchema: getSetupInput,\n annotations: readOnly\n },\n (input) => guard(() => getSetupTool(ctx, input))\n );\n\n server.registerTool(\n 'validate_usage',\n {\n title: 'Validate component usage',\n description:\n 'Check an Angular template or component source against the compiled API of an ExhaustiveUI component: unknown inputs and outputs, invalid literal values, unsupported two-way bindings, deprecated inputs, inputs and outputs removed or renamed in v22 (with their replacement), wrong selectors and PrimeNG imports. Accepts a batch of up to 10 usages.',\n inputSchema: validateUsageInput,\n annotations: readOnly\n },\n (input) => guard(() => validateUsageTool(ctx, input))\n );\n\n server.registerTool(\n 'version',\n {\n title: 'ExhaustiveUI MCP version',\n description: 'Return the server version, the documented library version, where the docs are read from (live site or offline snapshot) and the registered tools, resources and prompts.',\n inputSchema: versionInput,\n annotations: readOnly\n },\n () => guard(() => versionTool(ctx))\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Resources\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst STATIC_RESOURCES: { name: string; file: string; title: string; description: string; mimeType: string }[] = [\n { name: 'llms-txt', file: 'llms.txt', title: 'ExhaustiveUI llms.txt', description: 'Index of the ExhaustiveUI guides and components with their URLs.', mimeType: 'text/plain' },\n { name: 'llms-full-txt', file: 'llms-full.txt', title: 'ExhaustiveUI llms-full.txt', description: 'The complete ExhaustiveUI documentation in one Markdown file.', mimeType: 'text/plain' },\n {\n name: 'manifest',\n file: 'manifest.json',\n title: 'ExhaustiveUI API manifest',\n description: 'Compiled metadata of every entry point of @exhaustive-ui/core: selectors, inputs, outputs, templates, pass-through keys, services and types.',\n mimeType: 'application/json'\n },\n { name: 'components-index', file: 'components.json', title: 'ExhaustiveUI components index', description: 'Every component with its documentation sections, examples and API, plus the guides.', mimeType: 'application/json' }\n];\n\nfunction registerResources(server: McpServer, ctx: ToolContext): void {\n for (const resource of STATIC_RESOURCES) {\n const uri = `${RESOURCE_BASE_URI}/${resource.file}`;\n\n server.registerResource(resource.name, uri, { title: resource.title, description: resource.description, mimeType: resource.mimeType }, async () => ({\n contents: [{ uri, mimeType: resource.mimeType, text: await ctx.source.readText(resource.file) }]\n }));\n }\n\n server.registerResource(\n 'component-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/components/{component}.md`, {\n list: async () => ({\n resources: (await ctx.catalog()).components.map((component) => ({ uri: component.resourceUri, name: component.name, title: component.title, description: component.description, mimeType: 'text/markdown' }))\n }),\n complete: { component: completeComponent(ctx) }\n }),\n { title: 'ExhaustiveUI component docs', description: 'Generated Markdown documentation of one component (examples, API tables, pass-through options, theming).', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text: await ctx.source.readText(component.docPath) }] };\n }\n );\n\n server.registerResource(\n 'component-api',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/components/{component}/api.json`, {\n list: async () => ({\n resources: (await ctx.catalog()).components.map((component) => ({ uri: component.apiResourceUri, name: `${component.name}-api`, title: `${component.title} API`, mimeType: 'application/json' }))\n }),\n complete: { component: completeComponent(ctx) }\n }),\n { title: 'ExhaustiveUI component API', description: 'API of one component as JSON: documented members and compiled declarations.', mimeType: 'application/json' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n\n return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(componentApi(component), null, 2) }] };\n }\n );\n\n server.registerResource(\n 'guide-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/pages/{guide}.md`, {\n list: async () => ({\n resources: (await ctx.catalog()).guides.map((guide) => ({ uri: guide.resourceUri, name: guide.name, title: guide.title, description: guide.description, mimeType: 'text/markdown' }))\n }),\n complete: {\n guide: async (value) => {\n const prefix = value.toLowerCase();\n\n return (await ctx.catalog()).guides.map((guide) => guide.name).filter((name) => name.startsWith(prefix));\n }\n }\n }),\n { title: 'ExhaustiveUI guide docs', description: 'Generated Markdown of one guide.', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const guide = findGuide(await ctx.catalog(), variable(variables.guide));\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text: await ctx.source.readText(guide.docPath) }] };\n }\n );\n\n server.registerResource(\n 'example-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/examples/{component}/{section}.md`, {\n list: undefined,\n complete: {\n component: completeComponent(ctx),\n section: async (value, context) => {\n const componentName = context?.arguments?.component;\n\n if (!componentName) {\n return [];\n }\n\n const component = findComponent(await ctx.catalog(), componentName);\n const prefix = value.toLowerCase();\n\n return component.sections\n .filter((section) => section.hasCode)\n .map((section) => section.id)\n .filter((id) => id.toLowerCase().startsWith(prefix));\n }\n }\n }),\n { title: 'ExhaustiveUI examples', description: 'One code example of a component, as Markdown.', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n const section = requireSection(component.sections, variable(variables.section));\n const text = [\n `# ${component.title}: ${section.label}`,\n '',\n section.description ?? '',\n '',\n `Source: ${component.resourceUri}`,\n '',\n section.hasCode ? `\\`\\`\\`${section.codeLanguage}\\n${section.code}\\n\\`\\`\\`` : '_This section has no code example._'\n ].join('\\n');\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text }] };\n }\n );\n}\n\nfunction completeComponent(ctx: ToolContext): (value: string) => Promise<string[]> {\n return async (value) => {\n const prefix = value.toLowerCase();\n\n return (await ctx.catalog()).components\n .map((component) => component.name)\n .filter((name) => name.startsWith(prefix))\n .slice(0, 50);\n };\n}\n\nfunction variable(value: string | string[] | undefined): string {\n const single = Array.isArray(value) ? value[0] : value;\n\n if (!single) {\n throw new Error('Missing resource template variable');\n }\n\n return single;\n}\n\nexport function componentApi(component: ComponentEntry): Record<string, unknown> {\n return {\n name: component.name,\n title: component.title,\n import: component.import,\n modules: component.modules,\n selectors: component.selectors,\n api: component.api,\n compiled: component.declarations\n };\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Prompts\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst PROMPTS: Record<(typeof PROMPT_NAMES)[number], { title: string; description: string; steps: string[] }> = {\n use_component: {\n title: 'Use an ExhaustiveUI component',\n description: 'Add an ExhaustiveUI component to an Angular app correctly, from its documented API and examples.',\n steps: [\n 'Call get_component for the component (includeApi: true when you need inputs, outputs or templates).',\n 'Call get_example for the closest documented example and adapt it; keep the `@exhaustive-ui/core/<name>` import.',\n 'Call validate_usage on the template you wrote before answering.'\n ]\n },\n build_form: {\n title: 'Build a form with ExhaustiveUI',\n description: 'Build an Angular form (reactive or template-driven) with ExhaustiveUI form components.',\n steps: [\n 'Call search with scope \"components\" for the inputs the form needs (inputtext, select, datepicker, checkbox, ...).',\n 'Call get_example with section \"reactiveforms\" or \"forms\" for each component to see the documented form integration.',\n 'Call validate_usage on the final template.'\n ]\n },\n theme_component: {\n title: 'Theme an ExhaustiveUI component',\n description: 'Customize a component with design tokens, pass-through attributes, CSS classes or Tailwind.',\n steps: [\n 'Call get_setup with environment \"styled\" (or \"unstyled\", \"tailwind\", \"passthrough\") for the theming model.',\n 'Call get_component with includeApi: true and read its pt keys, styles (CSS classes) and tokens.',\n 'Prefer design tokens (dt input or theme preset) over overriding CSS classes.'\n ]\n },\n migrate_from_primeng: {\n title: 'Migrate from PrimeNG',\n description: 'Plan the migration of PrimeNG (or Optimus UI) code to ExhaustiveUI.',\n steps: [\n 'Call get_guide for \"primeng\" (from PrimeNG v21) or \"optimus\" (from Optimus UI v2), and follow its steps.',\n 'From PrimeNG: update Angular to v22 with --force while primeng is installed, then run `ng generate @exhaustive-ui/core:migrate-from-primeng`. From Optimus UI: run `ng generate @exhaustive-ui/core:migrate-from-optimus`. Then run `ng update @exhaustive-ui/core --migrate-only --from=3.0.0` and follow get_guide \"v22\".',\n 'For each PrimeNG component used, call get_component with the PrimeNG name: renamed components (dropdown, calendar, sidebar, overlaypanel, inputswitch, tabview...) resolve to their ExhaustiveUI equivalent.',\n 'Replace `primeng/<name>` imports with `@exhaustive-ui/core/<name>` and call validate_usage on each migrated template.'\n ]\n },\n update_to_v22: {\n title: 'Update to ExhaustiveUI v22',\n description: 'Update an application to ExhaustiveUI v22 (Angular v22, Signals API) and fix what ng update leaves for review.',\n steps: [\n 'Call get_guide for \"v22\" (the migration guide to v22) and follow its update steps for the starting point: an ExhaustiveUI prerelease, PrimeNG v21 or Optimus UI.',\n 'Update Angular first (`ng update @angular/core@22 @angular/cli@22`), then run `ng update @exhaustive-ui/core@22`; its nine migrations rewrite styleClass to class, renamed inputs, outputs and templates, bindings of removed inputs and outputs, and the configuration API, and print what they left for review. Handle each reported place as the \"Reviewing the report\" section of the guide describes.',\n 'In TypeScript code that holds a component instance (viewChild, ViewChild, injected component), read inputs as signals (`table.selection()`), write two-way properties with `.set()` (`drawer.visible.set(true)`), and call signal queries.',\n 'Components are OnPush (except Table, TreeTable and DynamicDialog): pass new arrays or objects, or signals, instead of mutating data bound to them in place.',\n 'Call validate_usage on each template that uses a `p-*` element: removed or renamed v22 inputs are reported with their replacement.'\n ]\n },\n audit_component_usage: {\n title: 'Audit ExhaustiveUI usage',\n description: 'Review application code for ExhaustiveUI API mismatches.',\n steps: [\n 'Collect every template that uses a `p-*` element or `p*` directive.',\n 'Call validate_usage with \"usages\" batches of up to 10 { component, code } items.',\n 'Fix errors first (unknown inputs/outputs, invalid values, PrimeNG imports), then review warnings (deprecated inputs).'\n ]\n }\n};\n\nfunction registerPrompts(server: McpServer): void {\n for (const name of PROMPT_NAMES) {\n const prompt = PROMPTS[name];\n\n server.registerPrompt(\n name,\n {\n title: prompt.title,\n description: prompt.description,\n argsSchema: { component: z.string().optional().describe('Component name'), goal: z.string().optional().describe('What the user wants to achieve') }\n },\n ({ component, goal }) => ({\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: [\n `${prompt.description}${component ? ` Component: ${component}.` : ''}`,\n goal ? `Goal: ${goal}` : '',\n '',\n 'Use the ExhaustiveUI MCP tools rather than memory of PrimeNG:',\n ...prompt.steps.map((step, index) => `${index + 1}. ${step}`)\n ]\n .filter((line) => line !== undefined)\n .join('\\n')\n }\n }\n ]\n })\n );\n }\n}\n\nexport type { Catalog, ComponentEntry, DirectiveEntry, GuideEntry, SectionEntry } from './types';\nexport type { DocsSource, FetchLike, SourceStatus } from './source';\nexport type { ServerConfig } from './config';\nexport type { ToolContext, ToolResult } from './tools';\n","#!/usr/bin/env node\nimport { realpathSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { SERVER_NAME, readPackageVersion, runExhaustiveUiMcpServer } from './server';\n\nexport { DEFAULT_CACHE_TTL_SECONDS, DEFAULT_DOCS_URL, DEFAULT_FETCH_TIMEOUT_MS, RESOURCE_BASE_URI, resolveConfig } from './config';\nexport { buildCatalog, CatalogLoader, findComponent, findGuide, findSection } from './catalog';\nexport { CachedSource, FallbackSource, MemorySource, RemoteSource, SnapshotSource, createDocsSource } from './source';\nexport { searchCatalog } from './search';\nexport { validateComponentUsage, type UsageIssue } from './validate';\nexport { PROMPT_NAMES, RESOURCE_TEMPLATE_NAMES, STATIC_RESOURCE_URIS, TOOL_NAMES } from './tools';\nexport { SERVER_NAME, componentApi, createExhaustiveUiMcpServer, createToolContext, readPackageVersion, runExhaustiveUiMcpServer, type CreateServerOptions } from './server';\nexport type { Catalog, ComponentEntry, DirectiveEntry, DocsSource, FetchLike, GuideEntry, SectionEntry, ServerConfig, SourceStatus, ToolContext, ToolResult } from './server';\n\nconst HELP = `${SERVER_NAME}: Model Context Protocol server for the ExhaustiveUI Angular component library.\n\nUsage: exhaustive-ui-mcp [--help] [--version]\n\nThe server speaks MCP over stdio; register it in your MCP client, for example:\n claude mcp add exhaustive-ui -- npx -y @exhaustive-ui/mcp\n\nEnvironment variables:\n EXHAUSTIVE_UI_DOCS_URL Docs site to read from (default https://exhaustive-ui.com)\n EXHAUSTIVE_UI_MCP_CACHE_TTL Seconds a fetched document is reused (default 900)\n EXHAUSTIVE_UI_MCP_FETCH_TIMEOUT Milliseconds before a request to the docs site is abandoned (default 10000)\n EXHAUSTIVE_UI_MCP_OFFLINE Set to 1 to only use the offline snapshot bundled with the package\n EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR Directory of the offline snapshot (default: the package's data/ directory)\n`;\n\nfunction isCliEntrypoint(): boolean {\n const entry = process.argv[1];\n\n if (!entry) {\n return false;\n }\n\n try {\n return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));\n } catch {\n return false;\n }\n}\n\nif (isCliEntrypoint()) {\n const args = process.argv.slice(2);\n\n if (args.includes('--help') || args.includes('-h')) {\n console.log(HELP);\n } else if (args.includes('--version') || args.includes('-v')) {\n console.log(readPackageVersion());\n } else {\n runExhaustiveUiMcpServer().catch((error: unknown) => {\n console.error(`Failed to start ${SERVER_NAME}:`, error);\n process.exit(1);\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,mBAAmB;AAChC,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,oBAAoB;;AAGjC,MAAa,uBAAuB,cAAc,IAAI,IAAI,WAAW,OAAO,KAAK,GAAG,CAAC;AAiBrF,SAAgB,cAAc,MAAW,QAAQ,KAAK,YAAmC,CAAC,GAAiB;CACvG,OAAO;EACH,UAAU,UAAU,WAAW,IAAI,sDAA0C,CAAE,QAAQ,QAAQ,EAAE;EACjG,YAAY,UAAU,cAAc,YAAY,IAAI,gCAAsD,IAAI;EAC9G,gBAAgB,UAAU,kBAAkB,YAAY,IAAI,oCAAyD;EACrH,SAAS,UAAU,WAAW,aAAa,IAAI,yBAAyB;EACxE,aAAa,iBAAiB,YAAY,UAAU,cAAe,IAAI,kCAAkC;CAC7G;AACJ;AAEA,SAAS,YAAY,OAA2B,UAA0B;CACt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;;;;;;;AAe5B,SAAS,kBAA2B;CAChC,MAAM,QAAQ,QAAQ,KAAK;CAE3B,IAAI,CAAC,OACD,OAAO;CAGX,IAAI;EACA,OAAO,aAAa,KAAK,MAAM,aAAa,cAAc,OAAO,KAAK,GAAG,CAAC;CAC9E,QAAQ;EACJ,OAAO;CACX;AACJ;AAEA,IAAI,gBAAgB,GAAG;CACnB,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CAEjC,IAAI,KAAK,SAAS,QAAQ,KAAK,KAAK,SAAS,IAAI,GAC7C,QAAQ,IAAI,IAAI;MACb,IAAI,KAAK,SAAS,WAAW,KAAK,KAAK,SAAS,IAAI,GACvD,QAAQ,IAAI,mBAAmB,CAAC;MAEhC,yBAAyB,CAAC,CAAC,OAAO,UAAmB;EACjD,QAAQ,MAAM,mBAAmB,YAAY,IAAI,KAAK;EACtD,QAAQ,KAAK,CAAC;CAClB,CAAC;AAET"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts","../src/errors.ts","../src/text.ts","../src/catalog.ts","../src/source.ts","../src/search.ts","../src/template.ts","../src/v22.ts","../src/validate.ts","../src/tools.ts","../src/server.ts","../src/index.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url';\n\nexport const DEFAULT_DOCS_URL = 'https://exhaustive-ui.com';\nexport const DEFAULT_CACHE_TTL_SECONDS = 15 * 60;\nexport const DEFAULT_FETCH_TIMEOUT_MS = 10_000;\nexport const RESOURCE_BASE_URI = 'exhaustive-ui://docs';\n\n/** Package-relative path of the offline snapshot written by scripts/prebuild.mjs (works from src/ and from dist/). */\nexport const DEFAULT_SNAPSHOT_DIR = fileURLToPath(new URL('../data', import.meta.url));\n\nexport interface ServerConfig {\n /** Base URL of the docs site; the machine-readable docs live under `${docsUrl}/llms/`. */\n docsUrl: string;\n /** How long a fetched document is reused before it is fetched again. */\n cacheTtlMs: number;\n /** Per-request timeout for the docs site. */\n fetchTimeoutMs: number;\n /** When true the live site is never contacted and only the snapshot is used. */\n offline: boolean;\n /** Directory holding the offline snapshot; undefined disables the fallback. */\n snapshotDir: string | undefined;\n}\n\nexport type Env = Record<string, string | undefined>;\n\nexport function resolveConfig(env: Env = process.env, overrides: Partial<ServerConfig> = {}): ServerConfig {\n return {\n docsUrl: (overrides.docsUrl ?? env.EXHAUSTIVE_UI_DOCS_URL ?? DEFAULT_DOCS_URL).replace(/\\/+$/, ''),\n cacheTtlMs: overrides.cacheTtlMs ?? parseNumber(env.EXHAUSTIVE_UI_MCP_CACHE_TTL, DEFAULT_CACHE_TTL_SECONDS) * 1000,\n fetchTimeoutMs: overrides.fetchTimeoutMs ?? parseNumber(env.EXHAUSTIVE_UI_MCP_FETCH_TIMEOUT, DEFAULT_FETCH_TIMEOUT_MS),\n offline: overrides.offline ?? parseBoolean(env.EXHAUSTIVE_UI_MCP_OFFLINE),\n snapshotDir: 'snapshotDir' in overrides ? overrides.snapshotDir : (env.EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR ?? DEFAULT_SNAPSHOT_DIR)\n };\n}\n\nfunction parseNumber(value: string | undefined, fallback: number): number {\n if (value === undefined || value.trim() === '') {\n return fallback;\n }\n\n const parsed = Number(value);\n\n return Number.isFinite(parsed) && parsed >= 0 ? parsed : fallback;\n}\n\nfunction parseBoolean(value: string | undefined): boolean {\n return value !== undefined && ['1', 'true', 'yes', 'on'].includes(value.trim().toLowerCase());\n}\n","/** A tool request that cannot be fulfilled; the structured content is returned to the client next to the message. */\nexport class ToolError extends Error {\n constructor(\n message: string,\n public readonly structuredContent: Record<string, unknown> = {}\n ) {\n super(message);\n this.name = 'ToolError';\n }\n}\n\n/** The docs source has no such document (HTTP 404, SPA fallback page, or missing snapshot file). */\nexport class DocsNotFoundError extends Error {\n constructor(\n public readonly path: string,\n message = `Document \"${path}\" not found`\n ) {\n super(message);\n this.name = 'DocsNotFoundError';\n }\n}\n\n/** The docs source could not be reached or answered with an error. */\nexport class DocsFetchError extends Error {\n constructor(\n public readonly path: string,\n message: string,\n options?: { cause?: unknown }\n ) {\n super(message, options);\n this.name = 'DocsFetchError';\n }\n}\n\n/** First line of an error message, with local filesystem paths redacted. */\nexport function describeError(error: unknown): string {\n const message = error instanceof Error ? error.message : String(error);\n\n return (\n message\n .split(/\\r?\\n/, 1)[0]!\n .trim()\n .replace(/(?:[A-Za-z]:\\\\|\\/(?:Users|private|tmp|var|home|root)\\/)[^\\s]+/g, '[redacted path]') || 'Tool request failed unexpectedly.'\n );\n}\n","/** Lower-case, dash-separated form of a name, route or title (\"Angular Button Component\" -> \"angular-button-component\"). */\nexport function slugify(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\n/** Letters and digits only (\"Angular CLI\" -> \"angularcli\"); used to compare environment names and selectors loosely. */\nexport function compact(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '');\n}\n\nexport function unique<T>(values: Iterable<T>): T[] {\n return [...new Set(values)];\n}\n\nconst STOP_WORDS = new Set(['a', 'an', 'and', 'as', 'by', 'for', 'from', 'how', 'i', 'in', 'is', 'of', 'on', 'or', 'the', 'to', 'use', 'with']);\n\n/** Significant search terms of a query. */\nexport function tokenize(value: string): string[] {\n return unique(\n slugify(value)\n .split('-')\n .filter((term) => term.length > 1 && !STOP_WORDS.has(term))\n );\n}\n\nconst SYNONYMS: Record<string, string[]> = {\n busy: ['loading', 'spinner'],\n calendar: ['datepicker', 'date'],\n chips: ['autocomplete', 'multiple'],\n danger: ['severity', 'error'],\n date: ['datepicker', 'calendar'],\n datatable: ['table'],\n dialog: ['modal', 'popup'],\n dropdown: ['select'],\n dropzone: ['fileinput', 'upload'],\n error: ['danger', 'severity', 'invalid'],\n file: ['fileinput', 'fileupload', 'upload'],\n files: ['file'],\n filter: ['filtering', 'filters', 'filtered', 'search'],\n filtering: ['filter'],\n filters: ['filter'],\n form: ['forms', 'ngmodel', 'reactive'],\n forms: ['form'],\n icon: ['icons'],\n icons: ['icon'],\n inputswitch: ['toggleswitch'],\n lazy: ['virtual', 'scroller', 'loading'],\n load: ['loading'],\n loading: ['load', 'spinner', 'busy'],\n menu: ['menubar', 'tieredmenu', 'contextmenu', 'panelmenu'],\n modal: ['dialog'],\n notification: ['toast', 'message'],\n overlaypanel: ['popover'],\n page: ['paginator', 'pagination', 'pages'],\n pages: ['paginator', 'pagination'],\n paginate: ['paginator', 'pagination'],\n pagination: ['paginator', 'page'],\n paginator: ['pagination', 'page'],\n popup: ['popover', 'dialog', 'overlay'],\n pt: ['passthrough', 'pass'],\n passthrough: ['pt'],\n select: ['selection', 'selected', 'dropdown'],\n selected: ['selection', 'select'],\n selection: ['select', 'selected'],\n severity: ['danger', 'error', 'success', 'warn', 'info'],\n sidebar: ['drawer'],\n sort: ['sorting', 'sortable', 'sorted'],\n sortable: ['sort'],\n sorting: ['sort'],\n spinner: ['loading', 'progressspinner'],\n switch: ['toggleswitch'],\n tab: ['tabs'],\n tabview: ['tabs'],\n template: ['templates', 'templating', 'ng-template'],\n templates: ['template'],\n templating: ['template'],\n theme: ['theming', 'themes', 'tokens', 'preset'],\n themes: ['theme'],\n theming: ['theme'],\n toggle: ['togglebutton', 'toggleswitch'],\n token: ['tokens', 'theming'],\n tokens: ['token', 'theming'],\n tooltip: ['tooltips'],\n upload: ['fileinput', 'fileupload', 'file'],\n validation: ['invalid', 'forms'],\n virtual: ['scroller', 'virtualscroll', 'lazy']\n};\n\n/** Crude English stemmer, good enough to match \"sorting\" against \"sortable\". */\nexport function stem(term: string): string {\n return term\n .replace(/(?:ing|ers|er|ed|es|s)$/i, '')\n .replace(/(?:tion|ions)$/i, 't')\n .replace(/(?:able)$/i, '');\n}\n\n/** A term together with its synonyms and stem; every entry is at least two characters long. */\nexport function expandTerm(term: string): string[] {\n const base = slugify(term);\n const variants = new Set<string>([base]);\n\n for (const synonym of SYNONYMS[base] ?? []) {\n variants.add(synonym);\n }\n\n const stemmed = stem(base);\n\n if (stemmed !== base) {\n variants.add(stemmed);\n }\n\n return [...variants].filter((variant) => variant.length > 1);\n}\n\n/** Whether one of the (expanded) terms occurs in the text; prefix matches count for terms longer than three characters. */\nexport function matchesTerm(term: string, lowerText: string, textTerms: readonly string[]): boolean {\n return expandTerm(term).some((variant) => lowerText.includes(variant) || textTerms.includes(variant) || textTerms.some((textTerm) => variant.length > 3 && textTerm.length > 3 && (textTerm.startsWith(variant) || variant.startsWith(textTerm))));\n}\n\n/** Up to five short excerpts around the occurrences of the needle. */\nexport function snippets(text: string, needle: string, limit = 5): string[] {\n const lower = text.toLowerCase();\n const target = needle.toLowerCase();\n const results: string[] = [];\n let index = lower.indexOf(target);\n\n while (index !== -1 && results.length < limit) {\n const start = Math.max(0, index - 45);\n const end = Math.min(text.length, index + target.length + 45);\n\n results.push(text.slice(start, end).replace(/\\s+/g, ' ').trim());\n index = lower.indexOf(target, index + target.length);\n }\n\n return results;\n}\n\n/** The best snippets for a term, trying its synonyms when the term itself does not occur. */\nexport function snippetsForTerm(text: string, term: string): string[] {\n for (const variant of expandTerm(term)) {\n const found = snippets(text, variant);\n\n if (found.length > 0) {\n return found;\n }\n }\n\n return [];\n}\n\n/** Human readable title without the \"Angular ... Component\" wrapper of the generated docs (\"Angular Button Component\" -> \"Button\"). */\nexport function shortTitle(title: string): string {\n return title.replace(/^Angular\\s+/i, '').replace(/\\s+(Component|Directive|API)$/i, '');\n}\n","import { RESOURCE_BASE_URI } from './config';\nimport { ToolError } from './errors';\nimport type { DocsSource } from './source';\nimport { compact, expandTerm, shortTitle, slugify, unique } from './text';\nimport type { Catalog, CodeLanguage, ComponentEntry, ComponentsJson, DirectiveEntry, GuideEntry, ManifestEntryPoint, ManifestJson, RawSection, SectionEntry } from './types';\n\n/** Names PrimeNG users (and older ExhaustiveUI versions) may still use for a component. */\nexport const COMPONENT_ALIASES: Record<string, string> = {\n calendar: 'datepicker',\n chips: 'autocomplete',\n 'data-table': 'table',\n datatable: 'table',\n dropdown: 'select',\n 'file-input': 'fileinput',\n 'inplace-editor': 'inplace',\n inputswitch: 'toggleswitch',\n overlaypanel: 'popover',\n sidebar: 'drawer',\n tabview: 'tabs',\n virtualscroller: 'scroller'\n};\n\nexport interface BuildCatalogOptions {\n resourceBaseUri?: string;\n}\n\n/** Normalize the two generated indexes into one catalog. */\nexport function buildCatalog(componentsJson: ComponentsJson, manifest: ManifestJson, options: BuildCatalogOptions = {}): Catalog {\n const base = (options.resourceBaseUri ?? RESOURCE_BASE_URI).replace(/\\/+$/, '');\n const site = manifest.site.replace(/\\/+$/, '');\n const entryPoints = new Map<string, ManifestEntryPoint>(manifest.entryPoints.map((entryPoint) => [entryPoint.name, entryPoint]));\n const guideNames = new Set(componentsJson.pages.map((page) => page.name));\n\n const guides: GuideEntry[] = componentsJson.pages.map((page) => ({\n kind: 'guide',\n name: page.name,\n title: page.title,\n description: page.description ?? '',\n route: `/${page.path}`,\n publicUrl: `${site}/${page.path}`,\n markdownUrl: `${site}/llms/pages/${page.name}.md`,\n docPath: `pages/${page.name}.md`,\n resourceUri: `${base}/pages/${page.name}.md`,\n sections: page.sections.map(normalizeSection)\n }));\n\n const components: ComponentEntry[] = componentsJson.components\n // The generator lists every docs route as a component, including the LLMs page itself: a route with no compiled\n // entry point and no code example documents nothing from the library.\n .filter((component) => entryPoints.has(component.name) || (!guideNames.has(component.name) && component.sections.some((section) => section.examples?.typescript || section.examples?.html)))\n .map((component) => {\n const entryPoint = entryPoints.get(component.name);\n const declarations = entryPoint?.declarations ?? [];\n\n return {\n kind: 'component',\n name: component.name,\n title: component.title,\n description: component.description ?? '',\n route: `/${component.name}`,\n publicUrl: `${site}/${component.name}`,\n markdownUrl: `${site}/llms/components/${component.name}.md`,\n docPath: `components/${component.name}.md`,\n resourceUri: `${base}/components/${component.name}.md`,\n apiResourceUri: `${base}/components/${component.name}/api.json`,\n import: entryPoint?.import,\n modules: entryPoint?.modules ?? [],\n selectors: unique(declarations.flatMap((declaration) => splitSelectors(declaration.selector))),\n declarations,\n sections: component.sections.map(normalizeSection),\n api: component.api ?? {}\n };\n });\n\n const componentNames = new Set(components.map((component) => component.name));\n const directives: DirectiveEntry[] = manifest.entryPoints.flatMap((entryPoint) =>\n (entryPoint.declarations ?? [])\n .filter((declaration) => declaration.kind === 'directive' && declaration.selector)\n .map((declaration) => ({\n className: declaration.className,\n selector: declaration.selector!,\n entryPoint: entryPoint.name,\n import: entryPoint.import,\n description: declaration.description,\n component: componentNames.has(entryPoint.name) ? entryPoint.name : undefined\n }))\n );\n\n return {\n libraryVersion: manifest.version,\n docsVersion: componentsJson.version,\n generatedAt: componentsJson.generatedAt,\n site,\n components,\n guides,\n directives\n };\n}\n\nfunction normalizeSection(section: RawSection): SectionEntry {\n const examples = section.examples ?? undefined;\n const [code, codeLanguage] = pickCode(examples);\n\n return {\n id: section.id,\n label: section.label,\n description: section.description || undefined,\n hasCode: code !== undefined,\n codeLanguage,\n code\n };\n}\n\nfunction pickCode(examples: RawSection['examples']): [string | undefined, CodeLanguage | undefined] {\n if (examples?.typescript?.trim()) {\n return [examples.typescript, 'typescript'];\n }\n\n if (examples?.html?.trim()) {\n return [examples.html, 'html'];\n }\n\n if (examples?.command?.trim()) {\n return [examples.command, 'bash'];\n }\n\n return [undefined, undefined];\n}\n\n/** \"p-autoComplete, p-autocomplete, p-auto-complete\" -> three selectors. */\nexport function splitSelectors(selector: string | undefined): string[] {\n return (selector ?? '')\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean);\n}\n\n/** Attribute name of an attribute selector (\"[pTooltip]\" -> \"pTooltip\"), or undefined for element selectors. */\nexport function attributeSelectorName(selector: string): string | undefined {\n const match = /^\\[([^\\]=]+)(?:=[^\\]]*)?\\]$/.exec(selector.trim());\n\n return match?.[1];\n}\n\n/** Every spelling under which a component can be requested. */\nfunction componentKeys(component: ComponentEntry): string[] {\n const keys = [component.name, shortTitle(component.title), component.import?.split('/').pop() ?? ''];\n\n for (const selector of component.selectors) {\n const attribute = attributeSelectorName(selector);\n\n keys.push(attribute ?? selector, (attribute ?? selector).replace(/^p-?/i, ''));\n }\n\n for (const declaration of component.declarations) {\n keys.push(declaration.className);\n }\n\n return unique(keys.map(compact).filter(Boolean));\n}\n\n/** Resolve a component by name, title, selector, class name, alias, route or URL. */\nexport function findComponent(catalog: Catalog, query: string): ComponentEntry {\n const raw = query.trim();\n const lastSegment = raw\n .replace(/^https?:\\/\\/[^/]+/, '')\n .replace(/^exhaustive-ui:\\/\\/docs/, '')\n .replace(/\\.md$/, '')\n .replace(/\\/api\\.json$/, '')\n .split('/')\n .filter(Boolean)\n .pop();\n const candidates = unique([raw, lastSegment ?? raw].map(compact).filter(Boolean));\n const aliased = candidates.map((candidate) => COMPONENT_ALIASES[candidate]).filter((name): name is string => !!name);\n\n for (const candidate of [...candidates, ...aliased.map(compact)]) {\n const exact = catalog.components.find((component) => component.name === candidate) ?? catalog.components.find((component) => componentKeys(component).includes(candidate));\n\n if (exact) {\n return exact;\n }\n }\n\n const suggestions = suggestComponents(catalog, raw);\n\n throw new ToolError(`Component \"${query}\" not found.${suggestions.length ? ` Did you mean: ${suggestions.join(', ')}?` : ''}`, {\n component: query,\n suggestions,\n nextCall: { tool: 'list', arguments: { kind: 'components' } }\n });\n}\n\nexport function suggestComponents(catalog: Catalog, query: string, limit = 5): string[] {\n const needle = compact(query);\n const terms = expandTerm(query).map(compact);\n const scored = catalog.components\n .map((component) => {\n const keys = componentKeys(component);\n let score = 0;\n\n if (needle && keys.some((key) => key.startsWith(needle) || needle.startsWith(key))) {\n score += 10;\n }\n\n if (needle && keys.some((key) => editDistance(key, needle) <= Math.max(1, Math.floor(needle.length / 4)))) {\n score += 8;\n }\n\n if (needle && keys.some((key) => key.includes(needle) || needle.includes(key))) {\n score += 5;\n }\n\n if (needle.length >= 4 && keys.some((key) => key.slice(0, 4) === needle.slice(0, 4))) {\n score += 3;\n }\n\n if (terms.some((term) => keys.some((key) => key.includes(term)))) {\n score += 2;\n }\n\n return { name: component.name, score };\n })\n .filter((entry) => entry.score > 0)\n .sort((a, b) => b.score - a.score || a.name.localeCompare(b.name));\n\n return scored.slice(0, limit).map((entry) => entry.name);\n}\n\n/** Levenshtein distance, for \"did you mean\" suggestions on short names. */\nfunction editDistance(a: string, b: string): number {\n if (a === b) {\n return 0;\n }\n\n let previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n\n for (let j = 1; j <= b.length; j++) {\n current[j] = Math.min(previous[j]! + 1, current[j - 1]! + 1, previous[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n\n previous = current;\n }\n\n return previous[b.length]!;\n}\n\n/** Resolve a guide by name (\"installation\"), route (\"theming/styled\"), title, markdown path or URL. */\nexport function findGuide(catalog: Catalog, query: string): GuideEntry {\n const normalized = normalizeGuidePath(query);\n const last = normalized.split('/').pop() ?? normalized;\n const byPath = catalog.guides.filter((guide) => guideKeys(guide).includes(normalized));\n\n if (byPath.length === 1) {\n return byPath[0]!;\n }\n\n const byName = catalog.guides.filter((guide) => [guide.name, slugify(guide.title), compact(guide.title)].includes(last) || compact(guide.name) === compact(last));\n\n if (byName.length === 1) {\n return byName[0]!;\n }\n\n const candidates = byPath.length > 1 ? byPath : byName;\n\n if (candidates.length > 1) {\n throw new ToolError(`Guide \"${query}\" is ambiguous. Use the full route of one of the candidates.`, {\n guide: query,\n candidates: candidates.map((guide) => ({ name: guide.name, title: guide.title, route: guide.route, resourceUri: guide.resourceUri }))\n });\n }\n\n throw new ToolError(`Guide \"${query}\" not found.`, {\n guide: query,\n availableGuides: catalog.guides.map((guide) => guide.route.slice(1)),\n nextCall: { tool: 'list', arguments: { kind: 'guides' } }\n });\n}\n\nfunction guideKeys(guide: GuideEntry): string[] {\n return unique([guide.name, guide.route.slice(1), guide.docPath.replace(/\\.md$/, ''), slugify(guide.title)].map(normalizeGuidePath));\n}\n\nfunction normalizeGuidePath(value: string): string {\n return value\n .trim()\n .toLowerCase()\n .replace(/^exhaustive-ui:\\/\\/docs\\//, '')\n .replace(/^https?:\\/\\/[^/]+\\//, '')\n .replace(/^llms\\/pages\\//, '')\n .replace(/^pages\\//, '')\n .replace(/\\.md$/, '')\n .split('/')\n .map(slugify)\n .filter(Boolean)\n .join('/');\n}\n\n/** Resolve a section of a component or guide by id or label; undefined when nothing matches. */\nexport function findSection(sections: readonly SectionEntry[], query: string): SectionEntry | undefined {\n const needle = compact(query);\n\n return sections.find((section) => compact(section.id) === needle || compact(section.label) === needle) ?? sections.find((section) => slugify(section.label).includes(slugify(query)));\n}\n\nexport function requireSection(sections: readonly SectionEntry[], query: string): SectionEntry {\n const section = findSection(sections, query);\n\n if (!section) {\n throw new ToolError(`Section \"${query}\" not found.`, { section: query, availableSections: sections.map((entry) => entry.id) });\n }\n\n return section;\n}\n\n/** Loads and caches the catalog; a rebuild only happens when the source hands back different index documents. */\nexport class CatalogLoader {\n private cached: { components: string; manifest: string; catalog: Catalog } | undefined;\n\n constructor(\n private readonly source: DocsSource,\n private readonly options: BuildCatalogOptions = {}\n ) {}\n\n async load(): Promise<Catalog> {\n const [components, manifest] = await Promise.all([this.source.readText('components.json'), this.source.readText('manifest.json')]);\n\n if (this.cached && this.cached.components === components && this.cached.manifest === manifest) {\n return this.cached.catalog;\n }\n\n const catalog = buildCatalog(parseJson<ComponentsJson>(components, 'components.json'), parseJson<ManifestJson>(manifest, 'manifest.json'), this.options);\n\n this.cached = { components, manifest, catalog };\n\n return catalog;\n }\n}\n\nfunction parseJson<T>(text: string, name: string): T {\n try {\n return JSON.parse(text) as T;\n } catch (error) {\n throw new Error(`${name} is not valid JSON: ${(error as Error).message}`);\n }\n}\n","import { readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport type { ServerConfig } from './config';\nimport { DocsFetchError, DocsNotFoundError, describeError } from './errors';\n\n/**\n * Where the machine-readable docs come from. Paths are relative to the `/llms/` directory of the docs site:\n * `components.json`, `manifest.json`, `llms.txt`, `llms-full.txt`, `components/<name>.md`, `pages/<name>.md`.\n */\nexport interface DocsSource {\n readonly kind: string;\n readText(docsPath: string): Promise<string>;\n}\n\nconst DOCS_PATH_PATTERN = /^(?:components\\.json|manifest\\.json|llms\\.txt|llms-full\\.txt|(?:components|pages)\\/[a-z0-9][a-z0-9._-]*\\.md)$/;\n\n/** Reject anything that is not one of the generated docs files, so a crafted resource URI cannot read elsewhere. */\nexport function assertDocsPath(docsPath: string): string {\n if (!DOCS_PATH_PATTERN.test(docsPath)) {\n throw new DocsNotFoundError(docsPath, `\"${docsPath}\" is not a generated docs file`);\n }\n\n return docsPath;\n}\n\n/** In-memory documents, for tests and embedding. */\nexport class MemorySource implements DocsSource {\n readonly kind = 'memory';\n\n constructor(private readonly documents: Map<string, string> = new Map()) {}\n\n async readText(docsPath: string): Promise<string> {\n const text = this.documents.get(assertDocsPath(docsPath));\n\n if (text === undefined) {\n throw new DocsNotFoundError(docsPath);\n }\n\n return text;\n }\n}\n\n/** The offline snapshot produced at build time by scripts/prebuild.mjs. */\nexport class SnapshotSource implements DocsSource {\n readonly kind = 'snapshot';\n\n constructor(readonly directory: string) {}\n\n async readText(docsPath: string): Promise<string> {\n const file = path.join(this.directory, assertDocsPath(docsPath));\n\n try {\n return await readFile(file, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n throw new DocsNotFoundError(docsPath, `Document \"${docsPath}\" is not in the offline snapshot`);\n }\n\n throw new DocsFetchError(docsPath, `Cannot read \"${docsPath}\" from the offline snapshot: ${describeError(error)}`, { cause: error });\n }\n }\n}\n\nexport type FetchLike = (input: string, init?: { signal?: AbortSignal; headers?: Record<string, string> }) => Promise<{ ok: boolean; status: number; headers: { get(name: string): string | null }; text(): Promise<string> }>;\n\nexport interface RemoteSourceOptions {\n baseUrl: string;\n timeoutMs: number;\n fetchImpl?: FetchLike;\n userAgent?: string;\n}\n\n/** The live docs site. A not-found path is served as the SPA shell with HTTP 200, so HTML answers are treated as misses. */\nexport class RemoteSource implements DocsSource {\n readonly kind = 'remote';\n private readonly fetchImpl: FetchLike;\n\n constructor(private readonly options: RemoteSourceOptions) {\n this.fetchImpl = options.fetchImpl ?? (globalThis.fetch as unknown as FetchLike);\n }\n\n urlFor(docsPath: string): string {\n return `${this.options.baseUrl.replace(/\\/+$/, '')}/llms/${assertDocsPath(docsPath)}`;\n }\n\n async readText(docsPath: string): Promise<string> {\n const url = this.urlFor(docsPath);\n let response: Awaited<ReturnType<FetchLike>>;\n\n try {\n response = await this.fetchImpl(url, {\n signal: AbortSignal.timeout(this.options.timeoutMs),\n headers: {\n accept: 'text/markdown, text/plain, application/json;q=0.9, */*;q=0.1',\n 'user-agent': this.options.userAgent ?? '@exhaustive-ui/mcp'\n }\n });\n } catch (error) {\n throw new DocsFetchError(docsPath, `Cannot reach ${url}: ${describeError(error)}`, { cause: error });\n }\n\n if (response.status === 404) {\n throw new DocsNotFoundError(docsPath, `${url} answered HTTP 404`);\n }\n\n if (!response.ok) {\n throw new DocsFetchError(docsPath, `${url} answered HTTP ${response.status}`);\n }\n\n const text = await response.text();\n\n if (/text\\/html/i.test(response.headers.get('content-type') ?? '') || /^\\s*<(?:!doctype|html)/i.test(text)) {\n throw new DocsNotFoundError(docsPath, `${url} is not published (the site answered with its HTML shell)`);\n }\n\n return text;\n }\n}\n\ninterface CacheEntry {\n value: string;\n expiresAt: number;\n}\n\nexport interface CachedSourceOptions {\n ttlMs: number;\n now?: () => number;\n}\n\n/** Remembers documents for a TTL, dedupes concurrent reads, and serves a stale copy when a refresh fails. */\nexport class CachedSource implements DocsSource {\n readonly kind: string;\n private readonly entries = new Map<string, CacheEntry>();\n private readonly pending = new Map<string, Promise<string>>();\n private readonly now: () => number;\n private hits = 0;\n private misses = 0;\n\n constructor(\n private readonly inner: DocsSource,\n private readonly options: CachedSourceOptions\n ) {\n this.kind = inner.kind;\n this.now = options.now ?? Date.now;\n }\n\n async readText(docsPath: string): Promise<string> {\n const cached = this.entries.get(docsPath);\n\n if (cached && cached.expiresAt > this.now()) {\n this.hits++;\n\n return cached.value;\n }\n\n const inFlight = this.pending.get(docsPath);\n\n if (inFlight) {\n return inFlight;\n }\n\n this.misses++;\n\n const request = this.inner\n .readText(docsPath)\n .then((value) => {\n this.entries.set(docsPath, { value, expiresAt: this.now() + this.options.ttlMs });\n\n return value;\n })\n .catch((error: unknown) => {\n if (cached) {\n // Keep serving what we have rather than failing: the docs change rarely.\n this.entries.set(docsPath, { value: cached.value, expiresAt: this.now() + this.options.ttlMs });\n\n return cached.value;\n }\n\n throw error;\n })\n .finally(() => {\n this.pending.delete(docsPath);\n });\n\n this.pending.set(docsPath, request);\n\n return request;\n }\n\n invalidate(): void {\n this.entries.clear();\n }\n\n stats(): { entries: number; hits: number; misses: number; ttlMs: number } {\n return { entries: this.entries.size, hits: this.hits, misses: this.misses, ttlMs: this.options.ttlMs };\n }\n}\n\nexport interface FallbackStatus {\n primary: string;\n fallback: string;\n fallbackReads: number;\n lastFallbackAt?: string;\n lastFallbackReason?: string;\n /** Set while the primary is skipped after a connection failure. */\n primarySkippedUntil?: string;\n}\n\nexport interface FallbackSourceOptions {\n /** After a connection failure the primary is not retried for this long, so an offline session stays responsive. */\n cooldownMs?: number;\n now?: () => number;\n}\n\nexport const DEFAULT_FALLBACK_COOLDOWN_MS = 60_000;\n\n/** Reads from the primary source and falls back to the secondary one when the primary fails for any reason. */\nexport class FallbackSource implements DocsSource {\n readonly kind: string;\n private readonly cooldownMs: number;\n private readonly now: () => number;\n private fallbackReads = 0;\n private lastFallbackAt: string | undefined;\n private lastFallbackReason: string | undefined;\n private primarySkippedUntil = 0;\n\n constructor(\n private readonly primary: DocsSource,\n private readonly fallback: DocsSource,\n options: FallbackSourceOptions = {}\n ) {\n this.kind = `${primary.kind}+${fallback.kind}`;\n this.cooldownMs = options.cooldownMs ?? DEFAULT_FALLBACK_COOLDOWN_MS;\n this.now = options.now ?? Date.now;\n }\n\n async readText(docsPath: string): Promise<string> {\n if (this.primarySkippedUntil > this.now()) {\n try {\n return await this.readFallback(docsPath, undefined);\n } catch {\n // The snapshot lacks it: the live site is the only hope, cool-down or not.\n }\n }\n\n try {\n return await this.primary.readText(docsPath);\n } catch (primaryError) {\n if (primaryError instanceof DocsFetchError) {\n this.primarySkippedUntil = this.now() + this.cooldownMs;\n }\n\n try {\n return await this.readFallback(docsPath, primaryError);\n } catch (fallbackError) {\n // A document missing from both places is a not-found; otherwise report why the live site failed.\n throw primaryError instanceof DocsNotFoundError && fallbackError instanceof DocsNotFoundError ? fallbackError : primaryError;\n }\n }\n }\n\n private async readFallback(docsPath: string, primaryError: unknown): Promise<string> {\n const text = await this.fallback.readText(docsPath);\n\n this.fallbackReads++;\n this.lastFallbackAt = new Date().toISOString();\n\n if (primaryError !== undefined) {\n this.lastFallbackReason = describeError(primaryError);\n }\n\n return text;\n }\n\n status(): FallbackStatus {\n return {\n primary: this.primary.kind,\n fallback: this.fallback.kind,\n fallbackReads: this.fallbackReads,\n lastFallbackAt: this.lastFallbackAt,\n lastFallbackReason: this.lastFallbackReason,\n primarySkippedUntil: this.primarySkippedUntil > this.now() ? new Date(this.primarySkippedUntil).toISOString() : undefined\n };\n }\n}\n\nexport interface SourceStatus {\n mode: 'remote' | 'offline';\n docsUrl: string;\n cacheTtlSeconds: number;\n snapshotDir?: string;\n fallback?: FallbackStatus;\n cache?: { entries: number; hits: number; misses: number };\n}\n\nexport interface ConfiguredSource {\n source: DocsSource;\n status(): SourceStatus;\n}\n\n/** The runtime source: the live site behind a TTL cache, falling back to the offline snapshot (or the snapshot alone when offline). */\nexport function createDocsSource(config: ServerConfig, fetchImpl?: FetchLike): ConfiguredSource {\n const snapshot = config.snapshotDir ? new SnapshotSource(config.snapshotDir) : undefined;\n\n if (config.offline) {\n if (!snapshot) {\n throw new Error('Offline mode needs an offline snapshot directory (EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR).');\n }\n\n return {\n source: snapshot,\n status: () => ({ mode: 'offline', docsUrl: config.docsUrl, cacheTtlSeconds: 0, snapshotDir: snapshot.directory })\n };\n }\n\n const remote = new CachedSource(new RemoteSource({ baseUrl: config.docsUrl, timeoutMs: config.fetchTimeoutMs, fetchImpl }), { ttlMs: config.cacheTtlMs });\n const fallback = snapshot ? new FallbackSource(remote, snapshot) : undefined;\n\n return {\n source: fallback ?? remote,\n status: () => ({\n mode: 'remote',\n docsUrl: config.docsUrl,\n cacheTtlSeconds: Math.round(config.cacheTtlMs / 1000),\n snapshotDir: snapshot?.directory,\n fallback: fallback?.status(),\n cache: remote.stats()\n })\n };\n}\n","import { shortTitle, slugify, snippets, snippetsForTerm, matchesTerm, tokenize, unique } from './text';\nimport type { Catalog, ComponentEntry, GuideEntry } from './types';\n\nexport type SearchScope = 'all' | 'components' | 'guides' | 'api' | 'examples';\n\ninterface IndexedField {\n text: string;\n lower: string;\n terms: readonly string[];\n weight: number;\n}\n\ninterface IndexEntry {\n scope: Exclude<SearchScope, 'all'>;\n result: Record<string, unknown>;\n fields: IndexedField[];\n}\n\nexport interface SearchHit extends Record<string, unknown> {\n type: string;\n score: number;\n matchedTerms: string[];\n matches: string[];\n}\n\nconst indexes = new WeakMap<Catalog, IndexEntry[]>();\n\n/** Search components, guides, API members and examples of the catalog. Results are sorted by relevance. */\nexport function searchCatalog(catalog: Catalog, query: string, scope: SearchScope = 'all'): SearchHit[] {\n const phrase = query.trim().toLowerCase();\n const terms = tokenize(query);\n const entries = indexFor(catalog).filter((entry) => (scope === 'all' ? entry.scope === 'components' || entry.scope === 'guides' : entry.scope === scope));\n const hits: SearchHit[] = [];\n\n for (const entry of entries) {\n const match = scoreEntry(entry.fields, phrase, terms);\n\n if (match) {\n hits.push({ ...entry.result, type: String(entry.result.type), score: match.score, matchedTerms: match.matchedTerms, matches: match.matches });\n }\n }\n\n return hits.sort((a, b) => b.score - a.score || b.matchedTerms.length - a.matchedTerms.length || String(a.title ?? a.name).localeCompare(String(b.title ?? b.name)));\n}\n\nfunction scoreEntry(fields: IndexedField[], phrase: string, terms: string[]): { score: number; matchedTerms: string[]; matches: string[] } | undefined {\n const matchedTerms = new Set<string>();\n const matches: string[] = [];\n let score = 0;\n let phraseMatched = false;\n\n for (const field of fields) {\n if (!field.text) {\n continue;\n }\n\n if (phrase && field.lower.includes(phrase)) {\n phraseMatched = true;\n score += 100 * field.weight;\n matches.push(...snippets(field.text, phrase));\n }\n\n for (const term of terms) {\n if (matchesTerm(term, field.lower, field.terms)) {\n matchedTerms.add(term);\n score += field.weight;\n matches.push(...snippetsForTerm(field.text, term));\n }\n }\n }\n\n const required = terms.length <= 2 ? 1 : Math.max(2, Math.ceil(terms.length * 0.4));\n\n if (!phraseMatched && matchedTerms.size < required) {\n return undefined;\n }\n\n return { score, matchedTerms: [...matchedTerms], matches: unique(matches).slice(0, 5) };\n}\n\nfunction indexFor(catalog: Catalog): IndexEntry[] {\n let index = indexes.get(catalog);\n\n if (!index) {\n index = buildIndex(catalog);\n indexes.set(catalog, index);\n }\n\n return index;\n}\n\nfunction buildIndex(catalog: Catalog): IndexEntry[] {\n const entries: IndexEntry[] = [];\n\n for (const component of catalog.components) {\n entries.push(componentEntry(component));\n entries.push(...apiEntries(component));\n entries.push(...exampleEntries(component));\n }\n\n for (const guide of catalog.guides) {\n entries.push(guideEntry(guide));\n }\n\n return entries;\n}\n\nfunction componentEntry(component: ComponentEntry): IndexEntry {\n const api = component.api;\n const apiText = [...(api.props ?? []), ...(api.emits ?? []), ...(api.templates ?? []), ...(api.methods ?? []), ...(api.pt ?? [])].map((member) => `${member.name} ${member.description ?? ''}`).join(' ');\n const sectionsText = component.sections.map((section) => `${section.label} ${section.description ?? ''}`).join(' ');\n const codeText = component.sections.map((section) => section.code ?? '').join('\\n');\n\n return {\n scope: 'components',\n result: {\n type: 'component',\n name: component.name,\n title: component.title,\n description: component.description,\n selectors: component.selectors,\n import: component.import,\n resourceUri: component.resourceUri,\n publicUrl: component.publicUrl,\n nextCall: { tool: 'get_component', arguments: { component: component.name } }\n },\n fields: [\n field([component.name, shortTitle(component.title), ...component.selectors, component.import ?? '', ...component.declarations.map((declaration) => declaration.className)].join(' '), 8),\n field(component.description, 4),\n field(sectionsText, 3),\n field(apiText, 3),\n field(codeText, 1)\n ]\n };\n}\n\nfunction guideEntry(guide: GuideEntry): IndexEntry {\n return {\n scope: 'guides',\n result: {\n type: 'guide',\n name: guide.name,\n title: guide.title,\n description: guide.description,\n route: guide.route,\n resourceUri: guide.resourceUri,\n publicUrl: guide.publicUrl,\n nextCall: { tool: 'get_guide', arguments: { guide: guide.name } }\n },\n fields: [\n field([guide.name, guide.route, guide.title].join(' '), 8),\n field(guide.description, 4),\n field(guide.sections.map((section) => `${section.label} ${section.description ?? ''}`).join(' '), 3),\n field(guide.sections.map((section) => section.code ?? '').join('\\n'), 1)\n ]\n };\n}\n\nfunction apiEntries(component: ComponentEntry): IndexEntry[] {\n const api = component.api;\n const members: { member: string; name: string; type?: string; description?: string }[] = [\n ...(api.props ?? []).map((prop) => ({ member: 'prop', name: prop.name, type: prop.type, description: prop.description })),\n ...(api.emits ?? []).map((emit) => ({ member: 'emit', name: emit.name, type: emit.parameters?.map((parameter) => `${parameter.name}: ${parameter.type ?? 'unknown'}`).join(', '), description: emit.description })),\n ...(api.templates ?? []).map((template) => ({ member: 'template', name: template.name, type: template.type, description: template.description })),\n ...(api.methods ?? []).map((method) => ({ member: 'method', name: method.name, type: method.returnType, description: method.description })),\n ...(api.pt ?? []).map((pt) => ({ member: 'pt', name: pt.name, type: pt.type, description: pt.description })),\n ...(api.styles ?? []).map((style) => ({ member: 'style', name: style.class, description: style.description })),\n ...(api.tokens ?? []).map((token) => ({ member: 'token', name: token.token, type: token.variable, description: token.description }))\n ];\n\n return members.map((member) => ({\n scope: 'api',\n result: {\n type: 'api',\n component: component.name,\n member: member.member,\n name: member.name,\n memberType: member.type,\n description: member.description,\n apiResourceUri: component.apiResourceUri,\n nextCall: { tool: 'get_component', arguments: { component: component.name, includeApi: true } }\n },\n fields: [field(`${component.name} ${member.name} ${slugify(member.name).replace(/-/g, ' ')}`, 8), field(`${member.type ?? ''} ${member.description ?? ''}`, 3)]\n }));\n}\n\nfunction exampleEntries(component: ComponentEntry): IndexEntry[] {\n return component.sections\n .filter((section) => section.hasCode)\n .map((section) => ({\n scope: 'examples',\n result: {\n type: 'example',\n component: component.name,\n section: section.id,\n title: section.label,\n description: section.description,\n codeLanguage: section.codeLanguage,\n resourceUri: component.resourceUri,\n nextCall: { tool: 'get_example', arguments: { component: component.name, section: section.id } }\n },\n fields: [field(`${component.name} ${section.label} ${section.id}`, 8), field(section.description ?? '', 3), field(section.code ?? '', 1)]\n }));\n}\n\nfunction field(text: string | undefined, weight: number): IndexedField {\n const value = text ?? '';\n\n return { text: value, lower: value.toLowerCase(), terms: tokenize(value), weight };\n}\n","/**\n * A deliberately small scanner for Angular templates and component sources: enough to find the elements a component\n * is used on and the bindings written on them, without pulling the Angular compiler into an MCP server.\n */\n\nexport type AttributeKind = 'static' | 'property' | 'event' | 'twoWay' | 'structural' | 'reference' | 'other';\n\nexport interface TemplateAttribute {\n raw: string;\n kind: AttributeKind;\n /** Binding target without its sigils: `[severity]` -> `severity`, `(onClick)` -> `onClick`. */\n name: string;\n value?: string;\n}\n\nexport interface TemplateElement {\n name: string;\n attributes: TemplateAttribute[];\n raw: string;\n}\n\nexport interface ImportStatement {\n source: string;\n names: string[];\n}\n\nconst TAG_PATTERN = /<([A-Za-z][\\w.-]*)((?:\\s+(?:[^\\s<>\"'=/]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'<>]+))?))*)\\s*\\/?>/g;\nconst ATTRIBUTE_PATTERN = /([^\\s\"'=<>/]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'<>]+)))?/g;\nconst IMPORT_PATTERN = /import\\s+(?:type\\s+)?(?:([\\w$]+)\\s*,?\\s*)?(?:\\{([^}]*)\\}|\\*\\s+as\\s+([\\w$]+))?\\s*from\\s*['\"]([^'\"]+)['\"]/g;\n\n/** Every opening element of the template with its attributes. */\nexport function scanElements(code: string): TemplateElement[] {\n const elements: TemplateElement[] = [];\n\n for (const match of code.matchAll(TAG_PATTERN)) {\n const attributes: TemplateAttribute[] = [];\n\n for (const attribute of (match[2] ?? '').matchAll(ATTRIBUTE_PATTERN)) {\n const raw = attribute[1]!;\n const value = attribute[2] ?? attribute[3] ?? attribute[4];\n\n attributes.push({ raw, value, ...classifyAttribute(raw) });\n }\n\n elements.push({ name: match[1]!, attributes, raw: match[0] });\n }\n\n return elements;\n}\n\nexport function classifyAttribute(raw: string): { kind: AttributeKind; name: string } {\n let match = /^\\[\\((.+)\\)\\]$/.exec(raw);\n\n if (match) {\n return { kind: 'twoWay', name: match[1]! };\n }\n\n match = /^bindon-(.+)$/.exec(raw);\n\n if (match) {\n return { kind: 'twoWay', name: match[1]! };\n }\n\n match = /^\\[(.+)\\]$/.exec(raw) ?? /^bind-(.+)$/.exec(raw);\n\n if (match) {\n const target = match[1]!;\n\n return /^(?:attr|class|style)\\./.test(target) ? { kind: 'other', name: target } : { kind: 'property', name: target };\n }\n\n match = /^\\((.+)\\)$/.exec(raw) ?? /^on-(.+)$/.exec(raw);\n\n if (match) {\n return { kind: 'event', name: match[1]! };\n }\n\n if (raw.startsWith('*')) {\n return { kind: 'structural', name: raw.slice(1) };\n }\n\n if (raw.startsWith('#') || raw.startsWith('ref-')) {\n return { kind: 'reference', name: raw.replace(/^#|^ref-/, '') };\n }\n\n if (raw.startsWith('@') || raw.startsWith('i18n') || raw.includes('.')) {\n return { kind: 'other', name: raw };\n }\n\n return { kind: 'static', name: raw };\n}\n\n/** ES import statements of a component source. */\nexport function scanImports(code: string): ImportStatement[] {\n const imports: ImportStatement[] = [];\n\n for (const match of code.matchAll(IMPORT_PATTERN)) {\n const names = [\n match[1],\n match[3],\n ...(match[2] ?? '').split(',').map(\n (name) =>\n name\n .trim()\n .split(/\\s+as\\s+/)\n .pop() ?? ''\n )\n ].filter((name): name is string => !!name);\n\n imports.push({ source: match[4]!, names });\n }\n\n return imports;\n}\n\n/** Whether an attribute value is a template expression rather than a literal. */\nexport function isInterpolated(value: string | undefined): boolean {\n return value !== undefined && value.includes('{{');\n}\n\n/** The string literal a property binding assigns (`[severity]=\"'danger'\"` -> `danger`), or undefined when it is an expression. */\nexport function literalOfBinding(value: string | undefined): string | undefined {\n const match = value === undefined ? null : /^\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*$/.exec(value);\n\n return match ? (match[1] ?? match[2]) : undefined;\n}\n","import { compact } from './text';\n\n/**\n * Inputs and outputs removed or renamed in ExhaustiveUI v22, keyed by component tag (`p-` prefix,\n * case and hyphens ignored). Mirrors the `ng update` migrations of @exhaustive-ui/core\n * (styleclass-to-class, renamed-inputs, renamed-outputs, remove-dead-inputs, remove-dead-outputs) so that\n * validate_usage can name the replacement instead of only reporting an unknown binding.\n */\n\nexport const STYLE_CLASS_REMOVED: readonly string[] = [\n 'accordion',\n 'autocomplete',\n 'avatar',\n 'avatargroup',\n 'badge',\n 'blockui',\n 'card',\n 'carousel',\n 'cascadeselect',\n 'checkbox',\n 'chip',\n 'colorpicker',\n 'dataview',\n 'datepicker',\n 'divider',\n 'dock',\n 'editor',\n 'iconfield',\n 'image',\n 'inplace',\n 'inputgroup',\n 'inputgroupaddon',\n 'inputicon',\n 'inputnumber',\n 'knob',\n 'listbox',\n 'megamenu',\n 'menubar',\n 'message',\n 'metergroup',\n 'multiselect',\n 'orderlist',\n 'organizationchart',\n 'paginator',\n 'panel',\n 'panelmenu',\n 'password',\n 'progressbar',\n 'progressspinner',\n 'radiobutton',\n 'scrollpanel',\n 'select',\n 'skeleton',\n 'slider',\n 'splitbutton',\n 'splitter',\n 'table',\n 'tag',\n 'terminal',\n 'timeline',\n 'toast',\n 'togglebutton',\n 'toggleswitch',\n 'toolbar',\n 'tree',\n 'treetable'\n];\n\nexport const RENAMED: Record<string, Record<string, string>> = {\n drawer: { showcloseicon: 'closable', ariacloselabel: 'closeAriaLabel' },\n paginator: { dropdownappendto: 'appendTo' },\n dialog: { content: 'headerTemplate' },\n autocomplete: { minlength: 'minQueryLength' },\n treeselect: { containerstyleclass: 'class', containerstyle: 'style' },\n treetable: { virtualrowheight: 'virtualScrollItemSize' },\n // attribute directives, keyed by their attribute selector\n pbutton: { ptbuttondirective: 'pButtonPT' },\n pbuttonlabel: { ptbuttonlabel: 'pButtonLabelPT' },\n pbuttonicon: { ptbuttonicon: 'pButtonIconPT' },\n pbadge: { ptbadgedirective: 'pBadgePT', size: 'badgeSize' },\n pinputtext: { ptinputtext: 'pInputTextPT' },\n ptooltip: { pttooltip: 'pTooltipPT' }\n};\n\nexport const DEAD_INPUTS: Record<string, readonly string[]> = {\n toast: ['showTransformOptions', 'hideTransformOptions', 'showTransitionOptions', 'hideTransitionOptions'],\n toastitem: ['showTransformOptions', 'hideTransformOptions', 'showTransitionOptions', 'hideTransitionOptions'],\n message: ['showTransitionOptions', 'hideTransitionOptions'],\n overlay: ['showTransitionOptions', 'hideTransitionOptions'],\n colorpicker: ['showTransitionOptions', 'hideTransitionOptions'],\n overlaybadge: ['size'],\n fieldset: ['transitionOptions'],\n panel: ['transitionOptions'],\n accordion: ['transitionOptions'],\n scrolltop: ['showTransitionOptions', 'hideTransitionOptions'],\n togglebutton: ['inputId'],\n popover: ['showTransitionOptions', 'hideTransitionOptions', 'ariaCloseLabel'],\n image: ['showTransitionOptions', 'hideTransitionOptions', 'modalEnterAnimation', 'modalLeaveAnimation'],\n drawer: ['transitionOptions'],\n menu: ['showTransitionOptions', 'hideTransitionOptions'],\n splitbutton: ['showTransitionOptions', 'hideTransitionOptions', 'plain'],\n password: ['showTransitionOptions', 'hideTransitionOptions'],\n button: ['badgeClass'],\n contextmenusub: ['autoZIndex', 'baseZIndex', 'popup'],\n tieredmenu: ['showTransitionOptions', 'hideTransitionOptions'],\n menubar: ['autoZIndex', 'baseZIndex'],\n menubarsub: ['autoZIndex', 'baseZIndex', 'mobileActive', 'ariaLabel', 'ariaLabelledBy'],\n panelmenu: ['transitionOptions', 'tabindex'],\n megamenusub: ['disabled', 'queryMatches'],\n galleria: ['showTransitionOptions', 'hideTransitionOptions', 'containerClass'],\n fileupload: ['removeStyleClass'],\n cascadeselect: ['inputLabel', 'emptyMessage'],\n datepicker: ['showTransitionOptions', 'hideTransitionOptions'],\n dialog: ['transitionOptions', 'rtl'],\n confirmdialog: ['closeAriaLabel', 'acceptAriaLabel', 'rejectAriaLabel', 'rtl', 'transitionOptions', 'focusTrap', 'defaultFocus'],\n treenode: ['rowNode', 'root', 'firstChild', 'lastChild'],\n selectitem: ['visible', 'itemSize'],\n table: ['frozenColumns', 'frozenWidth'],\n autocomplete: ['autoZIndex', 'baseZIndex', 'showTransitionOptions', 'hideTransitionOptions', 'autoHighlight'],\n multiselect: ['filterFields'],\n stepper: ['transitionOptions'],\n listbox: ['searchLocale'],\n dataview: ['gridStyleClass', 'trackBy'],\n orderlist: ['trackBy', 'header'],\n picklist: ['trackBy', 'sourceTrackBy', 'targetTrackBy'],\n toggleswitch: ['size'],\n selectbutton: ['tabindex'],\n confirmpopup: ['showTransitionOptions', 'hideTransitionOptions', 'baseZIndex'],\n treetablesorticon: ['ariaLabelAsc', 'ariaLabelDesc']\n};\n\nexport const RENAMED_OUTPUTS: Record<string, Record<string, string>> = {\n orderlist: { onFilterEvent: 'onFilter' },\n table: { selectAllChange: 'onSelectAllChange' },\n multiselect: { onPanelShow: 'onShow', onPanelHide: 'onHide' }\n};\n\nexport const DEAD_OUTPUTS: Record<string, readonly string[]> = {\n overlay: ['onAnimationStart', 'onAnimationDone'],\n menubarsub: ['menuFocus', 'menuBlur', 'menuKeydown']\n};\n\nfunction tagKey(tag: string): string {\n return compact(tag.replace(/^p-/i, ''));\n}\n\nfunction has(list: readonly string[] | undefined, name: string): boolean {\n return !!list?.some((entry) => entry.toLowerCase() === name.toLowerCase());\n}\n\n/**\n * Replacement guidance for an input that no longer exists on `tag` (an element name, or an attribute\n * directive selector such as `[pTooltip]`), or undefined when it was not removed in v22.\n */\nexport function removedInputHint(tag: string, name: string): { message: string; suggestion?: string } | undefined {\n const key = tagKey(tag);\n const lower = name.toLowerCase();\n\n if (lower === 'styleclass' && STYLE_CLASS_REMOVED.includes(key)) {\n return { message: 'styleClass was removed in v22: use the native class attribute (ng update applies the styleclass-to-class migration).', suggestion: 'class' };\n }\n\n const renamed = RENAMED[key]?.[lower];\n\n if (renamed) {\n return { message: `${name} was renamed to ${renamed} in v22 (ng update applies the renamed-inputs migration).`, suggestion: renamed };\n }\n\n if (has(DEAD_INPUTS[key], name)) {\n return { message: `${name} was removed in v22: it had no effect anymore, delete the binding (ng update applies the remove-dead-inputs migration).` };\n }\n\n return undefined;\n}\n\n/** Replacement guidance for an output that no longer exists on `tag`, or undefined when it was not removed in v22. */\nexport function removedOutputHint(tag: string, name: string): { message: string; suggestion?: string } | undefined {\n const key = tagKey(tag);\n const renamed = RENAMED_OUTPUTS[key]?.[name];\n\n if (renamed) {\n return { message: `${name} was renamed to ${renamed} in v22, with the same event payload (ng update applies the renamed-outputs migration).`, suggestion: renamed };\n }\n\n if (!has(DEAD_OUTPUTS[key], name)) {\n return undefined;\n }\n\n const replacement = key === 'overlay' ? 'use onOverlayBeforeEnter/onOverlayAfterEnter (show) or onOverlayBeforeLeave/onOverlayAfterLeave (hide) instead' : 'it never fired, bind the native focus/blur/keydown events of the element instead';\n\n return { message: `${name} was removed in v22: ${replacement} (ng update applies the remove-dead-outputs migration).` };\n}\n","import { COMPONENT_ALIASES, attributeSelectorName, splitSelectors } from './catalog';\nimport { isInterpolated, literalOfBinding, scanElements, scanImports, type TemplateElement } from './template';\nimport { compact, slugify } from './text';\nimport { removedInputHint, removedOutputHint } from './v22';\nimport type { Catalog, ComponentEntry, ManifestDeclaration, ManifestInput } from './types';\n\nexport type IssueSeverity = 'error' | 'warning';\n\nexport interface UsageIssue {\n kind: string;\n severity: IssueSeverity;\n name?: string;\n message: string;\n allowedProps?: string;\n allowedValues?: string;\n allowedEvents?: string;\n suggestion?: string;\n}\n\n/** Attributes any element may carry; never reported as unknown inputs. */\nconst GLOBAL_ATTRIBUTES = new Set([\n 'id',\n 'class',\n 'style',\n 'title',\n 'hidden',\n 'tabindex',\n 'role',\n 'lang',\n 'dir',\n 'slot',\n 'part',\n 'autofocus',\n 'draggable',\n 'contenteditable',\n 'spellcheck',\n 'translate',\n 'accesskey',\n 'inert',\n 'popover',\n 'ngmodel',\n 'ngclass',\n 'ngstyle',\n 'ngmodeloptions',\n 'formcontrol',\n 'formcontrolname',\n 'formgroup',\n 'formgroupname',\n 'formarrayname',\n 'ngmodelgroup',\n 'ngform',\n 'ngnativevalidate',\n 'ngnonbindable',\n 'ngtemplateoutlet',\n 'ngtemplateoutletcontext',\n 'ngcomponentoutlet',\n 'ngprojectas',\n 'routerlink',\n 'routerlinkactive',\n 'routerlinkactiveoptions',\n 'queryparams',\n 'cdkdrag',\n 'cdkdroplist',\n 'ptooltip'\n]);\n\n/** Attributes and properties of native elements a directive like pButton or pInputText is applied to. */\nconst NATIVE_ATTRIBUTES = new Set([\n 'type',\n 'name',\n 'value',\n 'placeholder',\n 'disabled',\n 'readonly',\n 'required',\n 'checked',\n 'selected',\n 'multiple',\n 'min',\n 'max',\n 'step',\n 'minlength',\n 'maxlength',\n 'pattern',\n 'size',\n 'rows',\n 'cols',\n 'wrap',\n 'autocomplete',\n 'inputmode',\n 'enterkeyhint',\n 'src',\n 'srcset',\n 'alt',\n 'href',\n 'target',\n 'rel',\n 'download',\n 'for',\n 'form',\n 'list',\n 'label',\n 'width',\n 'height',\n 'loading',\n 'innerhtml',\n 'innertext',\n 'textcontent',\n 'scrolltop',\n 'scrollleft'\n]);\n\nconst LEGACY_IMPORT_PATTERN = /^(?:primeng(?:\\/.*)?|@primeng\\/.*|@openng\\/optimus-ui(?:\\/.*)?|optimus-ui(?:\\/.*)?)$/;\n\ninterface SelectorIndex {\n /** Lower-cased element selector -> declaration. */\n elements: Map<string, DeclarationRef>;\n /** Lower-cased attribute selector name -> declaration. */\n attributes: Map<string, DeclarationRef>;\n}\n\ninterface DeclarationRef {\n component: ComponentEntry;\n declaration: ManifestDeclaration;\n}\n\nconst selectorIndexes = new WeakMap<Catalog, SelectorIndex>();\n\nfunction selectorIndex(catalog: Catalog): SelectorIndex {\n let index = selectorIndexes.get(catalog);\n\n if (!index) {\n index = { elements: new Map(), attributes: new Map() };\n\n for (const component of catalog.components) {\n for (const declaration of component.declarations) {\n for (const selector of splitSelectors(declaration.selector)) {\n const attribute = attributeSelectorName(selector);\n\n if (attribute) {\n index.attributes.set(attribute.toLowerCase(), { component, declaration });\n } else if (/^[a-z][\\w-]*$/i.test(selector)) {\n index.elements.set(selector.toLowerCase(), { component, declaration });\n }\n }\n }\n }\n\n selectorIndexes.set(catalog, index);\n }\n\n return index;\n}\n\n/** Validate a template or component source against the generated API of one component. */\nexport function validateComponentUsage(catalog: Catalog, component: ComponentEntry, code: string): UsageIssue[] {\n const issues: UsageIssue[] = [...checkImports(component, code)];\n\n if (component.declarations.length === 0) {\n issues.push({\n kind: 'api-unavailable',\n severity: 'warning',\n name: component.name,\n message: `No compiled API metadata is available for ${component.title}; bindings could not be checked.`\n });\n\n return issues;\n }\n\n const index = selectorIndex(catalog);\n const ownSelectors = new Set(component.selectors.map((selector) => (attributeSelectorName(selector) ?? selector).toLowerCase()));\n const elements = scanElements(code);\n const usages = elements.map((element) => ({ element, matches: declarationsOn(element, index) })).filter(({ matches }) => matches.some((ref) => ref.component === component));\n\n if (usages.length === 0) {\n issues.push(...checkSelectorMismatch(component, elements, index));\n\n if (!issues.some((issue) => issue.kind === 'selector-mismatch' || issue.kind === 'unknown-selector')) {\n issues.push({\n kind: 'selector-not-found',\n severity: 'warning',\n name: component.name,\n message: `The code does not use ${component.title}: none of its selectors (${component.selectors.join(', ')}) appear in it.`\n });\n }\n\n return issues;\n }\n\n for (const { element, matches } of usages) {\n issues.push(...checkElement(component, element, matches, ownSelectors.has(element.name.toLowerCase())));\n }\n\n return dedupe(issues);\n}\n\nfunction checkImports(component: ComponentEntry, code: string): UsageIssue[] {\n const issues: UsageIssue[] = [];\n\n for (const statement of scanImports(code)) {\n if (LEGACY_IMPORT_PATTERN.test(statement.source)) {\n const target = statement.source.split('/').slice(1).join('/');\n const suggestion = target && target === component.name ? component.import : target ? `@exhaustive-ui/core/${target}` : '@exhaustive-ui/core';\n\n issues.push({\n kind: 'import-mismatch',\n severity: 'error',\n name: statement.source,\n message: `\"${statement.source}\" is a PrimeNG / Optimus UI import; ExhaustiveUI components are imported from @exhaustive-ui/core.`,\n suggestion: suggestion ? `import { ${statement.names.join(', ') || component.modules[0] || component.declarations[0]?.className || ''} } from '${suggestion}';` : undefined\n });\n }\n }\n\n return issues;\n}\n\nfunction declarationsOn(element: TemplateElement, index: SelectorIndex): DeclarationRef[] {\n const refs: DeclarationRef[] = [];\n const byElement = index.elements.get(element.name.toLowerCase());\n\n if (byElement) {\n refs.push(byElement);\n }\n\n for (const attribute of element.attributes) {\n if (attribute.kind !== 'static' && attribute.kind !== 'property') {\n continue;\n }\n\n const byAttribute = index.attributes.get(attribute.name.toLowerCase());\n\n if (byAttribute && !refs.includes(byAttribute)) {\n refs.push(byAttribute);\n }\n }\n\n return refs;\n}\n\nfunction checkSelectorMismatch(component: ComponentEntry, elements: TemplateElement[], index: SelectorIndex): UsageIssue[] {\n const issues: UsageIssue[] = [];\n const names = new Set([component.name, ...component.declarations.map((declaration) => compact(declaration.className))]);\n\n for (const element of elements) {\n const tag = element.name;\n const key = compact(tag.replace(/^p-/i, ''));\n const aliasTarget = COMPONENT_ALIASES[slugify(tag.replace(/^p-/i, ''))];\n\n if (/^[A-Z]/.test(tag) && names.has(compact(tag))) {\n issues.push({\n kind: 'selector-mismatch',\n severity: 'error',\n name: tag,\n message: `ExhaustiveUI ${component.title} is used through its selector (${component.selectors.join(', ')}), not the PascalCase <${tag}> tag.`,\n suggestion: component.selectors[0]\n });\n } else if (/^p-/i.test(tag) && !index.elements.has(tag.toLowerCase())) {\n const renamed = aliasTarget === component.name;\n const related = renamed || names.has(key) || slugify(tag).startsWith(`p-${component.name}`);\n\n issues.push({\n kind: 'unknown-selector',\n severity: 'error',\n name: tag,\n message: renamed\n ? `<${tag}> is the PrimeNG name of this component; in ExhaustiveUI ${component.title} uses ${component.selectors.join(' or ')}.`\n : `<${tag}> is not a selector of any ExhaustiveUI component${related ? '' : ` (expected ${component.title} here)`}; use ${component.selectors.join(' or ')}.`,\n suggestion: component.selectors[0]\n });\n }\n }\n\n return issues;\n}\n\nfunction checkElement(component: ComponentEntry, element: TemplateElement, matches: DeclarationRef[], isOwnElement: boolean): UsageIssue[] {\n const issues: UsageIssue[] = [];\n const own = matches.filter((ref) => ref.component === component).map((ref) => ref.declaration);\n const inputs = new Map<string, ManifestInput>();\n const outputs = new Set<string>();\n const everyInput = new Set<string>();\n\n for (const ref of matches) {\n // The attribute that applies a directive (pButton, pTooltip...) is a selector, not an input.\n for (const selector of splitSelectors(ref.declaration.selector)) {\n const attribute = attributeSelectorName(selector);\n\n if (attribute) {\n everyInput.add(attribute.toLowerCase());\n }\n }\n\n for (const input of ref.declaration.inputs ?? []) {\n everyInput.add(input.name.toLowerCase());\n\n if (ref.component === component) {\n inputs.set(input.name.toLowerCase(), input);\n }\n }\n\n for (const output of ref.declaration.outputs ?? []) {\n outputs.add(output.name);\n }\n }\n\n // the attribute directives of this component applied on the element (pButton, pTooltip...)\n const directiveAttributes = own\n .flatMap((declaration) => splitSelectors(declaration.selector).map(attributeSelectorName))\n .filter((attribute): attribute is string => !!attribute && element.attributes.some((candidate) => candidate.name.toLowerCase() === attribute.toLowerCase()));\n const removedHint = (name: string) => (isOwnElement ? removedInputHint(element.name, name) : directiveAttributes.map((attribute) => removedInputHint(`[${attribute}]`, name)).find(Boolean));\n const allowedProps = [...inputs.keys()].sort().join(', ');\n const allowedEvents = [...outputs].sort().join(', ');\n const supportsForms = own.some((declaration) => declaration.forms);\n const label = own[0]?.className ?? component.title;\n\n for (const attribute of element.attributes) {\n const lowerName = attribute.name.toLowerCase();\n\n switch (attribute.kind) {\n case 'static':\n case 'property': {\n if (everyInput.has(lowerName) && !inputs.has(lowerName)) {\n // Belongs to another ExhaustiveUI directive on the same element (e.g. pTooltip on a p-button).\n break;\n }\n\n const input = inputs.get(lowerName);\n\n if (!input) {\n const removed = removedHint(attribute.name);\n\n if (!removed && (GLOBAL_ATTRIBUTES.has(lowerName) || lowerName.startsWith('aria-') || lowerName.startsWith('data-') || lowerName.startsWith('ng') || (!isOwnElement && NATIVE_ATTRIBUTES.has(lowerName)))) {\n break;\n }\n\n issues.push({\n kind: 'unknown-prop',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an input of ${label}.${removed ? ` ${removed.message}` : ''}`,\n allowedProps,\n ...(removed?.suggestion ? { suggestion: removed.suggestion } : {})\n });\n break;\n }\n\n if (input.deprecated) {\n issues.push({\n kind: 'deprecated-prop',\n severity: 'warning',\n name: input.name,\n message: `Input \"${input.name}\" of ${label} is deprecated: ${input.deprecated}`\n });\n }\n\n const literal = attribute.kind === 'static' ? (isInterpolated(attribute.value) ? undefined : attribute.value) : literalOfBinding(attribute.value);\n\n if (literal !== undefined && input.values && input.values.length > 0 && !input.values.includes(literal)) {\n issues.push({\n kind: 'invalid-enum-value',\n severity: 'error',\n name: input.name,\n message: `\"${literal}\" is not an allowed value of ${label} input \"${input.name}\".`,\n allowedValues: input.values.join(', ')\n });\n }\n\n break;\n }\n case 'event': {\n if (outputs.has(attribute.name)) {\n break;\n }\n\n const input = inputs.get(lowerName.replace(/change$/, ''));\n\n if (input?.twoWay && /change$/i.test(attribute.name)) {\n break;\n }\n\n const removed = isOwnElement ? removedOutputHint(element.name, attribute.name) : undefined;\n\n if (removed || /^on[A-Z]/.test(attribute.name)) {\n issues.push({\n kind: 'unknown-output',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an output of ${label}.${removed ? ` ${removed.message}` : ''}`,\n allowedEvents,\n ...(removed?.suggestion ? { suggestion: removed.suggestion } : {})\n });\n }\n\n break;\n }\n case 'twoWay': {\n if (lowerName === 'ngmodel') {\n if (isOwnElement && !supportsForms && !inputs.has('ngmodel')) {\n issues.push({\n kind: 'forms-unsupported',\n severity: 'warning',\n name: 'ngModel',\n message: `${label} does not implement ControlValueAccessor, so [(ngModel)] has no effect on it.`\n });\n }\n\n break;\n }\n\n const input = inputs.get(lowerName);\n\n if (!input) {\n if (everyInput.has(lowerName) || GLOBAL_ATTRIBUTES.has(lowerName)) {\n break;\n }\n\n issues.push({\n kind: 'unknown-prop',\n severity: 'error',\n name: attribute.name,\n message: `\"${attribute.name}\" is not an input of ${label}, so it cannot be bound two-way.`,\n allowedProps\n });\n } else if (!input.twoWay && !outputs.has(`${input.name}Change`)) {\n issues.push({\n kind: 'two-way-binding-unsupported',\n severity: 'error',\n name: input.name,\n message: `Input \"${input.name}\" of ${label} has no \"${input.name}Change\" output; bind it one-way with [${input.name}].`\n });\n }\n\n break;\n }\n default:\n break;\n }\n }\n\n return issues;\n}\n\nfunction dedupe(issues: UsageIssue[]): UsageIssue[] {\n const seen = new Set<string>();\n\n return issues.filter((issue) => {\n const key = `${issue.kind}:${issue.name ?? ''}:${issue.message}`;\n\n if (seen.has(key)) {\n return false;\n }\n\n seen.add(key);\n\n return true;\n });\n}\n\nexport function formatIssues(componentTitle: string, issues: UsageIssue[]): string {\n const lines = issues.map((issue) => {\n const extras = [\n issue.allowedProps ? ` Allowed inputs: ${issue.allowedProps}.` : '',\n issue.allowedValues ? ` Allowed values: ${issue.allowedValues}.` : '',\n issue.allowedEvents ? ` Allowed outputs: ${issue.allowedEvents}.` : '',\n issue.suggestion ? ` Suggestion: ${issue.suggestion}` : ''\n ].join('');\n\n return `- [${issue.severity}] ${issue.kind}${issue.name ? ` ${issue.name}` : ''}: ${issue.message}${extras}`;\n });\n\n return [`Usage has ${issues.length} validation issue${issues.length === 1 ? '' : 's'} for ${componentTitle}.`, ...lines].join('\\n');\n}\n","import { z } from 'zod';\nimport { findComponent, findGuide, findSection, requireSection } from './catalog';\nimport { RESOURCE_BASE_URI } from './config';\nimport { ToolError, describeError } from './errors';\nimport { searchCatalog } from './search';\nimport type { DocsSource, SourceStatus } from './source';\nimport { compact, expandTerm, slugify, unique } from './text';\nimport type { Catalog, ComponentEntry, GuideEntry, SectionEntry } from './types';\nimport { formatIssues, validateComponentUsage } from './validate';\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Results\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ToolResult {\n [key: string]: unknown;\n content: { type: 'text'; text: string }[];\n structuredContent: Record<string, unknown>;\n isError?: boolean;\n}\n\n/**\n * Every tool answers with structured content plus its JSON serialization as text, so clients that only forward text\n * content still see the whole answer. `summary` is a one-line description of the result.\n */\nexport function ok(structured: Record<string, unknown>, summary: string): ToolResult {\n const structuredContent = { summary, ...structured };\n\n return { content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }], structuredContent };\n}\n\nexport function fail(message: string, structured: Record<string, unknown> = {}): ToolResult {\n const structuredContent = { summary: message, error: message, ...structured };\n\n return { content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }], structuredContent, isError: true };\n}\n\n/** Turn thrown errors into error results instead of protocol failures. */\nexport async function guard(run: () => Promise<ToolResult>): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n return error instanceof ToolError ? fail(error.message, error.structuredContent) : fail(describeError(error));\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface ToolContext {\n serverName: string;\n serverVersion: string;\n source: DocsSource;\n catalog(): Promise<Catalog>;\n sourceStatus(): SourceStatus;\n}\n\nexport const TOOL_NAMES = ['list', 'search', 'get_component', 'get_guide', 'get_example', 'get_setup', 'validate_usage', 'version'] as const;\n\nexport const STATIC_RESOURCE_URIS = [`${RESOURCE_BASE_URI}/llms.txt`, `${RESOURCE_BASE_URI}/llms-full.txt`, `${RESOURCE_BASE_URI}/manifest.json`, `${RESOURCE_BASE_URI}/components.json`];\n\nexport const RESOURCE_TEMPLATE_NAMES = ['component-docs', 'component-api', 'guide-docs', 'example-docs'];\n\nexport const PROMPT_NAMES = ['use_component', 'build_form', 'theme_component', 'migrate_from_primeng', 'update_to_v22', 'audit_component_usage'] as const;\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Input schemas\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport const listInput = {\n kind: z.enum(['components', 'directives', 'guides', 'examples', 'resources']).default('components').describe('What to list.'),\n limit: z.number().int().min(1).max(200).default(50),\n offset: z.number().int().min(0).default(0)\n};\n\nexport const searchInput = {\n query: z.string().min(1).describe('Free text: component names, features (\"lazy loading\"), API members (\"onRowSelect\"), guide topics.'),\n scope: z\n .enum(['all', 'components', 'guides', 'api', 'examples'])\n .default('all')\n .describe('\"all\" searches components and guides; \"api\" searches inputs, outputs, templates, methods, PT keys, CSS classes and tokens; \"examples\" searches code examples.'),\n limit: z.number().int().min(1).max(50).default(10),\n offset: z.number().int().min(0).default(0)\n};\n\nconst componentRequest = z.object({\n component: z.string().min(1).describe('Component name, selector, class name or docs URL (e.g. \"button\", \"p-button\", \"Table\", \"dropdown\").'),\n sections: z.array(z.string()).optional().describe('Restrict to these section ids or labels.'),\n includeApi: z.boolean().default(false).describe('Include the API (inputs, outputs, templates, methods, PT keys, CSS classes, tokens) and compiled declarations.'),\n includeExamples: z.boolean().default(false).describe('Include the code of every example section.'),\n detail: z.enum(['compact', 'full']).default('compact').describe('\"full\" also returns the complete Markdown document.')\n});\n\nexport const getComponentInput = {\n ...componentRequest.shape,\n component: componentRequest.shape.component.optional(),\n components: z.array(z.unknown()).max(10).optional().describe('Batch form: up to 10 single-component requests.')\n};\n\nexport const getGuideInput = {\n guide: z.string().min(1).describe('Guide name or route: \"installation\", \"configuration\", \"theming/styled\", \"tailwind\", \"guides/accessibility\"...'),\n section: z.string().optional().describe('Section id or label to focus on.'),\n detail: z.enum(['compact', 'full']).default('compact').describe('\"full\" also returns the complete Markdown document.')\n};\n\nexport const getExampleInput = {\n component: z.string().min(1),\n section: z.string().optional().describe('Section id or label (\"basic\", \"lazy\", \"Template\"...). Defaults to the first section with code.'),\n variant: z.string().optional().describe('Feature hint used when no section matches (\"outlined\", \"severity\", \"icons\"...).')\n};\n\nexport const getSetupInput = {\n environment: z.string().optional().describe('What to set up: \"angular-cli\" (default), \"configuration\", \"styled\", \"unstyled\", \"tailwind\", \"icons\", \"custom-icons\", \"passthrough\".')\n};\n\nconst usageRequest = z.object({\n component: z.string().min(1),\n code: z.string().min(1).describe('Angular template or component source using the component.')\n});\n\nexport const validateUsageInput = {\n component: usageRequest.shape.component.optional(),\n code: usageRequest.shape.code.optional(),\n usages: z.array(z.unknown()).max(10).optional().describe('Batch form: up to 10 { component, code } items.')\n};\n\nexport const versionInput = {};\n\ntype ListInput = z.infer<z.ZodObject<typeof listInput>>;\ntype SearchInput = z.infer<z.ZodObject<typeof searchInput>>;\ntype ComponentRequest = z.infer<typeof componentRequest>;\ntype GetComponentInput = z.infer<z.ZodObject<typeof getComponentInput>>;\ntype GetGuideInput = z.infer<z.ZodObject<typeof getGuideInput>>;\ntype GetExampleInput = z.infer<z.ZodObject<typeof getExampleInput>>;\ntype GetSetupInput = z.infer<z.ZodObject<typeof getSetupInput>>;\ntype UsageRequest = z.infer<typeof usageRequest>;\ntype ValidateUsageInput = z.infer<z.ZodObject<typeof validateUsageInput>>;\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Summaries shared by several tools\n// ---------------------------------------------------------------------------------------------------------------------\n\nfunction componentSummary(component: ComponentEntry): Record<string, unknown> {\n return {\n name: component.name,\n title: component.title,\n description: component.description,\n selectors: component.selectors,\n import: component.import,\n modules: component.modules,\n resourceUri: component.resourceUri,\n apiResourceUri: component.apiResourceUri,\n publicUrl: component.publicUrl,\n markdownUrl: component.markdownUrl\n };\n}\n\nfunction guideSummary(guide: GuideEntry): Record<string, unknown> {\n return {\n name: guide.name,\n title: guide.title,\n description: guide.description,\n route: guide.route,\n resourceUri: guide.resourceUri,\n publicUrl: guide.publicUrl,\n markdownUrl: guide.markdownUrl\n };\n}\n\nfunction sectionSummary(section: SectionEntry): Record<string, unknown> {\n return { id: section.id, label: section.label, description: section.description, hasCode: section.hasCode, codeLanguage: section.codeLanguage };\n}\n\nfunction exampleCall(component: ComponentEntry, section: SectionEntry): Record<string, unknown> {\n return { tool: 'get_example', arguments: { component: component.name, section: section.id } };\n}\n\nexport function resourceEntries(catalog: Catalog): Record<string, unknown>[] {\n const base = RESOURCE_BASE_URI;\n const entries: Record<string, unknown>[] = [\n { uri: `${base}/llms.txt`, type: 'index', name: 'llms.txt', title: 'ExhaustiveUI llms.txt', mimeType: 'text/plain', publicUrl: `${catalog.site}/llms/llms.txt` },\n { uri: `${base}/llms-full.txt`, type: 'index', name: 'llms-full.txt', title: 'ExhaustiveUI llms-full.txt', mimeType: 'text/plain', publicUrl: `${catalog.site}/llms/llms-full.txt` },\n { uri: `${base}/manifest.json`, type: 'manifest', name: 'manifest.json', title: 'ExhaustiveUI API manifest', mimeType: 'application/json', publicUrl: `${catalog.site}/llms/manifest.json` },\n { uri: `${base}/components.json`, type: 'index', name: 'components.json', title: 'ExhaustiveUI components index', mimeType: 'application/json', publicUrl: `${catalog.site}/llms/components.json` }\n ];\n\n for (const component of catalog.components) {\n entries.push({ uri: component.resourceUri, type: 'component', name: component.name, title: component.title, mimeType: 'text/markdown', publicUrl: component.markdownUrl });\n entries.push({ uri: component.apiResourceUri, type: 'component-api', name: component.name, title: `${component.title} API`, mimeType: 'application/json' });\n }\n\n for (const guide of catalog.guides) {\n entries.push({ uri: guide.resourceUri, type: 'guide', name: guide.name, title: guide.title, mimeType: 'text/markdown', publicUrl: guide.markdownUrl });\n }\n\n return entries;\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// list\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function listTool(ctx: ToolContext, input: ListInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n let items: Record<string, unknown>[];\n\n switch (input.kind) {\n case 'components':\n items = catalog.components.map(componentSummary);\n break;\n case 'directives':\n items = catalog.directives.map((directive) => ({ ...directive }));\n break;\n case 'guides':\n items = catalog.guides.map(guideSummary);\n break;\n case 'examples':\n items = catalog.components.flatMap((component) =>\n component.sections.filter((section) => section.hasCode).map((section) => ({ component: component.name, section: section.id, title: section.label, codeLanguage: section.codeLanguage, nextCall: exampleCall(component, section) }))\n );\n break;\n case 'resources':\n items = resourceEntries(catalog);\n break;\n }\n\n const page = items.slice(input.offset, input.offset + input.limit);\n\n return ok({ kind: input.kind, total: items.length, limit: input.limit, offset: input.offset, items: page }, `${page.length} of ${items.length} ${input.kind} returned.`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// search\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function searchTool(ctx: ToolContext, input: SearchInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const hits = searchCatalog(catalog, input.query, input.scope);\n const page = hits.slice(input.offset, input.offset + input.limit);\n\n return ok({ query: input.query, scope: input.scope, total: hits.length, limit: input.limit, offset: input.offset, results: page }, `${page.length} of ${hits.length} result${hits.length === 1 ? '' : 's'} for \"${input.query}\".`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_component\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function getComponentTool(ctx: ToolContext, input: GetComponentInput): Promise<ToolResult> {\n if (input.components !== undefined) {\n if (input.component !== undefined || input.sections !== undefined || input.includeApi || input.includeExamples || input.detail !== 'compact') {\n throw new ToolError('Use either the single-component fields or \"components\", not both.');\n }\n\n return batch(input.components, componentRequest, 'component', (item) => getSingleComponent(ctx, item));\n }\n\n if (!input.component) {\n throw new ToolError('\"component\" is required.');\n }\n\n return getSingleComponent(ctx, { ...input, component: input.component });\n}\n\nasync function getSingleComponent(ctx: ToolContext, input: ComponentRequest): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const sections = input.sections?.length ? input.sections.map((query) => requireSection(component.sections, query)) : component.sections;\n const withCode = sections.filter((section) => section.hasCode);\n const document = input.detail === 'full' ? await ctx.source.readText(component.docPath) : undefined;\n\n const result: Record<string, unknown> = {\n ...componentSummary(component),\n route: component.route,\n declarations: component.declarations.map((declaration) => ({ kind: declaration.kind, className: declaration.className, selector: declaration.selector, forms: declaration.forms, standalone: declaration.standalone })),\n sections: sections.map(sectionSummary),\n examplesAvailable: withCode.map((section) => ({ section: section.id, title: section.label, codeLanguage: section.codeLanguage, nextCall: exampleCall(component, section) }))\n };\n\n if (input.includeExamples) {\n result.examples = withCode.map((section) => ({ section: section.id, title: section.label, description: section.description, codeLanguage: section.codeLanguage, code: section.code }));\n }\n\n if (input.includeApi) {\n result.api = component.api;\n result.compiled = component.declarations;\n }\n\n if (document !== undefined) {\n result.document = document;\n }\n\n const next = withCode[0] ? ` Next: get_example ${JSON.stringify({ component: component.name, section: withCode[0].id })}.` : '';\n\n return ok({ component: result }, `${component.title}: ${sections.length} section${sections.length === 1 ? '' : 's'}, ${withCode.length} with code; source ${component.resourceUri}.${next}`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_guide\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function getGuideTool(ctx: ToolContext, input: GetGuideInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const guide = findGuide(catalog, input.guide);\n const section = input.section ? requireSection(guide.sections, input.section) : undefined;\n const document = input.detail === 'full' ? await ctx.source.readText(guide.docPath) : undefined;\n\n return ok(\n {\n guide: {\n ...guideSummary(guide),\n section: section ? { ...sectionSummary(section), code: section.code } : undefined,\n sections: guide.sections.map(sectionSummary),\n document\n }\n },\n `${guide.title} guide: ${guide.sections.length} section${guide.sections.length === 1 ? '' : 's'}; source ${guide.resourceUri}.`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_example\n// ---------------------------------------------------------------------------------------------------------------------\n\n/** Section ids the usual feature words map to. */\nconst VARIANT_SECTIONS: Record<string, string[]> = {\n basic: ['basic'],\n default: ['basic'],\n primary: ['basic'],\n danger: ['severity'],\n error: ['severity', 'invalid'],\n warning: ['severity'],\n success: ['severity'],\n busy: ['loading'],\n spinner: ['loading'],\n outline: ['outlined'],\n icon: ['icons', 'icon'],\n size: ['sizes'],\n small: ['sizes'],\n large: ['sizes'],\n pagination: ['paginator', 'page'],\n page: ['paginator'],\n paging: ['paginator'],\n sorting: ['sort', 'singlecolumnsort', 'multiplecolumnssort'],\n sortable: ['sort', 'singlecolumnsort'],\n filtering: ['filter', 'filterbasic', 'filteradvanced'],\n filters: ['filter', 'filterbasic'],\n select: ['selection', 'singleselection', 'multipleselection', 'checkboxselection', 'radiobuttonselection'],\n selected: ['selection'],\n checkbox: ['checkboxselection', 'checkbox'],\n form: ['reactiveforms', 'forms', 'templatedrivenforms'],\n forms: ['reactiveforms', 'forms', 'templatedrivenforms'],\n reactive: ['reactiveforms'],\n ngmodel: ['templatedrivenforms', 'forms'],\n lazy: ['lazy', 'lazyload', 'virtualscroll'],\n virtual: ['virtualscroll', 'lazy'],\n template: ['template', 'templates', 'customtemplate'],\n templating: ['template'],\n disabled: ['disabled'],\n invalid: ['invalid'],\n accessible: ['accessibility']\n};\n\nexport async function getExampleTool(ctx: ToolContext, input: GetExampleInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const withCode = component.sections.filter((section) => section.hasCode);\n\n if (withCode.length === 0) {\n throw new ToolError(`No code example is available for ${component.title}.`, exampleFailure(component, input, undefined));\n }\n\n const query = input.section ?? input.variant;\n let section: SectionEntry | undefined;\n\n if (query) {\n section = findSection(component.sections, query) ?? bestSection(component.sections, [input.section, input.variant]);\n } else {\n section = withCode.find((entry) => compact(entry.id) === 'basic') ?? withCode[0];\n }\n\n if (!section) {\n throw new ToolError(`No section of ${component.title} matches ${describeRequest(input)}.`, exampleFailure(component, input, undefined));\n }\n\n if (!section.hasCode) {\n const alternative = input.variant ? bestSection(withCode, [input.variant]) : undefined;\n\n if (alternative) {\n section = alternative;\n } else {\n throw new ToolError(`Section \"${section.id}\" of ${component.title} has no code example.`, exampleFailure(component, input, section));\n }\n }\n\n return ok(\n {\n component: component.name,\n title: component.title,\n section: section.id,\n sectionTitle: section.label,\n requestedSection: input.section,\n requestedVariant: input.variant,\n description: section.description,\n codeLanguage: section.codeLanguage,\n code: section.code,\n import: component.import,\n resourceUri: component.resourceUri,\n publicUrl: component.publicUrl\n },\n `${component.title} \"${section.label}\" example (${section.codeLanguage}).`\n );\n}\n\nfunction describeRequest(input: GetExampleInput): string {\n return [input.section ? `section \"${input.section}\"` : '', input.variant ? `variant \"${input.variant}\"` : ''].filter(Boolean).join(' and ') || 'the request';\n}\n\nfunction bestSection(sections: readonly SectionEntry[], hints: (string | undefined)[]): SectionEntry | undefined {\n const terms = unique(\n hints\n .filter((hint): hint is string => !!hint)\n .flatMap((hint) => {\n const slug = slugify(hint);\n\n return [slug, ...(VARIANT_SECTIONS[slug] ?? []), ...slug.split('-').flatMap((part) => [part, ...(VARIANT_SECTIONS[part] ?? []), ...expandTerm(part)])];\n })\n .map(compact)\n .filter((term) => term.length > 1)\n );\n\n const scored = sections\n .map((section, index) => {\n const keys = [compact(section.id), compact(section.label)];\n const text = `${section.label} ${section.description ?? ''}`.toLowerCase();\n let score = 0;\n\n if (keys.some((key) => terms.includes(key))) {\n score += 100;\n }\n\n if (keys.some((key) => terms.some((term) => term.length > 3 && (key.includes(term) || term.includes(key))))) {\n score += 60;\n }\n\n if (terms.some((term) => term.length > 3 && text.includes(term))) {\n score += 30;\n }\n\n if (score > 0 && section.hasCode) {\n score += 10;\n }\n\n return { section, index, score };\n })\n .filter((entry) => entry.score > 0)\n .sort((a, b) => b.score - a.score || a.index - b.index);\n\n return scored[0]?.section;\n}\n\nfunction exampleFailure(component: ComponentEntry, input: GetExampleInput, selected: SectionEntry | undefined): Record<string, unknown> {\n const withCode = component.sections.filter((section) => section.hasCode);\n const suggested = bestSection(withCode, [input.section, input.variant]);\n const props = (component.api.props ?? []).filter((prop) => !/^aria/i.test(prop.name));\n const hints = unique([input.section, input.variant].filter((hint): hint is string => !!hint).flatMap((hint) => expandTerm(hint)));\n\n return {\n component: component.name,\n requestedSection: input.section ?? selected?.id,\n requestedVariant: input.variant,\n availableSections: component.sections.map((section) => section.id),\n sectionsWithCode: withCode.map((section) => section.id),\n suggestedSections: unique([suggested?.id, ...withCode.slice(0, 5).map((section) => section.id)].filter((id): id is string => !!id)),\n suggestedApiProps: props\n .filter((prop) => hints.some((hint) => slugify(prop.name).includes(hint) || (prop.description ?? '').toLowerCase().includes(hint)))\n .slice(0, 8)\n .map((prop) => ({ name: prop.name, type: prop.type, description: prop.description })),\n apiAvailable: props.length > 0,\n sourceBackedCodeAvailable: withCode.length > 0,\n componentResourceUri: component.resourceUri,\n apiResourceUri: component.apiResourceUri,\n nextCall: suggested ? exampleCall(component, suggested) : { tool: 'get_component', arguments: { component: component.name, includeApi: true } }\n };\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// get_setup\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst SETUP_ENVIRONMENTS: { environment: string; guide: string; aliases: string[] }[] = [\n { environment: 'angular-cli', guide: 'installation', aliases: ['angular', 'cli', 'ng', 'npm', 'pnpm', 'yarn', 'install', 'installation', 'setup', 'getting-started', 'quickstart', 'start', 'default'] },\n { environment: 'configuration', guide: 'configuration', aliases: ['config', 'configure', 'provideexhaustiveui', 'providers', 'app-config', 'ripple', 'zindex', 'locale', 'translation'] },\n { environment: 'styled', guide: 'theming/styled', aliases: ['theme', 'themes', 'theming', 'preset', 'presets', 'aura', 'lara', 'nora', 'material', 'design-tokens', 'tokens', 'dark-mode', 'css-variables'] },\n { environment: 'unstyled', guide: 'theming/unstyled', aliases: ['headless', 'no-theme'] },\n { environment: 'tailwind', guide: 'tailwind', aliases: ['tailwindcss', 'tailwind-css', 'tw'] },\n { environment: 'icons', guide: 'icons', aliases: ['icon', 'openng-icons', 'primeicons'] },\n { environment: 'custom-icons', guide: 'customicons', aliases: ['customicons', 'custom-icon', 'font-awesome', 'material-icons', 'svg-icons'] },\n { environment: 'passthrough', guide: 'passthrough', aliases: ['pass-through', 'pt'] }\n];\n\nexport async function getSetupTool(ctx: ToolContext, input: GetSetupInput): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const requested = input.environment?.trim();\n const key = compact(requested ?? 'angular-cli');\n const match = SETUP_ENVIRONMENTS.find((entry) => compact(entry.environment) === key || entry.aliases.some((alias) => compact(alias) === key));\n let guide: GuideEntry | undefined;\n\n if (match) {\n guide = findGuide(catalog, match.guide);\n } else if (requested) {\n try {\n guide = findGuide(catalog, requested);\n } catch {\n guide = undefined;\n }\n }\n\n if (!guide) {\n throw new ToolError(`Setup environment \"${requested}\" is unsupported. Valid environments: ${SETUP_ENVIRONMENTS.map((entry) => entry.environment).join(', ')}.`, {\n environment: requested,\n validEnvironments: SETUP_ENVIRONMENTS.map((entry) => entry.environment),\n candidates: SETUP_ENVIRONMENTS.map((entry) => ({ environment: entry.environment, guide: entry.guide, aliases: entry.aliases }))\n });\n }\n\n const document = await ctx.source.readText(guide.docPath);\n\n return ok(\n {\n environment: match?.environment ?? guide.name,\n guide: { ...guideSummary(guide), sections: guide.sections.map(sectionSummary), document },\n relatedGuides: SETUP_ENVIRONMENTS.filter((entry) => entry.guide !== match?.guide).map((entry) => ({ environment: entry.environment, nextCall: { tool: 'get_setup', arguments: { environment: entry.environment } } }))\n },\n `${guide.title} setup docs returned (${match?.environment ?? guide.name}).`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// validate_usage\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function validateUsageTool(ctx: ToolContext, input: ValidateUsageInput): Promise<ToolResult> {\n if (input.usages !== undefined) {\n if (input.component !== undefined || input.code !== undefined) {\n throw new ToolError('Use either the single usage fields or \"usages\", not both.');\n }\n\n return batch(input.usages, usageRequest, 'usage', (item) => validateSingleUsage(ctx, item));\n }\n\n if (!input.component || !input.code) {\n throw new ToolError('\"component\" and \"code\" are required.');\n }\n\n return validateSingleUsage(ctx, { component: input.component, code: input.code });\n}\n\nasync function validateSingleUsage(ctx: ToolContext, input: UsageRequest): Promise<ToolResult> {\n const catalog = await ctx.catalog();\n const component = findComponent(catalog, input.component);\n const issues = validateComponentUsage(catalog, component, input.code);\n const errors = issues.filter((issue) => issue.severity === 'error');\n const structured = { component: component.name, title: component.title, selectors: component.selectors, valid: errors.length === 0, issues, apiResourceUri: component.apiResourceUri };\n\n if (errors.length > 0) {\n return fail(formatIssues(component.title, issues), structured);\n }\n\n return ok(structured, issues.length > 0 ? `${component.title} usage is valid, with ${issues.length} warning${issues.length === 1 ? '' : 's'}.` : `${component.title} usage is valid against the compiled API.`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// version\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport async function versionTool(ctx: ToolContext): Promise<ToolResult> {\n const status = ctx.sourceStatus();\n let data: Record<string, unknown>;\n\n try {\n const catalog = await ctx.catalog();\n\n data = {\n libraryVersion: catalog.libraryVersion,\n docsVersion: catalog.docsVersion,\n generatedAt: catalog.generatedAt,\n site: catalog.site,\n counts: {\n components: catalog.components.length,\n directives: catalog.directives.length,\n guides: catalog.guides.length,\n examples: catalog.components.reduce((sum, component) => sum + component.sections.filter((section) => section.hasCode).length, 0)\n }\n };\n } catch (error) {\n data = { error: describeError(error) };\n }\n\n return ok(\n {\n server: { name: ctx.serverName, version: ctx.serverVersion },\n data,\n source: status,\n tools: [...TOOL_NAMES],\n resources: { static: STATIC_RESOURCE_URIS, templates: RESOURCE_TEMPLATE_NAMES },\n prompts: [...PROMPT_NAMES]\n },\n `${ctx.serverName} ${ctx.serverVersion}; ${TOOL_NAMES.length} tools; docs from ${status.mode === 'offline' ? 'the offline snapshot' : status.docsUrl}.`\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Batch helper\n// ---------------------------------------------------------------------------------------------------------------------\n\nasync function batch<T>(items: unknown[], schema: z.ZodType<T>, label: string, run: (item: T) => Promise<ToolResult>): Promise<ToolResult> {\n if (items.length === 0) {\n throw new ToolError(`\"${label}s\" must contain at least one item.`);\n }\n\n const results: Record<string, unknown>[] = [];\n\n for (const [index, item] of items.entries()) {\n const parsed = schema.safeParse(item);\n\n if (!parsed.success) {\n results.push({ index, status: 'error', error: `Invalid ${label} item: ${parsed.error.issues.map((issue) => `${issue.path.join('.') || label}: ${issue.message}`).join('; ')}.` });\n continue;\n }\n\n const result = await guard(() => run(parsed.data));\n\n results.push({ index, status: result.isError ? 'error' : 'success', ...result.structuredContent });\n }\n\n const succeeded = results.filter((result) => result.status === 'success').length;\n\n return ok({ total: results.length, succeeded, failed: results.length - succeeded, results }, `${succeeded} of ${results.length} ${label} request${results.length === 1 ? '' : 's'} succeeded.`);\n}\n","import { readFileSync } from 'node:fs';\nimport { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { z } from 'zod';\nimport { CatalogLoader, findComponent, findGuide, requireSection } from './catalog';\nimport { RESOURCE_BASE_URI, resolveConfig, type Env, type ServerConfig } from './config';\nimport { createDocsSource, type DocsSource, type FetchLike, type SourceStatus } from './source';\nimport {\n PROMPT_NAMES,\n getComponentInput,\n getComponentTool,\n getExampleInput,\n getExampleTool,\n getGuideInput,\n getGuideTool,\n getSetupInput,\n getSetupTool,\n guard,\n listInput,\n listTool,\n searchInput,\n searchTool,\n validateUsageInput,\n validateUsageTool,\n versionInput,\n versionTool,\n type ToolContext\n} from './tools';\nimport type { Catalog, ComponentEntry } from './types';\n\nexport const SERVER_NAME = '@exhaustive-ui/mcp';\n\nexport interface CreateServerOptions {\n /** Environment to read EXHAUSTIVE_UI_* variables from; defaults to process.env. */\n env?: Env;\n /** Explicit configuration, taking precedence over the environment. */\n config?: Partial<ServerConfig>;\n /** Replace the configured docs source entirely (tests, embedding). */\n source?: DocsSource;\n /** Custom fetch for the live site (tests). */\n fetchImpl?: FetchLike;\n version?: string;\n}\n\nconst readOnly = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } as const;\n\nexport function readPackageVersion(): string {\n try {\n const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as { version?: string };\n\n return pkg.version ?? '0.0.0';\n } catch {\n return '0.0.0';\n }\n}\n\n/** Build the tool context: configured docs source, catalog loader and status reporting. */\nexport function createToolContext(options: CreateServerOptions = {}): ToolContext {\n const config = resolveConfig(options.env ?? process.env, options.config);\n const configured = options.source ? { source: options.source, status: (): SourceStatus => ({ mode: 'offline', docsUrl: config.docsUrl, cacheTtlSeconds: 0 }) } : createDocsSource(config, options.fetchImpl);\n const loader = new CatalogLoader(configured.source);\n\n return {\n serverName: SERVER_NAME,\n serverVersion: options.version ?? readPackageVersion(),\n source: configured.source,\n catalog: () => loader.load(),\n sourceStatus: () => configured.status()\n };\n}\n\nexport async function createExhaustiveUiMcpServer(options: CreateServerOptions = {}): Promise<McpServer> {\n const ctx = createToolContext(options);\n const server = new McpServer({ name: SERVER_NAME, version: ctx.serverVersion, title: 'ExhaustiveUI docs' }, { capabilities: { tools: {}, resources: {}, prompts: {} } });\n\n registerTools(server, ctx);\n registerResources(server, ctx);\n registerPrompts(server);\n\n return server;\n}\n\nexport async function runExhaustiveUiMcpServer(options: CreateServerOptions = {}): Promise<void> {\n const server = await createExhaustiveUiMcpServer(options);\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n console.error(`${SERVER_NAME} running on stdio`);\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Tools\n// ---------------------------------------------------------------------------------------------------------------------\n\nfunction registerTools(server: McpServer, ctx: ToolContext): void {\n server.registerTool(\n 'list',\n {\n title: 'List ExhaustiveUI docs',\n description: 'List the ExhaustiveUI components, directives, guides, code examples or MCP resources.',\n inputSchema: listInput,\n annotations: readOnly\n },\n (input) => guard(() => listTool(ctx, input))\n );\n\n server.registerTool(\n 'search',\n {\n title: 'Search ExhaustiveUI docs',\n description: 'Search the ExhaustiveUI component docs, guides, API members (inputs, outputs, templates, PT keys, tokens) and code examples.',\n inputSchema: searchInput,\n annotations: readOnly\n },\n (input) => guard(() => searchTool(ctx, input))\n );\n\n server.registerTool(\n 'get_component',\n {\n title: 'Get component docs',\n description: 'Read the docs of an ExhaustiveUI component: sections, available examples, and optionally its API, compiled declarations and full Markdown document. Accepts a batch of up to 10 components.',\n inputSchema: getComponentInput,\n annotations: readOnly\n },\n (input) => guard(() => getComponentTool(ctx, input))\n );\n\n server.registerTool(\n 'get_guide',\n {\n title: 'Get guide docs',\n description: 'Read an ExhaustiveUI guide (installation, configuration, theming, Tailwind, icons, pass through, accessibility, migration...).',\n inputSchema: getGuideInput,\n annotations: readOnly\n },\n (input) => guard(() => getGuideTool(ctx, input))\n );\n\n server.registerTool(\n 'get_example',\n {\n title: 'Get a code example',\n description: 'Return one complete, source-backed code example of a component (a standalone Angular component with its template and imports).',\n inputSchema: getExampleInput,\n annotations: readOnly\n },\n (input) => guard(() => getExampleTool(ctx, input))\n );\n\n server.registerTool(\n 'get_setup',\n {\n title: 'Get setup docs',\n description: 'Return the installation and setup guidance for ExhaustiveUI in an Angular project (Angular CLI by default; also configuration, styled/unstyled theming, Tailwind, icons, pass through).',\n inputSchema: getSetupInput,\n annotations: readOnly\n },\n (input) => guard(() => getSetupTool(ctx, input))\n );\n\n server.registerTool(\n 'validate_usage',\n {\n title: 'Validate component usage',\n description:\n 'Check an Angular template or component source against the compiled API of an ExhaustiveUI component: unknown inputs and outputs, invalid literal values, unsupported two-way bindings, deprecated inputs, inputs and outputs removed or renamed in v22 (with their replacement), wrong selectors and PrimeNG imports. Accepts a batch of up to 10 usages.',\n inputSchema: validateUsageInput,\n annotations: readOnly\n },\n (input) => guard(() => validateUsageTool(ctx, input))\n );\n\n server.registerTool(\n 'version',\n {\n title: 'ExhaustiveUI MCP version',\n description: 'Return the server version, the documented library version, where the docs are read from (live site or offline snapshot) and the registered tools, resources and prompts.',\n inputSchema: versionInput,\n annotations: readOnly\n },\n () => guard(() => versionTool(ctx))\n );\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Resources\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst STATIC_RESOURCES: { name: string; file: string; title: string; description: string; mimeType: string }[] = [\n { name: 'llms-txt', file: 'llms.txt', title: 'ExhaustiveUI llms.txt', description: 'Index of the ExhaustiveUI guides and components with their URLs.', mimeType: 'text/plain' },\n { name: 'llms-full-txt', file: 'llms-full.txt', title: 'ExhaustiveUI llms-full.txt', description: 'The complete ExhaustiveUI documentation in one Markdown file.', mimeType: 'text/plain' },\n {\n name: 'manifest',\n file: 'manifest.json',\n title: 'ExhaustiveUI API manifest',\n description: 'Compiled metadata of every entry point of @exhaustive-ui/core: selectors, inputs, outputs, templates, pass-through keys, services and types.',\n mimeType: 'application/json'\n },\n { name: 'components-index', file: 'components.json', title: 'ExhaustiveUI components index', description: 'Every component with its documentation sections, examples and API, plus the guides.', mimeType: 'application/json' }\n];\n\nfunction registerResources(server: McpServer, ctx: ToolContext): void {\n for (const resource of STATIC_RESOURCES) {\n const uri = `${RESOURCE_BASE_URI}/${resource.file}`;\n\n server.registerResource(resource.name, uri, { title: resource.title, description: resource.description, mimeType: resource.mimeType }, async () => ({\n contents: [{ uri, mimeType: resource.mimeType, text: await ctx.source.readText(resource.file) }]\n }));\n }\n\n server.registerResource(\n 'component-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/components/{component}.md`, {\n list: async () => ({\n resources: (await ctx.catalog()).components.map((component) => ({ uri: component.resourceUri, name: component.name, title: component.title, description: component.description, mimeType: 'text/markdown' }))\n }),\n complete: { component: completeComponent(ctx) }\n }),\n { title: 'ExhaustiveUI component docs', description: 'Generated Markdown documentation of one component (examples, API tables, pass-through options, theming).', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text: await ctx.source.readText(component.docPath) }] };\n }\n );\n\n server.registerResource(\n 'component-api',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/components/{component}/api.json`, {\n list: async () => ({\n resources: (await ctx.catalog()).components.map((component) => ({ uri: component.apiResourceUri, name: `${component.name}-api`, title: `${component.title} API`, mimeType: 'application/json' }))\n }),\n complete: { component: completeComponent(ctx) }\n }),\n { title: 'ExhaustiveUI component API', description: 'API of one component as JSON: documented members and compiled declarations.', mimeType: 'application/json' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n\n return { contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(componentApi(component), null, 2) }] };\n }\n );\n\n server.registerResource(\n 'guide-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/pages/{guide}.md`, {\n list: async () => ({\n resources: (await ctx.catalog()).guides.map((guide) => ({ uri: guide.resourceUri, name: guide.name, title: guide.title, description: guide.description, mimeType: 'text/markdown' }))\n }),\n complete: {\n guide: async (value) => {\n const prefix = value.toLowerCase();\n\n return (await ctx.catalog()).guides.map((guide) => guide.name).filter((name) => name.startsWith(prefix));\n }\n }\n }),\n { title: 'ExhaustiveUI guide docs', description: 'Generated Markdown of one guide.', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const guide = findGuide(await ctx.catalog(), variable(variables.guide));\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text: await ctx.source.readText(guide.docPath) }] };\n }\n );\n\n server.registerResource(\n 'example-docs',\n new ResourceTemplate(`${RESOURCE_BASE_URI}/examples/{component}/{section}.md`, {\n list: undefined,\n complete: {\n component: completeComponent(ctx),\n section: async (value, context) => {\n const componentName = context?.arguments?.component;\n\n if (!componentName) {\n return [];\n }\n\n const component = findComponent(await ctx.catalog(), componentName);\n const prefix = value.toLowerCase();\n\n return component.sections\n .filter((section) => section.hasCode)\n .map((section) => section.id)\n .filter((id) => id.toLowerCase().startsWith(prefix));\n }\n }\n }),\n { title: 'ExhaustiveUI examples', description: 'One code example of a component, as Markdown.', mimeType: 'text/markdown' },\n async (uri, variables) => {\n const component = findComponent(await ctx.catalog(), variable(variables.component));\n const section = requireSection(component.sections, variable(variables.section));\n const text = [\n `# ${component.title}: ${section.label}`,\n '',\n section.description ?? '',\n '',\n `Source: ${component.resourceUri}`,\n '',\n section.hasCode ? `\\`\\`\\`${section.codeLanguage}\\n${section.code}\\n\\`\\`\\`` : '_This section has no code example._'\n ].join('\\n');\n\n return { contents: [{ uri: uri.href, mimeType: 'text/markdown', text }] };\n }\n );\n}\n\nfunction completeComponent(ctx: ToolContext): (value: string) => Promise<string[]> {\n return async (value) => {\n const prefix = value.toLowerCase();\n\n return (await ctx.catalog()).components\n .map((component) => component.name)\n .filter((name) => name.startsWith(prefix))\n .slice(0, 50);\n };\n}\n\nfunction variable(value: string | string[] | undefined): string {\n const single = Array.isArray(value) ? value[0] : value;\n\n if (!single) {\n throw new Error('Missing resource template variable');\n }\n\n return single;\n}\n\nexport function componentApi(component: ComponentEntry): Record<string, unknown> {\n return {\n name: component.name,\n title: component.title,\n import: component.import,\n modules: component.modules,\n selectors: component.selectors,\n api: component.api,\n compiled: component.declarations\n };\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n// Prompts\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst PROMPTS: Record<(typeof PROMPT_NAMES)[number], { title: string; description: string; steps: string[] }> = {\n use_component: {\n title: 'Use an ExhaustiveUI component',\n description: 'Add an ExhaustiveUI component to an Angular app correctly, from its documented API and examples.',\n steps: [\n 'Call get_component for the component (includeApi: true when you need inputs, outputs or templates).',\n 'Call get_example for the closest documented example and adapt it; keep the `@exhaustive-ui/core/<name>` import.',\n 'Call validate_usage on the template you wrote before answering.'\n ]\n },\n build_form: {\n title: 'Build a form with ExhaustiveUI',\n description: 'Build an Angular form (reactive or template-driven) with ExhaustiveUI form components.',\n steps: [\n 'Call search with scope \"components\" for the inputs the form needs (inputtext, select, datepicker, checkbox, ...).',\n 'Call get_example with section \"reactiveforms\" or \"forms\" for each component to see the documented form integration.',\n 'Call validate_usage on the final template.'\n ]\n },\n theme_component: {\n title: 'Theme an ExhaustiveUI component',\n description: 'Customize a component with design tokens, pass-through attributes, CSS classes or Tailwind.',\n steps: [\n 'Call get_setup with environment \"styled\" (or \"unstyled\", \"tailwind\", \"passthrough\") for the theming model.',\n 'Call get_component with includeApi: true and read its pt keys, styles (CSS classes) and tokens.',\n 'Prefer design tokens (dt input or theme preset) over overriding CSS classes.'\n ]\n },\n migrate_from_primeng: {\n title: 'Migrate from PrimeNG',\n description: 'Plan the migration of PrimeNG (or Optimus UI) code to ExhaustiveUI.',\n steps: [\n 'Call get_guide for \"primeng\" (from PrimeNG v21) or \"optimus\" (from Optimus UI v2), and follow its steps.',\n 'From PrimeNG: update Angular to v22 with --force while primeng is installed, then run `ng generate @exhaustive-ui/core:migrate-from-primeng`. From Optimus UI: run `ng generate @exhaustive-ui/core:migrate-from-optimus`. Then run `ng update @exhaustive-ui/core --migrate-only --from=3.0.0` and follow get_guide \"v22\".',\n 'For each PrimeNG component used, call get_component with the PrimeNG name: renamed components (dropdown, calendar, sidebar, overlaypanel, inputswitch, tabview...) resolve to their ExhaustiveUI equivalent.',\n 'Replace `primeng/<name>` imports with `@exhaustive-ui/core/<name>` and call validate_usage on each migrated template.'\n ]\n },\n update_to_v22: {\n title: 'Update to ExhaustiveUI v22',\n description: 'Update an application to ExhaustiveUI v22 (Angular v22, Signals API) and fix what ng update leaves for review.',\n steps: [\n 'Call get_guide for \"v22\" (the migration guide to v22) and follow its update steps for the starting point: an ExhaustiveUI prerelease, PrimeNG v21 or Optimus UI.',\n 'Update Angular first (`ng update @angular/core@22 @angular/cli@22`), then run `ng update @exhaustive-ui/core@22`; its nine migrations rewrite styleClass to class, renamed inputs, outputs and templates, bindings of removed inputs and outputs, and the configuration API, and print what they left for review. Handle each reported place as the \"Reviewing the report\" section of the guide describes.',\n 'In TypeScript code that holds a component instance (viewChild, ViewChild, injected component), read inputs as signals (`table.selection()`), write two-way properties with `.set()` (`drawer.visible.set(true)`), and call signal queries.',\n 'Components are OnPush (except Table, TreeTable and DynamicDialog): pass new arrays or objects, or signals, instead of mutating data bound to them in place.',\n 'Call validate_usage on each template that uses a `p-*` element: removed or renamed v22 inputs are reported with their replacement.'\n ]\n },\n audit_component_usage: {\n title: 'Audit ExhaustiveUI usage',\n description: 'Review application code for ExhaustiveUI API mismatches.',\n steps: [\n 'Collect every template that uses a `p-*` element or `p*` directive.',\n 'Call validate_usage with \"usages\" batches of up to 10 { component, code } items.',\n 'Fix errors first (unknown inputs/outputs, invalid values, PrimeNG imports), then review warnings (deprecated inputs).'\n ]\n }\n};\n\nfunction registerPrompts(server: McpServer): void {\n for (const name of PROMPT_NAMES) {\n const prompt = PROMPTS[name];\n\n server.registerPrompt(\n name,\n {\n title: prompt.title,\n description: prompt.description,\n argsSchema: { component: z.string().optional().describe('Component name'), goal: z.string().optional().describe('What the user wants to achieve') }\n },\n ({ component, goal }) => ({\n messages: [\n {\n role: 'user',\n content: {\n type: 'text',\n text: [\n `${prompt.description}${component ? ` Component: ${component}.` : ''}`,\n goal ? `Goal: ${goal}` : '',\n '',\n 'Use the ExhaustiveUI MCP tools rather than memory of PrimeNG:',\n ...prompt.steps.map((step, index) => `${index + 1}. ${step}`)\n ]\n .filter((line) => line !== undefined)\n .join('\\n')\n }\n }\n ]\n })\n );\n }\n}\n\nexport type { Catalog, ComponentEntry, DirectiveEntry, GuideEntry, SectionEntry } from './types';\nexport type { DocsSource, FetchLike, SourceStatus } from './source';\nexport type { ServerConfig } from './config';\nexport type { ToolContext, ToolResult } from './tools';\n","#!/usr/bin/env node\nimport { realpathSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { SERVER_NAME, readPackageVersion, runExhaustiveUiMcpServer } from './server';\n\nexport { DEFAULT_CACHE_TTL_SECONDS, DEFAULT_DOCS_URL, DEFAULT_FETCH_TIMEOUT_MS, RESOURCE_BASE_URI, resolveConfig } from './config';\nexport { buildCatalog, CatalogLoader, findComponent, findGuide, findSection } from './catalog';\nexport { CachedSource, FallbackSource, MemorySource, RemoteSource, SnapshotSource, createDocsSource } from './source';\nexport { searchCatalog } from './search';\nexport { validateComponentUsage, type UsageIssue } from './validate';\nexport { PROMPT_NAMES, RESOURCE_TEMPLATE_NAMES, STATIC_RESOURCE_URIS, TOOL_NAMES } from './tools';\nexport { SERVER_NAME, componentApi, createExhaustiveUiMcpServer, createToolContext, readPackageVersion, runExhaustiveUiMcpServer, type CreateServerOptions } from './server';\nexport type { Catalog, ComponentEntry, DirectiveEntry, DocsSource, FetchLike, GuideEntry, SectionEntry, ServerConfig, SourceStatus, ToolContext, ToolResult } from './server';\n\nconst HELP = `${SERVER_NAME}: Model Context Protocol server for the ExhaustiveUI Angular component library.\n\nUsage: exhaustive-ui-mcp [--help] [--version]\n\nThe server speaks MCP over stdio; register it in your MCP client, for example:\n claude mcp add exhaustive-ui -- npx -y @exhaustive-ui/mcp\n\nEnvironment variables:\n EXHAUSTIVE_UI_DOCS_URL Docs site to read from (default https://exhaustive-ui.com)\n EXHAUSTIVE_UI_MCP_CACHE_TTL Seconds a fetched document is reused (default 900)\n EXHAUSTIVE_UI_MCP_FETCH_TIMEOUT Milliseconds before a request to the docs site is abandoned (default 10000)\n EXHAUSTIVE_UI_MCP_OFFLINE Set to 1 to only use the offline snapshot bundled with the package\n EXHAUSTIVE_UI_MCP_SNAPSHOT_DIR Directory of the offline snapshot (default: the package's data/ directory)\n`;\n\nfunction isCliEntrypoint(): boolean {\n const entry = process.argv[1];\n\n if (!entry) {\n return false;\n }\n\n try {\n return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));\n } catch {\n return false;\n }\n}\n\nif (isCliEntrypoint()) {\n const args = process.argv.slice(2);\n\n if (args.includes('--help') || args.includes('-h')) {\n console.log(HELP);\n } else if (args.includes('--version') || args.includes('-v')) {\n console.log(readPackageVersion());\n } else {\n runExhaustiveUiMcpServer().catch((error: unknown) => {\n console.error(`Failed to start ${SERVER_NAME}:`, error);\n process.exit(1);\n });\n }\n}\n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