deepspace 0.22.0 → 0.23.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,"sources":["../src/documentation/build.ts","../package.json","../src/documentation/markdown.ts","../src/documentation/text.ts","../src/documentation/types.ts","../src/documentation/routing.ts","../src/documentation/artifacts.ts","../src/documentation/graph.ts","../src/documentation/config.ts","../src/shared/ai-models.ts","../src/documentation/config/schema.ts","../src/documentation/config/validation.ts","../src/documentation/mdx.ts","../src/documentation/openapi.ts","../src/documentation/openapi-object.ts","../src/documentation/openapi-samples.ts","../src/documentation/custom-runtime.ts","../src/documentation/fonts.ts","../src/documentation/output.ts","../src/documentation/resource-path.ts","../src/documentation/skill.ts","../src/documentation/renderer.ts","../src/documentation/runtime/styles/base.ts","../src/documentation/runtime/styles/content.ts","../src/documentation/runtime/styles/navigation.ts","../src/documentation/runtime/styles/overlays.ts","../src/documentation/runtime/styles/responsive.ts","../src/documentation/runtime/styles.ts","../src/documentation/template.ts","../src/documentation/vite.ts"],"sourcesContent":["import { buildSync } from 'esbuild'\nimport { readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { version as sdkPackageVersion } from '../../package.json'\nimport {\n createAssistantChunks,\n createSearchEntries,\n pageMarkdown,\n pagesInNavigationOrder,\n renderLlmsFull,\n renderLlmsIndex,\n renderRobots,\n renderSitemap,\n stableJson,\n} from './artifacts'\nimport { validateDocumentation } from './graph'\nimport { buildCustomDocumentationRuntime, runtimeEntry } from './custom-runtime'\nimport { readBundledFont, resolveDocumentationFonts } from './fonts'\nimport { DocumentationOutput } from './output'\nimport { artifactPathsForRoute } from './routing'\nimport { documentationPublicPath, normalizeDocumentationBasePath } from './routing'\nimport { encodeNativeDocumentationPath, isNativeDocumentationResourcePath } from './resource-path'\nimport { createDocumentationSkillArtifacts } from './skill'\nimport {\n createPageRuntime,\n createNotFoundPage,\n renderDocumentationFavicon,\n renderPage,\n renderRedirect,\n DOCUMENTATION_CSS,\n DOCUMENTATION_THEME_BOOTSTRAP,\n} from './template'\nimport {\n DOCUMENTATION_MANIFEST_VERSION,\n DocumentationError,\n type DocumentationBuildManifest,\n type DocumentationBuildResult,\n} from './types'\n\nexport interface BuildDocumentationOptions {\n appDir: string\n outputDir?: string\n baseUrl?: string\n /** Public mount on the ordinary app host. Defaults to `/docs`. */\n basePath?: string\n}\n\nexport function buildDocumentation(options: BuildDocumentationOptions): DocumentationBuildResult {\n const validation = validateDocumentation(options.appDir)\n const outputDir = options.outputDir ? resolve(options.outputDir) : validation.outputDir\n const output = new DocumentationOutput(outputDir, validation.appDir, validation.sourceDir)\n const basePath = normalizeDocumentationBasePath(options.basePath ?? '/docs')\n const renderConfig = options.baseUrl\n ? { ...validation.graph.config, url: options.baseUrl }\n : validation.graph.config\n\n const write = output.write.bind(output)\n\n const customRuntime = buildCustomDocumentationRuntime(validation, basePath)\n if (customRuntime) {\n for (const asset of customRuntime.browserAssets) write(`assets/${asset.path}`, asset.content)\n }\n\n for (const page of validation.graph.pages) {\n const artifactPaths = artifactPathsForRoute(page.route)\n const renderOptions = {\n config: renderConfig,\n basePath,\n page,\n pages: validation.graph.pages,\n navigation: validation.graph.navigation,\n }\n const runtime = createPageRuntime(renderOptions)\n write(artifactPaths.html, renderPage(renderOptions, customRuntime ? {\n customStylesheets: customRuntime.stylesheets,\n markup: customRuntime.render(runtime.data, page.route),\n runtimeModule: true,\n runtimeScript: documentationPublicPath(basePath, '/assets/documentation-custom-runtime.js'),\n } : {}, runtime))\n write(artifactPaths.data, stableJson(runtime.document))\n write(artifactPaths.markdown, pageMarkdown(page, basePath))\n }\n for (const [from, to] of Object.entries(validation.graph.config.redirects)) {\n write(artifactPathsForRoute(from).html, renderRedirect(to, basePath))\n }\n\n const notFoundPage = createNotFoundPage()\n const notFoundOptions = {\n config: renderConfig,\n basePath,\n page: notFoundPage,\n pages: [notFoundPage],\n navigation: validation.graph.navigation,\n }\n const notFoundRuntime = createPageRuntime(notFoundOptions)\n write('404.html', renderPage(notFoundOptions, customRuntime ? {\n customStylesheets: customRuntime.stylesheets,\n markup: customRuntime.render(notFoundRuntime.data, notFoundPage.route),\n runtimeModule: true,\n runtimeScript: documentationPublicPath(basePath, '/assets/documentation-custom-runtime.js'),\n } : {}, notFoundRuntime))\n write('assets/documentation.css', DOCUMENTATION_CSS.trimStart())\n write('assets/documentation-theme.js', DOCUMENTATION_THEME_BOOTSTRAP)\n for (const font of resolveDocumentationFonts(renderConfig.theme, basePath)) {\n if (font.bundled) write(`assets/fonts/${font.bundled.fileName}`, readBundledFont(font.bundled))\n }\n if (!renderConfig.theme.favicon) write('assets/favicon.svg', renderDocumentationFavicon(renderConfig.theme))\n if (!customRuntime) write('assets/documentation-runtime.js', buildDocumentationRuntime().trimStart())\n write('search.json', stableJson(createSearchEntries(validation.graph.pages)))\n write('assistant-index.json', stableJson(createAssistantChunks(validation.graph.pages)))\n const openApiOperations = validation.graph.pages.flatMap((page) =>\n page.openapi ? [{ route: page.route, ...page.openapi }] : [],\n )\n if (openApiOperations.length > 0) write('openapi.json', stableJson(openApiOperations))\n const machinePages = pagesInNavigationOrder(validation.graph.pages, validation.graph.navigation)\n write('llms.txt', renderLlmsIndex(machinePages, validation.graph.config.name, basePath))\n write('llms-full.txt', renderLlmsFull(machinePages, validation.graph.config.name, basePath))\n const skill = createDocumentationSkillArtifacts(validation.graph, renderConfig.url, basePath)\n write('skill.md', skill.markdown)\n write(`.well-known/skills/${skill.name}/SKILL.md`, skill.markdown)\n write('.well-known/skills/index.json', stableJson(skill.legacyIndex))\n write(`.well-known/agent-skills/${skill.name}/skill.md`, skill.markdown)\n write('.well-known/agent-skills/index.json', stableJson(skill.discoveryIndex))\n write('sitemap.xml', renderSitemap(validation.graph.pages, renderConfig.url))\n write('robots.txt', renderRobots(renderConfig.url, renderConfig.seo.noindex))\n output.copyMedia(\n validation.sourceDir,\n new Set(\n validation.graph.pages\n .filter((page) => page.kind === 'openapi')\n .map((page) => resolve(page.sourcePath)),\n ),\n )\n\n const resources = [...output.files]\n .filter((file) => isNativeDocumentationResourcePath(`/${file}`))\n .map((file) => encodeNativeDocumentationPath(`/${file}`))\n .sort()\n const outputHash = output.hash()\n const manifest: DocumentationBuildManifest = {\n version: DOCUMENTATION_MANIFEST_VERSION,\n sourceHash: validation.graph.sourceHash,\n outputHash,\n sdkVersion: sdkPackageVersion,\n name: validation.graph.config.name,\n pageCount: validation.graph.pages.length,\n routes: [\n ...validation.graph.pages.map((page) => page.route),\n ...Object.keys(validation.graph.config.redirects),\n ].map(encodeNativeDocumentationPath).sort(),\n resources,\n assistant: validation.graph.config.assistant,\n mcp: validation.graph.config.mcp,\n domains: validation.graph.config.domains,\n basePath,\n }\n write('manifest.json', stableJson(manifest))\n\n return {\n ...validation,\n outputDir,\n manifest,\n files: [...output.files].sort(),\n }\n}\n\n/**\n * Published packages ship a pre-bundled browser runtime beside `dist/documentation.js`.\n * Source checkouts compile the same entry on demand so SDK tests and local CLI\n * development exercise the real hydration code rather than a test-only shim.\n */\nfunction buildDocumentationRuntime(): string {\n const entry = runtimeEntry('documentation-runtime.js', 'runtime/auto-client.tsx')\n if (entry.endsWith('.js')) return readFileSync(entry, 'utf8')\n\n const result = buildSync({\n entryPoints: [entry],\n bundle: true,\n write: false,\n minify: true,\n platform: 'browser',\n format: 'iife',\n target: ['es2022'],\n jsx: 'automatic',\n define: { 'process.env.NODE_ENV': '\"production\"' },\n })\n const output = result.outputFiles?.[0]?.text\n if (!output) {\n throw new DocumentationError('Unable to compile the documentation browser runtime', 'documentation_runtime_build_failed')\n }\n return output\n}\n","{\n \"name\": \"deepspace\",\n \"version\": \"0.22.0\",\n \"engines\": {\n \"node\": \">=22.15.0 <23 || >=24 <25 || >=26 <27\"\n },\n \"description\": \"DeepSpace SDK — build real-time collaborative apps on Cloudflare Workers\",\n \"type\": \"module\",\n \"sideEffects\": false,\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"deepspace\": \"dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./schema\": {\n \"types\": \"./dist/schema.d.ts\",\n \"import\": \"./dist/schema.js\"\n },\n \"./worker\": {\n \"types\": \"./dist/worker.d.ts\",\n \"import\": \"./dist/worker.js\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.js\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.js\"\n },\n \"./testing/mcp\": {\n \"types\": \"./dist/testing-mcp.d.ts\",\n \"import\": \"./dist/testing-mcp.js\"\n },\n \"./documentation\": {\n \"types\": \"./dist/documentation.d.ts\",\n \"import\": \"./dist/documentation.js\"\n },\n \"./documentation/react\": {\n \"types\": \"./dist/documentation-react.d.ts\",\n \"import\": \"./dist/documentation-react.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"features\",\n \"CHANGELOG.md\"\n ],\n \"scripts\": {\n \"build\": \"node ../../scripts/clean-artifacts.mjs dist --tsbuildinfo && tsup\",\n \"type-check\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"test:documentation-browser\": \"playwright test --config src/documentation/runtime/__browser__/playwright.config.ts\",\n \"clean\": \"node ../../scripts/clean-artifacts.mjs dist --tsbuildinfo\",\n \"prepublishOnly\": \"pnpm build\"\n },\n \"dependencies\": {\n \"@ai-sdk/anthropic\": \"2.0.91\",\n \"@ai-sdk/openai\": \"2.0.116\",\n \"@ai-sdk/openai-compatible\": \"1.0.46\",\n \"@clack/prompts\": \"^1.2.0\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"acorn\": \"^8.16.0\",\n \"ai\": \"5.0.222\",\n \"better-auth\": \"1.6.23\",\n \"citty\": \"^0.2.0\",\n \"cross-spawn\": \"^7.0.6\",\n \"esbuild\": \"^0.27.0\",\n \"highlight.js\": \"^11.11.1\",\n \"hono\": \"^4.6.0\",\n \"jose\": \"^6.1.0\",\n \"marked\": \"^18.0.7\",\n \"mdast-util-gfm\": \"^3.1.0\",\n \"mdast-util-to-markdown\": \"^2.1.2\",\n \"rehype-highlight\": \"^7.0.2\",\n \"remark-frontmatter\": \"^5.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sanitize-html\": \"^2.17.6\",\n \"smol-toml\": \"^1.6.1\",\n \"yaml\": \"^2.9.0\",\n \"yjs\": \"^13.6.0\",\n \"zod\": \"^4.3.6\"\n },\n \"peerDependencies\": {\n \"@playwright/test\": \">=1.40.0\",\n \"clsx\": \">=2.0.0\",\n \"lucide-react\": \">=0.400.0\",\n \"react\": \"^18.0.0 || ^19.0.0\",\n \"react-dom\": \"^18.0.0 || ^19.0.0\",\n \"tailwind-merge\": \">=2.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"@playwright/test\": {\n \"optional\": true\n },\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n },\n \"clsx\": {\n \"optional\": true\n },\n \"tailwind-merge\": {\n \"optional\": true\n },\n \"lucide-react\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@cloudflare/workers-types\": \"^4.20241205.0\",\n \"@playwright/test\": \"^1.59.1\",\n \"@types/better-sqlite3\": \"^7.6.12\",\n \"@types/cross-spawn\": \"^6.0.6\",\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"@types/sanitize-html\": \"^2.16.1\",\n \"better-sqlite3\": \"^12.0.0\",\n \"clsx\": \"^2.1.1\",\n \"framer-motion\": \"^12.38.0\",\n \"jsdom\": \"^29.1.1\",\n \"lucide-react\": \"^1.7.0\",\n \"react-router-dom\": \"^7.1.0\",\n \"tailwind-merge\": \"^3.5.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^4.1.0\"\n },\n \"keywords\": [\n \"deepspace\",\n \"cloudflare-workers\",\n \"durable-objects\",\n \"real-time\",\n \"collaborative\",\n \"sdk\"\n ],\n \"license\": \"Apache-2.0\",\n \"homepage\": \"https://deep.space\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/deepdotspace/deepspace.git\",\n \"directory\": \"packages/deepspace\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/deepdotspace/deepspace/issues\"\n }\n}\n","import hljs from 'highlight.js/lib/core'\nimport bash from 'highlight.js/lib/languages/bash'\nimport css from 'highlight.js/lib/languages/css'\nimport javascript from 'highlight.js/lib/languages/javascript'\nimport json from 'highlight.js/lib/languages/json'\nimport markdown from 'highlight.js/lib/languages/markdown'\nimport typescript from 'highlight.js/lib/languages/typescript'\nimport xml from 'highlight.js/lib/languages/xml'\nimport yaml from 'highlight.js/lib/languages/yaml'\nimport { Marked } from 'marked'\nimport sanitizeHtml from 'sanitize-html'\nimport { parse as parseYaml } from 'yaml'\nimport { createSlugger, errorMessage, escapeHtml } from './text'\nimport { DocumentationError, type DocumentationFrontmatter, type DocumentationHeading } from './types'\n\nconst COMPONENT_NAMES = [\n 'Note',\n 'Tip',\n 'Warning',\n 'Info',\n 'Card',\n 'Accordion',\n 'AccordionGroup',\n 'Step',\n 'Tab',\n 'CodeGroup',\n 'Steps',\n 'Tabs',\n] as const\n\ntype ComponentName = (typeof COMPONENT_NAMES)[number]\n\nconst LEAF_COMPONENTS: ComponentName[] = [\n 'Note',\n 'Tip',\n 'Warning',\n 'Info',\n 'Card',\n 'Accordion',\n 'Step',\n 'Tab',\n 'CodeGroup',\n]\n\nconst WRAPPER_COMPONENTS: ComponentName[] = ['AccordionGroup', 'Steps', 'Tabs']\n\nfor (const [name, language] of Object.entries({\n bash,\n css,\n html: xml,\n javascript,\n json,\n jsx: javascript,\n markdown,\n md: markdown,\n shell: bash,\n sh: bash,\n ts: typescript,\n tsx: typescript,\n typescript,\n xml,\n yaml,\n yml: yaml,\n})) {\n hljs.registerLanguage(name, language)\n}\n\nconst markdownRenderer = new Marked({\n renderer: {\n code({ text, lang }) {\n const { language, title } = parseCodeFenceInfo(lang)\n const highlighted = language && hljs.getLanguage(language)\n ? hljs.highlight(text, { language, ignoreIllegals: true }).value\n : escapeHtml(text)\n const className = language\n ? ` class=\"language-${escapeHtml(language)} hljs\"`\n : ' class=\"hljs\"'\n return `<pre${title ? ` data-code-title=\"${escapeHtml(title)}\"` : ''}><code${className}>${highlighted}</code></pre>\\n`\n },\n },\n})\n\nexport interface ParsedMarkdown {\n frontmatter: DocumentationFrontmatter\n markdown: string\n html: string\n text: string\n headings: DocumentationHeading[]\n}\n\n/** Remove the first authored Markdown H1 because the documentation shell owns the page H1. */\nexport function stripFirstMarkdownH1(source: string): string {\n const lines = [...source.matchAll(/.*(?:\\r?\\n|$)/g)].filter((match) => match[0])\n let inFrontmatter = false\n let frontmatterSeen = false\n let fence: { marker: '`' | '~'; length: number } | undefined\n for (const [index, match] of lines.entries()) {\n const raw = match[0]\n const line = raw.replace(/\\r?\\n$/, '')\n const content = index === 0 ? line.replace(/^\\uFEFF/, '') : line\n if (index === 0 && content === '---') {\n inFrontmatter = true\n frontmatterSeen = true\n continue\n }\n if (inFrontmatter) {\n if (frontmatterSeen && /^(?:---|\\.\\.\\.)\\s*$/.test(content)) inFrontmatter = false\n continue\n }\n const fenceMatch = content.match(/^ {0,3}(`{3,}|~{3,})/)\n if (fenceMatch?.[1]) {\n const marker = fenceMatch[1][0] as '`' | '~'\n if (!fence) fence = { marker, length: fenceMatch[1].length }\n else if (fence.marker === marker && fenceMatch[1].length >= fence.length) fence = undefined\n continue\n }\n if (fence || !/^ {0,3}#(?:[\\t ]+|$)/.test(content)) continue\n const start = match.index ?? 0\n const newline = raw.endsWith('\\r\\n') ? '\\r\\n' : raw.endsWith('\\n') ? '\\n' : ''\n return `${source.slice(0, start)}${newline}${source.slice(start + raw.length)}`\n }\n return source\n}\n\nexport function parseMarkdown(source: string, file: string): ParsedMarkdown {\n const { frontmatter, body } = parseFrontmatter(source, file)\n validateExecutableMdx(body, file)\n\n const placeholders: string[] = []\n let prepared = protectCode(body.replace(/^\\uFEFF/, ''), placeholders)\n for (const name of [...LEAF_COMPONENTS, ...WRAPPER_COMPONENTS]) {\n prepared = replaceComponentBlocks(prepared, name, placeholders)\n }\n\n const rendered = String(markdownRenderer.parse(prepared, { gfm: true, breaks: false }))\n let restored = rendered\n for (let pass = 0; pass < placeholders.length + 1; pass++) {\n let changed = false\n restored = restored.replace(\n /(?:<p>)?@@DEEPSPACE_COMPONENT_(\\d+)@@(?:<\\/p>)?/g,\n (_match, indexRaw: string) => {\n const replacement = placeholders[Number(indexRaw)]\n if (replacement === undefined) return ''\n changed = true\n return replacement\n },\n )\n if (!changed) break\n }\n restored = restored.replace(\n /<div class=\"documentation-code-group\" data-code-group-pending data-code-group-title=\"([^\"]*)\">([\\s\\S]*?)<\\/div>/g,\n (_match, title: string, innerHtml: string) => renderCodeGroup(innerHtml, title),\n )\n\n const safe = sanitizeHtml(restored, {\n allowedTags: [\n ...sanitizeHtml.defaults.allowedTags,\n 'article',\n 'aside',\n 'button',\n 'details',\n 'div',\n 'figure',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'input',\n 'label',\n 'section',\n 'span',\n 'summary',\n 'table',\n 'thead',\n 'tbody',\n 'tr',\n 'th',\n 'td',\n ],\n allowedAttributes: {\n a: ['href', 'title', 'target', 'rel', 'class'],\n aside: ['class'],\n button: ['type', 'class', 'data-copy-code'],\n code: ['class'],\n details: ['class', 'open'],\n div: ['class', 'data-tab-group', 'data-tab-persist'],\n img: ['src', 'alt', 'title', 'width', 'height', 'loading'],\n input: ['type', 'checked', 'disabled'],\n pre: ['class', 'data-code-title'],\n section: ['class', 'data-tab', 'data-tab-title'],\n span: ['class'],\n summary: ['class'],\n table: ['class'],\n '*': ['id', 'aria-label', 'aria-hidden', 'role'],\n },\n allowedSchemes: ['http', 'https', 'mailto'],\n allowProtocolRelative: false,\n disallowedTagsMode: 'escape',\n transformTags: {\n a: (_tagName, attributes) => {\n const external = /^https?:\\/\\//i.test(attributes.href ?? '')\n return {\n tagName: 'a',\n attribs: external\n ? { ...attributes, target: '_blank', rel: 'noopener noreferrer' }\n : attributes,\n }\n },\n img: (_tagName, attributes) => ({\n tagName: 'img',\n attribs: { ...attributes, loading: attributes.loading ?? 'lazy' },\n }),\n },\n })\n\n const { html, headings } = addHeadingIds(safe)\n return {\n frontmatter,\n markdown: body.trim(),\n html,\n text: htmlToText(html),\n headings,\n }\n}\n\nexport function parseFrontmatter(\n source: string,\n file: string,\n): { frontmatter: DocumentationFrontmatter; body: string } {\n if (!source.startsWith('---\\n') && !source.startsWith('---\\r\\n')) {\n return { frontmatter: {}, body: source }\n }\n const normalized = source.replace(/\\r\\n/g, '\\n')\n const end = normalized.indexOf('\\n---\\n', 4)\n if (end === -1) {\n throw new DocumentationError(\n `Unclosed front matter in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_unclosed', message: 'Expected a closing --- line', file, line: 1 }],\n )\n }\n\n let value: unknown\n try {\n value = parseYaml(normalized.slice(4, end), { maxAliasCount: 20 })\n } catch (error) {\n throw new DocumentationError(\n `Invalid front matter in ${file}: ${errorMessage(error)}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_yaml', message: errorMessage(error), file, line: 1 }],\n )\n }\n if (value === null) value = {}\n if (typeof value !== 'object' || Array.isArray(value)) {\n throw new DocumentationError(\n `Front matter must be a mapping in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_shape', message: 'Expected key/value front matter', file, line: 1 }],\n )\n }\n const raw = value as Record<string, unknown>\n const frontmatter: DocumentationFrontmatter = {}\n for (const key of ['title', 'description', 'slug'] as const) {\n if (raw[key] !== undefined && typeof raw[key] !== 'string') {\n throw frontmatterTypeError(file, key, 'string')\n }\n if (typeof raw[key] === 'string') frontmatter[key] = raw[key]\n }\n for (const key of ['hidden', 'noindex'] as const) {\n if (raw[key] !== undefined && typeof raw[key] !== 'boolean') {\n throw frontmatterTypeError(file, key, 'boolean')\n }\n if (typeof raw[key] === 'boolean') frontmatter[key] = raw[key]\n }\n return { frontmatter, body: normalized.slice(end + 5) }\n}\n\nfunction replaceComponentBlocks(\n source: string,\n name: ComponentName,\n placeholders: string[],\n): string {\n const pattern = new RegExp(`<${name}(\\\\s[^>]*)?>([\\\\s\\\\S]*?)<\\\\/${name}>`, 'g')\n return source.replace(pattern, (_match, attributesRaw: string | undefined, inner: string) => {\n const attributes = parseAttributes(attributesRaw ?? '')\n const innerHtml = String(markdownRenderer.parse(inner.trim(), { gfm: true, breaks: false }))\n const html = renderComponent(name, attributes, innerHtml)\n const index = placeholders.push(html) - 1\n return `\\n\\n@@DEEPSPACE_COMPONENT_${index}@@\\n\\n`\n })\n}\n\nfunction renderComponent(\n name: ComponentName,\n attributes: Record<string, string>,\n innerHtml: string,\n): string {\n const title = escapeHtml(attributes.title ?? attributes.label ?? '')\n switch (name) {\n case 'Note':\n case 'Tip':\n case 'Warning':\n case 'Info':\n return `<aside class=\"documentation-callout documentation-callout-${name.toLowerCase()}\">` +\n `${title ? `<strong>${title}</strong>` : `<strong>${name}</strong>`}${innerHtml}</aside>`\n case 'Card': {\n const href = safeHref(attributes.href)\n const content = `${title ? `<strong>${title}</strong>` : ''}${innerHtml}`\n return href\n ? `<a class=\"documentation-card\" href=\"${escapeHtml(href)}\">${content}<span aria-hidden=\"true\">→</span></a>`\n : `<div class=\"documentation-card\">${content}</div>`\n }\n case 'Accordion':\n return `<details class=\"documentation-accordion\"><summary>${title || 'Details'}</summary>${innerHtml}</details>`\n case 'AccordionGroup':\n return `<div class=\"documentation-accordion-group\">${innerHtml}</div>`\n case 'Step':\n return `<section class=\"documentation-step\">${title ? `<h3>${title}</h3>` : ''}${innerHtml}</section>`\n case 'Steps':\n return `<div class=\"documentation-steps\">${innerHtml}</div>`\n case 'Tab':\n return `<section class=\"documentation-tab\" data-tab data-tab-title=\"${title || 'Tab'}\">${innerHtml}</section>`\n case 'Tabs':\n return `<div class=\"documentation-tabs\" data-tab-group>${innerHtml}</div>`\n case 'CodeGroup':\n return `<div class=\"documentation-code-group\" data-code-group-pending data-code-group-title=\"${title}\">${innerHtml}</div>`\n }\n}\n\nfunction renderCodeGroup(innerHtml: string, title: string): string {\n const blocks = [...innerHtml.matchAll(/<pre([^>]*)>([\\s\\S]*?)<\\/pre>/g)]\n if (blocks.length === 0) {\n return `<div class=\"documentation-code-group\">${title ? `<div class=\"documentation-code-group-title\">${title}</div>` : ''}${innerHtml}</div>`\n }\n const tabs = blocks.map((match, index) => {\n const attributes = match[1] ?? ''\n const explicit = attributes.match(/\\sdata-code-title=\"([^\"]+)\"/)?.[1]\n const language = match[2]?.match(/class=\"language-([^\\s\"]+)/)?.[1]\n const label = explicit ?? codeLanguageLabel(language) ?? `Example ${index + 1}`\n return `<section class=\"documentation-code-tab\" data-tab data-tab-title=\"${escapeHtml(label)}\"><pre${attributes}>${match[2]}</pre></section>`\n }).join('')\n return `<div class=\"documentation-code-group\" data-tab-group data-tab-persist=\"code\">${title ? `<div class=\"documentation-code-group-title\">${title}</div>` : ''}${tabs}</div>`\n}\n\nexport function parseCodeFenceInfo(value: string | undefined): { language?: string; title?: string } {\n const raw = value?.trim() ?? ''\n if (!raw) return {}\n const language = raw.split(/\\s+/, 1)[0]?.toLowerCase()\n const metadata = raw.slice(language?.length ?? 0).trim()\n const quotedTitle = metadata.match(/(?:^|\\s)title=(?:\"([^\"]+)\"|'([^']+)')/i)\n // A bare token is a title (or code-group tab label) unless it is an option\n // shape: {1,3-4} ranges, key=value pairs, or a known option keyword — those\n // must never render as a header bar.\n const optionKeyword = /^(?:wrap|expandable|twoslash|focus)$/i.test(metadata)\n const bareTitle = metadata && !metadata.includes('=') && !metadata.startsWith('{') && !optionKeyword\n ? metadata\n : undefined\n const title = quotedTitle?.[1] ?? quotedTitle?.[2] ?? bareTitle\n return {\n ...(language ? { language } : {}),\n ...(title ? { title: title.trim() } : {}),\n }\n}\n\nfunction codeLanguageLabel(language: string | undefined): string | undefined {\n if (!language) return undefined\n const names: Record<string, string> = {\n bash: 'Shell',\n javascript: 'JavaScript',\n js: 'JavaScript',\n jsx: 'React',\n shell: 'Shell',\n sh: 'Shell',\n ts: 'TypeScript',\n tsx: 'React',\n typescript: 'TypeScript',\n }\n return names[language] ?? language.toUpperCase()\n}\n\nfunction parseAttributes(raw: string): Record<string, string> {\n const attributes: Record<string, string> = {}\n const pattern = /([A-Za-z][A-Za-z0-9_-]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g\n for (const match of raw.matchAll(pattern)) {\n attributes[match[1]] = match[2] ?? match[3] ?? ''\n }\n return attributes\n}\n\nfunction validateExecutableMdx(body: string, file: string): void {\n const validationBody = stripCodeForValidation(body)\n const lines = validationBody.split('\\n')\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index]\n if (/^\\s*(?:import|export)\\s/.test(line)) {\n throw new DocumentationError(\n `Executable MDX is not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'mdx_module_syntax',\n message: 'Use the built-in documentation component vocabulary instead of import/export',\n file,\n line: index + 1,\n }],\n )\n }\n if (/<[A-Za-z][^>]*\\son[A-Za-z]+\\s*=/.test(line) || /<script\\b/i.test(line)) {\n throw new DocumentationError(\n `Active HTML is not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'active_html',\n message: 'Scripts and inline event handlers are prohibited',\n file,\n line: index + 1,\n }],\n )\n }\n if (/<[A-Z][A-Za-z0-9]*[^>]*=\\s*\\{/.test(line)) {\n throw new DocumentationError(\n `JSX expressions are not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'jsx_expression',\n message: 'Component attributes must use quoted string values',\n file,\n line: index + 1,\n }],\n )\n }\n }\n\n const componentPattern = /<\\/?([A-Z][A-Za-z0-9]*)\\b/g\n for (const match of validationBody.matchAll(componentPattern)) {\n if (!COMPONENT_NAMES.includes(match[1] as ComponentName)) {\n const line = validationBody.slice(0, match.index).split('\\n').length\n throw new DocumentationError(\n `Unknown documentation component <${match[1]}> in ${file}:${line}`,\n 'documentation_mdx_component_unknown',\n [{\n code: 'unknown_component',\n message: `Supported components: ${COMPONENT_NAMES.join(', ')}`,\n file,\n line,\n }],\n )\n }\n }\n}\n\nfunction protectCode(source: string, placeholders: string[]): string {\n const fenced = source.replace(\n /^([ \\t]*)(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^\\1\\2[ \\t]*(?=\\n|$)/gm,\n (block, indentation: string) => {\n const normalized = indentation\n ? block.split('\\n').map((line) => line.startsWith(indentation) ? line.slice(indentation.length) : line).join('\\n')\n : block\n const html = String(markdownRenderer.parse(normalized, { gfm: true, breaks: false }))\n const index = placeholders.push(html) - 1\n return `\\n\\n@@DEEPSPACE_COMPONENT_${index}@@\\n\\n`\n },\n )\n return fenced.replace(/`([^`\\n]+)`/g, (_match, code: string) => {\n const index = placeholders.push(`<code>${escapeHtml(code)}</code>`) - 1\n return `@@DEEPSPACE_COMPONENT_${index}@@`\n })\n}\n\nfunction stripCodeForValidation(source: string): string {\n return source\n .replace(\n /^([ \\t]*)(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^\\1\\2[ \\t]*(?=\\n|$)/gm,\n (block) => block.replace(/[^\\n]/g, ' '),\n )\n .replace(/`[^`\\n]+`/g, (code) => ' '.repeat(code.length))\n}\n\nfunction addHeadingIds(html: string): { html: string; headings: DocumentationHeading[] } {\n const headings: DocumentationHeading[] = []\n const slug = createSlugger()\n const output = html.replace(/<h([1-6])>([\\s\\S]*?)<\\/h\\1>/g, (_match, depthRaw, content) => {\n const text = htmlToText(content)\n const id = slug(text)\n const depth = Number(depthRaw)\n headings.push({ depth, id, text })\n return `<h${depth} id=\"${id}\">${content}<a class=\"documentation-heading-anchor\" href=\"#${id}\" aria-label=\"Link to ${escapeHtml(text)}\">#</a></h${depth}>`\n })\n return { html: output, headings }\n}\n\nexport { slugify } from './text'\n\nexport function htmlToText(html: string): string {\n return decodeEntities(\n html\n .replace(/<pre[\\s\\S]*?<\\/pre>/g, ' ')\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim(),\n )\n}\n\nfunction decodeEntities(value: string): string {\n return value\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n}\n\nfunction safeHref(value: string | undefined): string {\n if (!value) return ''\n if (/^(?:https?:|mailto:|\\/|#)/i.test(value)) return value\n return ''\n}\n\nfunction frontmatterTypeError(file: string, key: string, type: string): DocumentationError {\n return new DocumentationError(\n `Front matter ${key} must be a ${type} in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_type', message: `${key} must be a ${type}`, file, line: 1 }],\n )\n}\n","/** Render an unknown failure without unsafe structural assumptions. */\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nexport function escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n}\n\nexport function escapeXml(value: string): string {\n return escapeHtml(value).replace(/&#39;/g, '&apos;')\n}\n\nexport function slugify(value: string): string {\n return value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\n/** Add the documentation qualifier exactly once in user- and agent-facing copy. */\nexport function documentationSubject(name: string): string {\n const normalized = name.trim()\n if (!normalized || /^documentation$/i.test(normalized)) return 'documentation'\n return /(?:\\bdocs?|documentation)$/i.test(normalized) ? normalized : `${normalized} documentation`\n}\n\n/** Allocate stable, collision-free ids with the same rules in Markdown and MDX. */\nexport function createSlugger(fallback = 'section'): (value: string) => string {\n const seen = new Map<string, number>()\n return (value) => {\n const base = slugify(value) || fallback\n const count = seen.get(base) ?? 0\n seen.set(base, count + 1)\n return count === 0 ? base : `${base}-${count + 1}`\n }\n}\n","import type { z } from 'zod'\nimport type { themeObjectSchema } from './config/schema'\n\nexport const DOCUMENTATION_CONFIG_FILE = 'documentation.json'\nexport const DOCUMENTATION_MANIFEST_VERSION = 2\n\nexport type DocumentationAssistantAccess = 'disabled' | 'public' | 'authenticated'\nexport type DocumentationMcpAccess = 'disabled' | 'public'\nexport const DOCUMENTATION_CONTEXTUAL_ACTIONS = [\n 'copy',\n 'view',\n 'assistant',\n 'chatgpt',\n 'claude',\n 'mcp',\n 'add-mcp',\n 'cursor',\n 'vscode',\n] as const\nexport type DocumentationContextualAction = (typeof DOCUMENTATION_CONTEXTUAL_ACTIONS)[number]\nexport const DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS: readonly DocumentationContextualAction[] =\n DOCUMENTATION_CONTEXTUAL_ACTIONS\n\nexport interface DocumentationFontConfig {\n family: string\n weight?: number | string\n source?: string\n format?: string\n}\n\n/**\n * The `theme` object as authored in documentation.json — exactly the keys\n * the config schema accepts under `theme.*`, derived from that schema so\n * the two can never drift. Everything else (fonts, background decoration,\n * styling, logo href) is configured through the Mintlify-style top-level\n * keys and only exists on the resolved theme.\n */\nexport type DocumentationThemeConfig = z.infer<typeof themeObjectSchema>\n\n/**\n * The fully resolved theme after config loading merges `theme.*` with the\n * Mintlify top-level keys (`colors`, `logo`, `favicon`, `appearance`,\n * `background`, `fonts`, `styling`). This is what the template and runtime\n * consume; it is an output shape, never accepted as `theme.*` input.\n */\nexport interface ResolvedDocumentationTheme extends DocumentationThemeConfig {\n backgroundDark?: string\n backgroundDecoration?: 'none' | 'gradient' | 'grid'\n bodyFont?: DocumentationFontConfig\n headingFont?: DocumentationFontConfig\n monoFont?: DocumentationFontConfig\n codeBlockMode?: 'dark' | 'system'\n eyebrowStyle?: 'section' | 'breadcrumbs' | 'none'\n logoHref?: string\n}\n\nexport interface DocumentationLinkConfig {\n label: string\n href: string\n}\n\nexport interface DocumentationNavGroup {\n group: string\n pages: DocumentationNavigationItem[]\n}\n\nexport type DocumentationNavigationItem = string | DocumentationLinkConfig | DocumentationNavGroup\n\nexport const DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES = ['curl', 'javascript', 'python', 'go'] as const\nexport type DocumentationOpenApiSampleLanguage = (typeof DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES)[number]\nexport type DocumentationOpenApiSampleDefaults = 'required' | 'all'\n\nexport interface DocumentationOpenApiExamplesConfig {\n languages: DocumentationOpenApiSampleLanguage[]\n defaults: DocumentationOpenApiSampleDefaults\n autogenerate: boolean\n}\n\nexport const DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES = {\n languages: ['curl', 'python', 'javascript', 'go'],\n defaults: 'all',\n autogenerate: true,\n} as const satisfies Omit<DocumentationOpenApiExamplesConfig, 'languages'> & {\n languages: readonly DocumentationOpenApiSampleLanguage[]\n}\n\nexport interface DocumentationOpenApiConfig {\n source: string\n route?: string\n label?: string\n playground?: boolean\n baseUrl?: string\n examples?: DocumentationOpenApiExamplesConfig\n}\n\nexport interface DocumentationAssistantConfig {\n access: DocumentationAssistantAccess\n model?: string\n suggestions?: string[]\n}\n\nexport interface DocumentationMcpConfig {\n access: DocumentationMcpAccess\n}\n\nexport interface DocumentationContextualConfig {\n actions: DocumentationContextualAction[]\n}\n\nexport interface DocumentationSeoConfig {\n noindex?: boolean\n ogImage?: string\n metaTags?: Record<string, string>\n}\n\nexport interface DocumentationConfig {\n $schema?: string\n name: string\n description?: string\n source: string\n output: string\n url?: string\n /** Explicit custom hostnames that mount this documentation at `/`. */\n domains: string[]\n theme: ResolvedDocumentationTheme\n navigation?: DocumentationNavigationItem[]\n links: DocumentationLinkConfig[]\n footer: DocumentationLinkConfig[]\n redirects: Record<string, string>\n openapi: DocumentationOpenApiConfig[]\n assistant: DocumentationAssistantConfig\n mcp: DocumentationMcpConfig\n contextual: DocumentationContextualConfig\n seo: DocumentationSeoConfig\n}\n\nexport interface DocumentationFrontmatter {\n title?: string\n description?: string\n slug?: string\n hidden?: boolean\n noindex?: boolean\n}\n\nexport interface DocumentationHeading {\n depth: number\n id: string\n text: string\n}\n\nexport interface DocumentationPage {\n sourcePath: string\n relativePath: string\n route: string\n title: string\n description?: string\n hidden: boolean\n noindex: boolean\n markdown: string\n html: string\n text: string\n headings: DocumentationHeading[]\n sourceFormat: 'markdown' | 'mdx' | 'generated'\n kind: 'page' | 'openapi'\n openapi?: DocumentationOpenApiOperation\n}\n\nexport interface DocumentationNavigationPage {\n kind: 'page'\n route: string\n label: string\n}\n\nexport interface DocumentationNavigationLink {\n kind: 'link'\n href: string\n label: string\n}\n\nexport interface DocumentationNavigationGroup {\n kind: 'group'\n label: string\n items: DocumentationNavigationNode[]\n}\n\nexport type DocumentationNavigationNode = DocumentationNavigationPage | DocumentationNavigationLink | DocumentationNavigationGroup\n\nexport interface DocumentationOpenApiParameter {\n name: string\n in: string\n required: boolean\n description?: string\n schema?: unknown\n example?: unknown\n}\n\nexport interface DocumentationOpenApiResponse {\n status: string\n description: string\n schema?: unknown\n}\n\nexport interface DocumentationOpenApiCodeSample {\n language: string\n label: string\n syntax: string\n code: string\n generated: boolean\n}\n\nexport interface DocumentationOpenApiOperation {\n method: string\n path: string\n operationId: string\n summary: string\n description?: string\n tags: string[]\n parameters: DocumentationOpenApiParameter[]\n requestBody?: unknown\n responses: DocumentationOpenApiResponse[]\n security?: unknown\n baseUrl?: string\n playground: boolean\n codeSamples: DocumentationOpenApiCodeSample[]\n}\n\nexport interface DocumentationSearchEntry {\n route: string\n title: string\n description?: string\n /** Carries ids so search can offer section results, not only whole pages. */\n headings: DocumentationHeading[]\n text: string\n}\n\nexport interface DocumentationAssistantChunk {\n id: string\n route: string\n title: string\n heading?: string\n text: string\n}\n\nexport interface DocumentationGraph {\n config: DocumentationConfig\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n sourceHash: string\n}\n\nexport interface DocumentationBuildManifest {\n version: typeof DOCUMENTATION_MANIFEST_VERSION\n sourceHash: string\n outputHash: string\n /** Version of the `deepspace` package that compiled this output. */\n sdkVersion: string\n name: string\n pageCount: number\n /** Authored pages plus configured redirect entry points. */\n routes: string[]\n /** Exact non-HTML artifacts that may be served from the public mount. */\n resources: string[]\n assistant: DocumentationAssistantConfig\n mcp: DocumentationMcpConfig\n domains: string[]\n /** Default public mount on the ordinary app hostname. */\n basePath: string\n}\n\nexport interface DocumentationDiagnostic {\n code: string\n message: string\n file?: string\n line?: number\n}\n\nexport interface DocumentationValidationResult {\n appDir: string\n configPath: string\n sourceDir: string\n outputDir: string\n graph: DocumentationGraph\n warnings: DocumentationDiagnostic[]\n}\n\nexport interface DocumentationBuildResult extends DocumentationValidationResult {\n manifest: DocumentationBuildManifest\n files: string[]\n}\n\nexport interface DocumentationRuntimePageLink {\n route: string\n title: string\n}\n\nexport interface DocumentationRuntimePage {\n route: string\n title: string\n description?: string\n html: string\n headings: DocumentationHeading[]\n kind: DocumentationPage['kind']\n markdownUrl: string\n openapi?: DocumentationOpenApiOperation\n}\n\nexport interface DocumentationRuntimeData {\n /** Public mount (`/docs` on an app host, empty on an explicit documentation domain). */\n basePath: string\n config: Pick<\n DocumentationConfig,\n 'name' | 'description' | 'theme' | 'links' | 'footer' | 'assistant' | 'mcp' | 'contextual'\n >\n page: DocumentationRuntimePage\n navigation: DocumentationNavigationNode[]\n breadcrumbs: string[]\n previous?: DocumentationRuntimePageLink\n next?: DocumentationRuntimePageLink\n}\n\nexport type DocumentationRuntimeRouteData = Omit<DocumentationRuntimeData, 'config' | 'navigation'>\n\n/** Small per-route payload used by the hydrated documentation router. */\nexport interface DocumentationRuntimeRouteDocument {\n canonical: string | null\n data: DocumentationRuntimeRouteData\n description: string | null\n openGraph: Record<'og:title' | 'og:description' | 'og:url', string | null>\n robots: string | null\n title: string\n}\n\nexport class DocumentationError extends Error {\n readonly code: string\n readonly diagnostics: DocumentationDiagnostic[]\n\n constructor(message: string, code: string, diagnostics: DocumentationDiagnostic[] = []) {\n super(message)\n this.name = 'DocumentationError'\n this.code = code\n this.diagnostics = diagnostics\n }\n}\n","import { DocumentationError } from './types'\n\n/** Slash-collapsing shared by the compiler's strict normalizer and the\n * worker's lenient normalizer for untrusted lookup input, which must miss\n * rather than throw. */\nexport function collapseRoute(value: string): string {\n let route = `/${value}`.replace(/\\/{2,}/g, '/')\n if (route.length > 1) route = route.replace(/\\/$/, '')\n return route\n}\n\n/** Normalize and validate every public documentation route in one place. */\nexport function normalizeRoute(value: string): string {\n assertSafeRoute(value)\n let route = collapseRoute(value)\n route = route.replace(/\\.(?:md|mdx)$/i, '')\n route = route.replace(/\\/index$/i, '')\n return route || '/'\n}\n\nexport function routeFromRelativePath(relativePath: string): string {\n let path = relativePath.replace(/\\.(?:md|mdx)$/i, '')\n if (path === 'index') path = ''\n else path = path.replace(/\\/index$/i, '')\n return normalizeRoute(path)\n}\n\n/** Normalize the public mount for native documentation. Empty means a custom documentation host. */\nexport function normalizeDocumentationBasePath(value: string | undefined): string {\n if (!value || value === '/') return ''\n const normalized = normalizeRoute(value)\n if (normalized === '/_documentation') {\n throw new DocumentationError('The internal /_documentation namespace cannot be a public documentation base', 'documentation_base_invalid')\n }\n return normalized\n}\n\n/** Convert a logical documentation route/resource into its public URL path. */\nexport function documentationPublicPath(basePath: string, path: string): string {\n const base = normalizeDocumentationBasePath(basePath)\n const suffix = path.startsWith('/') ? path : `/${path}`\n if (suffix === '/') return base || '/'\n return `${base}${suffix}`\n}\n\n/** Project logical root-relative references onto the active public mount. */\nexport function publicDocumentationReferences(source: string, basePath: string): string {\n const base = normalizeDocumentationBasePath(basePath)\n if (!base) return source\n const publicPath = (value: string): string =>\n value === base || value.startsWith(`${base}/`) ? value : `${base}${value}`\n return source\n .replace(\n /(\\]\\()(\\/(?!\\/)[^)\\s]*)/g,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n .replace(\n /^(\\s*\\[[^\\]]+\\]:\\s*)(\\/(?!\\/)\\S*)/gm,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n .replace(\n /(\\b(?:href|src)=[\"'])(\\/(?!\\/)[^\"']*)/g,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n}\n\n/** Convert a public request pathname back to a logical documentation route. */\nexport function documentationLogicalPath(basePath: string, pathname: string): string | null {\n const base = normalizeDocumentationBasePath(basePath)\n if (!base) return pathname.startsWith('/') ? pathname : `/${pathname}`\n if (pathname === base) return '/'\n if (!pathname.startsWith(`${base}/`)) return null\n return pathname.slice(base.length) || '/'\n}\n\n/** Canonical public Markdown projection for a page route. */\nexport function markdownUrlForRoute(route: string, basePath = ''): string {\n const logical = route === '/' ? '/index.md' : `${normalizeRoute(route)}.md`\n return documentationPublicPath(basePath, logical)\n}\n\n/** Deterministic build artifact paths for one canonical page route. */\nexport function artifactPathsForRoute(route: string): {\n data: string\n html: string\n markdown: string\n} {\n const clean = normalizeRoute(route).replace(/^\\//, '')\n return clean\n ? {\n data: `data/${clean}.json`,\n html: `${clean}/index.html`,\n markdown: `${clean}.md`,\n }\n : {\n data: 'data/index.json',\n html: 'index.html',\n markdown: 'index.md',\n }\n}\n\nexport function routeArtifactId(route: string): string {\n return route === '/'\n ? 'index'\n : normalizeRoute(route).replace(/^\\//, '').replace(/[^a-z0-9]+/gi, '-')\n}\n\nexport function joinSiteUrl(base: string, route: string): string {\n const path = route.startsWith('/') ? route : `/${route}`\n return `${base.replace(/\\/$/, '')}${path}`\n}\n\nfunction assertSafeRoute(value: string): void {\n if (value.includes('\\\\') || value.includes('\\0')) throw unsafeRoute(value)\n\n let decoded = value\n for (let pass = 0; pass < 5; pass++) {\n let next: string\n try {\n next = decodeURIComponent(decoded)\n } catch {\n throw unsafeRoute(value)\n }\n if (next === decoded) break\n decoded = next\n }\n if (\n decoded.includes('\\\\') ||\n decoded.includes('\\0') ||\n decoded.split('/').some((segment) => segment === '.' || segment === '..')\n ) throw unsafeRoute(value)\n}\n\nfunction unsafeRoute(value: string): DocumentationError {\n return new DocumentationError(\n `Documentation route contains an unsafe path segment: ${value}`,\n 'documentation_route_invalid',\n [{ code: 'route_path_escape', message: value }],\n )\n}\n","import { htmlToText } from './markdown'\nimport {\n joinSiteUrl,\n markdownUrlForRoute,\n publicDocumentationReferences,\n routeArtifactId,\n} from './routing'\nimport { escapeXml } from './text'\nimport type {\n DocumentationAssistantChunk,\n DocumentationNavigationNode,\n DocumentationPage,\n DocumentationSearchEntry,\n} from './types'\n\nexport function pageMarkdown(page: DocumentationPage, basePath = '/docs'): string {\n const title = `# ${page.title}`\n const body = publicDocumentationReferences(page.markdown, basePath).trim()\n return `${title}\\n${page.description ? `\\n${page.description}\\n` : ''}${body ? `\\n${body}\\n` : '\\n'}`\n}\n\nexport function createSearchEntries(pages: DocumentationPage[]): DocumentationSearchEntry[] {\n return pages\n .filter((page) => !page.hidden)\n .map((page) => ({\n route: page.route,\n title: page.title,\n ...(page.description ? { description: page.description } : {}),\n headings: page.headings.filter((heading) => heading.depth > 1),\n text: page.text.slice(0, 12_000),\n }))\n}\n\nexport function createAssistantChunks(pages: DocumentationPage[]): DocumentationAssistantChunk[] {\n return pages.flatMap((page) => {\n if (page.hidden) return []\n const chunks: DocumentationAssistantChunk[] = []\n let index = 0\n const sections = page.html.split(/(?=<h[23]\\b)/)\n for (const section of sections) {\n const headingMatch = section.match(/^<h[23] id=\"([^\"]+)\">/)\n const heading = headingMatch\n ? page.headings.find((candidate) => candidate.id === headingMatch[1])\n : undefined\n const route = heading ? `${page.route}#${heading.id}` : page.route\n const paragraphs = htmlToText(section).split(/(?<=[.!?])\\s+(?=[A-Z0-9])/)\n let current = ''\n const flush = (): void => {\n const text = current.trim()\n if (!text) return\n chunks.push({\n id: `${routeArtifactId(page.route)}:${index++}`,\n route,\n title: page.title,\n ...(heading ? { heading: heading.text } : {}),\n text,\n })\n current = ''\n }\n for (const paragraph of paragraphs) {\n if (current.length + paragraph.length > 1_800) flush()\n current += `${current ? ' ' : ''}${paragraph}`\n }\n flush()\n }\n return chunks\n })\n}\n\nexport function pagesInNavigationOrder(\n pages: DocumentationPage[],\n navigation: DocumentationNavigationNode[],\n): DocumentationPage[] {\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const ordered: DocumentationPage[] = []\n const seen = new Set<string>()\n const visit = (nodes: DocumentationNavigationNode[]): void => {\n for (const node of nodes) {\n if (node.kind === 'group') {\n visit(node.items)\n continue\n }\n if (node.kind !== 'page' || seen.has(node.route)) continue\n const page = byRoute.get(node.route)\n if (page) ordered.push(page)\n seen.add(node.route)\n }\n }\n visit(navigation)\n for (const page of pages) {\n if (!seen.has(page.route)) ordered.push(page)\n }\n return ordered\n}\n\nexport function renderLlmsIndex(pages: DocumentationPage[], name: string, basePath = '/docs'): string {\n const lines = [`# ${name}`, '', '> Documentation index generated by DeepSpace Documentation.', '']\n for (const page of pages.filter((candidate) => !candidate.hidden)) {\n lines.push(\n `- [${page.title}](${markdownUrlForRoute(page.route, basePath)})` +\n `${page.description ? `: ${page.description}` : ''}`,\n )\n }\n return `${lines.join('\\n')}\\n`\n}\n\nexport function renderLlmsFull(\n pages: DocumentationPage[],\n name: string,\n basePath = '/docs',\n): string {\n return `# ${name}\\n\\n${pages\n .filter((page) => !page.hidden)\n .map((page) =>\n `${pageMarkdown(page, basePath).trim()}\\n\\nSource: ${markdownUrlForRoute(page.route, basePath)}`,\n )\n .join('\\n\\n---\\n\\n')}\\n`\n}\n\nexport function renderSitemap(pages: DocumentationPage[], baseUrl: string | undefined): string {\n const urls = baseUrl\n ? pages\n .filter((page) => !page.hidden && !page.noindex)\n .map((page) => ` <url><loc>${escapeXml(joinSiteUrl(baseUrl, page.route))}</loc></url>`)\n .join('\\n')\n : ''\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\\n${urls}${urls ? '\\n' : ''}</urlset>\\n`\n}\n\nexport function renderRobots(baseUrl: string | undefined, noindex: boolean | undefined): string {\n if (noindex) return 'User-agent: *\\nDisallow: /\\n'\n return `User-agent: *\\nAllow: /\\n${baseUrl ? `Sitemap: ${joinSiteUrl(baseUrl, '/sitemap.xml')}\\n` : ''}`\n}\n\nexport function stableJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`\n}\n","import { createHash } from 'node:crypto'\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { basename, dirname, extname, join, posix, relative, resolve, sep } from 'node:path'\nimport { loadDocumentationConfig, type LoadedDocumentationConfig } from './config'\nimport { parseMarkdown, slugify, stripFirstMarkdownH1 } from './markdown'\nimport { parseMdx } from './mdx'\nimport { operationMarkdown, parseOpenApi } from './openapi'\nimport { normalizeRoute, routeFromRelativePath } from './routing'\nimport {\n DocumentationError,\n type DocumentationConfig,\n type DocumentationDiagnostic,\n type DocumentationGraph,\n type DocumentationNavigationItem,\n type DocumentationNavigationNode,\n type DocumentationPage,\n type DocumentationValidationResult,\n} from './types'\n\nexport function validateDocumentation(appDir: string): DocumentationValidationResult {\n const loaded = loadDocumentationConfig(appDir)\n if (!existsSync(loaded.sourceDir)) {\n throw new DocumentationError(\n `Documentation source directory not found: ${loaded.config.source}`,\n 'documentation_source_missing',\n [{ code: 'source_missing', message: loaded.config.source, file: loaded.sourceDir }],\n )\n }\n const warnings: DocumentationDiagnostic[] = [...loaded.warnings]\n const contentFiles = collectContentFiles(loaded.sourceDir)\n const sourceFiles = contentFiles.filter((path) => ['.md', '.mdx'].includes(extname(path).toLowerCase()))\n if (sourceFiles.length === 0 && loaded.config.openapi.length === 0) {\n throw new DocumentationError(\n `No .md or .mdx pages found in ${loaded.config.source}`,\n 'documentation_pages_missing',\n [{ code: 'pages_missing', message: loaded.config.source, file: loaded.sourceDir }],\n )\n }\n\n const pages = sourceFiles.map((sourcePath) => pageFromSource(loaded, sourcePath))\n const openApiHashes: string[] = []\n const openApiGroups: DocumentationNavigationNode[] = []\n for (const openapiConfig of loaded.config.openapi) {\n const api = parseOpenApi(resolve(appDir), openapiConfig)\n openApiHashes.push(api.raw)\n const apiPages = api.operations.map((operation) => {\n const markdown = operationMarkdown(operation)\n const parsed = parseMarkdown(markdown, `${api.sourcePath}#${operation.operationId}`)\n return {\n sourcePath: api.sourcePath,\n relativePath: `${relative(resolve(appDir), api.sourcePath)}#${operation.operationId}`,\n route: joinRoute(api.route, operation.operationId),\n title: operation.summary,\n description: operation.description,\n hidden: false,\n noindex: loaded.config.seo.noindex === true,\n markdown,\n html: parsed.html,\n text: parsed.text,\n headings: parsed.headings,\n sourceFormat: 'generated' as const,\n kind: 'openapi' as const,\n openapi: operation,\n } satisfies DocumentationPage\n })\n pages.push(...apiPages)\n openApiGroups.push({\n kind: 'group',\n label: api.title,\n items: apiPages.map((page) => ({ kind: 'page', route: page.route, label: page.title })),\n })\n }\n\n assertUniqueRoutes(pages)\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const navigation = loaded.config.navigation\n ? normalizeNavigation(loaded.config.navigation, byRoute, loaded.config)\n : automaticNavigation(pages.filter((page) => page.kind === 'page'))\n navigation.push(...openApiGroups)\n assertNavigationCoverage(navigation, pages, loaded.config)\n validatePageLinks(pages, byRoute, loaded.config.redirects)\n validateRedirectTargets(loaded.config, byRoute)\n\n const hash = createHash('sha256')\n hash.update(loaded.raw)\n for (const contentPath of contentFiles) {\n hash.update(relative(resolve(appDir), contentPath).split(sep).join('/'))\n hash.update(readFileSync(contentPath))\n }\n for (const raw of openApiHashes) hash.update(raw)\n const graph: DocumentationGraph = {\n config: loaded.config,\n pages: pages.sort((a, b) => a.route.localeCompare(b.route)),\n navigation,\n sourceHash: hash.digest('hex'),\n }\n return {\n appDir: resolve(appDir),\n configPath: loaded.configPath,\n sourceDir: loaded.sourceDir,\n outputDir: loaded.outputDir,\n graph,\n warnings,\n }\n}\n\nfunction pageFromSource(loaded: LoadedDocumentationConfig, sourcePath: string): DocumentationPage {\n const source = readFileSync(sourcePath, 'utf8')\n const relativePath = relative(loaded.sourceDir, sourcePath).split(sep).join('/')\n const rewritten = rewriteLocalReferences(source, relativePath, loaded.sourceDir, sourcePath)\n const sourceFormat = extname(sourcePath).toLowerCase() === '.mdx' ? 'mdx' : 'markdown'\n const authored = sourceFormat === 'mdx'\n ? parseMdx(rewritten, sourcePath)\n : parseMarkdown(rewritten, sourcePath)\n const route = authored.frontmatter.slug\n ? normalizeRoute(authored.frontmatter.slug)\n : routeFromRelativePath(relativePath)\n const title = authored.frontmatter.title\n ?? authored.headings.find((heading) => heading.depth === 1)?.text\n ?? titleFromFile(relativePath)\n const normalizedSource = stripFirstMarkdownH1(rewritten)\n const parsed = sourceFormat === 'mdx'\n ? parseMdx(normalizedSource, sourcePath)\n : parseMarkdown(normalizedSource, sourcePath)\n return {\n sourcePath,\n relativePath,\n route,\n title,\n description: parsed.frontmatter.description,\n hidden: parsed.frontmatter.hidden === true,\n noindex: loaded.config.seo.noindex === true || parsed.frontmatter.noindex === true,\n markdown: parsed.markdown,\n html: parsed.html,\n text: parsed.text,\n headings: parsed.headings,\n sourceFormat,\n kind: 'page',\n }\n}\n\nfunction collectContentFiles(sourceDir: string): string[] {\n const files: string[] = []\n const walk = (directory: string): void => {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'node_modules') continue\n const path = join(directory, entry.name)\n if (entry.isSymbolicLink()) {\n throw new DocumentationError(\n `Documentation content may not contain symbolic links: ${path}`,\n 'documentation_source_unsafe',\n [{ code: 'source_symlink', message: path, file: path }],\n )\n }\n if (entry.isDirectory()) walk(path)\n else if (entry.isFile()) files.push(path)\n }\n }\n walk(sourceDir)\n return files.sort()\n}\n\nfunction normalizeNavigation(\n items: DocumentationNavigationItem[],\n pages: Map<string, DocumentationPage>,\n config: DocumentationConfig,\n): DocumentationNavigationNode[] {\n return items.map((item): DocumentationNavigationNode => {\n if (typeof item === 'string') {\n const route = navigationReferenceToRoute(item)\n const page = pages.get(route)\n if (!page) {\n throw new DocumentationError(\n `Navigation references a missing page: ${item}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_missing_page', message: item }],\n )\n }\n return { kind: 'page', route, label: page.title }\n }\n if ('group' in item) {\n return {\n kind: 'group',\n label: item.group,\n items: normalizeNavigation(item.pages, pages, config),\n }\n }\n if (!isSafeLink(item.href)) {\n throw new DocumentationError(\n `Unsafe navigation link: ${item.href}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_unsafe_link', message: item.href }],\n )\n }\n if (item.href.startsWith('/')) {\n const route = normalizeRoute(item.href)\n if (!pages.has(route) && !config.redirects[route]) {\n throw new DocumentationError(\n `Navigation link points to an unknown internal route: ${item.href}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_missing_route', message: item.href }],\n )\n }\n return { kind: 'link', href: route, label: item.label }\n }\n return { kind: 'link', href: item.href, label: item.label }\n })\n}\n\nfunction automaticNavigation(pages: DocumentationPage[]): DocumentationNavigationNode[] {\n return pages\n .filter((page) => !page.hidden)\n .sort((a, b) => a.route.localeCompare(b.route))\n .map((page) => ({ kind: 'page', route: page.route, label: page.title }))\n}\n\nfunction assertNavigationCoverage(\n navigation: DocumentationNavigationNode[],\n pages: DocumentationPage[],\n config: DocumentationConfig,\n): void {\n if (!config.navigation) return\n const routes = new Set<string>()\n const visit = (nodes: DocumentationNavigationNode[]): void => {\n for (const node of nodes) {\n if (node.kind === 'page') routes.add(node.route)\n else if (node.kind === 'group') visit(node.items)\n }\n }\n visit(navigation)\n const orphaned = pages.filter((page) => page.kind === 'page' && !page.hidden && !routes.has(page.route))\n if (orphaned.length > 0) {\n throw new DocumentationError(\n `${orphaned.length} public page(s) are missing from navigation`,\n 'documentation_navigation_incomplete',\n orphaned.map((page) => ({\n code: 'navigation_orphan',\n message: page.route,\n file: page.sourcePath,\n })),\n )\n }\n}\n\nfunction validatePageLinks(\n pages: DocumentationPage[],\n byRoute: Map<string, DocumentationPage>,\n redirects: Record<string, string>,\n): void {\n const diagnostics: DocumentationDiagnostic[] = []\n for (const page of pages) {\n if (page.kind !== 'page') continue\n const pattern = /(!?)\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^\"']*[\"'])?\\)/g\n for (const match of page.markdown.matchAll(pattern)) {\n const isImage = match[1] === '!'\n const href = match[2]\n if (isImage || href.startsWith('/media/')) continue\n if (/^(?:https?:|mailto:|#|data:)/i.test(href)) continue\n const routePart = href.split('#')[0].split('?')[0]\n if (!routePart) continue\n const target = routePart.startsWith('/')\n ? normalizeRoute(routePart)\n : normalizeRoute(posix.join(dirname(page.route), routePart))\n const normalized = navigationReferenceToRoute(target)\n if (!byRoute.has(normalized) && !redirects[normalized]) {\n diagnostics.push({\n code: 'broken_internal_link',\n message: `${href} resolves to ${normalized}`,\n file: page.sourcePath,\n line: page.markdown.slice(0, match.index).split('\\n').length,\n })\n }\n }\n }\n if (diagnostics.length > 0) {\n throw new DocumentationError(\n `${diagnostics.length} broken internal documentation link(s)`,\n 'documentation_links_invalid',\n diagnostics,\n )\n }\n}\n\nexport function rewriteLocalReferences(\n source: string,\n relativePath: string,\n sourceDir: string,\n sourcePath: string,\n): string {\n const pageDirectory = posix.dirname(relativePath)\n return source.replace(\n /(!?)\\[([^\\]]*)\\]\\(([^)\\s]+)((?:\\s+[\"'][^\"']*[\"'])?)\\)/g,\n (match, imageMarker: string, label: string, href: string, title: string) => {\n if (/^(?:https?:|mailto:|data:|#)/i.test(href)) return match\n const [pathPart, suffix = ''] = href.split(/(?=[?#])/)\n if (!pathPart) return match\n const relativeTarget = pathPart.startsWith('/')\n ? pathPart.replace(/^\\//, '')\n : posix.normalize(posix.join(pageDirectory, pathPart))\n if (relativeTarget === '..' || relativeTarget.startsWith('../')) {\n throw new DocumentationError(\n `Documentation reference escapes the source directory: ${href}`,\n 'documentation_link_unsafe',\n [{ code: 'link_path_escape', message: href, file: sourcePath }],\n )\n }\n const absoluteTarget = resolve(sourceDir, relativeTarget)\n if (imageMarker === '!') {\n if (!existsSync(absoluteTarget)) {\n throw new DocumentationError(\n `Documentation image not found: ${href}`,\n 'documentation_asset_missing',\n [{ code: 'asset_missing', message: href, file: sourcePath }],\n )\n }\n return `![${label}](/media/${relativeTarget}${suffix}${title})`\n }\n if (/\\.(?:md|mdx)$/i.test(relativeTarget)) {\n return `[${label}](${routeFromRelativePath(relativeTarget)}${suffix}${title})`\n }\n const markdownTarget = [\n `${absoluteTarget}.mdx`,\n `${absoluteTarget}.md`,\n join(absoluteTarget, 'index.mdx'),\n join(absoluteTarget, 'index.md'),\n ].find(existsSync)\n if (markdownTarget) {\n const targetRelative = relative(sourceDir, markdownTarget).split(sep).join('/')\n return `[${label}](${routeFromRelativePath(targetRelative)}${suffix}${title})`\n }\n if (existsSync(absoluteTarget)) {\n return `[${label}](/media/${relativeTarget}${suffix}${title})`\n }\n return match\n },\n )\n}\n\nfunction validateRedirectTargets(config: DocumentationConfig, byRoute: Map<string, DocumentationPage>): void {\n for (const [from, to] of Object.entries(config.redirects)) {\n const normalizedFrom = normalizeRoute(from)\n if (byRoute.has(normalizedFrom)) {\n throw new DocumentationError(\n `Redirect source collides with a page: ${from}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_page_collision', message: from }],\n )\n }\n const finalTarget = followRedirects(to, config.redirects)\n if (!byRoute.has(normalizeRoute(finalTarget))) {\n throw new DocumentationError(\n `Redirect target does not exist: ${from} -> ${to}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_missing_target', message: `${from} -> ${to}` }],\n )\n }\n }\n}\n\nfunction followRedirects(route: string, redirects: Record<string, string>): string {\n let cursor = route\n const seen = new Set<string>()\n while (redirects[cursor] && !seen.has(cursor)) {\n seen.add(cursor)\n cursor = redirects[cursor]\n }\n return cursor\n}\n\nfunction assertUniqueRoutes(pages: DocumentationPage[]): void {\n const seen = new Map<string, DocumentationPage>()\n for (const page of pages) {\n const existing = seen.get(page.route)\n if (existing) {\n throw new DocumentationError(\n `Multiple documentation pages resolve to ${page.route}`,\n 'documentation_route_collision',\n [existing, page].map((candidate) => ({\n code: 'route_collision',\n message: candidate.route,\n file: candidate.sourcePath,\n })),\n )\n }\n if (\n ['/api', '/assets', '/data', '/media', '/mcp', '/.well-known'].some(\n (reserved) => page.route === reserved || page.route.startsWith(`${reserved}/`),\n )\n ) {\n throw new DocumentationError(\n `Documentation route uses a reserved prefix: ${page.route}`,\n 'documentation_route_reserved',\n [{ code: 'reserved_route', message: page.route, file: page.sourcePath }],\n )\n }\n seen.set(page.route, page)\n }\n}\n\nfunction navigationReferenceToRoute(value: string): string {\n return normalizeRoute(value)\n}\n\nfunction titleFromFile(relativePath: string): string {\n const stem = basename(relativePath, extname(relativePath))\n const candidate = stem.toLowerCase() === 'index' ? basename(dirname(relativePath)) : stem\n if (!candidate || candidate === '.') return 'Overview'\n return candidate.split(/[-_]/).filter(Boolean).map(capitalize).join(' ')\n}\n\nfunction capitalize(value: string): string {\n return value.charAt(0).toUpperCase() + value.slice(1)\n}\n\nfunction joinRoute(left: string, right: string): string {\n return normalizeRoute(`${left}/${slugify(right)}`)\n}\n\nfunction isSafeLink(value: string): boolean {\n return /^(?:https?:\\/\\/|mailto:|\\/|#)/i.test(value)\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { z } from 'zod'\nimport {\n getDeepSpaceAIModel,\n listDeepSpaceAgentModels,\n resolveDeepSpaceAgentModel,\n} from '../shared/ai-models'\nimport {\n DOCUMENTATION_CONFIG_FILE,\n DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES,\n DocumentationError,\n type DocumentationConfig,\n type DocumentationDiagnostic,\n type DocumentationNavigationItem,\n type DocumentationOpenApiConfig,\n} from './types'\nimport { RAW_CONFIG_KEYS, THEME_CONFIG_KEYS, openapiItemSchema, rawConfigSchema } from './config/schema'\nimport {\n humanize,\n isWithin,\n safeChildPath,\n validateLinks,\n validateRedirects,\n} from './config/validation'\nimport { errorMessage } from './text'\n\nexport interface LoadedDocumentationConfig {\n config: DocumentationConfig\n configPath: string\n sourceDir: string\n outputDir: string\n raw: string\n warnings: DocumentationDiagnostic[]\n}\n\nexport function loadDocumentationConfig(appDir: string): LoadedDocumentationConfig {\n const resolvedAppDir = resolve(appDir)\n const configPath = resolve(resolvedAppDir, DOCUMENTATION_CONFIG_FILE)\n if (!existsSync(configPath)) {\n throw new DocumentationError(\n `No ${DOCUMENTATION_CONFIG_FILE} found in ${resolvedAppDir}`,\n 'documentation_config_missing',\n [{ code: 'documentation_config_missing', message: `Create ${DOCUMENTATION_CONFIG_FILE}`, file: configPath }],\n )\n }\n\n const raw = readFileSync(configPath, 'utf8')\n let input: unknown\n try {\n input = JSON.parse(raw)\n } catch (error) {\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} is not valid JSON: ${errorMessage(error)}`,\n 'documentation_config_invalid',\n [{ code: 'invalid_json', message: errorMessage(error), file: configPath }],\n )\n }\n\n const parsed = rawConfigSchema.safeParse(input)\n if (!parsed.success) {\n const diagnostics = parsed.error.issues.map((issue) => ({\n code: 'invalid_config_value',\n message: `${issue.path.join('.') || '<root>'}: ${issue.message}`,\n file: configPath,\n }))\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} has ${diagnostics.length} validation error(s)`,\n 'documentation_config_invalid',\n diagnostics,\n )\n }\n\n const data = parsed.data\n if (\n data.assistant.model !== undefined &&\n !resolveDeepSpaceAgentModel(data.assistant.model, 'documentation')\n ) {\n const catalogModel = getDeepSpaceAIModel(data.assistant.model)\n const reason = catalogModel\n ? `does not support the multi-step documentation agent (${catalogModel.note ?? 'incompatible runtime contract'})`\n : 'is not in the DeepSpace model catalog'\n const supported = listDeepSpaceAgentModels('documentation')\n .map((model) => model.id)\n .join(', ')\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} has an unsupported assistant model`,\n 'documentation_config_invalid',\n [\n {\n code: 'unsupported_assistant_model',\n message: `assistant.model '${data.assistant.model}' ${reason}. Supported models: ${supported}`,\n file: configPath,\n },\n ],\n )\n }\n const warnings: DocumentationDiagnostic[] = []\n if (input && typeof input === 'object' && !Array.isArray(input)) {\n for (const key of Object.keys(input)) {\n if (!RAW_CONFIG_KEYS.has(key)) {\n warnings.push({\n code: 'unsupported_config_key',\n message: `Unsupported Mintlify configuration key '${key}' was ignored`,\n file: configPath,\n })\n }\n }\n const rawTheme = (input as Record<string, unknown>).theme\n if (rawTheme && typeof rawTheme === 'object' && !Array.isArray(rawTheme)) {\n for (const key of Object.keys(rawTheme)) {\n if (!THEME_CONFIG_KEYS.has(key)) {\n warnings.push({\n code: 'unsupported_config_key',\n message: `Unsupported theme configuration key 'theme.${key}' was ignored`,\n file: configPath,\n })\n }\n }\n }\n }\n const themeInput = typeof data.theme === 'string' ? {} : data.theme\n if (typeof data.theme === 'string') {\n warnings.push({\n code: 'mintlify_theme_normalized',\n message: `Mintlify theme '${data.theme}' is mapped to the native Orbit surface`,\n file: configPath,\n })\n }\n const logo = typeof data.logo === 'string' ? { light: data.logo } : data.logo\n const background = data.background?.color\n const bodyFont =\n data.fonts?.body ?? (data.fonts?.family ? { family: data.fonts.family } : undefined)\n const headingFont = data.fonts?.heading ?? bodyFont\n const monoFont = data.fonts?.mono\n const navigation = Array.isArray(data.navigation) ? data.navigation : data.navigation?.groups\n if (data.navigation && !Array.isArray(data.navigation)) {\n warnings.push({\n code: 'mintlify_navigation_normalized',\n message: 'Mintlify navigation.groups was normalized to native navigation',\n file: configPath,\n })\n }\n const navbarLinks = [\n ...(data.navbar?.links ?? []),\n ...(data.navbar?.primary\n ? [{ label: data.navbar.primary.label, href: data.navbar.primary.href }]\n : []),\n ]\n const footer = Array.isArray(data.footer)\n ? data.footer\n : Object.entries(data.footer.socials ?? {}).map(([label, href]) => ({\n label: humanize(label),\n href,\n }))\n const config: DocumentationConfig = {\n $schema: data.$schema,\n name: data.name,\n description: data.description,\n source: data.source,\n output: data.output,\n url: data.url,\n domains: [...new Set(data.domains)],\n theme: {\n ...themeInput,\n accent: themeInput.accent ?? data.colors?.primary ?? data.colors?.light ?? data.colors?.dark,\n // Mintlify's colors.light is \"the anchor color used in dark mode\".\n accentDark: themeInput.accentDark ?? data.colors?.light,\n background: background?.light ?? themeInput.background,\n backgroundDark: background && 'dark' in background ? background.dark : undefined,\n backgroundDecoration: data.background?.decoration,\n bodyFont,\n headingFont,\n monoFont,\n codeBlockMode: data.styling?.codeblocks,\n eyebrowStyle: data.styling?.eyebrows,\n logo: themeInput.logo ?? logo?.light,\n logoDark: themeInput.logoDark ?? logo?.dark,\n logoHref: logo?.href,\n favicon: themeInput.favicon ?? data.favicon,\n defaultMode: data.appearance?.default ?? themeInput.defaultMode,\n strictMode: themeInput.strictMode ?? data.appearance?.strict,\n },\n navigation: navigation as DocumentationNavigationItem[] | undefined,\n links: data.links.length > 0 ? data.links : navbarLinks,\n footer,\n redirects: data.redirects,\n openapi: normalizeOpenApi(data.openapi, data.api) as DocumentationOpenApiConfig[],\n assistant: data.assistant,\n mcp: data.mcp,\n contextual: data.contextual,\n seo: {\n ...(data.seo.noindex === undefined ? {} : { noindex: data.seo.noindex }),\n ...(data.seo.ogImage ? { ogImage: data.seo.ogImage } : {}),\n ...((data.seo.metaTags ?? data.seo.metatags)\n ? { metaTags: data.seo.metaTags ?? data.seo.metatags }\n : {}),\n },\n }\n validateRedirects(config.redirects, configPath)\n validateLinks(config.links, 'links', configPath)\n validateLinks(config.footer, 'footer', configPath)\n if (config.theme.logoHref) {\n validateLinks([{ label: 'logo', href: config.theme.logoHref }], 'logo.href', configPath)\n }\n\n const sourceDir = safeChildPath(resolvedAppDir, config.source, 'source', configPath)\n const outputDir = safeChildPath(resolvedAppDir, config.output, 'output', configPath)\n if (sourceDir === outputDir || isWithin(sourceDir, outputDir)) {\n throw new DocumentationError(\n 'documentation.json output must not contain the documentation source directory',\n 'documentation_path_collision',\n [\n {\n code: 'documentation_path_collision',\n message: `source=${config.source}, output=${config.output}`,\n file: configPath,\n },\n ],\n )\n }\n\n config.theme = {\n ...config.theme,\n ...(config.theme.logo ? { logo: normalizeLocalAsset(config.theme.logo, sourceDir) } : {}),\n ...(config.theme.logoDark\n ? { logoDark: normalizeLocalAsset(config.theme.logoDark, sourceDir) }\n : {}),\n ...(config.theme.favicon\n ? { favicon: normalizeLocalAsset(config.theme.favicon, sourceDir) }\n : {}),\n ...(config.theme.bodyFont?.source\n ? {\n bodyFont: {\n ...config.theme.bodyFont,\n source: normalizeLocalAsset(config.theme.bodyFont.source, sourceDir),\n },\n }\n : {}),\n ...(config.theme.headingFont?.source\n ? {\n headingFont: {\n ...config.theme.headingFont,\n source: normalizeLocalAsset(config.theme.headingFont.source, sourceDir),\n },\n }\n : {}),\n ...(config.theme.monoFont?.source\n ? {\n monoFont: {\n ...config.theme.monoFont,\n source: normalizeLocalAsset(config.theme.monoFont.source, sourceDir),\n },\n }\n : {}),\n }\n if (config.seo.ogImage) {\n config.seo = {\n ...config.seo,\n ogImage: normalizeLocalAsset(config.seo.ogImage, sourceDir),\n }\n }\n\n return { config, configPath, sourceDir, outputDir, raw, warnings }\n}\n\nfunction normalizeLocalAsset(value: string, sourceDir: string): string {\n if (/^(?:https?:|data:|\\/media\\/)/i.test(value)) return value\n const relativePath = value.replace(/^\\.\\//, '').replace(/^\\/+/, '')\n if (!relativePath || !existsSync(resolve(sourceDir, relativePath))) return value\n return `/media/${relativePath.split('\\\\').join('/')}`\n}\n\nfunction normalizeOpenApi(\n value: z.infer<typeof openapiItemSchema> | Array<z.infer<typeof openapiItemSchema>> | undefined,\n api: z.infer<typeof rawConfigSchema>['api'],\n): Array<z.infer<typeof openapiItemSchema>> {\n if (!value) return []\n const items = Array.isArray(value) ? value : [value]\n return items.map((item) => {\n const localExamples = 'examples' in item ? item.examples : undefined\n const display = api?.playground?.display\n return {\n ...item,\n ...('playground' in item && item.playground !== undefined\n ? { playground: item.playground }\n : display\n ? { playground: display === 'interactive' }\n : {}),\n examples: {\n languages: localExamples?.languages ??\n api?.examples?.languages ?? [...DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.languages],\n defaults: localExamples?.defaults ??\n api?.examples?.defaults ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.defaults,\n autogenerate: localExamples?.autogenerate ??\n api?.examples?.autogenerate ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.autogenerate,\n },\n }\n })\n}\n","/**\n * Canonical DeepSpace model catalog and agent policy.\n *\n * Provider catalogs are discovery inputs, not a safe runtime allowlist: a\n * model is promoted here only after its tool loop, transport, pricing, and\n * streaming contract have been verified end to end through the DeepSpace\n * proxy. Every client picker and server agent profile consumes this module.\n */\n\nexport type DeepSpaceAIProvider = 'anthropic' | 'openai' | 'cerebras'\nexport type DeepSpaceAgentProfileId = 'application' | 'documentation'\nexport type DeepSpaceAgentSupport = 'multi-step' | 'single-step' | 'none'\n\nexport interface DeepSpaceAIModel {\n id: string\n label: string\n provider: DeepSpaceAIProvider\n providerLabel: string\n family: string\n /** Whether the model is eligible for DeepSpace's server-owned agent loop. */\n agentSupport: DeepSpaceAgentSupport\n /** Profiles in which the model has passed the complete runtime contract. */\n agentProfiles: readonly DeepSpaceAgentProfileId[]\n /** Provider transport currently used by the DeepSpace proxy adapter. */\n transport: 'messages' | 'chat-completions'\n recommendation: 'frontier' | 'balanced' | 'fast' | 'available' | 'limited'\n note?: string\n}\n\nexport interface DeepSpaceAgentProfile {\n id: DeepSpaceAgentProfileId\n defaultModel: string\n maxSteps: number\n maxToolCalls?: number\n allowedTools: 'application-defined' | readonly string[]\n}\n\n/**\n * Versioned provenance for the provider catalogs used during the latest\n * promotion review. Keeping this in the shipped artifact makes selection\n * policy auditable without allowing a mutable upstream list to change a\n * deployed app underneath a commit.\n */\nexport const DEEPSPACE_MODEL_CATALOG_PROVENANCE = {\n version: '2026-08-04',\n verifiedAt: '2026-08-04',\n sources: {\n anthropic: 'https://platform.claude.com/docs/en/api/beta/models/list',\n openai: 'https://developers.openai.com/api/docs/models/all',\n cerebras: 'https://inference-docs.cerebras.ai/models/overview',\n },\n} as const\n\nconst MULTI_STEP_AGENT_PROFILES = ['application', 'documentation'] as const\n\ntype MultiStepModelInput = Pick<DeepSpaceAIModel, 'id' | 'label' | 'family' | 'recommendation'>\ntype MultiStepProvider = Pick<DeepSpaceAIModel, 'provider' | 'providerLabel' | 'transport'>\n\nfunction createMultiStepModelFactory<const Provider extends MultiStepProvider>(provider: Provider) {\n return <const Model extends MultiStepModelInput>(model: Model) => ({\n ...model,\n ...provider,\n agentSupport: 'multi-step' as const,\n agentProfiles: MULTI_STEP_AGENT_PROFILES,\n })\n}\n\nconst anthropicModel = createMultiStepModelFactory({\n provider: 'anthropic',\n providerLabel: 'Anthropic',\n transport: 'messages',\n})\n\nconst openAIModel = createMultiStepModelFactory({\n provider: 'openai',\n providerLabel: 'OpenAI',\n transport: 'chat-completions',\n})\n\nexport const DEEPSPACE_AI_MODELS = [\n anthropicModel({\n id: 'claude-fable-5',\n label: 'Claude Fable 5',\n family: 'Claude 5',\n recommendation: 'frontier',\n }),\n anthropicModel({\n id: 'claude-opus-5',\n label: 'Claude Opus 5',\n family: 'Claude 5',\n recommendation: 'frontier',\n }),\n anthropicModel({\n id: 'claude-sonnet-5',\n label: 'Claude Sonnet 5',\n family: 'Claude 5',\n recommendation: 'balanced',\n }),\n anthropicModel({\n id: 'claude-haiku-4-5',\n label: 'Claude Haiku 4.5',\n family: 'Claude 4.5',\n recommendation: 'fast',\n }),\n openAIModel({\n id: 'gpt-5.6-sol',\n label: 'GPT-5.6 Sol',\n family: 'GPT-5.6',\n recommendation: 'frontier',\n }),\n openAIModel({\n id: 'gpt-5.6-terra',\n label: 'GPT-5.6 Terra',\n family: 'GPT-5.6',\n recommendation: 'balanced',\n }),\n openAIModel({\n id: 'gpt-5.6-luna',\n label: 'GPT-5.6 Luna',\n family: 'GPT-5.6',\n recommendation: 'fast',\n }),\n {\n id: 'gpt-oss-120b',\n label: 'GPT-OSS 120B',\n provider: 'cerebras',\n providerLabel: 'Cerebras',\n family: 'GPT-OSS',\n agentSupport: 'single-step',\n agentProfiles: [],\n transport: 'chat-completions',\n recommendation: 'limited',\n note: 'Available for direct generation; the current proxy adapter has not passed multi-step tool-result continuation.',\n },\n] as const satisfies readonly DeepSpaceAIModel[]\n\nexport const DEEPSPACE_AI_DEFAULTS = {\n agent: 'claude-sonnet-5',\n directGeneration: 'claude-sonnet-5',\n summarization: 'claude-haiku-4-5',\n} as const satisfies Record<string, DeepSpaceAIModelId>\n\nexport const DEEPSPACE_AGENT_PROFILES = {\n application: {\n id: 'application',\n defaultModel: DEEPSPACE_AI_DEFAULTS.agent,\n maxSteps: 21,\n maxToolCalls: 20,\n allowedTools: 'application-defined',\n },\n documentation: {\n id: 'documentation',\n defaultModel: DEEPSPACE_AI_DEFAULTS.agent,\n // Permit up to twenty completed read-only tools plus one final synthesis\n // step. The runner disables tools once the tool-call budget is exhausted.\n maxSteps: 21,\n maxToolCalls: 20,\n allowedTools: ['documentation_search', 'documentation_read'],\n },\n} as const satisfies Record<DeepSpaceAgentProfileId, DeepSpaceAgentProfile>\n\nexport type DeepSpaceAIModelId = (typeof DEEPSPACE_AI_MODELS)[number]['id']\n\nexport function getDeepSpaceAIModel(modelId: unknown): DeepSpaceAIModel | null {\n if (typeof modelId !== 'string') return null\n return DEEPSPACE_AI_MODELS.find((model) => model.id === modelId) ?? null\n}\n\nexport function listDeepSpaceAgentModels(\n profileId: DeepSpaceAgentProfileId = 'application',\n): readonly DeepSpaceAIModel[] {\n const defaultModel = DEEPSPACE_AGENT_PROFILES[profileId].defaultModel\n return DEEPSPACE_AI_MODELS.filter((model) =>\n (model.agentProfiles as readonly DeepSpaceAgentProfileId[]).includes(profileId),\n ).sort((left, right) => Number(right.id === defaultModel) - Number(left.id === defaultModel))\n}\n\nexport interface ResolvedDeepSpaceAgentModel {\n modelId: string\n provider: DeepSpaceAIProvider\n model: DeepSpaceAIModel\n profile: DeepSpaceAgentProfile\n}\n\nexport function resolveDeepSpaceAgentModel(\n modelId: unknown,\n profileId: DeepSpaceAgentProfileId = 'application',\n): ResolvedDeepSpaceAgentModel | null {\n const profile = DEEPSPACE_AGENT_PROFILES[profileId]\n const resolvedId = modelId === undefined ? profile.defaultModel : modelId\n const model = getDeepSpaceAIModel(resolvedId)\n if (!model || !model.agentProfiles.includes(profileId)) return null\n return { modelId: model.id, provider: model.provider, model, profile }\n}\n","import { z } from 'zod'\nimport {\n DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS,\n DOCUMENTATION_CONTEXTUAL_ACTIONS,\n DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES,\n} from '../types'\n\nconst linkSchema = z.object({\n label: z.string().trim().min(1),\n href: z.string().trim().min(1),\n})\n\ntype NavigationInput =\n | string\n | z.infer<typeof linkSchema>\n | {\n group: string\n pages: NavigationInput[]\n }\n\nconst navigationSchema: z.ZodType<NavigationInput> = z.lazy(() =>\n z.union([\n z.string().trim().min(1),\n linkSchema,\n z.object({\n group: z.string().trim().min(1),\n pages: z.array(navigationSchema).min(1),\n }),\n ]),\n)\n\nconst openApiExamplesSchema = z.object({\n languages: z.array(z.enum(DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES)).min(1).optional(),\n defaults: z.enum(['required', 'all']).optional(),\n autogenerate: z.boolean().optional(),\n})\n\nexport const openapiItemSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((source) => ({ source })),\n z.object({\n source: z.string().trim().min(1),\n route: z.string().trim().optional(),\n label: z.string().trim().min(1).optional(),\n playground: z.boolean().optional(),\n baseUrl: z.string().url().optional(),\n examples: openApiExamplesSchema.optional(),\n }),\n])\n\nexport const themeObjectSchema = z.object({\n accent: z.string().trim().optional(),\n accentDark: z.string().trim().optional(),\n background: z.string().trim().optional(),\n density: z.enum(['comfortable', 'compact']).optional(),\n logo: z.string().trim().optional(),\n logoDark: z.string().trim().optional(),\n favicon: z.string().trim().optional(),\n defaultMode: z.enum(['light', 'dark', 'system']).optional(),\n strictMode: z.boolean().optional(),\n})\n\n/** Derived from the schema so the unknown-key sweep can never drift from it. */\nexport const THEME_CONFIG_KEYS = new Set(Object.keys(themeObjectSchema.shape))\n\nconst fontSpecSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((family) => ({ family })),\n z.object({\n family: z.string().trim().min(1),\n weight: z.union([z.number().int().min(100).max(900), z.string().trim().min(1)]).optional(),\n source: z.string().trim().min(1).optional(),\n format: z.string().trim().min(1).optional(),\n }),\n])\n\nconst colorPairSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((color) => ({ light: color })),\n z.object({\n light: z.string().trim().min(1).optional(),\n dark: z.string().trim().min(1).optional(),\n }),\n])\n\nconst navigationRootSchema = z.union([\n z.array(navigationSchema),\n z.object({\n groups: z.array(\n z.object({\n group: z.string().trim().min(1),\n pages: z.array(navigationSchema).min(1),\n }),\n ),\n }),\n])\n\nconst navbarSchema = z\n .object({\n links: z.array(linkSchema).optional(),\n primary: z\n .object({\n type: z.string().optional(),\n label: z.string().trim().min(1),\n href: z.string().trim().min(1),\n })\n .optional(),\n })\n .optional()\n\nconst footerSchema = z.union([\n z.array(linkSchema),\n z.object({ socials: z.record(z.string(), z.string().trim().min(1)).optional() }),\n])\n\nconst logoSchema = z\n .union([\n z.string().trim().min(1),\n z.object({\n light: z.string().trim().min(1),\n dark: z.string().trim().min(1).optional(),\n href: z.string().trim().min(1).optional(),\n }),\n ])\n .optional()\n\nconst contextualActionsSchema = z\n .array(z.enum(DOCUMENTATION_CONTEXTUAL_ACTIONS))\n .min(1)\n .max(DOCUMENTATION_CONTEXTUAL_ACTIONS.length)\n .refine((actions) => new Set(actions).size === actions.length, {\n message: 'actions must not contain duplicates',\n })\n\nconst hostnameSchema = z\n .hostname('must be a hostname such as docs.example.com')\n .trim()\n .toLowerCase()\n .refine((value) => value.includes('.'), 'must include a public suffix')\n\nexport const rawConfigSchema = z.object({\n $schema: z.string().optional(),\n name: z.string().trim().min(1),\n description: z.string().trim().optional(),\n source: z.string().trim().min(1).default('documentation'),\n output: z.string().trim().min(1).default('dist/_documentation'),\n url: z.string().url().optional(),\n domains: z\n .array(hostnameSchema)\n .max(1, 'one compiled documentation surface has one canonical custom domain')\n .default([]),\n theme: z.union([z.string().trim().min(1), themeObjectSchema]).default({}),\n colors: z\n .object({\n primary: z.string().trim().optional(),\n light: z.string().trim().optional(),\n dark: z.string().trim().optional(),\n })\n .optional(),\n logo: logoSchema,\n favicon: z.string().trim().min(1).optional(),\n appearance: z\n .object({\n default: z.enum(['light', 'dark', 'system']).optional(),\n strict: z.boolean().optional(),\n })\n .optional(),\n background: z\n .object({\n color: colorPairSchema.optional(),\n decoration: z.enum(['none', 'gradient', 'grid']).optional(),\n })\n .optional(),\n fonts: z\n .object({\n family: z.string().trim().min(1).optional(),\n body: fontSpecSchema.optional(),\n heading: fontSpecSchema.optional(),\n mono: fontSpecSchema.optional(),\n })\n .optional(),\n styling: z\n .object({\n codeblocks: z.enum(['dark', 'system']).optional(),\n eyebrows: z.enum(['section', 'breadcrumbs', 'none']).optional(),\n })\n .optional(),\n navigation: navigationRootSchema.optional(),\n navbar: navbarSchema,\n links: z.array(linkSchema).default([]),\n footer: footerSchema.default([]),\n redirects: z.record(z.string(), z.string()).default({}),\n api: z\n .object({\n playground: z\n .object({\n display: z.enum(['interactive', 'simple', 'none']).optional(),\n })\n .optional(),\n examples: openApiExamplesSchema.optional(),\n })\n .optional(),\n openapi: z.union([openapiItemSchema, z.array(openapiItemSchema)]).optional(),\n assistant: z\n .object({\n access: z.enum(['disabled', 'public', 'authenticated']).default('disabled'),\n model: z.string().trim().min(1).optional(),\n suggestions: z.array(z.string().trim().min(1)).max(6).optional(),\n })\n .default({ access: 'disabled' }),\n mcp: z\n .object({\n access: z.enum(['disabled', 'public']).default('public'),\n })\n .default({ access: 'public' }),\n contextual: z\n .object({\n actions: contextualActionsSchema.default([...DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS]),\n })\n .default({ actions: [...DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS] }),\n seo: z\n .object({\n noindex: z.boolean().optional(),\n ogImage: z.string().trim().optional(),\n metaTags: z.record(z.string(), z.string()).optional(),\n metatags: z.record(z.string(), z.string()).optional(),\n })\n .default({}),\n})\n\nexport const RAW_CONFIG_KEYS = new Set([\n '$schema',\n 'name',\n 'description',\n 'source',\n 'output',\n 'url',\n 'domains',\n 'theme',\n 'colors',\n 'logo',\n 'favicon',\n 'appearance',\n 'background',\n 'fonts',\n 'styling',\n 'navigation',\n 'navbar',\n 'links',\n 'footer',\n 'redirects',\n 'api',\n 'openapi',\n 'assistant',\n 'mcp',\n 'contextual',\n 'seo',\n])\n","import { existsSync, realpathSync } from 'node:fs'\nimport { isAbsolute, relative, resolve } from 'node:path'\nimport { DocumentationError } from '../types'\n\nexport function validateLinks(\n links: Array<{ label: string; href: string }>,\n field: string,\n configPath: string,\n): void {\n for (const link of links) {\n if (!/^(?:https?:\\/\\/|mailto:|\\/|#)/i.test(link.href)) {\n throw new DocumentationError(\n `Unsafe ${field} link: ${link.href}`,\n 'documentation_config_invalid',\n [{ code: 'unsafe_link', message: `${field}: ${link.href}`, file: configPath }],\n )\n }\n }\n}\n\nexport function safeChildPath(appDir: string, configured: string, field: string, configPath: string): string {\n if (isAbsolute(configured)) {\n throw new DocumentationError(\n `documentation.json ${field} must be relative to the app directory`,\n 'documentation_path_invalid',\n [{ code: 'absolute_path', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n const path = resolve(appDir, configured)\n const rel = relative(appDir, path)\n if (rel === '..' || rel.startsWith(`..${pathSeparator()}`)) {\n throw new DocumentationError(\n `documentation.json ${field} escapes the app directory`,\n 'documentation_path_invalid',\n [{ code: 'path_escape', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n if (existsSync(path)) {\n const realRoot = realpathSync(appDir)\n const realPath = realpathSync(path)\n const realRelative = relative(realRoot, realPath)\n if (realRelative === '..' || realRelative.startsWith(`..${pathSeparator()}`)) {\n throw new DocumentationError(\n `documentation.json ${field} resolves outside the app directory`,\n 'documentation_path_invalid',\n [{ code: 'path_symlink_escape', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n }\n return path\n}\n\nfunction pathSeparator(): string {\n return process.platform === 'win32' ? '\\\\' : '/'\n}\n\nexport function isWithin(parent: string, child: string): boolean {\n const rel = relative(parent, child)\n return rel !== '' && rel !== '..' && !rel.startsWith(`..${pathSeparator()}`)\n}\n\nexport function validateRedirects(redirects: Record<string, string>, configPath: string): void {\n for (const [from, to] of Object.entries(redirects)) {\n if (!from.startsWith('/') || !to.startsWith('/')) {\n throw new DocumentationError(\n `Redirects must use absolute site paths: ${from} -> ${to}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_path', message: `${from} -> ${to}`, file: configPath }],\n )\n }\n if (from === to) {\n throw new DocumentationError(\n `Redirect points to itself: ${from}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_loop', message: from, file: configPath }],\n )\n }\n const seen = new Set([from])\n let cursor: string | undefined = to\n while (cursor && redirects[cursor]) {\n if (seen.has(cursor)) {\n throw new DocumentationError(\n `Redirect loop includes ${cursor}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_loop', message: [...seen, cursor].join(' -> '), file: configPath }],\n )\n }\n seen.add(cursor)\n cursor = redirects[cursor]\n }\n }\n}\n\nexport function humanize(value: string): string {\n return value\n .split(/[-_]/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ')\n}\n","import { createProcessor, type CompileOptions } from '@mdx-js/mdx'\nimport { gfmToMarkdown } from 'mdast-util-gfm'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport remarkFrontmatter from 'remark-frontmatter'\nimport remarkGfm from 'remark-gfm'\nimport rehypeHighlight from 'rehype-highlight'\nimport { parseCodeFenceInfo, parseFrontmatter, parseMarkdown, type ParsedMarkdown } from './markdown'\nimport { createSlugger, errorMessage } from './text'\nimport { DocumentationError } from './types'\n\ninterface SyntaxNode {\n type: string\n value?: string\n depth?: number\n lang?: string | null\n meta?: string | null\n name?: string | null\n attributes?: Array<{ type?: string; name?: string; value?: unknown }>\n children?: SyntaxNode[]\n data?: Record<string, unknown>\n position?: { start?: { line?: number } }\n}\n\nconst EXECUTABLE_NODE_TYPES = new Set([\n 'mdxjsEsm',\n 'mdxFlowExpression',\n 'mdxTextExpression',\n])\n\nexport function parseMdx(source: string, file: string): ParsedMarkdown {\n const { frontmatter, body } = parseFrontmatter(source, file)\n try {\n const processor = createProcessor({ remarkPlugins: [remarkGfm] })\n const tree = processor.parse(body) as unknown as SyntaxNode\n const staticTree = projectStaticMarkdown(tree)\n const markdown = toMarkdown(staticTree as unknown as Parameters<typeof toMarkdown>[0], {\n extensions: [gfmToMarkdown()],\n })\n return { ...parseMarkdown(markdown, file), frontmatter }\n } catch (error) {\n if (error instanceof DocumentationError) throw error\n const line = diagnosticLine(error)\n throw new DocumentationError(\n `Invalid MDX in ${file}: ${errorMessage(error)}`,\n 'documentation_mdx_invalid',\n [{ code: 'mdx_syntax', message: errorMessage(error), file, ...(line ? { line } : {}) }],\n )\n }\n}\n\n/** Shared compile settings keep graph headings and executable MDX output identical. */\nexport function mdxCompileOptions(): CompileOptions {\n return {\n jsx: false,\n outputFormat: 'program',\n remarkPlugins: [remarkGfm, remarkFrontmatter, removeFrontmatter, addRuntimeMetadata],\n rehypePlugins: [rehypeHighlight],\n }\n}\n\nfunction projectStaticMarkdown(node: SyntaxNode): SyntaxNode {\n const projected: SyntaxNode = { ...node }\n delete projected.attributes\n delete projected.name\n projected.children = (node.children ?? []).flatMap(projectStaticNode)\n return projected\n}\n\nfunction projectStaticNode(node: SyntaxNode): SyntaxNode[] {\n if (EXECUTABLE_NODE_TYPES.has(node.type)) return []\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n const title = jsxTitle(node)\n const titleNode = title\n ? [{\n type: 'paragraph',\n children: [{ type: 'text', value: title }],\n } satisfies SyntaxNode]\n : []\n return [...titleNode, ...(node.children ?? []).flatMap(projectStaticNode)]\n }\n return [projectStaticMarkdown(node)]\n}\n\nfunction jsxTitle(node: SyntaxNode): string | undefined {\n const attribute = node.attributes?.find((candidate) =>\n candidate.type === 'mdxJsxAttribute' && (candidate.name === 'title' || candidate.name === 'label'),\n )\n return typeof attribute?.value === 'string' ? attribute.value : undefined\n}\n\nfunction removeFrontmatter() {\n return (tree: SyntaxNode): void => {\n tree.children = tree.children?.filter((node) => node.type !== 'yaml')\n }\n}\n\nfunction addRuntimeMetadata() {\n return (tree: SyntaxNode): void => {\n const slug = createSlugger()\n visit(tree, (node) => {\n if (node.type === 'heading') {\n const text = staticText(node)\n const id = slug(text)\n node.data = {\n ...node.data,\n hProperties: {\n ...asRecord(node.data?.hProperties),\n id,\n },\n }\n }\n if (node.type === 'code' && typeof node.meta === 'string' && node.meta.trim()) {\n // Same fence-info grammar as the Markdown path: a bare word or a\n // title=\"…\" pair after the language becomes the block title.\n const { title } = parseCodeFenceInfo(`${node.lang ?? ''} ${node.meta}`.trim())\n if (title) {\n node.data = {\n ...node.data,\n hProperties: {\n ...asRecord(node.data?.hProperties),\n 'data-code-title': title,\n },\n }\n }\n }\n })\n }\n}\n\nfunction staticText(node: SyntaxNode): string {\n if (node.type === 'text' || node.type === 'inlineCode') return node.value ?? ''\n if (EXECUTABLE_NODE_TYPES.has(node.type)) return ''\n return (node.children ?? []).map(staticText).join('')\n}\n\nfunction visit(node: SyntaxNode, visitor: (node: SyntaxNode) => void): void {\n visitor(node)\n for (const child of node.children ?? []) visit(child, visitor)\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {}\n}\n\nfunction diagnosticLine(error: unknown): number | undefined {\n if (!error || typeof error !== 'object' || !('line' in error)) return undefined\n return typeof error.line === 'number' ? error.line : undefined\n}\n","import { existsSync, readFileSync, realpathSync } from 'node:fs'\nimport { basename, extname, relative, resolve, sep } from 'node:path'\nimport { parse as parseYaml } from 'yaml'\nimport {\n DocumentationError,\n type DocumentationOpenApiConfig,\n type DocumentationOpenApiOperation,\n type DocumentationOpenApiParameter,\n} from './types'\nimport { slugify } from './markdown'\nimport { normalizeRoute } from './routing'\nimport { errorMessage } from './text'\nimport { createOpenApiCodeSamples } from './openapi-samples'\nimport { asOpenApiObject, resolveOpenApiObject } from './openapi-object'\n\nconst HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head', 'trace'] as const\n\ninterface OpenApiDocument {\n openapi?: unknown\n swagger?: unknown\n info?: { title?: unknown; description?: unknown }\n servers?: Array<{ url?: unknown }>\n host?: unknown\n basePath?: unknown\n schemes?: unknown\n security?: unknown\n paths?: Record<string, Record<string, unknown>>\n}\n\nexport interface ParsedOpenApi {\n sourcePath: string\n title: string\n route: string\n raw: string\n operations: DocumentationOpenApiOperation[]\n}\n\nexport function parseOpenApi(appDir: string, config: DocumentationOpenApiConfig): ParsedOpenApi {\n const sourcePath = resolve(appDir, config.source)\n assertOpenApiSourcePath(appDir, sourcePath, config.source)\n if (!existsSync(sourcePath)) {\n throw new DocumentationError(`OpenAPI source not found: ${config.source}`, 'documentation_openapi_missing', [\n { code: 'openapi_missing', message: config.source, file: sourcePath },\n ])\n }\n assertOpenApiSourcePath(appDir, realpathSync(sourcePath), config.source)\n const raw = readFileSync(sourcePath, 'utf8')\n let parsed: unknown\n try {\n parsed = ['.yaml', '.yml'].includes(extname(sourcePath).toLowerCase())\n ? parseYaml(raw, { maxAliasCount: 50 })\n : JSON.parse(raw)\n } catch (error) {\n throw new DocumentationError(\n `Invalid OpenAPI document ${config.source}: ${errorMessage(error)}`,\n 'documentation_openapi_invalid',\n [{ code: 'openapi_parse', message: errorMessage(error), file: sourcePath }],\n )\n }\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw invalidOpenApi(sourcePath, 'Document root must be an object')\n }\n const document = parsed as OpenApiDocument\n if (typeof document.openapi !== 'string' && typeof document.swagger !== 'string') {\n throw invalidOpenApi(sourcePath, 'Expected an openapi or swagger version field')\n }\n if (!document.paths || typeof document.paths !== 'object') {\n throw invalidOpenApi(sourcePath, 'Expected a paths object')\n }\n\n const documentServer = firstServerUrl(document.servers) ?? swaggerServerUrl(document)\n const operations: DocumentationOpenApiOperation[] = []\n const ids = new Set<string>()\n for (const [path, pathItem] of Object.entries(document.paths)) {\n const normalizedPathItem = resolveOpenApiObject(pathItem, document as Record<string, unknown>)\n if (!normalizedPathItem) continue\n for (const method of HTTP_METHODS) {\n const operation = resolveOpenApiObject(\n normalizedPathItem[method],\n document as Record<string, unknown>,\n )\n if (!operation) continue\n const baseUrl =\n config.baseUrl ??\n firstServerUrl(operation.servers) ??\n firstServerUrl(normalizedPathItem.servers) ??\n documentServer\n const fallbackId = `${method}-${path}`\n const operationId = slugify(\n typeof operation.operationId === 'string' ? operation.operationId : fallbackId,\n )\n if (!operationId)\n throw invalidOpenApi(sourcePath, `Could not derive id for ${method} ${path}`)\n if (ids.has(operationId)) {\n throw invalidOpenApi(sourcePath, `Duplicate operation id: ${operationId}`)\n }\n ids.add(operationId)\n const summary =\n typeof operation.summary === 'string'\n ? operation.summary\n : `${method.toUpperCase()} ${path}`\n const parameters = mergeParameters(\n normalizedPathItem.parameters,\n operation.parameters,\n document as Record<string, unknown>,\n )\n const security = 'security' in operation ? operation.security : document.security\n const normalized = {\n method: method.toUpperCase(),\n path,\n operationId,\n summary,\n ...(typeof operation.description === 'string'\n ? { description: operation.description }\n : {}),\n tags: Array.isArray(operation.tags)\n ? operation.tags.filter((tag): tag is string => typeof tag === 'string')\n : [],\n parameters,\n ...('requestBody' in operation ? { requestBody: operation.requestBody } : {}),\n responses: normalizeResponses(operation.responses, document as Record<string, unknown>),\n ...(security === undefined ? {} : { security }),\n ...(baseUrl ? { baseUrl } : {}),\n playground: config.playground === true && Boolean(baseUrl),\n } satisfies Omit<DocumentationOpenApiOperation, 'codeSamples'>\n operations.push({\n ...normalized,\n codeSamples: createOpenApiCodeSamples(\n normalized,\n document as Record<string, unknown>,\n config.examples,\n operation['x-codeSamples'] ?? operation['x-code-samples'],\n ),\n })\n }\n }\n if (operations.length === 0) {\n throw invalidOpenApi(sourcePath, 'No HTTP operations found')\n }\n\n const route = normalizeRoute(config.route ?? '/api-reference')\n const title =\n config.label ??\n (typeof document.info?.title === 'string'\n ? document.info.title\n : basename(config.source, extname(config.source)))\n return { sourcePath, title, route, raw, operations }\n}\n\nfunction assertOpenApiSourcePath(appDir: string, sourcePath: string, configured: string): void {\n const sourceIsReal = existsSync(sourcePath)\n const root =\n sourceIsReal && existsSync(appDir) && sourcePath === realpathSync(sourcePath)\n ? realpathSync(appDir)\n : resolve(appDir)\n const rel = relative(root, sourcePath)\n if (rel === '..' || rel.startsWith(`..${sep}`) || rel === '') {\n throw new DocumentationError(\n `OpenAPI source must be a file inside the app directory: ${configured}`,\n 'documentation_openapi_path_invalid',\n [{ code: 'openapi_path_escape', message: configured, file: sourcePath }],\n )\n }\n}\n\nexport function operationMarkdown(operation: DocumentationOpenApiOperation): string {\n const lines = [\n `<div class=\"documentation-api-badge\"><span class=\"method method-${operation.method.toLowerCase()}\">${operation.method}</span><code>${operation.path}</code></div>`,\n '',\n ]\n if (operation.description) lines.push(operation.description, '')\n if (operation.parameters.length > 0) {\n lines.push(\n '## Parameters',\n '',\n '| Name | In | Required | Description |',\n '| --- | --- | --- | --- |',\n )\n for (const parameter of operation.parameters) {\n lines.push(\n `| \\`${escapeTable(parameter.name)}\\` | ${escapeTable(parameter.in)} | ` +\n `${parameter.required ? 'yes' : 'no'} | ${escapeTable(parameter.description ?? '')} |`,\n )\n }\n lines.push('')\n }\n if (operation.requestBody !== undefined) {\n lines.push('## Request body', '', '```json', prettyJson(operation.requestBody), '```', '')\n }\n if (operation.security !== undefined) {\n lines.push('## Security', '', '```json', prettyJson(operation.security), '```', '')\n }\n lines.push('## Responses', '')\n if (operation.responses.length === 0) {\n lines.push('No response schema is declared.', '')\n } else {\n for (const response of operation.responses) {\n lines.push(`### ${response.status}`, '', response.description || 'Response', '')\n if (response.schema !== undefined) {\n lines.push('```json', prettyJson(response.schema), '```', '')\n }\n }\n }\n if (operation.codeSamples.length > 0) {\n lines.push('## Request examples', '', '<CodeGroup title=\"Request\">', '')\n for (const sample of operation.codeSamples) {\n const fence = codeFence(sample.code)\n const label = sample.label.replace(/[\"\\r\\n]/g, \"'\")\n lines.push(`${fence}${sample.syntax} title=\"${label}\"`, sample.code, fence, '')\n }\n lines.push('</CodeGroup>', '')\n }\n return lines.join('\\n')\n}\n\nfunction mergeParameters(\n pathParameters: unknown,\n operationParameters: unknown,\n document: Record<string, unknown>,\n): DocumentationOpenApiParameter[] {\n const merged = new Map<string, DocumentationOpenApiParameter>()\n for (const values of [pathParameters, operationParameters]) {\n if (!Array.isArray(values)) continue\n for (const value of values) {\n for (const parameter of normalizeParameter(value, document)) {\n merged.set(`${parameter.in}\\0${parameter.name}`, parameter)\n }\n }\n }\n return [...merged.values()]\n}\n\nfunction normalizeParameter(\n value: unknown,\n document: Record<string, unknown>,\n): DocumentationOpenApiParameter[] {\n const parameter = resolveOpenApiObject(value, document)\n if (!parameter) return []\n if (typeof parameter.name !== 'string' || typeof parameter.in !== 'string') return []\n return [\n {\n name: parameter.name,\n in: parameter.in,\n required: parameter.required === true,\n ...(typeof parameter.description === 'string' ? { description: parameter.description } : {}),\n ...('schema' in parameter ? { schema: parameter.schema } : {}),\n ...('example' in parameter ? { example: parameter.example } : {}),\n },\n ]\n}\n\nfunction normalizeResponses(value: unknown, document: Record<string, unknown>) {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return []\n return Object.entries(value as Record<string, unknown>).map(([status, response]) => {\n const data = resolveOpenApiObject(response, document)\n if (!data) {\n return { status, description: '' }\n }\n return {\n status,\n description: typeof data.description === 'string' ? data.description : '',\n ...('content' in data ? { schema: data.content } : {}),\n }\n })\n}\n\nfunction invalidOpenApi(file: string, message: string): DocumentationError {\n return new DocumentationError(`Invalid OpenAPI document: ${message}`, 'documentation_openapi_invalid', [\n { code: 'openapi_shape', message, file },\n ])\n}\n\nfunction prettyJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return String(value)\n }\n}\n\nfunction escapeTable(value: string): string {\n return value.replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')\n}\n\nfunction codeFence(source: string): string {\n const longest = Math.max(0, ...[...source.matchAll(/`+/g)].map((match) => match[0].length))\n return '`'.repeat(Math.max(3, longest + 1))\n}\n\nfunction firstServerUrl(value: unknown): string | undefined {\n if (!Array.isArray(value)) return undefined\n for (const server of value) {\n const object = asOpenApiObject(server)\n if (typeof object?.url === 'string') return object.url\n }\n return undefined\n}\n\nfunction swaggerServerUrl(document: OpenApiDocument): string | undefined {\n if (typeof document.host !== 'string' || !document.host) return undefined\n const scheme = Array.isArray(document.schemes)\n ? document.schemes.find((value): value is string => typeof value === 'string')\n : undefined\n const basePath = typeof document.basePath === 'string' ? document.basePath : ''\n return `${scheme ?? 'https'}://${document.host}${basePath}`\n}\n","export type OpenApiObject = Record<string, unknown>\n\nexport function asOpenApiObject(value: unknown): OpenApiObject | undefined {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as OpenApiObject)\n : undefined\n}\n\nexport function resolveOpenApiObject(\n value: unknown,\n document: OpenApiObject,\n seen: Set<string> = new Set(),\n): OpenApiObject | undefined {\n const object = asOpenApiObject(value)\n if (!object || typeof object.$ref !== 'string') return object\n const reference = object.$ref\n if (!reference.startsWith('#/') || seen.has(reference)) return undefined\n seen.add(reference)\n let resolved: unknown = document\n for (const segment of reference.slice(2).split('/')) {\n resolved = asOpenApiObject(resolved)?.[segment.replace(/~1/g, '/').replace(/~0/g, '~')]\n }\n const target = asOpenApiObject(resolved)\n if (!target) return undefined\n const siblings = Object.fromEntries(Object.entries(object).filter(([key]) => key !== '$ref'))\n return { ...target, ...siblings }\n}\n","import {\n DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES,\n type DocumentationOpenApiCodeSample,\n type DocumentationOpenApiExamplesConfig,\n type DocumentationOpenApiParameter,\n type DocumentationOpenApiSampleLanguage,\n} from './types'\nimport { asOpenApiObject, resolveOpenApiObject, type OpenApiObject } from './openapi-object'\n\ninterface SampleOperation {\n method: string\n path: string\n baseUrl?: string\n parameters: DocumentationOpenApiParameter[]\n requestBody?: unknown\n security?: unknown\n}\n\nconst LANGUAGE_METADATA: Record<DocumentationOpenApiSampleLanguage, { label: string; syntax: string }> = {\n curl: { label: 'cURL', syntax: 'bash' },\n javascript: { label: 'JavaScript', syntax: 'javascript' },\n python: { label: 'Python', syntax: 'python' },\n go: { label: 'Go', syntax: 'go' },\n}\n\nexport function createOpenApiCodeSamples(\n operation: SampleOperation,\n document: OpenApiObject,\n examples: DocumentationOpenApiExamplesConfig | undefined,\n customSamples: unknown,\n): DocumentationOpenApiCodeSample[] {\n const custom = normalizeCustomSamples(customSamples)\n if (examples?.autogenerate === false || !operation.baseUrl) return custom\n\n const languages = examples?.languages ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.languages\n const defaults = examples?.defaults ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.defaults\n const request = buildSampleRequest(operation, document, defaults === 'all')\n const customLanguages = new Set(custom.map((sample) => knownLanguage(sample.language)))\n const generated = languages\n .filter((language) => !customLanguages.has(language))\n .map(\n (language): DocumentationOpenApiCodeSample => ({\n language,\n label: LANGUAGE_METADATA[language].label,\n syntax: LANGUAGE_METADATA[language].syntax,\n code: renderSample(language, request),\n generated: true,\n }),\n )\n return [...custom, ...generated]\n}\n\ninterface SampleRequest {\n method: string\n url: string\n headers: Record<string, string>\n body?: unknown\n}\n\nfunction buildSampleRequest(\n operation: SampleOperation,\n document: OpenApiObject,\n includeOptional: boolean,\n): SampleRequest {\n let path = operation.path\n const query = new URLSearchParams()\n const headers: Record<string, string> = { Accept: 'application/json' }\n const cookies: string[] = []\n const parameters = operation.parameters.filter(\n (parameter) => parameter.required || includeOptional,\n )\n\n for (const parameter of parameters) {\n const value = sampleParameterValue(parameter, document)\n if (parameter.in === 'path') {\n path = path.replaceAll(`{${parameter.name}}`, encodeURIComponent(String(value)))\n } else if (parameter.in === 'query') {\n query.set(parameter.name, String(value))\n } else if (parameter.in === 'header') {\n headers[parameter.name] = String(value)\n } else if (parameter.in === 'cookie') {\n cookies.push(`${parameter.name}=${String(value)}`)\n }\n }\n path = path.replace(/\\{([^}]+)\\}/g, (_match, name: string) =>\n encodeURIComponent(`example-${slugPart(name)}`),\n )\n\n applySecurity(operation.security ?? document.security, document, headers, query, cookies)\n if (cookies.length > 0) headers.Cookie = cookies.join('; ')\n\n const body = requestBodyExample(operation.requestBody, document, includeOptional)\n if (body !== undefined) headers['Content-Type'] = 'application/json'\n const separator = path.includes('?') ? '&' : '?'\n const search = query.toString()\n const url = `${operation.baseUrl?.replace(/\\/$/, '') ?? ''}${path}${search ? `${separator}${search}` : ''}`\n return { method: operation.method, url, headers, ...(body === undefined ? {} : { body }) }\n}\n\nfunction sampleParameterValue(parameter: DocumentationOpenApiParameter, document: OpenApiObject): unknown {\n if (parameter.example !== undefined) return parameter.example\n const schema = resolveOpenApiObject(parameter.schema, document)\n if (schema) {\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0]\n if (schema.type === 'boolean') return true\n if (schema.type === 'integer' || schema.type === 'number') return 1\n }\n return `example-${slugPart(parameter.name)}`\n}\n\nfunction requestBodyExample(\n value: unknown,\n document: OpenApiObject,\n includeOptional: boolean,\n): unknown {\n const requestBody = resolveOpenApiObject(value, document)\n if (!requestBody) return undefined\n const content = asOpenApiObject(requestBody.content)\n if (!content) return undefined\n const jsonMedia = Object.entries(content).find(([contentType]) => contentType.endsWith('+json'))\n const media = asOpenApiObject(content['application/json']) ?? asOpenApiObject(jsonMedia?.[1])\n if (!media) return undefined\n if (media.example !== undefined) return media.example\n const namedExamples = asOpenApiObject(media.examples)\n if (namedExamples) {\n for (const example of Object.values(namedExamples)) {\n const resolved = resolveOpenApiObject(example, document)\n if (resolved && resolved.value !== undefined) return resolved.value\n }\n }\n return schemaExample(media.schema, document, includeOptional, new Set(), 0)\n}\n\nfunction schemaExample(\n value: unknown,\n document: OpenApiObject,\n includeOptional: boolean,\n seen: Set<string>,\n depth: number,\n): unknown {\n if (depth > 8) return undefined\n const schema = resolveOpenApiObject(value, document, seen)\n if (!schema) return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0]\n const alternatives = Array.isArray(schema.oneOf)\n ? schema.oneOf\n : Array.isArray(schema.anyOf)\n ? schema.anyOf\n : undefined\n if (alternatives?.[0] !== undefined) {\n return schemaExample(alternatives[0], document, includeOptional, seen, depth + 1)\n }\n if (Array.isArray(schema.allOf)) {\n return Object.assign(\n {},\n ...schema.allOf.map((part) => {\n const example = schemaExample(part, document, includeOptional, seen, depth + 1)\n return asOpenApiObject(example) ?? {}\n }),\n )\n }\n const properties = asOpenApiObject(schema.properties)\n if (schema.type === 'object' || properties) {\n const required = new Set(\n Array.isArray(schema.required)\n ? schema.required.filter((name): name is string => typeof name === 'string')\n : [],\n )\n return Object.fromEntries(\n Object.entries(properties ?? {})\n .filter(([name]) => includeOptional || required.has(name))\n .map(([name, property]) => [\n name,\n schemaExample(property, document, includeOptional, new Set(seen), depth + 1),\n ])\n .filter((entry) => entry[1] !== undefined),\n )\n }\n if (schema.type === 'array' || schema.items !== undefined) {\n const item = schemaExample(schema.items, document, includeOptional, seen, depth + 1)\n return item === undefined ? [] : [item]\n }\n if (schema.type === 'boolean') return true\n if (schema.type === 'integer' || schema.type === 'number') return 1\n if (schema.type === 'string') return stringExample(schema.format)\n return undefined\n}\n\nfunction stringExample(format: unknown): string {\n switch (format) {\n case 'date-time':\n return '2026-01-01T00:00:00Z'\n case 'date':\n return '2026-01-01'\n case 'email':\n return 'user@example.com'\n case 'uuid':\n return '00000000-0000-4000-8000-000000000000'\n case 'uri':\n case 'url':\n return 'https://example.com'\n default:\n return 'string'\n }\n}\n\nfunction applySecurity(\n value: unknown,\n document: OpenApiObject,\n headers: Record<string, string>,\n query: URLSearchParams,\n cookies: string[],\n): void {\n if (!Array.isArray(value)) return\n const requirement = value.map(asOpenApiObject).find(Boolean)\n if (!requirement) return\n const schemes = asOpenApiObject(asOpenApiObject(document.components)?.securitySchemes)\n for (const name of Object.keys(requirement)) {\n const scheme = resolveOpenApiObject(schemes?.[name], document)\n if (!scheme) continue\n if (scheme.type === 'http' && scheme.scheme === 'bearer') {\n headers.Authorization = 'Bearer <token>'\n } else if (scheme.type === 'http' && scheme.scheme === 'basic') {\n headers.Authorization = 'Basic <credentials>'\n } else if (scheme.type === 'apiKey' && typeof scheme.name === 'string') {\n if (scheme.in === 'query') query.set(scheme.name, '<api-key>')\n else if (scheme.in === 'cookie') cookies.push(`${scheme.name}=<api-key>`)\n else headers[scheme.name] = '<api-key>'\n }\n }\n}\n\nfunction renderSample(language: DocumentationOpenApiSampleLanguage, request: SampleRequest): string {\n switch (language) {\n case 'curl':\n return renderCurl(request)\n case 'javascript':\n return renderJavaScript(request)\n case 'python':\n return renderPython(request)\n case 'go':\n return renderGo(request)\n }\n}\n\nfunction renderCurl(request: SampleRequest): string {\n const lines = [`curl --request ${request.method} \\\\`, ` --url '${escapeShell(request.url)}'`]\n for (const [name, value] of Object.entries(request.headers)) {\n lines[lines.length - 1] += ' \\\\'\n lines.push(` --header '${escapeShell(`${name}: ${value}`)}'`)\n }\n if (request.body !== undefined) {\n lines[lines.length - 1] += ' \\\\'\n lines.push(` --data '${escapeShell(prettyJson(request.body))}'`)\n }\n return lines.join('\\n')\n}\n\nfunction renderJavaScript(request: SampleRequest): string {\n const options = [\n `method: ${JSON.stringify(request.method)}`,\n `headers: ${indent(prettyJson(request.headers), 2).trimStart()}`,\n ...(request.body === undefined\n ? []\n : [`body: JSON.stringify(${indent(prettyJson(request.body), 2).trimStart()})`]),\n ]\n return [\n `const response = await fetch(${JSON.stringify(request.url)}, {`,\n options.map((option) => ` ${option},`).join('\\n'),\n '})',\n '',\n 'if (!response.ok) throw new Error(`Request failed: ${response.status}`)',\n 'const data = await response.json()',\n 'console.log(data)',\n ].join('\\n')\n}\n\nfunction renderPython(request: SampleRequest): string {\n const arguments_ = [\n JSON.stringify(request.method),\n JSON.stringify(request.url),\n `headers=${pythonValue(request.headers)}`,\n ...(request.body === undefined ? [] : [`json=${pythonValue(request.body)}`]),\n ]\n return [\n 'import requests',\n '',\n 'response = requests.request(',\n arguments_.map((argument) => ` ${argument},`).join('\\n'),\n ')',\n 'response.raise_for_status()',\n 'print(response.json())',\n ].join('\\n')\n}\n\nfunction renderGo(request: SampleRequest): string {\n const requestBody =\n request.body === undefined\n ? 'nil'\n : `strings.NewReader(${JSON.stringify(prettyJson(request.body))})`\n const imports = ['\"fmt\"', '\"io\"', '\"net/http\"']\n if (request.body !== undefined) imports.push('\"strings\"')\n return [\n 'package main',\n '',\n 'import (',\n ...imports.map((value) => `\\t${value}`),\n ')',\n '',\n 'func main() {',\n `\\treq, err := http.NewRequest(${JSON.stringify(request.method)}, ${JSON.stringify(request.url)}, ${requestBody})`,\n '\\tif err != nil { panic(err) }',\n ...Object.entries(request.headers).map(\n ([name, value]) => `\\treq.Header.Set(${JSON.stringify(name)}, ${JSON.stringify(value)})`,\n ),\n '',\n '\\tres, err := http.DefaultClient.Do(req)',\n '\\tif err != nil { panic(err) }',\n '\\tdefer res.Body.Close()',\n '',\n '\\tbody, err := io.ReadAll(res.Body)',\n '\\tif err != nil { panic(err) }',\n '\\tfmt.Println(string(body))',\n '}',\n ].join('\\n')\n}\n\nfunction normalizeCustomSamples(value: unknown): DocumentationOpenApiCodeSample[] {\n if (!Array.isArray(value)) return []\n return value.flatMap((entry): DocumentationOpenApiCodeSample[] => {\n const sample = asOpenApiObject(entry)\n const language = typeof sample?.lang === 'string' ? sample.lang.trim().toLowerCase() : ''\n const source = typeof sample?.source === 'string' ? sample.source.trim() : ''\n if (!language || !source) return []\n const normalizedLanguage = knownLanguage(language)\n const label =\n typeof sample?.label === 'string' && sample.label.trim()\n ? sample.label.trim()\n : normalizedLanguage\n ? LANGUAGE_METADATA[normalizedLanguage].label\n : language\n return [\n {\n language,\n label,\n syntax: syntaxForLanguage(language),\n code: source,\n generated: false,\n },\n ]\n })\n}\n\nfunction knownLanguage(value: string): DocumentationOpenApiSampleLanguage | undefined {\n if (['curl', 'bash', 'shell', 'sh'].includes(value)) return 'curl'\n if (['javascript', 'js', 'node', 'nodejs'].includes(value)) return 'javascript'\n if (['python', 'py'].includes(value)) return 'python'\n if (['go', 'golang'].includes(value)) return 'go'\n return undefined\n}\n\nfunction syntaxForLanguage(value: string): string {\n const known = knownLanguage(value)\n return known ? LANGUAGE_METADATA[known].syntax : value.replace(/[^a-z0-9_+#.-]/g, '') || 'text'\n}\n\nfunction prettyJson(value: unknown): string {\n return JSON.stringify(value, null, 2)\n}\n\nfunction pythonValue(value: unknown): string {\n return prettyJson(value)\n .replace(/\\btrue\\b/g, 'True')\n .replace(/\\bfalse\\b/g, 'False')\n .replace(/\\bnull\\b/g, 'None')\n}\n\nfunction escapeShell(value: string): string {\n return value.replace(/'/g, `'\"'\"'`)\n}\n\nfunction indent(value: string, spaces: number): string {\n const prefix = ' '.repeat(spaces)\n return value\n .split('\\n')\n .map((line) => `${prefix}${line}`)\n .join('\\n')\n}\n\nfunction slugPart(value: string): string {\n return (\n value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '') || 'value'\n )\n}\n","import { compileSync } from '@mdx-js/mdx'\nimport { parse as parseJavaScript } from 'acorn'\nimport { buildSync, type BuildOptions, type BuildResult, type OutputFile } from 'esbuild'\nimport { createRequire } from 'node:module'\nimport { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { dirname, extname, join, relative, resolve, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { rewriteLocalReferences } from './graph'\nimport { stripFirstMarkdownH1 } from './markdown'\nimport { mdxCompileOptions } from './mdx'\nimport { documentationPublicPath, publicDocumentationReferences } from './routing'\nimport { errorMessage } from './text'\nimport { DocumentationError, type DocumentationRuntimeData, type DocumentationValidationResult } from './types'\n\nexport interface CustomDocumentationRuntime {\n browserAssets: Array<{ path: string; content: string }>\n stylesheets: string[]\n render(data: DocumentationRuntimeData, route: string): string\n}\n\ninterface JavaScriptNode {\n type: string\n start?: number\n end?: number\n source?: JavaScriptNode\n value?: unknown\n [key: string]: unknown\n}\n\nexport function buildCustomDocumentationRuntime(\n validation: DocumentationValidationResult,\n basePath: string,\n): CustomDocumentationRuntime | null {\n const sitePath = resolve(validation.appDir, 'documentation.tsx')\n const mdxPages = validation.graph.pages.filter((page) => page.sourceFormat === 'mdx')\n if (!existsSync(sitePath) && mdxPages.length === 0) return null\n\n const temporaryDir = mkdtempSync(join(tmpdir(), 'deepspace-documentation-runtime-'))\n try {\n const compiledPages = mdxPages.map((page, index) => {\n const source = readFileSync(page.sourcePath, 'utf8')\n const rewritten = rewriteLocalReferences(\n source,\n page.relativePath,\n validation.sourceDir,\n page.sourcePath,\n )\n const compiled = compileSync(\n publicDocumentationReferences(stripFirstMarkdownH1(rewritten), basePath),\n mdxCompileOptions(),\n )\n const path = join(temporaryDir, `page-${index}.mjs`)\n writeFileSync(path, resolveCompiledImports(String(compiled), page.sourcePath, validation.appDir))\n return { path, route: page.route }\n })\n\n const clientEntry = runtimeEntry('documentation-client-core.js', 'runtime/client.tsx')\n const publicEntry = runtimeEntry('documentation-react.js', 'runtime/public.tsx')\n const serverEntry = runtimeEntry('documentation-server-core.js', 'runtime/server.tsx')\n const browserEntry = join(temporaryDir, 'browser-entry.ts')\n const serverBundleEntry = join(temporaryDir, 'server-entry.ts')\n writeFileSync(browserEntry, generatedBrowserEntry(clientEntry, publicEntry, sitePath, compiledPages))\n writeFileSync(serverBundleEntry, generatedServerEntry(serverEntry, sitePath, compiledPages))\n\n const reactAliases = runtimeDependencyAliases(validation.appDir)\n const alias = { ...reactAliases, 'deepspace/documentation/react': publicEntry }\n const browserOutDir = join(temporaryDir, 'browser')\n const sharedBuildOptions: BuildOptions = {\n absWorkingDir: temporaryDir,\n bundle: true,\n define: { 'process.env.NODE_ENV': '\"production\"' },\n jsx: 'automatic',\n target: ['es2022'],\n ...(existsSync(resolve(validation.appDir, 'tsconfig.json'))\n ? { tsconfig: resolve(validation.appDir, 'tsconfig.json') }\n : {}),\n write: false,\n }\n const browser = buildSync({\n ...sharedBuildOptions,\n alias,\n entryPoints: ['browser-entry.ts'],\n chunkNames: 'documentation-page-[hash]',\n entryNames: 'documentation-custom-runtime',\n format: 'esm',\n loader: assetLoaders('dataurl'),\n minify: true,\n outdir: browserOutDir,\n platform: 'browser',\n splitting: true,\n })\n const server = buildSync({\n ...sharedBuildOptions,\n alias: { ...reactAliases, 'deepspace/documentation/react': serverEntry },\n entryPoints: ['server-entry.ts'],\n format: 'cjs',\n loader: { ...assetLoaders('dataurl'), '.css': 'text' },\n logLevel: 'silent',\n minify: false,\n outdir: join(temporaryDir, 'server'),\n platform: 'node',\n target: ['node22'],\n })\n const browserAssets = (browser.outputFiles ?? []).map((output) => ({\n path: relative(browserOutDir, output.path).split(sep).join('/'),\n content: output.text,\n }))\n if (!browserAssets.some((asset) => asset.path === 'documentation-custom-runtime.js')) {\n throw new Error('Executable documentation build did not emit documentation-custom-runtime.js')\n }\n const stylesheets = browserAssets\n .filter((asset) => extname(asset.path) === '.css')\n .map((asset) => documentationPublicPath(basePath, `/assets/${asset.path}`))\n const serverJavaScript = outputWithExtension(server, '.js').text\n const module = { exports: {} as { render?: (route: string, data: DocumentationRuntimeData) => string } }\n const evaluate = new Function('require', 'module', 'exports', serverJavaScript)\n evaluate(createRequire(join(validation.appDir, 'package.json')), module, module.exports)\n if (typeof module.exports.render !== 'function') {\n throw new Error('The generated documentation server renderer did not export render()')\n }\n return {\n browserAssets,\n stylesheets,\n render: (data, route) => module.exports.render?.(route, data) ?? '',\n }\n } catch (error) {\n if (error instanceof DocumentationError) throw error\n throw new DocumentationError(\n `Unable to compile executable documentation: ${errorMessage(error)}`,\n 'documentation_runtime_build_failed',\n [{ code: 'runtime_compile', message: errorMessage(error), file: existsSync(sitePath) ? sitePath : undefined }],\n )\n } finally {\n rmSync(temporaryDir, { recursive: true, force: true })\n }\n}\n\nfunction generatedBrowserEntry(\n clientEntry: string,\n publicEntry: string,\n sitePath: string,\n pages: Array<{ path: string; route: string }>,\n): string {\n const siteImport = existsSync(sitePath)\n ? `import Site from ${quote(sitePath)}`\n : `import { DefaultDocumentation as Site } from ${quote(publicEntry)}`\n const pageLoaders = pages.map((page) => `${quote(page.route)}: () => import(${quote(page.path)})`).join(',\\n')\n return `import { hydrateDocumentation } from ${quote(clientEntry)}\n${siteImport}\nconst loaders = { ${pageLoaders} }\nconst pages = {}\nasync function loadPage(route) {\n const loader = loaders[route]\n if (loader && !pages[route]) pages[route] = (await loader()).default\n}\nconst payload = document.getElementById('deepspace-documentation-data')\nif (payload?.textContent) await loadPage(JSON.parse(payload.textContent).page.route)\nhydrateDocumentation({ Site, pages, loadPage })\n`\n}\n\nfunction generatedServerEntry(\n serverEntry: string,\n sitePath: string,\n pages: Array<{ path: string; route: string }>,\n): string {\n const imports = pages.map((page, index) => `import Page${index} from ${quote(page.path)}`).join('\\n')\n const siteImport = existsSync(sitePath)\n ? `import Site from ${quote(sitePath)}`\n : `import { DefaultDocumentation as Site } from ${quote(serverEntry)}`\n const pageMap = pages.map((page, index) => `${quote(page.route)}: Page${index}`).join(',\\n')\n return `import { renderDocumentation } from ${quote(serverEntry)}\n${siteImport}\n${imports}\nconst pages = { ${pageMap} }\nexport function render(route, data) {\n return renderDocumentation({ data, Page: pages[route], Site })\n}\n`\n}\n\nfunction resolveCompiledImports(code: string, sourcePath: string, appDir: string): string {\n const tree = parseJavaScript(code, { ecmaVersion: 'latest', sourceType: 'module' }) as unknown as JavaScriptNode\n const replacements: Array<{ start: number; end: number; value: string }> = []\n const appRequire = createRequire(join(appDir, 'package.json'))\n const resolveAlias = tsconfigAliasResolver(appDir)\n visitJavaScript(tree, (node) => {\n const source = importSource(node)\n if (!source || typeof source.value !== 'string' || source.start === undefined || source.end === undefined) {\n return\n }\n const specifier = source.value\n if (/^(?:data:|https?:|node:)/.test(specifier)) return\n const resolved = specifier.startsWith('.')\n ? resolve(dirname(sourcePath), specifier)\n : specifier === 'deepspace/documentation/react' || specifier === 'react' || specifier.startsWith('react/')\n ? specifier\n : (resolveAlias(specifier) ?? appRequire.resolve(specifier))\n replacements.push({ start: source.start, end: source.end, value: quote(resolved.split(sep).join('/')) })\n })\n return replacements\n .sort((left, right) => right.start - left.start)\n .reduce(\n (output, replacement) =>\n `${output.slice(0, replacement.start)}${replacement.value}${output.slice(replacement.end)}`,\n code,\n )\n}\n\n/** Map tsconfig `paths` aliases (e.g. `@/*`) to app-rooted absolute paths,\n * like relative imports: the emitted path stays extensionless and esbuild\n * performs extension/tsconfig resolution. First target per pattern only. */\nfunction tsconfigAliasResolver(appDir: string): (specifier: string) => string | undefined {\n let base = appDir\n let aliases: Array<{ prefix: string; exact: boolean; target: string }> = []\n try {\n const raw = readFileSync(join(appDir, 'tsconfig.json'), 'utf8')\n const parsed = JSON.parse(\n raw.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').replace(/^\\s*\\/\\/.*$/gm, ''),\n ) as { compilerOptions?: { baseUrl?: string; paths?: Record<string, string[]> } }\n const options = parsed.compilerOptions\n if (options?.paths) {\n base = resolve(appDir, options.baseUrl ?? '.')\n aliases = Object.entries(options.paths)\n .filter(([, targets]) => typeof targets?.[0] === 'string')\n .map(([pattern, targets]) => ({\n exact: !pattern.includes('*'),\n prefix: pattern.replace(/\\*$/, ''),\n target: targets[0].replace(/\\*$/, ''),\n }))\n .sort((left, right) => right.prefix.length - left.prefix.length)\n }\n } catch {\n // An unreadable tsconfig means no aliases; aliased imports then fail\n // loudly through appRequire.resolve with the original specifier.\n }\n return (specifier) => {\n for (const alias of aliases) {\n if (alias.exact ? specifier === alias.prefix : specifier.startsWith(alias.prefix)) {\n return resolve(base, `${alias.target}${alias.exact ? '' : specifier.slice(alias.prefix.length)}`)\n }\n }\n return undefined\n }\n}\n\nfunction importSource(node: JavaScriptNode): JavaScriptNode | undefined {\n if (\n node.type === 'ImportDeclaration' ||\n node.type === 'ExportAllDeclaration' ||\n node.type === 'ExportNamedDeclaration' ||\n node.type === 'ImportExpression'\n ) return node.source\n return undefined\n}\n\nfunction visitJavaScript(node: JavaScriptNode, visitor: (node: JavaScriptNode) => void): void {\n visitor(node)\n for (const value of Object.values(node)) {\n if (Array.isArray(value)) {\n for (const child of value) {\n if (isJavaScriptNode(child)) visitJavaScript(child, visitor)\n }\n } else if (isJavaScriptNode(value)) {\n visitJavaScript(value, visitor)\n }\n }\n}\n\nfunction isJavaScriptNode(value: unknown): value is JavaScriptNode {\n return Boolean(value && typeof value === 'object' && 'type' in value && typeof value.type === 'string')\n}\n\n/** Resolve a runtime artifact beside this module, or its source in a repo\n * checkout. A published package has no sources, so a missing artifact fails\n * by name instead of self-compiling. */\nexport function runtimeEntry(builtName: string, sourceRelativePath: string): string {\n const built = fileURLToPath(new URL(`./${builtName}`, import.meta.url))\n if (existsSync(built)) return built\n const source = fileURLToPath(new URL(`./${sourceRelativePath}`, import.meta.url))\n if (!existsSync(source)) {\n throw new Error(`${builtName} is missing from this deepspace installation; reinstall the package`)\n }\n return source\n}\n\nfunction runtimeDependencyAliases(appDir: string): Record<string, string> {\n const require = createRequire(join(appDir, 'package.json'))\n return Object.fromEntries(\n ['react', 'react/jsx-runtime', 'react-dom', 'react-dom/client', 'react-dom/server']\n .map((specifier) => [specifier, require.resolve(specifier)]),\n )\n}\n\nfunction outputWithExtension(result: BuildResult, extension: string): OutputFile {\n const output = optionalOutputWithExtension(result, extension)\n if (!output) throw new Error(`Executable documentation build did not emit a ${extension} file`)\n return output\n}\n\nfunction optionalOutputWithExtension(result: BuildResult, extension: string): OutputFile | undefined {\n return result.outputFiles?.find((output) => extname(output.path) === extension)\n}\n\nfunction assetLoaders(imageLoader: 'dataurl'): Record<string, 'css' | 'dataurl'> {\n return {\n '.avif': imageLoader,\n '.css': 'css',\n '.gif': imageLoader,\n '.jpeg': imageLoader,\n '.jpg': imageLoader,\n '.png': imageLoader,\n '.svg': imageLoader,\n '.webp': imageLoader,\n '.woff': imageLoader,\n '.woff2': imageLoader,\n }\n}\n\nfunction quote(value: string): string {\n return JSON.stringify(value)\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { fileURLToPath } from 'node:url'\nimport { documentationPublicPath } from './routing'\nimport type { DocumentationFontConfig, ResolvedDocumentationTheme } from './types'\n\nexport interface DocumentationBundledFont {\n family: string\n fileName: string\n /** Variable axis range, so one file serves every weight the stylesheet asks for. */\n weight: string\n}\n\nexport const DOCUMENTATION_BUNDLED_BODY_FONT: DocumentationBundledFont = {\n family: 'Inter',\n fileName: 'inter-variable.woff2',\n weight: '100 900',\n}\n\nexport const DOCUMENTATION_BUNDLED_MONO_FONT: DocumentationBundledFont = {\n family: 'Geist Mono',\n fileName: 'geist-mono-variable.woff2',\n weight: '100 900',\n}\n\nexport const DOCUMENTATION_BUNDLED_FONTS: readonly DocumentationBundledFont[] = [\n DOCUMENTATION_BUNDLED_BODY_FONT,\n DOCUMENTATION_BUNDLED_MONO_FONT,\n]\n\nexport interface DocumentationResolvedFont {\n family: string\n source: string\n weight: string\n format: string\n /** Set when the bytes come from this package rather than the app's media directory. */\n bundled?: DocumentationBundledFont\n}\n\n/**\n * One ordered list of faces the page must load, whether they are bundled with the\n * SDK or supplied by the app. `renderFontFaces`, `renderFontPreloads`, and the\n * build's asset emission all read this so a face can never be declared without\n * its bytes being written, or written without being declared.\n *\n * A slot the author configured without a `source` names a font they provide\n * themselves (system-installed or a custom stylesheet); it contributes no face.\n */\nexport function resolveDocumentationFonts(\n theme: ResolvedDocumentationTheme,\n basePath: string,\n): DocumentationResolvedFont[] {\n const resolved: DocumentationResolvedFont[] = []\n const seen = new Set<string>()\n const add = (font: DocumentationResolvedFont): void => {\n const key = `${font.family}:${font.source}:${font.weight}`\n if (seen.has(key)) return\n seen.add(key)\n resolved.push(font)\n }\n const addAuthored = (font: DocumentationFontConfig | undefined, fallbackFamily: string): void => {\n if (!font?.source || !validFontSource(font.source)) return\n add({\n family: safeFontFamily(font.family, fallbackFamily),\n source: font.source,\n weight: safeFontWeight(font.weight),\n format: safeFontFormat(font.format),\n })\n }\n const addBundled = (bundled: DocumentationBundledFont): void => add({\n family: bundled.family,\n source: bundledFontHref(basePath, bundled),\n weight: bundled.weight,\n format: 'woff2',\n bundled,\n })\n\n // An absent heading slot inherits the body family, so it needs no face of its own.\n if (theme.bodyFont) addAuthored(theme.bodyFont, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n else addBundled(DOCUMENTATION_BUNDLED_BODY_FONT)\n addAuthored(theme.headingFont, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n if (theme.monoFont) addAuthored(theme.monoFont, DOCUMENTATION_BUNDLED_MONO_FONT.family)\n else addBundled(DOCUMENTATION_BUNDLED_MONO_FONT)\n return resolved\n}\n\nexport function bundledFontHref(basePath: string, font: DocumentationBundledFont): string {\n return documentationPublicPath(basePath, `/assets/fonts/${font.fileName}`)\n}\n\n/**\n * The build copies these woff2 files to `dist/fonts`, so one module-relative\n * path serves both a published install and a source checkout.\n */\nexport function readBundledFont(font: DocumentationBundledFont): Uint8Array {\n const path = fileURLToPath(new URL(`./fonts/${font.fileName}`, import.meta.url))\n if (!existsSync(path)) {\n throw new Error(`${font.fileName} is missing from this deepspace installation; reinstall the package`)\n }\n return readFileSync(path)\n}\n\n/** Guard against CSS injection through a configured family name. */\nexport function safeFontFamily(\n value: string | undefined,\n fallback = DOCUMENTATION_BUNDLED_BODY_FONT.family,\n): string {\n return value && /^[a-z0-9 ,.'-]{1,80}$/i.test(value) ? value : fallback\n}\n\nexport function validFontSource(value: string): boolean {\n return /^(?:\\/[a-z0-9_./%-]+|https:\\/\\/[^\\s\"'()<>]+)$/i.test(value)\n}\n\nfunction safeFontWeight(value: DocumentationFontConfig['weight']): string {\n if (typeof value === 'number') return String(value)\n return /^(?:normal|bold|[1-9]00|[1-9]00\\s+[1-9]00)$/i.test(String(value ?? '')) ? String(value) : 'normal'\n}\n\nfunction safeFontFormat(value: string | undefined): string {\n return value && /^[a-z0-9-]{2,20}$/i.test(value) ? value : ''\n}\n","import { createHash } from 'node:crypto'\nimport {\n existsSync,\n mkdirSync,\n readFileSync,\n readdirSync,\n rmSync,\n writeFileSync,\n} from 'node:fs'\nimport { dirname, extname, join, relative, resolve, sep } from 'node:path'\nimport sanitizeHtml from 'sanitize-html'\nimport { DocumentationError } from './types'\n\nconst MEDIA_EXTENSIONS = new Set([\n '.avif',\n '.gif',\n '.ico',\n '.jpeg',\n '.jpg',\n '.png',\n '.svg',\n '.webp',\n '.woff',\n '.woff2',\n])\n\nconst SOURCE_EXTENSIONS = new Set(['.css', '.js', '.jsx', '.md', '.mdx', '.ts', '.tsx'])\n\n/** Owns all filesystem mutation and hashing for one deterministic documentation build. */\nexport class DocumentationOutput {\n readonly files = new Set<string>()\n\n constructor(\n readonly outputDir: string,\n appDir: string,\n sourceDir: string,\n ) {\n assertSafeOutput(appDir, sourceDir, outputDir)\n if (existsSync(outputDir)) rmSync(outputDir, { recursive: true, force: true })\n mkdirSync(outputDir, { recursive: true })\n }\n\n write(relativePath: string, content: string | Uint8Array): void {\n const path = this.safePath(relativePath)\n mkdirSync(dirname(path), { recursive: true })\n writeFileSync(path, content)\n this.files.add(normalizeRelativePath(relativePath))\n }\n\n copyMedia(sourceDir: string, auxiliarySources: Set<string>): void {\n const walk = (directory: string): void => {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'node_modules') continue\n const sourcePath = join(directory, entry.name)\n if (entry.isDirectory()) {\n walk(sourcePath)\n continue\n }\n const extension = extname(entry.name).toLowerCase()\n if (SOURCE_EXTENSIONS.has(extension) || auxiliarySources.has(resolve(sourcePath))) continue\n if (!MEDIA_EXTENSIONS.has(extension)) {\n throw new DocumentationError(\n `Unsupported documentation media type: ${relative(sourceDir, sourcePath)}`,\n 'documentation_media_unsupported',\n [{\n code: 'media_type_unsupported',\n message: extension || '(no extension)',\n file: sourcePath,\n }],\n )\n }\n const mediaPath = `media/${normalizeRelativePath(relative(sourceDir, sourcePath))}`\n const content = extension === '.svg'\n ? sanitizeSvg(readFileSync(sourcePath, 'utf8'), sourcePath)\n : readFileSync(sourcePath)\n this.write(mediaPath, content)\n }\n }\n walk(sourceDir)\n }\n\n hash(): string {\n const hash = createHash('sha256')\n for (const file of [...this.files].sort()) {\n hash.update(file)\n hash.update(readFileSync(join(this.outputDir, file)))\n }\n return hash.digest('hex')\n }\n\n private safePath(relativePath: string): string {\n const path = resolve(this.outputDir, relativePath)\n const rel = relative(this.outputDir, path)\n if (rel === '..' || rel.startsWith(`..${sep}`) || rel === '') {\n throw new DocumentationError(\n `Refusing documentation artifact outside the output directory: ${relativePath}`,\n 'documentation_output_unsafe',\n [{ code: 'artifact_path_escape', message: relativePath }],\n )\n }\n return path\n }\n}\n\nfunction assertSafeOutput(appDir: string, sourceDir: string, outputDir: string): void {\n const appRelative = relative(appDir, outputDir)\n const sourceRelative = relative(sourceDir, outputDir)\n if (\n outputDir === appDir ||\n outputDir === sourceDir ||\n appRelative === '..' ||\n appRelative.startsWith(`..${sep}`) ||\n sourceRelative === '' ||\n (!sourceRelative.startsWith('..') && sourceRelative !== '')\n ) {\n throw new DocumentationError(\n `Refusing unsafe documentation output directory: ${outputDir}`,\n 'documentation_output_unsafe',\n [{ code: 'unsafe_output', message: outputDir }],\n )\n }\n}\n\nfunction sanitizeSvg(source: string, sourcePath: string): string {\n const safe = sanitizeHtml(source, {\n allowedTags: [\n 'svg', 'g', 'path', 'circle', 'ellipse', 'line', 'polyline', 'polygon',\n 'rect', 'image', 'defs', 'linearGradient', 'radialGradient', 'stop',\n 'clipPath', 'mask', 'title', 'desc', 'text', 'tspan',\n ],\n allowedAttributes: {\n svg: [\n 'xmlns', 'xmlns:xlink', 'viewBox', 'width', 'height', 'fill', 'stroke',\n 'role', 'aria-label',\n ],\n image: ['href', 'xlink:href', 'x', 'y', 'width', 'height', 'preserveAspectRatio'],\n '*': [\n 'id', 'class', 'd', 'x', 'y', 'x1', 'x2', 'y1', 'y2', 'cx', 'cy',\n 'r', 'rx', 'ry', 'points', 'width', 'height', 'viewBox', 'fill',\n 'fill-rule', 'fill-opacity', 'stroke', 'stroke-width', 'stroke-linecap',\n 'stroke-linejoin', 'stroke-opacity', 'opacity', 'transform', 'offset',\n 'stop-color', 'stop-opacity', 'clip-path', 'mask', 'role', 'aria-label',\n 'aria-hidden', 'font-family', 'font-size', 'font-style', 'font-weight',\n 'letter-spacing', 'text-anchor', 'dominant-baseline',\n ],\n },\n allowedSchemes: ['data'],\n allowProtocolRelative: false,\n disallowedTagsMode: 'discard',\n parser: { lowerCaseTags: false, lowerCaseAttributeNames: false },\n })\n if (!/<svg\\b/i.test(safe)) {\n throw new DocumentationError(\n `Invalid documentation SVG: ${relative(process.cwd(), sourcePath)}`,\n 'documentation_media_invalid',\n [{ code: 'svg_invalid', message: 'Expected an SVG root element', file: sourcePath }],\n )\n }\n return safe\n}\n\nfunction normalizeRelativePath(path: string): string {\n return path.split(sep).join('/')\n}\n","const RESOURCE_EXTENSIONS = new Set([\n '7z', 'avif', 'css', 'csv', 'gif', 'gz', 'ico', 'jpeg', 'jpg', 'js', 'json', 'map',\n 'md', 'mjs', 'mp3', 'mp4', 'pdf', 'png', 'svg', 'tar', 'txt', 'wasm', 'webm',\n 'webp', 'woff', 'woff2', 'xml', 'yaml', 'yml', 'zip',\n])\n\n/** Distinguish generated documentation resources from authored page routes. */\nexport function isNativeDocumentationResourcePath(pathname: string): boolean {\n const leaf = pathname.slice(pathname.lastIndexOf('/') + 1)\n const extension = leaf.includes('.') ? leaf.slice(leaf.lastIndexOf('.') + 1).toLowerCase() : ''\n return extension !== '' && RESOURCE_EXTENSIONS.has(extension)\n}\n\n/** Encode a compiler-owned logical path without collapsing its segment boundaries. */\nexport function encodeNativeDocumentationPath(pathname: string): string {\n return pathname.split('/').map((segment) => encodeURIComponent(segment)).join('/')\n}\n\n/** Normalize one URL pathname while preserving encoded slashes as data, not separators. */\nexport function canonicalNativeDocumentationRequestPath(pathname: string): string | null {\n try {\n return pathname\n .split('/')\n .map((segment) => encodeURIComponent(decodeURIComponent(segment)))\n .join('/')\n } catch {\n return null\n }\n}\n","import { createHash } from 'node:crypto'\nimport { documentationPublicPath, markdownUrlForRoute } from './routing'\nimport { documentationSubject } from './text'\nimport type { DocumentationGraph, DocumentationNavigationNode, DocumentationPage } from './types'\n\nexport const AGENT_SKILLS_SCHEMA = 'https://schemas.agentskills.io/discovery/0.2.0/schema.json'\n\nexport interface DocumentationSkillArtifacts {\n name: string\n description: string\n markdown: string\n legacyIndex: Record<string, unknown>\n discoveryIndex: Record<string, unknown>\n}\n\n/** Build one deterministic, installable skill from the same graph as the site. */\nexport function createDocumentationSkillArtifacts(\n graph: DocumentationGraph,\n baseUrl?: string,\n basePath = '/docs',\n): DocumentationSkillArtifacts {\n const name = documentationSkillName(graph.config.name)\n const description = documentationSkillDescription(graph.config.name, graph.config.description)\n const root = baseUrl?.replace(/\\/$/, '') ?? ''\n const markdown = renderDocumentationSkill(graph, name, description, root)\n const digest = createHash('sha256').update(markdown).digest('hex')\n\n return {\n name,\n description,\n markdown,\n legacyIndex: {\n skills: [{ name, description, files: ['SKILL.md'] }],\n },\n discoveryIndex: {\n $schema: AGENT_SKILLS_SCHEMA,\n skills: [\n {\n name,\n type: 'skill-md',\n description,\n url: documentationPublicPath(basePath, `/.well-known/agent-skills/${name}/skill.md`),\n digest: `sha256:${digest}`,\n },\n ],\n },\n }\n}\n\nexport function documentationSkillName(value: string): string {\n const normalized = value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .replace(/-{2,}/g, '-')\n return normalized.slice(0, 64).replace(/-+$/g, '') || 'documentation'\n}\n\nfunction documentationSkillDescription(name: string, description?: string): string {\n const detail = description?.replace(/\\s+/g, ' ').trim()\n const value = detail\n ? `Use when answering questions, integrating, or implementing work with ${name}. ${detail}`\n : `Use when answering questions, integrating, or implementing work with ${name}.`\n return value.slice(0, 1_024).trim()\n}\n\nfunction renderDocumentationSkill(\n graph: DocumentationGraph,\n name: string,\n description: string,\n root: string,\n): string {\n const lines = [\n '---',\n `name: ${JSON.stringify(name)}`,\n `description: ${JSON.stringify(description)}`,\n 'metadata:',\n ' version: \"1.0\"',\n ` source-hash: ${JSON.stringify(graph.sourceHash)}`,\n '---',\n '',\n `# ${graph.config.name}`,\n '',\n graph.config.description ??\n `Use the published ${documentationSubject(graph.config.name)} as the source of truth.`,\n '',\n '## Grounding workflow',\n '',\n `1. Read [the documentation index](${root}/llms.txt) to discover the available pages.`,\n graph.config.mcp.access === 'public'\n ? `2. Prefer the read-only MCP server at \\`${root}/mcp\\` for ranked search and exact page reads.`\n : `2. Search the index, then open the relevant page Markdown directly.`,\n `3. Read a page's canonical Markdown before making implementation claims or quoting commands.`,\n `4. Treat this release as authoritative; do not mix instructions from another version or hostname.`,\n '',\n '## Documentation map',\n '',\n ...renderNavigation(graph.navigation, graph.pages, root),\n '## Constraints',\n '',\n '- Do not invent APIs, commands, configuration keys, or supported behavior.',\n '- Preserve security, authentication, billing, and deployment boundaries stated in the documentation.',\n '- When pages disagree, prefer the more specific page and report the conflict.',\n '- Link the exact source page in the final answer when the client supports citations.',\n '',\n ]\n return lines.join('\\n')\n}\n\nfunction renderNavigation(\n navigation: DocumentationNavigationNode[],\n pages: DocumentationPage[],\n root: string,\n): string[] {\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const lines: string[] = []\n const seen = new Set<string>()\n\n const visit = (nodes: DocumentationNavigationNode[], depth: number): void => {\n for (const node of nodes) {\n if (node.kind === 'group') {\n lines.push(`${'#'.repeat(Math.min(depth + 2, 6))} ${node.label}`, '')\n visit(node.items, depth + 1)\n continue\n }\n if (node.kind !== 'page' || seen.has(node.route)) continue\n const page = byRoute.get(node.route)\n if (!page || page.hidden) continue\n seen.add(page.route)\n const markdownRoute = markdownUrlForRoute(page.route)\n lines.push(renderPageLink(page, root, markdownRoute))\n }\n }\n\n visit(navigation, 1)\n const remaining = pages.filter((page) => !page.hidden && !seen.has(page.route))\n if (remaining.length > 0) {\n lines.push('### More', '')\n for (const page of remaining) {\n const markdownRoute = markdownUrlForRoute(page.route)\n lines.push(renderPageLink(page, root, markdownRoute))\n }\n }\n lines.push('')\n return lines\n}\n\nfunction renderPageLink(page: DocumentationPage, root: string, markdownRoute: string): string {\n return (\n `- [${page.title}](${root}${markdownRoute})` +\n `${page.description ? ` — ${page.description}` : ''}`\n )\n}\n","import { buildSync } from 'esbuild'\nimport { createRequire } from 'node:module'\nimport { runtimeEntry } from './custom-runtime'\nimport type { DocumentationRuntimeData } from './types'\n\ninterface DefaultRendererModule {\n renderDefaultDocumentation(data: DocumentationRuntimeData): string\n}\n\nlet cachedRenderer: DefaultRendererModule | undefined\n\n/**\n * Load default React SSR behind a runtime boundary. The native documentation compiler\n * and the DeepSpace CLI can be imported without evaluating React or\n * react-dom/server.\n */\nexport function renderDefaultDocumentation(data: DocumentationRuntimeData): string {\n cachedRenderer ??= loadDefaultRenderer()\n return cachedRenderer.renderDefaultDocumentation(data)\n}\n\nfunction loadDefaultRenderer(): DefaultRendererModule {\n const entry = runtimeEntry('documentation-default-renderer.cjs', 'runtime/default-renderer.tsx')\n if (entry.endsWith('.cjs')) {\n return createRequire(import.meta.url)(entry) as DefaultRendererModule\n }\n\n const result = buildSync({\n entryPoints: [entry],\n bundle: true,\n write: false,\n minify: false,\n platform: 'node',\n format: 'cjs',\n target: ['node22'],\n jsx: 'automatic',\n define: { 'process.env.NODE_ENV': '\"production\"' },\n })\n const source = result.outputFiles?.[0]?.text\n if (!source) throw new Error('Default documentation renderer did not emit JavaScript')\n\n const module = { exports: {} as DefaultRendererModule }\n const evaluate = new Function('require', 'module', 'exports', source)\n evaluate(createRequire(import.meta.url), module, module.exports)\n return module.exports\n}\n","export const DOCUMENTATION_BASE_CSS = String.raw`\n:root {\n /* The configured accent is injected as --documentation-accent-light; the\n * dark theme swaps in --documentation-accent-dark, which defaults to a\n * readable lightened derivative so a site that configures only one accent\n * never ships invisible links on the dark background. */\n --documentation-accent-light: #635bff;\n --documentation-accent-dark: color-mix(in oklab, var(--documentation-accent-light) 52%, white);\n --documentation-accent: var(--documentation-accent-light);\n /* Glyphs painted directly on the accent. Dark lightens the accent, so the\n * readable ink on it flips from white to near-black. */\n --documentation-accent-contrast: #ffffff;\n --documentation-brand-bg: #f8fafc;\n --documentation-brand-bg-dark: #0c0e14;\n --documentation-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --documentation-font-heading: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --documentation-font-mono: \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n --documentation-bg: #fbfcfe;\n --documentation-surface: #ffffff;\n --documentation-surface-raised: #ffffff;\n --documentation-panel: #f4f6fa;\n --documentation-panel-strong: #edf0f6;\n --documentation-text: #11131a;\n --documentation-text-soft: #353a47;\n --documentation-muted: #5c6270;\n --documentation-faint: #646a78;\n --documentation-border: #e4e7ed;\n --documentation-border-strong: #d7dbe4;\n --documentation-code-bg: #11131a;\n --documentation-code-panel: #171a23;\n --documentation-code-text: #e8ebf5;\n --documentation-shadow-sm: 0 1px 2px rgba(15, 18, 28, .04), 0 2px 8px rgba(15, 18, 28, .03);\n --documentation-shadow-lg: 0 24px 80px rgba(15, 18, 28, .18), 0 6px 24px rgba(15, 18, 28, .08);\n /* Honest glass: used only where content physically passes beneath a surface\n * (the launcher pill, the floating/mobile assistant panel). High-opacity\n * tint plus blur keeps the surface legible over prose, dark code, and\n * images without any protective gradient; the inset highlight is the lit\n * top edge that makes the pane read as material rather than mist. */\n --documentation-glass-bg: color-mix(in srgb, var(--documentation-surface-raised) 86%, transparent);\n --documentation-glass-border: color-mix(in srgb, var(--documentation-border-strong) 90%, var(--documentation-accent));\n --documentation-glass-highlight: rgba(255, 255, 255, .6);\n --documentation-font-size: 17px;\n --documentation-line-height: 1.65;\n --documentation-content-width: 720px;\n --documentation-reader-pad: 62px 52px 96px;\n --documentation-header-height: 66px;\n --documentation-sidebar-width: 292px;\n --documentation-assistant-width: 420px;\n /* Darkened against the light page; the dark theme lightens it instead. */\n --documentation-focus-ring: color-mix(in srgb, var(--documentation-accent) 82%, var(--documentation-text));\n color-scheme: light;\n font-family: var(--documentation-font-body);\n}\n\n:root[data-theme=\"dark\"] {\n --documentation-accent: var(--documentation-accent-dark);\n --documentation-accent-contrast: #0c0e14;\n --documentation-brand-bg: var(--documentation-brand-bg-dark);\n --documentation-bg: var(--documentation-brand-bg-dark);\n --documentation-surface: #10131b;\n --documentation-surface-raised: #151923;\n --documentation-panel: #171b25;\n --documentation-panel-strong: #1e2330;\n --documentation-text: #f2f4fa;\n --documentation-text-soft: #cbd0dc;\n --documentation-muted: #999fad;\n --documentation-faint: #808797;\n --documentation-border: #252a36;\n --documentation-border-strong: #343a49;\n --documentation-code-bg: #080a0f;\n --documentation-code-panel: #10131a;\n --documentation-code-text: #eef0f7;\n --documentation-shadow-sm: 0 1px 2px rgba(0, 0, 0, .24);\n --documentation-shadow-lg: 0 28px 90px rgba(0, 0, 0, .55), 0 8px 24px rgba(0, 0, 0, .35);\n --documentation-glass-bg: color-mix(in srgb, var(--documentation-surface-raised) 80%, transparent);\n --documentation-glass-border: color-mix(in srgb, var(--documentation-border-strong) 86%, var(--documentation-accent));\n --documentation-glass-highlight: rgba(255, 255, 255, .07);\n --documentation-focus-ring: color-mix(in srgb, var(--documentation-accent) 74%, white);\n color-scheme: dark;\n}\n\n/* theme.density, stamped by the template as data-density. Compact reworks the\n * whole reading measure through the tokens alone so no layout rule forks. */\n:root[data-density=\"compact\"] {\n --documentation-font-size: 15px;\n --documentation-line-height: 1.6;\n --documentation-content-width: 680px;\n --documentation-reader-pad: 44px 44px 80px;\n --documentation-header-height: 58px;\n --documentation-sidebar-width: 264px;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-gutter: stable; }\nbody { margin: 0; background: var(--documentation-brand-bg); color: var(--documentation-text); font-family: var(--documentation-font-body); font-size: var(--documentation-font-size); line-height: var(--documentation-line-height); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }\n:root[data-background-decoration=\"gradient\"] body { background-image: radial-gradient(circle at 58% 7%, color-mix(in srgb, var(--documentation-accent) 7%, transparent), transparent 32%); background-attachment: fixed; }\n:root[data-background-decoration=\"grid\"] body { background-image: linear-gradient(color-mix(in srgb, var(--documentation-border) 26%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--documentation-border) 26%, transparent) 1px, transparent 1px); background-attachment: fixed; background-size: 32px 32px; }\nbody:has(.documentation-modal-layer), body:has(.documentation-mobile-nav) { overflow: hidden; }\nbutton, input, textarea { font: inherit; }\nbutton, a, summary, label { -webkit-tap-highlight-color: transparent; }\na { color: inherit; }\nbutton:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--documentation-focus-ring); outline-offset: 3px; }\n::selection { background: color-mix(in srgb, var(--documentation-accent) 24%, transparent); }\n/* Chrome is an instrument, not a document: its labels never select and its\n * links never spawn the native drag ghost. The article prose, assistant\n * answers, and every input stay fully selectable. (The router's dragstart\n * chokepoint enforces the no-ghost rule in engines without -webkit-user-drag.) */\n.documentation-header, .documentation-sidebar, .documentation-mobile-nav, .documentation-outline, .documentation-outline-disclosure > summary, .documentation-breadcrumbs, .documentation-article-meta, .documentation-pagination, .documentation-search-dialog, .documentation-launcher-dock, .documentation-assistant > header, .documentation-assistant-suggestions, .documentation-assistant > footer, .documentation-tab-buttons, .documentation-code-actions, .documentation-theme-controls { user-select: none; -webkit-user-select: none; }\n.documentation-search-dialog input, .documentation-launcher-dock input, .documentation-search-results { user-select: text; -webkit-user-select: text; }\n:is(.documentation-header, .documentation-sidebar, .documentation-mobile-nav, .documentation-outline, .documentation-breadcrumbs, .documentation-article-meta, .documentation-pagination, .documentation-search-dialog) :is(a, img) { -webkit-user-drag: none; }\n\n.documentation-skip-link { position: fixed; z-index: 200; top: -64px; left: 16px; padding: 9px 13px; border-radius: 8px; background: var(--documentation-text); color: var(--documentation-bg); font-weight: 650; text-decoration: none; }\n.documentation-skip-link:focus { top: 12px; }\n/* The only navigation feedback. The article itself never animates: a route\n * swap is a hard cut committed in one frame, because any overlap of two text\n * layers — any fade, slide, or view transition — reads as ghosting. */\n.documentation-app.is-navigating::before { content: \"\"; position: fixed; z-index: 240; inset: 0 auto auto 0; width: 42%; height: 2px; background: var(--documentation-accent); animation: documentation-navigation-progress .8s ease-in-out infinite alternate; }\n\n`\n","export const DOCUMENTATION_CONTENT_CSS = String.raw`\n.documentation-main { min-width: 0; margin-left: var(--documentation-sidebar-width); margin-right: 0; transition: margin-right .24s ease; }\n.documentation-reader-grid { display: grid; grid-template-columns: minmax(0, var(--documentation-content-width)) 250px; justify-content: center; gap: 70px; width: 100%; padding: var(--documentation-reader-pad); }\n.documentation-reader-column { display: flex; min-width: 0; min-height: calc(100vh - var(--documentation-header-height) - 158px); flex-direction: column; }\n.documentation-article { display: flex; min-width: 0; flex: 1; flex-direction: column; }\n.documentation-breadcrumbs { display: none; align-items: center; gap: 5px; margin-bottom: 24px; color: var(--documentation-muted); font-size: 13px; }\n.documentation-breadcrumbs span { display: inline-flex; align-items: center; gap: 5px; }\n.documentation-breadcrumbs svg { width: 12px; height: 12px; }\n.documentation-article-header { margin-bottom: 38px; }\n.documentation-article-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 32px; margin-bottom: 7px; }\n.documentation-eyebrow { color: color-mix(in srgb, var(--documentation-accent) 76%, var(--documentation-text)); font-size: 13px; font-weight: 700; letter-spacing: .035em; }\n.documentation-contextual-actions { position: relative; display: inline-flex; flex: 0 0 auto; align-items: stretch; height: 32px; border: 1px solid var(--documentation-border); border-radius: 8px; background: color-mix(in srgb, var(--documentation-surface) 92%, transparent); box-shadow: var(--documentation-shadow-sm); }\n.documentation-contextual-actions button, .documentation-contextual-actions a, .documentation-contextual-actions summary { display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 30px; padding: 0 10px; border: 0; background: transparent; color: var(--documentation-muted); cursor: pointer; font: 590 12.5px/1 var(--documentation-font-body); text-decoration: none; white-space: nowrap; }\n.documentation-contextual-actions button:hover, .documentation-contextual-actions a:hover, .documentation-contextual-actions summary:hover { color: var(--documentation-text); }\n.documentation-contextual-actions svg { flex: 0 0 auto; width: 13px; height: 13px; }\n.documentation-contextual-actions details { position: relative; border-left: 1px solid var(--documentation-border); }\n.documentation-contextual-actions summary { width: 30px; padding: 0; justify-content: center; list-style: none; }\n.documentation-contextual-actions summary::-webkit-details-marker { display: none; }\n.documentation-contextual-actions details[open] summary { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-contextual-actions details[open] summary svg { transform: rotate(180deg); }\n.documentation-contextual-menu { position: absolute; z-index: 35; top: calc(100% + 7px); right: -1px; display: grid; width: min(344px, calc(100vw - 32px)); max-height: min(510px, calc(100vh - 120px)); overflow: auto; padding: 6px; border: 1px solid var(--documentation-border-strong); border-radius: 12px; background: var(--documentation-surface-raised); box-shadow: var(--documentation-shadow-lg); }\n.documentation-contextual-menu button, .documentation-contextual-menu a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; height: auto; min-height: 52px; padding: 7px 8px; border-radius: 8px; text-align: left; white-space: normal; }\n.documentation-contextual-menu button:hover, .documentation-contextual-menu a:hover { background: var(--documentation-panel); }\n.documentation-contextual-action-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--documentation-border); border-radius: 7px; background: var(--documentation-surface); color: var(--documentation-text-soft); }\n.documentation-contextual-action-icon svg { width: 15px; height: 15px; }\n.documentation-contextual-action-copy { display: grid; min-width: 0; gap: 2px; }\n.documentation-contextual-action-copy strong { color: var(--documentation-text); font-size: 13px; font-weight: 640; line-height: 1.25; }\n.documentation-contextual-action-copy small { color: var(--documentation-muted); font-size: 12px; font-weight: 450; line-height: 1.3; }\n.documentation-contextual-menu .documentation-contextual-action-external { width: 12px; height: 12px; color: var(--documentation-faint); }\n.documentation-article-header h1 { margin: 0; color: var(--documentation-text); font-family: var(--documentation-font-heading); font-size: clamp(34px, 3vw, 40px); font-weight: 650; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }\n.documentation-article-header h1:focus { outline: none; }\n.documentation-lede { max-width: 680px; margin: 14px 0 0; color: var(--documentation-text-soft); font-size: 19px; letter-spacing: -.01em; line-height: 1.55; }\n\n.documentation-prose { color: var(--documentation-text-soft); }\n.documentation-prose > :first-child { margin-top: 0; }\n/* Anchor clearance is owned once, by scroll-padding-top on the html element\n * — a per-heading scroll-margin here stacked with it and landed anchors a\n * full header-height too low. */\n.documentation-prose h1, .documentation-prose h2, .documentation-prose h3, .documentation-prose h4, .documentation-prose h5, .documentation-prose h6 { position: relative; color: var(--documentation-text); font-family: var(--documentation-font-heading); }\n.documentation-prose h1 { margin: 48px 0 18px; font-size: 30px; letter-spacing: -.025em; line-height: 1.2; }\n.documentation-prose h2 { margin: 50px 0 16px; padding-top: 5px; font-size: 25px; font-weight: 625; letter-spacing: -.025em; line-height: 1.28; }\n.documentation-prose h3 { margin: 34px 0 12px; font-size: 20px; font-weight: 620; letter-spacing: -.015em; line-height: 1.4; }\n.documentation-prose h4 { margin: 28px 0 10px; font-size: 17px; font-weight: 620; }\n/* Parked in the gutter so revealing it on hover never reflows the heading. The\n * bare class selector loses to the prose link rule, hence the descendant form. */\n.documentation-prose .documentation-heading-anchor { position: absolute; top: 0; left: -.82em; display: flex; align-items: center; height: 100%; padding-right: .25em; color: var(--documentation-faint); font-size: .8em; font-weight: 500; opacity: 0; text-decoration: none; transition: opacity .12s; }\n.documentation-prose :is(h1, h2, h3, h4, h5, h6):hover .documentation-heading-anchor, .documentation-prose .documentation-heading-anchor:focus-visible { opacity: 1; }\n.documentation-prose p { margin: 0 0 20px; }\n.documentation-prose ul, .documentation-prose ol { margin: 0 0 22px; padding-left: 26px; }\n.documentation-prose li { margin: 6px 0; padding-left: 3px; }\n.documentation-prose li::marker { color: var(--documentation-faint); }\n.documentation-prose strong { color: var(--documentation-text); font-weight: 610; }\n.documentation-prose a { color: color-mix(in srgb, var(--documentation-accent) 78%, var(--documentation-text)); font-weight: 560; text-decoration-color: color-mix(in srgb, var(--documentation-accent) 38%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.documentation-prose a:hover { text-decoration-color: currentColor; }\n.documentation-prose img { display: block; max-width: 100%; height: auto; margin: 26px 0; border: 1px solid var(--documentation-border); border-radius: 12px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); }\n.documentation-prose blockquote { margin: 25px 0; padding: 4px 0 4px 18px; border-left: 2px solid color-mix(in srgb, var(--documentation-accent) 45%, var(--documentation-border)); color: var(--documentation-muted); }\n.documentation-prose blockquote p:last-child { margin-bottom: 0; }\n.documentation-prose hr { margin: 44px 0; border: 0; border-top: 1px solid var(--documentation-border); }\n.documentation-prose :not(pre) > code, .documentation-assistant-message code { padding: 2px 6px; border-radius: 6px; background: var(--documentation-panel); color: var(--documentation-text); font: 520 .86em/1.4 var(--documentation-font-mono); overflow-wrap: anywhere; }\n.documentation-code-block { position: relative; margin: 24px 0; }\n.documentation-prose .documentation-code-block pre { margin: 0; }\n.documentation-prose pre { position: relative; overflow: auto; margin: 24px 0; padding: 20px; border: 1px solid color-mix(in srgb, var(--documentation-border-strong) 50%, #000); border-radius: 12px; background: linear-gradient(145deg, var(--documentation-code-panel), var(--documentation-code-bg)); color: var(--documentation-code-text); box-shadow: 0 12px 34px rgba(7, 9, 14, .12); font: 14px/1.65 var(--documentation-font-mono); tab-size: 2; }\n.documentation-prose pre code { display: block; min-width: max-content; background: transparent; }\n/* Actions overlay the code rather than floating inside its text flow, so no line\n * needs padding reserved for them and horizontal scrolling stays exact. */\n.documentation-code-actions { position: absolute; z-index: 2; top: 10px; right: 10px; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .14s; }\n.documentation-code-block:hover .documentation-code-actions, .documentation-code-actions:focus-within { opacity: 1; }\n.documentation-code-actions button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: color-mix(in srgb, var(--documentation-code-panel) 88%, transparent); color: #aeb5c6; cursor: pointer; backdrop-filter: blur(6px); }\n.documentation-code-actions button:hover { background: rgba(255, 255, 255, .14); color: #fff; }\n.documentation-code-actions svg { width: 15px; height: 15px; }\n/* The language rides in the hover actions row as a passive chip instead of a\n * permanently visible label that cost every block 38px of top padding. */\n.documentation-code-language { display: inline-flex; align-items: center; height: 30px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: color-mix(in srgb, var(--documentation-code-panel) 88%, transparent); color: #7f889c; font: 650 11px/1 var(--documentation-font-mono); letter-spacing: .06em; text-transform: uppercase; pointer-events: none; backdrop-filter: blur(6px); }\n/* Fence titles (filenames) get a slim header bar above the code. */\n.documentation-code-title { display: flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--documentation-border-strong) 50%, #000); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--documentation-code-panel); color: #aeb5c6; font: 600 12px/1.3 var(--documentation-font-mono); }\n.documentation-code-block:has(.documentation-code-title) pre { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }\n\n.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link { color: #b7a7ff; }\n.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition { color: #73dfb4; }\n.hljs-number, .hljs-meta, .hljs-built_in, .hljs-builtin-name, .hljs-params { color: #f0b96b; }\n.hljs-comment, .hljs-quote, .hljs-deletion { color: #767f93; font-style: italic; }\n.hljs-variable, .hljs-template-variable, .hljs-regexp { color: #ff95b4; }\n\n/* Light code blocks re-tint every token group above; a partial override would\n * leave the dark palette's colors on a near-white background. */\n:root[data-code-mode=\"system\"][data-theme=\"light\"] {\n --documentation-code-plain: #252936;\n --documentation-code-keyword: #6f42c1;\n --documentation-code-string: #0a7d55;\n --documentation-code-number: #8a4b00;\n --documentation-code-comment: #636a78;\n --documentation-code-variable: #b3246b;\n}\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-prose pre { border-color: var(--documentation-border); background: linear-gradient(145deg, #f7f8fb, #f1f3f7); color: var(--documentation-code-plain); box-shadow: 0 8px 26px rgba(15, 18, 28, .06); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-actions button { border-color: rgba(17, 19, 26, .12); background: rgba(255, 255, 255, .82); color: #606675; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-actions button:hover { background: #fff; color: #11131a; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-language { border-color: rgba(17, 19, 26, .12); background: rgba(255, 255, 255, .82); color: #757c8c; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-title { border-color: var(--documentation-border); background: #eef1f6; color: #5c6270; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link) { color: var(--documentation-code-keyword); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition) { color: var(--documentation-code-string); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-number, .hljs-meta, .hljs-built_in, .hljs-builtin-name, .hljs-params) { color: var(--documentation-code-number); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-comment, .hljs-quote, .hljs-deletion) { color: var(--documentation-code-comment); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-variable, .hljs-template-variable, .hljs-regexp) { color: var(--documentation-code-variable); }\n\n.documentation-prose table { display: block; width: 100%; overflow: auto; margin: 25px 0 29px; border: 1px solid var(--documentation-border); border-radius: 10px; border-collapse: separate; border-spacing: 0; background: var(--documentation-surface); font-size: 15px; }\n.documentation-prose thead { background: var(--documentation-panel); }\n.documentation-prose th, .documentation-prose td { min-width: 130px; padding: 11px 14px; border-right: 1px solid var(--documentation-border); border-bottom: 1px solid var(--documentation-border); text-align: left; vertical-align: top; }\n.documentation-prose th:last-child, .documentation-prose td:last-child { border-right: 0; }\n.documentation-prose tr:last-child td { border-bottom: 0; }\n.documentation-prose th { color: var(--documentation-text); font-size: 13px; font-weight: 700; letter-spacing: .02em; }\n\n.documentation-callout { --callout-accent: var(--documentation-accent); position: relative; margin: 24px 0; padding: 16px 18px 16px 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--callout-accent) 25%, var(--documentation-border)); border-radius: 11px; background: color-mix(in srgb, var(--callout-accent) 6%, var(--documentation-surface)); }\n.documentation-callout::before { content: \"\"; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--callout-accent); }\n.documentation-callout > strong { display: block; margin-bottom: 3px; color: color-mix(in srgb, var(--callout-accent) 72%, var(--documentation-text)); font-size: 14px; }\n.documentation-callout > :last-child { margin-bottom: 0; }\n.documentation-callout-warning { --callout-accent: #c9771a; }\n.documentation-callout-tip { --callout-accent: #17a673; }\n.documentation-callout-info { --callout-accent: #278fdb; }\n.documentation-callout-note { --callout-accent: var(--documentation-accent); }\n/* Card bodies are body copy, not links — without this the anchor's link color\n * bleeds into every description. */\n.documentation-card { color: var(--documentation-text-soft); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 14px 0; padding: 16px 17px; border: 1px solid var(--documentation-border); border-radius: 11px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); text-decoration: none !important; transition: border-color .16s, box-shadow .16s, transform .16s; }\n.documentation-card:hover { border-color: color-mix(in srgb, var(--documentation-accent) 42%, var(--documentation-border)); box-shadow: 0 7px 24px rgba(15, 18, 28, .07); transform: translateY(-1px); }\n.documentation-card strong { display: block; margin-bottom: 2px; }\n.documentation-accordion-group { margin: 21px 0; border: 1px solid var(--documentation-border); border-radius: 11px; overflow: hidden; }\n.documentation-accordion-group .documentation-accordion { margin: 0; border: 0; border-bottom: 1px solid var(--documentation-border); border-radius: 0; }\n.documentation-accordion-group .documentation-accordion:last-child { border-bottom: 0; }\n.documentation-accordion { margin: 14px 0; padding: 0 16px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); }\n.documentation-accordion summary { padding: 14px 25px 14px 0; color: var(--documentation-text); cursor: pointer; font-weight: 650; list-style: none; }\n.documentation-accordion summary::-webkit-details-marker { display: none; }\n.documentation-accordion summary::after { content: \"+\"; float: right; margin-right: -20px; color: var(--documentation-faint); font-size: 18px; font-weight: 400; line-height: 1; }\n.documentation-accordion[open] summary::after { content: \"−\"; }\n.documentation-accordion > :last-child { margin-bottom: 15px; }\n.documentation-steps { margin: 25px 0; counter-reset: documentation-step; }\n.documentation-step { position: relative; margin-left: 13px; padding: 0 0 29px 34px; border-left: 1px solid var(--documentation-border-strong); counter-increment: documentation-step; }\n.documentation-step:last-child { padding-bottom: 3px; border-color: transparent; }\n.documentation-step::before { content: counter(documentation-step); position: absolute; left: -14px; top: -1px; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid color-mix(in srgb, var(--documentation-accent) 46%, var(--documentation-border)); border-radius: 50%; background: var(--documentation-surface); color: color-mix(in srgb, var(--documentation-accent) 78%, var(--documentation-text)); box-shadow: 0 0 0 5px var(--documentation-bg); font-size: 11px; font-weight: 740; }\n.documentation-step h3 { margin-top: 0; }\n.documentation-tabs { margin: 23px 0; overflow: hidden; border: 1px solid var(--documentation-border); border-radius: 11px; background: var(--documentation-surface); }\n.documentation-tab-buttons { display: flex; gap: 2px; overflow-x: auto; padding: 6px; border-bottom: 1px solid var(--documentation-border); background: var(--documentation-panel); }\n.documentation-tab-buttons button { flex: 0 0 auto; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--documentation-muted); cursor: pointer; font-size: 13.5px; font-weight: 620; }\n.documentation-tab-buttons button[aria-selected=\"true\"] { background: var(--documentation-surface); color: var(--documentation-text); box-shadow: var(--documentation-shadow-sm); }\n.documentation-tab { padding: 16px 18px 2px; }\n.documentation-tab > :first-child { margin-top: 0; }\n.documentation-code-group { margin: 23px 0; overflow: hidden; border: 1px solid var(--documentation-border-strong); border-radius: 12px; background: var(--documentation-surface); }\n.documentation-code-group-title { padding: 8px 13px; border-bottom: 1px solid var(--documentation-border); background: var(--documentation-panel); color: var(--documentation-muted); font-size: 12px; font-weight: 650; }\n.documentation-code-group .documentation-tab-buttons { border-color: color-mix(in srgb, var(--documentation-border) 72%, transparent); background: var(--documentation-panel); }\n.documentation-code-tab { padding: 0; }\n.documentation-code-group .documentation-code-block { margin: 0; }\n.documentation-prose .documentation-code-group pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; }\n\n.documentation-api-badge { display: flex; align-items: center; gap: 9px; margin: 0 0 25px; padding: 11px 13px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-panel); }\n.method { display: inline-grid; place-items: center; min-width: 52px; padding: 4px 7px; border-radius: 6px; background: #3178e8; color: white; font: 750 10px/1.3 var(--documentation-font-mono); letter-spacing: .035em; }\n.method-post { background: #138b5b; }\n.method-put, .method-patch { background: #bd7215; }\n.method-delete { background: #cd464d; }\n.documentation-playground { margin: 48px 0 30px; padding: 20px; border: 1px solid var(--documentation-border); border-radius: 12px; background: var(--documentation-panel); }\n.documentation-playground-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n.documentation-playground-title > div { display: flex; align-items: center; gap: 9px; }\n.documentation-playground-title code { overflow: hidden; color: var(--documentation-muted); font: 11px var(--documentation-font-mono); text-overflow: ellipsis; white-space: nowrap; }\n.documentation-playground > p { color: var(--documentation-muted); font-size: 12px; }\n.documentation-playground label { display: grid; gap: 5px; margin: 13px 0; color: var(--documentation-muted); font-size: 11px; font-weight: 650; }\n.documentation-playground input, .documentation-playground textarea { width: 100%; padding: 10px; border: 1px solid var(--documentation-border-strong); border-radius: 8px; background: var(--documentation-surface); color: var(--documentation-text); font: 12.5px/1.55 var(--documentation-font-mono); resize: vertical; }\n.documentation-playground > button { padding: 9px 13px; border: 0; border-radius: 8px; background: var(--documentation-accent); color: var(--documentation-accent-contrast); cursor: pointer; font-size: 12px; font-weight: 680; }\n.documentation-playground > button:disabled { opacity: .58; cursor: wait; }\n.documentation-playground > pre { max-height: 320px; overflow: auto; margin: 14px 0 0; padding: 13px; border-radius: 8px; background: var(--documentation-code-bg); color: var(--documentation-code-text); font: 11.5px/1.55 var(--documentation-font-mono); white-space: pre-wrap; }\n\n.documentation-context-rail { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding-left: 18px; }\n.documentation-outline { display: grid; gap: 2px; }\n.documentation-outline h2 { margin: 0 0 9px; color: var(--documentation-text); font-size: 13.5px; font-weight: 650; }\n.documentation-outline a { padding: 5px 0; color: var(--documentation-muted); font-size: 13.5px; line-height: 1.45; text-decoration: none; transition: color .12s; }\n.documentation-outline a:hover, .documentation-outline a.is-active { color: var(--documentation-text); }\n.documentation-outline a.is-active { color: color-mix(in srgb, var(--documentation-accent) 74%, var(--documentation-text)); font-weight: 640; }\n.documentation-outline a.depth-3 { padding-left: 13px; }\n/* The outline for viewports that have no room for the sticky rail. */\n.documentation-outline-disclosure { display: none; margin: 0 0 32px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); }\n.documentation-outline-disclosure > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--documentation-text); cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }\n.documentation-outline-disclosure > summary::-webkit-details-marker { display: none; }\n.documentation-outline-disclosure > summary svg { width: 15px; height: 15px; color: var(--documentation-muted); }\n.documentation-outline-disclosure .documentation-outline { padding: 0 14px 12px; }\n.documentation-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: auto; padding-top: 28px; }\n.documentation-pagination a { display: flex; flex-direction: column; min-height: 86px; padding: 14px 16px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); text-decoration: none; transition: border-color .15s, transform .15s; }\n.documentation-pagination a:hover { border-color: color-mix(in srgb, var(--documentation-accent) 38%, var(--documentation-border)); transform: translateY(-1px); }\n.documentation-pagination a:last-child { text-align: right; }\n.documentation-pagination small { margin-bottom: 7px; color: var(--documentation-faint); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }\n.documentation-pagination span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--documentation-text); font-size: 15px; font-weight: 650; }\n.documentation-pagination a:last-child span { justify-content: flex-end; }\n.documentation-pagination svg { flex: 0 0 auto; width: 15px; }\n.documentation-pagination svg.is-back { transform: rotate(180deg); }\n\n`\n","export const DOCUMENTATION_NAVIGATION_CSS = String.raw`\n.documentation-header { position: fixed; z-index: 50; inset: 0 0 auto; display: grid; grid-template-columns: var(--documentation-sidebar-width) minmax(300px, 1fr) auto; align-items: center; height: var(--documentation-header-height); border-bottom: 1px solid color-mix(in srgb, var(--documentation-border) 84%, transparent); background: color-mix(in srgb, var(--documentation-bg) 91%, transparent); backdrop-filter: blur(18px) saturate(1.15); transition: right .24s ease; }\n.documentation-brand { display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; padding: 0 23px; color: var(--documentation-text); text-decoration: none; }\n.documentation-brand-mark { position: relative; display: grid; place-items: center; width: 27px; height: 27px; color: var(--documentation-accent); }\n.documentation-brand-mark svg { position: relative; width: 27px; height: 27px; }\n.documentation-brand-name { overflow: hidden; font-size: 16px; font-weight: 720; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-brand-product { padding-left: 10px; border-left: 1px solid var(--documentation-border-strong); color: var(--documentation-muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; }\n.documentation-brand-logo { max-width: 145px; max-height: 26px; object-fit: contain; object-position: left center; }\n.documentation-brand-logo-dark { display: none; }\n:root[data-theme=\"dark\"] .documentation-brand-logo-light { display: none; }\n:root[data-theme=\"dark\"] .documentation-brand-logo-dark { display: block; }\n\n.documentation-header-center { display: flex; align-items: center; justify-content: center; padding: 0 20px; }\n.documentation-search-trigger { display: flex; align-items: center; width: min(380px, 38vw); height: 38px; gap: 9px; padding: 0 10px 0 12px; font-size: 14px; border: 1px solid var(--documentation-border); border-radius: 10px; background: color-mix(in srgb, var(--documentation-surface) 88%, transparent); color: var(--documentation-muted); box-shadow: var(--documentation-shadow-sm); cursor: pointer; text-align: left; transition: border-color .15s, color .15s, transform .15s; }\n.documentation-search-trigger:hover { border-color: var(--documentation-border-strong); color: var(--documentation-text); transform: translateY(-1px); }\n.documentation-search-trigger > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-trigger svg { width: 16px; }\n.documentation-search-trigger kbd { padding: 2px 6px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 12px/1.3 var(--documentation-font-mono); }\n\n.documentation-top-links { display: flex; align-items: center; gap: 18px; height: 100%; padding: 0 24px 0 10px; }\n.documentation-top-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--documentation-muted); font-size: 14px; font-weight: 560; text-decoration: none; white-space: nowrap; }\n.documentation-top-links a:hover { color: var(--documentation-text); }\n.documentation-top-links svg { width: 12px; height: 12px; }\n.documentation-mobile-actions { display: none; align-items: center; gap: 3px; padding-right: 12px; }\n.documentation-icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--documentation-muted); cursor: pointer; }\n.documentation-icon-button:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n\n.documentation-frame { min-height: 100vh; padding-top: var(--documentation-header-height); }\n.documentation-sidebar { position: fixed; z-index: 30; inset: var(--documentation-header-height) auto 0 0; display: flex; flex-direction: column; width: var(--documentation-sidebar-width); border-right: 1px solid var(--documentation-border); background: var(--documentation-bg); }\n.documentation-page-tree { flex: 1; overflow: auto; padding: 26px 18px 36px 22px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--documentation-border-strong) transparent; }\n.documentation-nav-section { margin: 0 0 25px; }\n.documentation-nav-section > h2 { margin: 0 0 8px; padding: 0 9px; color: var(--documentation-text); font-size: 14px; font-weight: 650; }\n.documentation-nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; margin: 1px 0; padding: 6px 9px; border-radius: 8px; color: var(--documentation-muted); font-size: 14px; line-height: 1.4; text-decoration: none; transition: background .12s, color .12s; }\n.documentation-nav-link > span { min-width: 0; overflow-wrap: anywhere; }\n.documentation-nav-link > svg { flex: 0 0 auto; width: 12px; height: 12px; }\n.documentation-nav-link:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n/* Paper, not neon: the active state is a flat tint and a solid hairline —\n * no gradients, no glow. */\n.documentation-nav-link.is-active { position: relative; background: color-mix(in srgb, var(--documentation-accent) 10%, transparent); color: color-mix(in srgb, var(--documentation-accent) 72%, var(--documentation-text)); font-weight: 650; }\n.documentation-nav-link.is-active::before { content: \"\"; position: absolute; inset: 8px auto 8px -5px; width: 2px; border-radius: 4px; background: var(--documentation-accent); }\n.documentation-nav-folder { margin: 2px 0; }\n.documentation-nav-folder > summary { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 6px 9px; border-radius: 8px; color: var(--documentation-muted); cursor: pointer; font-size: 14px; font-weight: 620; list-style: none; }\n.documentation-nav-folder > summary::-webkit-details-marker { display: none; }\n.documentation-nav-folder > summary:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-nav-folder > summary svg { width: 13px; transition: transform .16s; }\n.documentation-nav-folder:not([open]) > summary svg { transform: rotate(-90deg); }\n.documentation-nav-folder > div { margin-left: 8px; padding-left: 9px; border-left: 1px solid var(--documentation-border); }\n\n.documentation-sidebar-footer { flex: 0 0 auto; display: grid; gap: 11px; padding: 13px 20px 16px 22px; border-top: 1px solid var(--documentation-border); background: color-mix(in srgb, var(--documentation-panel) 46%, var(--documentation-bg)); }\n.documentation-sidebar-footer > nav { display: flex; flex-wrap: wrap; gap: 8px 13px; }\n.documentation-sidebar-footer a, .documentation-sidebar-footer > span { color: var(--documentation-faint); font-size: 12px; text-decoration: none; }\n.documentation-sidebar-footer a:hover { color: var(--documentation-text); }\n.documentation-theme-controls { display: inline-flex; width: max-content; gap: 2px; padding: 2px; border: 1px solid var(--documentation-border); border-radius: 9px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); }\n.documentation-theme-controls button { display: grid; place-items: center; width: 28px; height: 25px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--documentation-faint); cursor: pointer; }\n.documentation-theme-controls button:hover { color: var(--documentation-text); }\n.documentation-theme-controls button[aria-pressed=\"true\"] { background: var(--documentation-panel-strong); color: var(--documentation-text); }\n.documentation-theme-controls svg { width: 14px; height: 14px; }\n\n`\n","export const DOCUMENTATION_OVERLAYS_CSS = String.raw`\n.documentation-modal-layer { position: fixed; z-index: 100; inset: 0; display: flex; background: rgba(9, 11, 17, .48); backdrop-filter: blur(5px); animation: documentation-fade-in .14s ease-out; }\n.documentation-search-layer { align-items: flex-start; justify-content: center; padding: min(12vh, 100px) 16px 16px; }\n.documentation-search-dialog { width: min(680px, 100%); overflow: hidden; border: 1px solid var(--documentation-border-strong); border-radius: 14px; background: var(--documentation-surface-raised); box-shadow: var(--documentation-shadow-lg); animation: documentation-dialog-in .18s ease-out; }\n.documentation-search-input { display: flex; align-items: center; gap: 11px; height: 56px; padding: 0 15px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-search-input > svg { flex: 0 0 auto; width: 18px; color: var(--documentation-muted); }\n.documentation-search-input input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 16px; }\n.documentation-search-input input::placeholder { color: var(--documentation-faint); }\n.documentation-search-input kbd, .documentation-search-dialog footer kbd { padding: 2px 6px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 11px/1.4 var(--documentation-font-mono); }\n.documentation-search-results { min-height: 180px; max-height: min(56vh, 500px); overflow: auto; padding: 7px; }\n.documentation-search-empty { display: grid; place-items: center; min-height: 180px; padding: 25px; color: var(--documentation-muted); text-align: center; }\n.documentation-search-empty svg { width: 29px; height: 29px; margin-bottom: 8px; color: var(--documentation-accent); }\n.documentation-search-empty strong { color: var(--documentation-text); font-size: 15px; }\n.documentation-search-empty span { font-size: 13px; }\n.documentation-search-state { padding: 28px 16px; color: var(--documentation-muted); font-size: 14px; text-align: center; }\n.documentation-search-result, .documentation-search-assistant { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--documentation-text); cursor: pointer; text-align: left; text-decoration: none; }\n.documentation-search-result.is-active, .documentation-search-assistant.is-active { background: var(--documentation-panel); }\n.documentation-search-copy, .documentation-search-assistant > span { min-width: 0; flex: 1; display: grid; gap: 2px; }\n.documentation-search-copy strong, .documentation-search-assistant strong { overflow: hidden; font-size: 15px; font-weight: 660; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-copy small, .documentation-search-assistant small { overflow: hidden; color: var(--documentation-muted); font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-crumbs { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--documentation-muted); font-size: 13px; line-height: 1.45; white-space: nowrap; }\n.documentation-search-crumbs svg { flex: 0 0 auto; width: 11px; height: 11px; color: var(--documentation-faint); }\n.documentation-search-kind { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--documentation-panel); color: var(--documentation-muted); }\n.documentation-search-kind svg { width: 14px; height: 14px; }\n.documentation-search-result > svg, .documentation-search-assistant > svg:last-child { flex: 0 0 auto; width: 14px; color: var(--documentation-faint); }\n.documentation-search-assistant { border-top: 1px solid var(--documentation-border); border-radius: 0 0 9px 9px; color: color-mix(in srgb, var(--documentation-accent) 76%, var(--documentation-text)); }\n.documentation-search-assistant > svg:first-child { flex: 0 0 auto; width: 19px; }\n.documentation-search-result mark { border-radius: 3px; background: color-mix(in srgb, var(--documentation-accent) 18%, transparent); color: inherit; font-weight: 700; }\n.documentation-search-dialog > footer { display: flex; gap: 17px; padding: 9px 14px; border-top: 1px solid var(--documentation-border); background: var(--documentation-panel); color: var(--documentation-faint); font-size: 12px; }\n.documentation-search-dialog > footer span { display: flex; align-items: center; gap: 3px; }\n\n.documentation-mobile-nav { display: flex; flex-direction: column; width: min(342px, 88vw); height: 100%; border-right: 1px solid var(--documentation-border); background: var(--documentation-bg); box-shadow: var(--documentation-shadow-lg); animation: documentation-drawer-in .2s ease-out; }\n.documentation-mobile-nav > header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-mobile-nav > header .documentation-brand { border: 0; padding-left: 20px; }\n.documentation-mobile-nav > header .documentation-icon-button { margin-right: 12px; }\n.documentation-mobile-nav > .documentation-page-tree { padding-top: 22px; }\n.documentation-mobile-nav > footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; padding: 13px 18px; border-top: 1px solid var(--documentation-border); }\n.documentation-mobile-nav > footer a { color: var(--documentation-muted); font-size: 13px; text-decoration: none; }\n\n/* The launcher owns a reserved slot in the reading column: sticky at the\n * viewport bottom while reading, ordinary flow above the pagination once the\n * end of the article arrives. It is present on the whole page — no auto-hide,\n * no protective gradient, no mask. The pill's own glass is its legibility\n * over prose, dark code, and images, and its in-flow slot means it never\n * crosses the pagination. */\n.documentation-launcher-dock { position: sticky; z-index: 40; bottom: 0; display: flex; justify-content: center; margin-top: auto; padding: 30px 0 18px; pointer-events: none; }\n.documentation-launcher-dock + .documentation-pagination { margin-top: 0; }\n.documentation-assistant-launcher { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0; width: min(452px, 100%); min-height: 48px; padding: 5px; border: 1px solid var(--documentation-glass-border); border-radius: 15px; background: var(--documentation-glass-bg); color: var(--documentation-text); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 16px 40px rgba(15, 18, 28, .12), 0 2px 8px rgba(15, 18, 28, .05); pointer-events: auto; backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); transition: border-color .16s, box-shadow .16s, transform .22s cubic-bezier(.4, 0, .2, 1); }\n.documentation-assistant-launcher:hover { border-color: color-mix(in srgb, var(--documentation-accent) 32%, var(--documentation-border-strong)); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 20px 48px rgba(15, 18, 28, .15), 0 2px 8px rgba(15, 18, 28, .06); transform: translateY(-1px); }\n.documentation-assistant-launcher:focus-within { border-color: color-mix(in srgb, var(--documentation-accent) 48%, var(--documentation-border-strong)); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 10%, transparent), 0 16px 40px rgba(15, 18, 28, .12); }\n.documentation-assistant-launcher input { min-width: 0; height: 36px; padding: 0 6px 0 14px; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 14px; }\n.documentation-assistant-launcher input::placeholder { color: var(--documentation-muted); }\n/* The 40% cap lives on the grid track: a percentage max-width here would\n * resolve against that track instead of the launcher. */\n.documentation-launcher-hint { display: grid; grid-auto-flow: column; gap: 3px; padding-right: 8px; }\n.documentation-launcher-hint kbd { padding: 2px 5px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 11px/1.3 var(--documentation-font-mono); }\n/* One send-button spec for the launcher and the composer: a circular accent\n * button with a gentle press cycle, dim while empty. */\n.documentation-launcher-send, .documentation-assistant-composer > button { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: var(--documentation-accent); color: var(--documentation-accent-contrast); cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }\n.documentation-launcher-send { width: 36px; height: 36px; }\n.documentation-launcher-send:hover:not(:disabled), .documentation-assistant-composer > button:hover:not(:disabled) { transform: scale(1.06); }\n.documentation-launcher-send:active:not(:disabled), .documentation-assistant-composer > button:active:not(:disabled) { transform: scale(.96); }\n.documentation-launcher-send:disabled, .documentation-assistant-composer > button:disabled { background: var(--documentation-panel-strong); color: var(--documentation-faint); cursor: default; }\n.documentation-launcher-send svg, .documentation-assistant-composer > button svg { width: 14px; height: 14px; }\n/* Docked beside the article on desktop so the page being asked about stays\n * readable; the narrow breakpoints below restore the floating card and sheet. */\n.documentation-assistant { position: fixed; z-index: 90; inset: var(--documentation-header-height) 0 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: var(--documentation-assistant-width); overflow: hidden; border-left: 1px solid var(--documentation-border-strong); background: var(--documentation-surface); box-shadow: -18px 0 48px rgba(15, 18, 28, .06); animation: documentation-assistant-dock-in .2s ease-out; }\n.documentation-app.is-assistant-open .documentation-main { margin-right: var(--documentation-assistant-width); }\n.documentation-app.is-assistant-open .documentation-header { right: var(--documentation-assistant-width); }\n.documentation-assistant > header { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 11px 0 18px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-assistant > header > div { display: flex; align-items: center; }\n.documentation-assistant > header > div > span { display: grid; gap: 1px; }\n.documentation-assistant > header strong { font-size: 14px; font-weight: 620; letter-spacing: -.01em; }\n.documentation-assistant > header small { color: var(--documentation-muted); font-size: 12px; }\n.documentation-assistant > header button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--documentation-muted); cursor: pointer; }\n.documentation-assistant > header button:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant > header button:focus-visible { outline-width: 1px; outline-offset: 1px; }\n.documentation-assistant > header button svg { width: 15px; height: 15px; }\n.documentation-assistant-messages { overflow: auto; padding: 20px 20px 14px; overscroll-behavior: contain; }\n.documentation-assistant-message { display: flex; align-items: flex-start; margin: 0 0 20px; color: var(--documentation-text-soft); font-size: 14.5px; line-height: 1.62; }\n.documentation-assistant-message > div { min-width: 0; max-width: 590px; }\n.documentation-assistant-message.is-user { justify-content: flex-end; margin-left: 54px; }\n.documentation-assistant-message.is-user > div { padding: 8px 11px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant-message.is-error > div { padding: 10px 13px; border: 1px solid color-mix(in srgb, #d05a60 32%, var(--documentation-border)); border-radius: 10px; background: color-mix(in srgb, #d05a60 7%, var(--documentation-surface)); color: color-mix(in srgb, #d05a60 58%, var(--documentation-text)); font-size: 13.5px; }\n.documentation-assistant-message a { color: color-mix(in srgb, var(--documentation-accent) 79%, var(--documentation-text)); font-weight: 580; text-underline-offset: 3px; }\n.documentation-assistant-markdown > :first-child { margin-top: 0; }\n.documentation-assistant-markdown > :last-child { margin-bottom: 0; }\n.documentation-assistant-markdown p { margin: 0 0 11px; }\n.documentation-assistant-markdown ul, .documentation-assistant-markdown ol { margin: 0 0 12px; padding-left: 20px; }\n.documentation-assistant-markdown li { margin: 3px 0; }\n.documentation-assistant-heading { display: block; margin: 15px 0 6px; color: var(--documentation-text); font-family: var(--documentation-font-heading); font-size: 14.5px; }\n.documentation-assistant-code { overflow: hidden; margin: 12px 0; border: 1px solid var(--documentation-border-strong); border-radius: 10px; background: var(--documentation-code-bg); color: var(--documentation-code-text); }\n.documentation-assistant-code figcaption { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 8px 0 12px; border-bottom: 1px solid rgba(255,255,255,.09); background: var(--documentation-code-panel); color: #aeb5c6; font: 600 12px/1.3 var(--documentation-font-mono); }\n.documentation-assistant-code button { padding: 4px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; background: rgba(255,255,255,.06); color: inherit; cursor: pointer; font-size: 12px; }\n.documentation-assistant-code pre { overflow: auto; margin: 0; padding: 13px; font: 13px/1.6 var(--documentation-font-mono); }\n.documentation-assistant-code code { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; white-space: pre; }\n.documentation-assistant-activity { display: inline-flex; align-items: center; gap: 8px; color: var(--documentation-muted); font-size: 13px; }\n.documentation-assistant-activity > span { width: 6px; height: 6px; border-radius: 50%; background: var(--documentation-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 10%, transparent); animation: documentation-activity 1.25s ease-in-out infinite; }\n.documentation-assistant-suggestions { display: grid; gap: 7px; margin-top: 26px; }\n.documentation-assistant-suggestions p { margin: 0 0 1px; color: var(--documentation-faint); font-size: 12px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }\n.documentation-assistant-suggestions button { min-height: 40px; padding: 9px 12px; border: 1px solid var(--documentation-border); border-radius: 9px; background: var(--documentation-bg); color: var(--documentation-muted); cursor: pointer; font-size: 13.5px; text-align: left; transition: border-color .14s, background .14s, color .14s; }\n.documentation-assistant-suggestions button:hover { border-color: var(--documentation-border-strong); background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant-composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 16px 10px; padding: 8px; border: 1px solid var(--documentation-border-strong); border-radius: 16px; background: var(--documentation-surface-raised); box-shadow: 0 3px 12px rgba(15, 18, 28, .045); transition: border-color .15s ease, box-shadow .15s ease; }\n.documentation-assistant-composer:focus-within { border-color: color-mix(in srgb, var(--documentation-accent) 52%, var(--documentation-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 9%, transparent); }\n/* The field grows with its content (the runtime sets the height); it never\n * shows a scrollbar until the growth cap, and never clips a glyph. */\n.documentation-assistant-composer textarea { min-height: 24px; max-height: 160px; flex: 1; padding: 5px 6px; resize: none; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 14px; line-height: 1.5; overflow-y: hidden; scrollbar-width: thin; }\n.documentation-assistant > footer { padding: 0 18px 12px; color: var(--documentation-faint); font-size: 12px; text-align: center; }\n@keyframes documentation-fade-in { from { opacity: 0; } }\n@keyframes documentation-dialog-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } }\n@keyframes documentation-drawer-in { from { transform: translateX(-24px); } }\n@keyframes documentation-assistant-dock-in { from { transform: translateX(24px); opacity: .5; } }\n@keyframes documentation-assistant-in { from { transform: translateX(-50%) translateY(18px) scale(.985); opacity: .7; } }\n@keyframes documentation-activity { 50% { opacity: .42; transform: scale(.82); } }\n@keyframes documentation-navigation-progress { from { transform: translateX(-20%); } to { transform: translateX(155%); } }\n\n`\n","export const DOCUMENTATION_RESPONSIVE_CSS = String.raw`\n@media (max-width: 1320px) {\n .documentation-reader-grid { grid-template-columns: minmax(0, 680px) 224px; gap: 48px; padding-inline: 70px; }\n .documentation-top-links { gap: 13px; padding-right: 16px; }\n .documentation-top-links a { font-size: 13px; }\n}\n\n/* The rail's own cut-off is 1140px; a docked panel takes that much again out of\n * the row, so the same choice applies that much earlier while it is open. */\n@media (max-width: 1560px) {\n .documentation-app.is-assistant-open .documentation-reader-grid { grid-template-columns: minmax(0, 760px); }\n .documentation-app.is-assistant-open .documentation-context-rail { display: none; }\n}\n\n@media (max-width: 1140px) {\n .documentation-reader-grid { grid-template-columns: minmax(0, 760px); }\n .documentation-context-rail { display: none; }\n .documentation-header { grid-template-columns: var(--documentation-sidebar-width) 1fr auto; }\n .documentation-top-links { display: none; }\n .documentation-breadcrumbs { display: flex; }\n .documentation-outline-disclosure { display: block; }\n /* Too narrow to dock beside the article; fall back to the floating card.\n * The article passes beneath it, so this surface is honest glass. */\n .documentation-assistant { inset: auto auto 18px 50%; width: min(620px, calc(100vw - 36px)); height: min(570px, calc(100vh - 94px)); border: 1px solid var(--documentation-glass-border); border-radius: 16px; background: var(--documentation-glass-bg); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), var(--documentation-shadow-lg); transform: translateX(-50%); animation: documentation-assistant-in .2s ease-out; }\n .documentation-app.is-assistant-open .documentation-main { margin-right: 0; }\n .documentation-app.is-assistant-open .documentation-header { right: 0; }\n}\n\n@media (max-width: 900px) {\n :root { --documentation-sidebar-width: 0px; }\n .documentation-header { grid-template-columns: minmax(0, 1fr) auto; }\n .documentation-header > .documentation-brand { padding-left: 17px; border-right: 0; }\n .documentation-header-center, .documentation-sidebar { display: none; }\n .documentation-mobile-actions { display: flex; }\n .documentation-main { margin-left: 0; }\n .documentation-reader-grid { padding: 44px 30px 64px; }\n .documentation-assistant { width: min(660px, calc(100vw - 24px)); }\n}\n\n@media (max-width: 600px) {\n body { font-size: 16px; }\n .documentation-brand { padding-right: 8px; }\n .documentation-brand-product { display: none; }\n .documentation-mobile-actions { padding-right: 8px; }\n .documentation-icon-button { width: 44px; height: 44px; }\n .documentation-reader-grid { padding: 31px 19px 48px; }\n .documentation-breadcrumbs { margin-bottom: 19px; overflow: hidden; white-space: nowrap; }\n .documentation-breadcrumbs span { flex: 0 0 auto; }\n .documentation-article-header { margin-bottom: 30px; }\n .documentation-article-meta { align-items: flex-start; }\n .documentation-eyebrow { padding-top: 8px; }\n .documentation-contextual-primary button, .documentation-contextual-primary a { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }\n .documentation-article-header h1 { font-size: 32px; line-height: 1.15; }\n .documentation-lede { font-size: 18px; line-height: 1.52; }\n .documentation-prose h2 { margin-top: 42px; font-size: 23px; }\n .documentation-prose h3 { font-size: 19px; }\n .documentation-prose pre { margin-inline: -5px; padding: 17px; border-radius: 10px; font-size: 13px; }\n .documentation-pagination { grid-template-columns: 1fr; }\n .documentation-search-layer { padding: 8px; align-items: stretch; }\n .documentation-search-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; border-radius: 12px; }\n .documentation-search-results { max-height: none; }\n .documentation-search-dialog > footer { justify-content: center; }\n .documentation-launcher-dock { padding-bottom: 12px; }\n .documentation-launcher-hint { display: none; }\n .documentation-assistant { inset: auto auto 0 0; width: 100%; height: calc(100vh - 8px); transform: none; border-width: 1px 0 0; border-radius: 18px 18px 0 0; }\n .documentation-assistant-suggestions { grid-template-columns: 1fr; }\n .documentation-playground-title { align-items: flex-start; flex-direction: column; }\n}\n\n/* Hover-only affordances: touch users get no reveal, so keep the space clear. */\n@media (hover: none) {\n .documentation-prose .documentation-heading-anchor { display: none; }\n .documentation-code-actions { opacity: 1; }\n .documentation-launcher-hint { display: none; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n html { scroll-behavior: auto; }\n *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }\n}\n`\n","import { DOCUMENTATION_BASE_CSS } from './styles/base'\nimport { DOCUMENTATION_CONTENT_CSS } from './styles/content'\nimport { DOCUMENTATION_NAVIGATION_CSS } from './styles/navigation'\nimport { DOCUMENTATION_OVERLAYS_CSS } from './styles/overlays'\nimport { DOCUMENTATION_RESPONSIVE_CSS } from './styles/responsive'\n\n/** One emitted stylesheet, assembled from independently customizable feature layers. */\nexport const DOCUMENTATION_CSS =\n DOCUMENTATION_BASE_CSS +\n DOCUMENTATION_NAVIGATION_CSS +\n DOCUMENTATION_CONTENT_CSS +\n DOCUMENTATION_OVERLAYS_CSS +\n DOCUMENTATION_RESPONSIVE_CSS\n","import type {\n DocumentationConfig,\n DocumentationNavigationNode,\n DocumentationPage,\n DocumentationRuntimeData,\n DocumentationRuntimeRouteDocument,\n ResolvedDocumentationTheme,\n} from './types'\nimport {\n DOCUMENTATION_BUNDLED_BODY_FONT,\n DOCUMENTATION_BUNDLED_MONO_FONT,\n resolveDocumentationFonts,\n safeFontFamily,\n type DocumentationResolvedFont,\n} from './fonts'\nimport { renderDefaultDocumentation } from './renderer'\nimport { documentationPublicPath, joinSiteUrl, markdownUrlForRoute } from './routing'\nimport { escapeHtml } from './text'\nexport { DOCUMENTATION_CSS } from './runtime/styles'\n\nexport interface DocumentationPageRenderOptions {\n config: DocumentationConfig\n basePath: string\n page: DocumentationPage\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n}\n\nexport interface DocumentationPageRuntime {\n data: DocumentationRuntimeData\n document: DocumentationRuntimeRouteDocument\n}\n\nexport function renderPage(options: DocumentationPageRenderOptions, assets: {\n customStylesheets?: string[]\n markup?: string\n runtimeModule?: boolean\n runtimeScript?: string\n} = {}, runtime = createPageRuntime(options)): string {\n const { config, page } = options\n const { data: runtimeData, document: runtimeDocument } = runtime\n const theme = runtimeData.config.theme\n const accent = documentationAccent(theme)\n const accentDark = validCssColor(theme.accentDark) ? theme.accentDark : undefined\n const background = validCssColor(theme.background) ? theme.background : '#fbfcfe'\n const backgroundDark = validCssColor(theme.backgroundDark) ? theme.backgroundDark : '#0c0e14'\n const defaultMode = theme.defaultMode ?? 'system'\n const bodyFont = cssFontStack(theme.bodyFont?.family)\n const headingFont = cssFontStack(theme.headingFont?.family ?? theme.bodyFont?.family)\n const monoFont = cssMonoFontStack(theme.monoFont?.family)\n const fonts = resolveDocumentationFonts(theme, options.basePath)\n const fontFaces = renderFontFaces(fonts)\n const fontPreloads = renderFontPreloads(fonts)\n const markup = assets.markup ?? renderDefaultDocumentation(runtimeData)\n const assetRoot = documentationPublicPath(options.basePath, '/assets')\n const favicon = theme.favicon ?? documentationPublicPath(options.basePath, '/assets/favicon.svg')\n\n return `<!doctype html>\n<html lang=\"en\" data-theme-mode=\"${defaultMode}\" data-theme-strict=\"${theme.strictMode ? 'true' : 'false'}\" data-code-mode=\"${theme.codeBlockMode ?? 'dark'}\" data-density=\"${theme.density ?? 'comfortable'}\" data-background-decoration=\"${theme.backgroundDecoration ?? 'none'}\" data-eyebrow-style=\"${theme.eyebrowStyle ?? 'section'}\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>${escapeHtml(runtimeDocument.title)}</title>\n <meta name=\"description\" content=\"${escapeHtml(runtimeDocument.description ?? '')}\">\n <meta name=\"generator\" content=\"DeepSpace Documentation Orbit\">\n <meta name=\"color-scheme\" content=\"light dark\">\n ${runtimeDocument.robots ? `<meta name=\"robots\" content=\"${escapeHtml(runtimeDocument.robots)}\">` : ''}\n ${runtimeDocument.canonical ? `<link rel=\"canonical\" href=\"${escapeHtml(runtimeDocument.canonical)}\">` : ''}\n <meta property=\"og:type\" content=\"article\">\n <meta property=\"og:title\" content=\"${escapeHtml(runtimeDocument.openGraph['og:title'] ?? '')}\">\n <meta property=\"og:description\" content=\"${escapeHtml(runtimeDocument.openGraph['og:description'] ?? '')}\">\n ${runtimeDocument.openGraph['og:url'] ? `<meta property=\"og:url\" content=\"${escapeHtml(runtimeDocument.openGraph['og:url'])}\">` : ''}\n ${config.seo.ogImage ? `<meta property=\"og:image\" content=\"${escapeHtml(config.seo.ogImage)}\">` : ''}\n ${config.seo.ogImage ? `<meta name=\"twitter:image\" content=\"${escapeHtml(config.seo.ogImage)}\">` : ''}\n <meta name=\"twitter:card\" content=\"${config.seo.ogImage ? 'summary_large_image' : 'summary'}\">\n <meta name=\"theme-color\" media=\"(prefers-color-scheme: light)\" content=\"${background}\">\n <meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"${backgroundDark}\">\n ${renderCustomMeta(config.seo.metaTags)}\n <link rel=\"icon\" href=\"${escapeHtml(favicon)}\">\n ${fontPreloads}\n <link rel=\"stylesheet\" href=\"${assetRoot}/documentation.css\">\n ${(assets.customStylesheets ?? []).map((href) => `<link rel=\"stylesheet\" href=\"${escapeHtml(href)}\">`).join('\\n ')}\n <style>${fontFaces}:root{--documentation-accent-light:${accent};${accentDark ? `--documentation-accent-dark:${accentDark};` : ''}--documentation-brand-bg:${background};--documentation-brand-bg-dark:${backgroundDark};--documentation-font-body:${bodyFont};--documentation-font-heading:${headingFont};--documentation-font-mono:${monoFont}}</style>\n <script src=\"${assetRoot}/documentation-theme.js\"></script>\n</head>\n<body data-route=\"${escapeHtml(page.route)}\">\n <div id=\"deepspace-documentation-root\">${markup}</div>\n <script id=\"deepspace-documentation-data\" type=\"application/json\">${serializeBootstrap(runtimeData)}</script>\n <script${assets.runtimeModule ? ' type=\"module\"' : ''} src=\"${escapeHtml(assets.runtimeScript ?? `${assetRoot}/documentation-runtime.js`)}\" defer></script>\n</body>\n</html>`\n}\n\nfunction renderFontFaces(fonts: DocumentationResolvedFont[]): string {\n return fonts\n .map((font) => {\n const format = font.format ? ` format(\"${font.format}\")` : ''\n return `@font-face{font-family:\"${font.family}\";src:url(\"${font.source}\")${format};font-weight:${font.weight};font-display:swap}`\n })\n .join('')\n}\n\nfunction renderFontPreloads(fonts: DocumentationResolvedFont[]): string {\n return fonts\n .map((font) => `<link rel=\"preload\" href=\"${escapeHtml(font.source)}\" as=\"font\" type=\"font/woff2\" crossorigin>`)\n .join('\\n ')\n}\n\nexport function documentationAccent(theme: ResolvedDocumentationTheme): string {\n return validCssColor(theme.accent) ? theme.accent : '#635bff'\n}\n\n/**\n * Default mark, themed from the configured accent so a site that sets no favicon\n * still gets a tab icon that matches its own palette.\n */\nexport function renderDocumentationFavicon(theme: ResolvedDocumentationTheme): string {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><path d=\"M16 2.5c.5 7.7 5.8 13 13.5 13.5-7.7.5-13 5.8-13.5 13.5C15.5 21.8 10.2 16.5 2.5 16 10.2 15.5 15.5 10.2 16 2.5Z\" fill=\"${escapeHtml(documentationAccent(theme))}\"/></svg>\\n`\n}\n\nfunction renderCustomMeta(metaTags: Record<string, string> | undefined): string {\n if (!metaTags) return ''\n return Object.entries(metaTags)\n .filter(([name]) => /^[a-z0-9][a-z0-9._:-]*$/i.test(name))\n .map(([name, content]) => `<meta name=\"${escapeHtml(name)}\" content=\"${escapeHtml(content)}\">`)\n .join('\\n ')\n}\n\nexport function createNotFoundPage(): DocumentationPage {\n return {\n sourcePath: '',\n relativePath: '',\n route: '/404',\n title: 'Page not found',\n description: 'The documentation page you requested does not exist.',\n hidden: true,\n noindex: true,\n markdown: '',\n html: '<p>The page may have moved. Search this documentation or return to the documentation home.</p><p><a href=\"/\">Go to documentation home</a></p>',\n text: 'Page not found',\n headings: [],\n sourceFormat: 'generated',\n kind: 'page',\n }\n}\n\nexport function renderNotFound(\n config: DocumentationConfig,\n navigation: DocumentationNavigationNode[],\n assets: Parameters<typeof renderPage>[1] = {},\n basePath = '/docs',\n): string {\n const page = createNotFoundPage()\n return renderPage({ config, basePath, page, pages: [page], navigation }, assets)\n}\n\nexport function createRuntimeRouteDocument(options: {\n config: DocumentationConfig\n basePath: string\n page: DocumentationPage\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n}): DocumentationRuntimeRouteDocument {\n return createPageRuntime(options).document\n}\n\nexport function createPageRuntime(options: DocumentationPageRenderOptions): DocumentationPageRuntime {\n const { config, page, pages, navigation } = options\n const data = createRuntimeData(config, page, pages, navigation, options.basePath)\n return {\n data,\n document: createRuntimeRouteDocumentFromData(config, page, data),\n }\n}\n\nfunction createRuntimeRouteDocumentFromData(\n config: DocumentationConfig,\n page: DocumentationPage,\n runtimeData: DocumentationRuntimeData,\n): DocumentationRuntimeRouteDocument {\n const data = {\n basePath: runtimeData.basePath,\n page: runtimeData.page,\n breadcrumbs: runtimeData.breadcrumbs,\n ...(runtimeData.previous ? { previous: runtimeData.previous } : {}),\n ...(runtimeData.next ? { next: runtimeData.next } : {}),\n }\n const canonical = config.url ? joinSiteUrl(config.url, page.route) : null\n const description = page.description ?? config.description ?? `${page.title} — ${config.name}`\n return {\n canonical,\n data,\n description,\n openGraph: {\n 'og:title': page.title,\n 'og:description': description,\n 'og:url': canonical,\n },\n robots: page.noindex ? 'noindex, nofollow' : null,\n title: `${page.title} · ${config.name}`,\n }\n}\n\nexport function renderRedirect(to: string, basePath = '/docs'): string {\n const safe = escapeHtml(documentationPublicPath(basePath, to))\n return `<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"robots\" content=\"noindex\"><meta http-equiv=\"refresh\" content=\"0;url=${safe}\"><link rel=\"canonical\" href=\"${safe}\"><title>Redirecting…</title></head><body><p>Redirecting to <a href=\"${safe}\">${safe}</a>.</p></body></html>`\n}\n\nfunction publicTheme(theme: ResolvedDocumentationTheme, basePath: string): ResolvedDocumentationTheme {\n const publicAsset = (value: string | undefined): string | undefined => {\n if (!value) return value\n const logical = value.startsWith('/_documentation/') ? value.slice('/_documentation'.length) : value\n return logical.startsWith('/media/') ? documentationPublicPath(basePath, logical) : logical\n }\n const publicFont = (font: ResolvedDocumentationTheme['bodyFont']): ResolvedDocumentationTheme['bodyFont'] =>\n font ? { ...font, source: publicAsset(font.source) } : font\n return {\n ...theme,\n logo: publicAsset(theme.logo),\n logoDark: publicAsset(theme.logoDark),\n favicon: publicAsset(theme.favicon),\n bodyFont: publicFont(theme.bodyFont),\n headingFont: publicFont(theme.headingFont),\n monoFont: publicFont(theme.monoFont),\n }\n}\n\nfunction publicPageHtml(html: string, basePath: string): string {\n return html.replace(\n /(\\b(?:href|src)=[\"'])(\\/(?!\\/)[^\"']*)([\"'])/gi,\n (_match, prefix: string, value: string, suffix: string) => {\n const logical = value.startsWith('/_documentation/') ? value.slice('/_documentation'.length) : value\n const publicValue = basePath && (logical === basePath || logical.startsWith(`${basePath}/`))\n ? logical\n : documentationPublicPath(basePath, logical)\n return `${prefix}${publicValue}${suffix}`\n },\n )\n}\n\nexport function createRuntimeData(\n config: DocumentationConfig,\n page: DocumentationPage,\n pages: DocumentationPage[],\n navigation: DocumentationNavigationNode[],\n basePath: string,\n): DocumentationRuntimeData {\n const ordered = orderedRoutes(navigation)\n const pageIndex = ordered.indexOf(page.route)\n const previous = pageIndex > 0\n ? pages.find((candidate) => candidate.route === ordered[pageIndex - 1])\n : undefined\n const next = pageIndex >= 0\n ? pages.find((candidate) => candidate.route === ordered[pageIndex + 1])\n : undefined\n return {\n basePath,\n config: {\n name: config.name,\n ...(config.description ? { description: config.description } : {}),\n theme: publicTheme(config.theme, basePath),\n links: config.links,\n footer: config.footer,\n assistant: config.assistant,\n mcp: config.mcp,\n contextual: config.contextual,\n },\n page: {\n route: page.route,\n title: page.title,\n ...(page.description ? { description: page.description } : {}),\n html: publicPageHtml(page.html, basePath),\n headings: page.headings,\n kind: page.kind,\n markdownUrl: markdownUrlForRoute(page.route, basePath),\n ...(page.openapi ? { openapi: page.openapi } : {}),\n },\n navigation,\n breadcrumbs: findBreadcrumbs(navigation, page.route) ?? [config.name, page.title],\n ...(previous ? { previous: { route: previous.route, title: previous.title } } : {}),\n ...(next ? { next: { route: next.route, title: next.title } } : {}),\n }\n}\n\nfunction findBreadcrumbs(\n nodes: DocumentationNavigationNode[],\n route: string,\n parents: string[] = [],\n): string[] | undefined {\n for (const node of nodes) {\n if (node.kind === 'page' && node.route === route) return [...parents, node.label]\n if (node.kind === 'group') {\n const result = findBreadcrumbs(node.items, route, [...parents, node.label])\n if (result) return result\n }\n }\n return undefined\n}\n\nfunction orderedRoutes(nodes: DocumentationNavigationNode[]): string[] {\n return nodes.flatMap((node): string[] => {\n if (node.kind === 'page') return [node.route]\n if (node.kind === 'group') return orderedRoutes(node.items)\n return []\n })\n}\n\nfunction serializeBootstrap(data: DocumentationRuntimeData): string {\n return JSON.stringify(data)\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/&/g, '\\\\u0026')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\nfunction validCssColor(value: string | undefined): value is string {\n if (!value) return false\n return /^(?:#[0-9a-f]{3,8}|(?:rgb|hsl)a?\\([0-9.,%\\s]+\\)|[a-z]{3,20})$/i.test(value)\n}\n\nfunction cssFontStack(value: string | undefined): string {\n const family = safeFontFamily(value, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n return `${family},ui-sans-serif,-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif`\n}\n\nfunction cssMonoFontStack(value: string | undefined): string {\n const family = safeFontFamily(value, DOCUMENTATION_BUNDLED_MONO_FONT.family)\n return `${family},ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace`\n}\n\nfunction themeBootstrap(): void {\n try {\n const stored = localStorage.getItem('deepspace-documentation-theme')\n const configured = document.documentElement.dataset.themeMode || 'system'\n const strict = document.documentElement.dataset.themeStrict === 'true'\n const mode = !strict && (stored === 'light' || stored === 'dark' || stored === 'system')\n ? stored\n : configured\n document.documentElement.dataset.themeMode = mode\n document.documentElement.dataset.theme = mode === 'system'\n ? (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n : mode\n } catch {\n document.documentElement.dataset.theme = 'light'\n }\n}\n\nexport const DOCUMENTATION_THEME_BOOTSTRAP = `(${themeBootstrap.toString()})()\\n`\n","import { existsSync, readdirSync, realpathSync, rmSync } from 'node:fs'\nimport { relative, resolve, sep } from 'node:path'\nimport { buildDocumentation } from './build'\nimport { DOCUMENTATION_CONFIG_FILE, type DocumentationBuildResult } from './types'\n\nconst IGNORED_DOCUMENTATION_WATCH_PATH =\n /^(?:\\.deepspace|\\.git|\\.wrangler|dist|node_modules|public\\/_documentation(?:-root)?|src\\/router\\.ts)(?:\\/|$)/\n\ninterface DocumentationViteServer {\n restart(): Promise<void>\n watcher: {\n add(paths: string[]): void\n on(event: 'all', handler: (event: string, path: string) => void): void\n on(event: 'ready', handler: () => void): void\n }\n config: {\n logger: {\n info(message: string): void\n error(message: string): void\n }\n }\n}\n\n/**\n * Vite bridge for the app Worker's ASSETS binding.\n *\n * Both development and production write Vite's reserved public namespace so\n * the Cloudflare ASSETS binding has one identical source in both environments.\n * Documentation's feature metadata sets `run_worker_first = true`, leaving the\n * app Worker as the single router while binding reads bypass it as assets.\n */\nexport function deepSpaceDocumentation(): {\n name: string\n config(\n config: { root?: string },\n _environment: { command: 'build' | 'serve' },\n ): {\n server: { watch: { ignored: string[] } }\n }\n configResolved(config: { root: string }): void\n configureServer(server: DocumentationViteServer): void\n} {\n let appDir = process.cwd()\n let outputDir = resolve(appDir, '.deepspace', 'documentation')\n let result: DocumentationBuildResult | null = null\n\n const rebuild = (): DocumentationBuildResult | null => {\n if (!existsSync(resolve(appDir, DOCUMENTATION_CONFIG_FILE))) {\n rmSync(outputDir, { recursive: true, force: true })\n rmSync(`${outputDir}-root`, { recursive: true, force: true })\n result = null\n return null\n }\n // Deploy supplies the public origin so this one compile is the release\n // artifact; development leaves it unset and keeps relative URLs.\n const baseUrl = process.env.DEEPSPACE_DOCUMENTATION_BASE_URL\n result = buildDocumentation({\n appDir,\n outputDir,\n ...(baseUrl ? { baseUrl } : {}),\n })\n if (result.manifest.domains.length) {\n buildDocumentation({\n appDir,\n outputDir: `${outputDir}-root`,\n basePath: '',\n baseUrl: `https://${result.manifest.domains[0]}`,\n })\n } else rmSync(`${outputDir}-root`, { recursive: true, force: true })\n return result\n }\n\n return {\n name: 'deepspace-documentation',\n config(config, environment) {\n appDir = resolve(config.root ?? process.cwd())\n outputDir = resolve(appDir, 'public', '_documentation')\n if (environment.command === 'serve') {\n rmSync(resolve(appDir, '.deepspace', 'documentation'), { recursive: true, force: true })\n rmSync(resolve(appDir, '.deepspace', 'documentation-root'), {\n recursive: true,\n force: true,\n })\n }\n try {\n rebuild()\n } catch (error) {\n // Vite reports only the message; keep the per-file diagnostics.\n throw new Error(documentationBuildErrorMessage(error), { cause: error })\n }\n return {\n server: {\n watch: {\n ignored: ['**/.deepspace/documentation*/**', '**/public/_documentation*/**'],\n },\n },\n }\n },\n configResolved(config) {\n const resolvedRoot = resolve(config.root)\n const rootChanged = !pathsReferToSameDirectory(appDir, resolvedRoot)\n appDir = resolvedRoot\n outputDir = resolve(appDir, 'public', '_documentation')\n if (rootChanged) rebuild()\n },\n configureServer(server) {\n if (!result) return\n\n const configPath = resolve(appDir, DOCUMENTATION_CONFIG_FILE)\n const customRuntimePath = resolve(appDir, 'documentation.tsx')\n const watchedPaths = [configPath, customRuntimePath, result.sourceDir]\n const initialPaths = currentDocumentationPaths(appDir)\n server.watcher.add(watchedPaths)\n const initialReplayTimeout = setTimeout(() => initialPaths.clear(), 10_000)\n initialReplayTimeout.unref()\n server.watcher.on('ready', () => {\n clearTimeout(initialReplayTimeout)\n initialPaths.clear()\n })\n let timer: ReturnType<typeof setTimeout> | undefined\n server.watcher.on('all', (event, path) => {\n const changed = canonicalPath(path)\n if ((event === 'add' || event === 'addDir') && initialPaths.delete(changed)) return\n if (!shouldRebuildDocumentation(appDir, configPath, result?.sourceDir ?? '', changed))\n return\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n try {\n const previousDomains = result?.manifest.domains ?? []\n const next = rebuild()\n if (next) {\n server.config.logger.info(\n `[deepspace] rebuilt ${next.manifest.pageCount} documentation page(s)`,\n )\n if (\n changed === canonicalPath(configPath) &&\n !sameDomains(previousDomains, next.manifest.domains)\n ) {\n void server.restart().catch((error) => {\n server.config.logger.error(\n `[deepspace] development Worker restart failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n })\n }\n }\n } catch (error) {\n server.config.logger.error(\n `[deepspace] documentation rebuild failed: ${documentationBuildErrorMessage(error)}`,\n )\n }\n }, 120)\n })\n },\n }\n}\n\nexport function documentationBuildErrorMessage(error: unknown): string {\n const diagnostics =\n error && typeof error === 'object' && 'diagnostics' in error\n ? (error as { diagnostics?: Array<{ file?: string; line?: number; message: string }> })\n .diagnostics\n : undefined\n if (!diagnostics?.length) return error instanceof Error ? error.message : String(error)\n return diagnostics\n .map(\n (diagnostic) =>\n `${diagnostic.file ?? 'documentation.json'}${diagnostic.line ? `:${diagnostic.line}` : ''}: ${diagnostic.message}`,\n )\n .join('\\n')\n}\n\nfunction sameDomains(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) return false\n const expected = new Set(right)\n return left.every((domain) => expected.has(domain))\n}\n\nfunction currentDocumentationPaths(appDir: string): Set<string> {\n const paths = new Set<string>()\n const directories = [appDir]\n for (const directory of directories) {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n const path = resolve(directory, entry.name)\n const relativePath = relative(appDir, path).split(sep).join('/')\n if (IGNORED_DOCUMENTATION_WATCH_PATH.test(relativePath)) continue\n paths.add(canonicalPath(path))\n if (entry.isDirectory()) directories.push(path)\n }\n }\n return paths\n}\n\nfunction canonicalPath(path: string): string {\n try {\n return realpathSync(path)\n } catch {\n return resolve(path)\n }\n}\n\nfunction pathsReferToSameDirectory(left: string, right: string): boolean {\n return canonicalPath(left) === canonicalPath(right)\n}\n\nfunction isWithinPath(root: string, candidate: string): boolean {\n if (!root) return false\n const path = relative(resolve(root), resolve(candidate))\n return path !== '..' && !path.startsWith(`..${sep}`)\n}\n\nfunction shouldRebuildDocumentation(\n appDir: string,\n configPath: string,\n sourceDir: string,\n changed: string,\n): boolean {\n appDir = canonicalPath(appDir)\n configPath = canonicalPath(configPath)\n sourceDir = canonicalPath(sourceDir)\n if (\n changed === configPath ||\n changed === resolve(appDir, 'documentation.tsx') ||\n isWithinPath(sourceDir, changed)\n ) {\n return true\n }\n if (!isWithinPath(appDir, changed) || !/\\.(?:css|js|jsx|ts|tsx)$/i.test(changed)) return false\n const relativePath = relative(appDir, changed).split(sep).join('/')\n return !IGNORED_DOCUMENTATION_WATCH_PATH.test(relativePath)\n}\n"],"mappings":";AAAA,SAAS,aAAAA,kBAAiB;AAC1B,SAAS,gBAAAC,qBAAoB;AAC7B,SAAS,WAAAC,gBAAe;;;ACAtB,cAAW;;;ACFb,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,SAAS;AAChB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AACjB,O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KAAK,YAAY,EAAG;AACzD,YAAM,IAAI,cAAc,IAAI,CAAC;AAC7B,UAAI,MAAM,YAAY,EAAG,aAAY,KAAK,IAAI;AAAA,IAChD;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,cAAc,MAAsB;AAC3C,MAAI;AACF,WAAOC,cAAa,IAAI;AAAA,EAC1B,QAAQ;AACN,WAAON,SAAQ,IAAI;AAAA,EACrB;AACF;AAEA,SAAS,0BAA0B,MAAc,OAAwB;AACvE,SAAO,cAAc,IAAI,MAAM,cAAc,KAAK;AACpD;AAEA,SAAS,aAAa,MAAc,WAA4B;AAC9D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,OAAOI,UAASJ,SAAQ,IAAI,GAAGA,SAAQ,SAAS,CAAC;AACvD,SAAO,SAAS,QAAQ,CAAC,KAAK,WAAW,KAAKK,IAAG,EAAE;AACrD;AAEA,SAAS,2BACP,QACA,YACA,WACA,SACS;AACT,WAAS,cAAc,MAAM;AAC7B,eAAa,cAAc,UAAU;AACrC,cAAY,cAAc,SAAS;AACnC,MACE,YAAY,cACZ,YAAYL,SAAQ,QAAQ,mBAAmB,KAC/C,aAAa,WAAW,OAAO,GAC/B;AACA,WAAO;AAAA,EACT;AACA,MAAI,CAAC,aAAa,QAAQ,OAAO,KAAK,CAAC,4BAA4B,KAAK,OAAO,EAAG,QAAO;AACzF,QAAM,eAAeI,UAAS,QAAQ,OAAO,EAAE,MAAMC,IAAG,EAAE,KAAK,GAAG;AAClE,SAAO,CAAC,iCAAiC,KAAK,YAAY;AAC5D;","names":["buildSync","readFileSync","resolve","visit","existsSync","readFileSync","basename","extname","relative","resolve","sep","existsSync","resolve","resolve","existsSync","markdown","existsSync","readFileSync","realpathSync","relative","resolve","parseYaml","document","document","resolve","existsSync","realpathSync","readFileSync","parseYaml","document","relative","prettyJson","existsSync","extname","resolve","markdown","relative","sep","readFileSync","visit","basename","existsSync","readFileSync","dirname","extname","join","relative","resolve","sep","resolve","existsSync","join","readFileSync","relative","sep","extname","dirname","require","existsSync","readFileSync","fileURLToPath","fileURLToPath","existsSync","readFileSync","createHash","existsSync","readFileSync","readdirSync","rmSync","writeFileSync","dirname","extname","join","relative","resolve","sep","sanitizeHtml","existsSync","rmSync","dirname","writeFileSync","readdirSync","join","extname","resolve","relative","readFileSync","createHash","sep","sanitizeHtml","createHash","markdown","createHash","visit","buildSync","createRequire","createRequire","buildSync","resolve","readFileSync","buildSync","existsSync","readdirSync","realpathSync","rmSync","relative","resolve","sep","resolve","existsSync","rmSync","readdirSync","relative","sep","realpathSync"]}
1
+ {"version":3,"sources":["../src/documentation/build.ts","../package.json","../src/documentation/markdown.ts","../src/documentation/text.ts","../src/documentation/types.ts","../src/documentation/routing.ts","../src/documentation/artifacts.ts","../src/documentation/graph.ts","../src/documentation/config.ts","../src/shared/ai-models.ts","../src/documentation/config/schema.ts","../src/documentation/config/validation.ts","../src/documentation/mdx.ts","../src/documentation/openapi.ts","../src/documentation/openapi-object.ts","../src/documentation/openapi-samples.ts","../src/documentation/custom-runtime.ts","../src/documentation/fonts.ts","../src/documentation/output.ts","../src/documentation/resource-path.ts","../src/documentation/skill.ts","../src/documentation/renderer.ts","../src/documentation/runtime/styles/base.ts","../src/documentation/runtime/styles/content.ts","../src/documentation/runtime/styles/navigation.ts","../src/documentation/runtime/styles/overlays.ts","../src/documentation/runtime/styles/responsive.ts","../src/documentation/runtime/styles.ts","../src/documentation/template.ts","../src/documentation/vite.ts"],"sourcesContent":["import { buildSync } from 'esbuild'\nimport { readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { version as sdkPackageVersion } from '../../package.json'\nimport {\n createAssistantChunks,\n createSearchEntries,\n pageMarkdown,\n pagesInNavigationOrder,\n renderLlmsFull,\n renderLlmsIndex,\n renderRobots,\n renderSitemap,\n stableJson,\n} from './artifacts'\nimport { validateDocumentation } from './graph'\nimport { buildCustomDocumentationRuntime, runtimeEntry } from './custom-runtime'\nimport { readBundledFont, resolveDocumentationFonts } from './fonts'\nimport { DocumentationOutput } from './output'\nimport { artifactPathsForRoute } from './routing'\nimport { documentationPublicPath, normalizeDocumentationBasePath } from './routing'\nimport { encodeNativeDocumentationPath, isNativeDocumentationResourcePath } from './resource-path'\nimport { createDocumentationSkillArtifacts } from './skill'\nimport {\n createPageRuntime,\n createNotFoundPage,\n renderDocumentationFavicon,\n renderPage,\n renderRedirect,\n DOCUMENTATION_CSS,\n DOCUMENTATION_THEME_BOOTSTRAP,\n} from './template'\nimport {\n DOCUMENTATION_MANIFEST_VERSION,\n DocumentationError,\n type DocumentationBuildManifest,\n type DocumentationBuildResult,\n} from './types'\n\nexport interface BuildDocumentationOptions {\n appDir: string\n outputDir?: string\n baseUrl?: string\n /** Public mount on the ordinary app host. Defaults to `/docs`. */\n basePath?: string\n}\n\nexport function buildDocumentation(options: BuildDocumentationOptions): DocumentationBuildResult {\n const validation = validateDocumentation(options.appDir)\n const outputDir = options.outputDir ? resolve(options.outputDir) : validation.outputDir\n const output = new DocumentationOutput(outputDir, validation.appDir, validation.sourceDir)\n const basePath = normalizeDocumentationBasePath(options.basePath ?? '/docs')\n const renderConfig = options.baseUrl\n ? { ...validation.graph.config, url: options.baseUrl }\n : validation.graph.config\n\n const write = output.write.bind(output)\n\n const customRuntime = buildCustomDocumentationRuntime(validation, basePath)\n if (customRuntime) {\n for (const asset of customRuntime.browserAssets) write(`assets/${asset.path}`, asset.content)\n }\n\n for (const page of validation.graph.pages) {\n const artifactPaths = artifactPathsForRoute(page.route)\n const renderOptions = {\n config: renderConfig,\n basePath,\n page,\n pages: validation.graph.pages,\n navigation: validation.graph.navigation,\n }\n const runtime = createPageRuntime(renderOptions)\n write(artifactPaths.html, renderPage(renderOptions, customRuntime ? {\n customStylesheets: customRuntime.stylesheets,\n markup: customRuntime.render(runtime.data, page.route),\n runtimeModule: true,\n runtimeScript: documentationPublicPath(basePath, '/assets/documentation-custom-runtime.js'),\n } : {}, runtime))\n write(artifactPaths.data, stableJson(runtime.document))\n write(artifactPaths.markdown, pageMarkdown(page, basePath))\n }\n for (const [from, to] of Object.entries(validation.graph.config.redirects)) {\n write(artifactPathsForRoute(from).html, renderRedirect(to, basePath))\n }\n\n const notFoundPage = createNotFoundPage()\n const notFoundOptions = {\n config: renderConfig,\n basePath,\n page: notFoundPage,\n pages: [notFoundPage],\n navigation: validation.graph.navigation,\n }\n const notFoundRuntime = createPageRuntime(notFoundOptions)\n write('404.html', renderPage(notFoundOptions, customRuntime ? {\n customStylesheets: customRuntime.stylesheets,\n markup: customRuntime.render(notFoundRuntime.data, notFoundPage.route),\n runtimeModule: true,\n runtimeScript: documentationPublicPath(basePath, '/assets/documentation-custom-runtime.js'),\n } : {}, notFoundRuntime))\n write('assets/documentation.css', DOCUMENTATION_CSS.trimStart())\n write('assets/documentation-theme.js', DOCUMENTATION_THEME_BOOTSTRAP)\n for (const font of resolveDocumentationFonts(renderConfig.theme, basePath)) {\n if (font.bundled) write(`assets/fonts/${font.bundled.fileName}`, readBundledFont(font.bundled))\n }\n if (!renderConfig.theme.favicon) write('assets/favicon.svg', renderDocumentationFavicon(renderConfig.theme))\n if (!customRuntime) write('assets/documentation-runtime.js', buildDocumentationRuntime().trimStart())\n write('search.json', stableJson(createSearchEntries(validation.graph.pages)))\n write('assistant-index.json', stableJson(createAssistantChunks(validation.graph.pages)))\n const openApiOperations = validation.graph.pages.flatMap((page) =>\n page.openapi ? [{ route: page.route, ...page.openapi }] : [],\n )\n if (openApiOperations.length > 0) write('openapi.json', stableJson(openApiOperations))\n const machinePages = pagesInNavigationOrder(validation.graph.pages, validation.graph.navigation)\n write('llms.txt', renderLlmsIndex(machinePages, validation.graph.config.name, basePath))\n write('llms-full.txt', renderLlmsFull(machinePages, validation.graph.config.name, basePath))\n const skill = createDocumentationSkillArtifacts(validation.graph, renderConfig.url, basePath)\n write('skill.md', skill.markdown)\n write(`.well-known/skills/${skill.name}/SKILL.md`, skill.markdown)\n write('.well-known/skills/index.json', stableJson(skill.legacyIndex))\n write(`.well-known/agent-skills/${skill.name}/skill.md`, skill.markdown)\n write('.well-known/agent-skills/index.json', stableJson(skill.discoveryIndex))\n write('sitemap.xml', renderSitemap(validation.graph.pages, renderConfig.url))\n write('robots.txt', renderRobots(renderConfig.url, renderConfig.seo.noindex))\n output.copyMedia(\n validation.sourceDir,\n new Set(\n validation.graph.pages\n .filter((page) => page.kind === 'openapi')\n .map((page) => resolve(page.sourcePath)),\n ),\n )\n\n const resources = [...output.files]\n .filter((file) => isNativeDocumentationResourcePath(`/${file}`))\n .map((file) => encodeNativeDocumentationPath(`/${file}`))\n .sort()\n const outputHash = output.hash()\n const manifest: DocumentationBuildManifest = {\n version: DOCUMENTATION_MANIFEST_VERSION,\n sourceHash: validation.graph.sourceHash,\n outputHash,\n sdkVersion: sdkPackageVersion,\n name: validation.graph.config.name,\n pageCount: validation.graph.pages.length,\n routes: [\n ...validation.graph.pages.map((page) => page.route),\n ...Object.keys(validation.graph.config.redirects),\n ].map(encodeNativeDocumentationPath).sort(),\n resources,\n assistant: validation.graph.config.assistant,\n mcp: validation.graph.config.mcp,\n domains: validation.graph.config.domains,\n basePath,\n }\n write('manifest.json', stableJson(manifest))\n\n return {\n ...validation,\n outputDir,\n manifest,\n files: [...output.files].sort(),\n }\n}\n\n/**\n * Published packages ship a pre-bundled browser runtime beside `dist/documentation.js`.\n * Source checkouts compile the same entry on demand so SDK tests and local CLI\n * development exercise the real hydration code rather than a test-only shim.\n */\nfunction buildDocumentationRuntime(): string {\n const entry = runtimeEntry('documentation-runtime.js', 'runtime/auto-client.tsx')\n if (entry.endsWith('.js')) return readFileSync(entry, 'utf8')\n\n const result = buildSync({\n entryPoints: [entry],\n bundle: true,\n write: false,\n minify: true,\n platform: 'browser',\n format: 'iife',\n target: ['es2022'],\n jsx: 'automatic',\n define: { 'process.env.NODE_ENV': '\"production\"' },\n })\n const output = result.outputFiles?.[0]?.text\n if (!output) {\n throw new DocumentationError('Unable to compile the documentation browser runtime', 'documentation_runtime_build_failed')\n }\n return output\n}\n","{\n \"name\": \"deepspace\",\n \"version\": \"0.23.0\",\n \"engines\": {\n \"node\": \">=22.15.0 <23 || >=24 <25 || >=26 <27\"\n },\n \"description\": \"DeepSpace SDK — build real-time collaborative apps on Cloudflare Workers\",\n \"type\": \"module\",\n \"sideEffects\": false,\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"bin\": {\n \"deepspace\": \"dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"./schema\": {\n \"types\": \"./dist/schema.d.ts\",\n \"import\": \"./dist/schema.js\"\n },\n \"./worker\": {\n \"types\": \"./dist/worker.d.ts\",\n \"import\": \"./dist/worker.js\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.js\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.js\"\n },\n \"./testing/mcp\": {\n \"types\": \"./dist/testing-mcp.d.ts\",\n \"import\": \"./dist/testing-mcp.js\"\n },\n \"./build\": {\n \"types\": \"./dist/build.d.ts\",\n \"import\": \"./dist/build.js\"\n },\n \"./documentation\": {\n \"types\": \"./dist/documentation.d.ts\",\n \"import\": \"./dist/documentation.js\"\n },\n \"./documentation/react\": {\n \"types\": \"./dist/documentation-react.d.ts\",\n \"import\": \"./dist/documentation-react.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"features\",\n \"CHANGELOG.md\"\n ],\n \"scripts\": {\n \"build\": \"node ../../scripts/clean-artifacts.mjs dist --tsbuildinfo && tsup\",\n \"type-check\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"test:documentation-browser\": \"playwright test --config src/documentation/runtime/__browser__/playwright.config.ts\",\n \"clean\": \"node ../../scripts/clean-artifacts.mjs dist --tsbuildinfo\",\n \"prepublishOnly\": \"pnpm build\"\n },\n \"dependencies\": {\n \"@ai-sdk/anthropic\": \"2.0.91\",\n \"@ai-sdk/openai\": \"2.0.116\",\n \"@ai-sdk/openai-compatible\": \"1.0.46\",\n \"@clack/prompts\": \"^1.2.0\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"acorn\": \"^8.16.0\",\n \"ai\": \"5.0.222\",\n \"better-auth\": \"1.6.23\",\n \"citty\": \"^0.2.0\",\n \"cross-spawn\": \"^7.0.6\",\n \"esbuild\": \"^0.27.0\",\n \"highlight.js\": \"^11.11.1\",\n \"hono\": \"^4.6.0\",\n \"jose\": \"^6.1.0\",\n \"marked\": \"^18.0.7\",\n \"mdast-util-gfm\": \"^3.1.0\",\n \"mdast-util-to-markdown\": \"^2.1.2\",\n \"rehype-highlight\": \"^7.0.2\",\n \"remark-frontmatter\": \"^5.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sanitize-html\": \"^2.17.6\",\n \"smol-toml\": \"^1.6.1\",\n \"yaml\": \"^2.9.0\",\n \"yjs\": \"^13.6.0\",\n \"zod\": \"^4.3.6\"\n },\n \"peerDependencies\": {\n \"@playwright/test\": \">=1.40.0\",\n \"clsx\": \">=2.0.0\",\n \"lucide-react\": \">=0.400.0\",\n \"react\": \"^18.0.0 || ^19.0.0\",\n \"react-dom\": \"^18.0.0 || ^19.0.0\",\n \"tailwind-merge\": \">=2.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"@playwright/test\": {\n \"optional\": true\n },\n \"react\": {\n \"optional\": true\n },\n \"react-dom\": {\n \"optional\": true\n },\n \"clsx\": {\n \"optional\": true\n },\n \"tailwind-merge\": {\n \"optional\": true\n },\n \"lucide-react\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@cloudflare/workers-types\": \"^4.20241205.0\",\n \"@playwright/test\": \"^1.59.1\",\n \"@types/better-sqlite3\": \"^7.6.12\",\n \"@types/cross-spawn\": \"^6.0.6\",\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"@types/sanitize-html\": \"^2.16.1\",\n \"better-sqlite3\": \"^12.0.0\",\n \"clsx\": \"^2.1.1\",\n \"framer-motion\": \"^12.38.0\",\n \"jsdom\": \"^29.1.1\",\n \"lucide-react\": \"^1.7.0\",\n \"react-router-dom\": \"^7.1.0\",\n \"tailwind-merge\": \"^3.5.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.7.0\",\n \"vitest\": \"^4.1.0\"\n },\n \"keywords\": [\n \"deepspace\",\n \"cloudflare-workers\",\n \"durable-objects\",\n \"real-time\",\n \"collaborative\",\n \"sdk\"\n ],\n \"license\": \"Apache-2.0\",\n \"homepage\": \"https://deep.space\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/deepdotspace/deepspace.git\",\n \"directory\": \"packages/deepspace\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/deepdotspace/deepspace/issues\"\n }\n}\n","import hljs from 'highlight.js/lib/core'\nimport bash from 'highlight.js/lib/languages/bash'\nimport css from 'highlight.js/lib/languages/css'\nimport javascript from 'highlight.js/lib/languages/javascript'\nimport json from 'highlight.js/lib/languages/json'\nimport markdown from 'highlight.js/lib/languages/markdown'\nimport typescript from 'highlight.js/lib/languages/typescript'\nimport xml from 'highlight.js/lib/languages/xml'\nimport yaml from 'highlight.js/lib/languages/yaml'\nimport { Marked } from 'marked'\nimport sanitizeHtml from 'sanitize-html'\nimport { parse as parseYaml } from 'yaml'\nimport { createSlugger, errorMessage, escapeHtml } from './text'\nimport { DocumentationError, type DocumentationFrontmatter, type DocumentationHeading } from './types'\n\nconst COMPONENT_NAMES = [\n 'Note',\n 'Tip',\n 'Warning',\n 'Info',\n 'Card',\n 'Accordion',\n 'AccordionGroup',\n 'Step',\n 'Tab',\n 'CodeGroup',\n 'Steps',\n 'Tabs',\n] as const\n\ntype ComponentName = (typeof COMPONENT_NAMES)[number]\n\nconst LEAF_COMPONENTS: ComponentName[] = [\n 'Note',\n 'Tip',\n 'Warning',\n 'Info',\n 'Card',\n 'Accordion',\n 'Step',\n 'Tab',\n 'CodeGroup',\n]\n\nconst WRAPPER_COMPONENTS: ComponentName[] = ['AccordionGroup', 'Steps', 'Tabs']\n\nfor (const [name, language] of Object.entries({\n bash,\n css,\n html: xml,\n javascript,\n json,\n jsx: javascript,\n markdown,\n md: markdown,\n shell: bash,\n sh: bash,\n ts: typescript,\n tsx: typescript,\n typescript,\n xml,\n yaml,\n yml: yaml,\n})) {\n hljs.registerLanguage(name, language)\n}\n\nconst markdownRenderer = new Marked({\n renderer: {\n code({ text, lang }) {\n const { language, title } = parseCodeFenceInfo(lang)\n const highlighted = language && hljs.getLanguage(language)\n ? hljs.highlight(text, { language, ignoreIllegals: true }).value\n : escapeHtml(text)\n const className = language\n ? ` class=\"language-${escapeHtml(language)} hljs\"`\n : ' class=\"hljs\"'\n return `<pre${title ? ` data-code-title=\"${escapeHtml(title)}\"` : ''}><code${className}>${highlighted}</code></pre>\\n`\n },\n },\n})\n\nexport interface ParsedMarkdown {\n frontmatter: DocumentationFrontmatter\n markdown: string\n html: string\n text: string\n headings: DocumentationHeading[]\n}\n\n/** Remove the first authored Markdown H1 because the documentation shell owns the page H1. */\nexport function stripFirstMarkdownH1(source: string): string {\n const lines = [...source.matchAll(/.*(?:\\r?\\n|$)/g)].filter((match) => match[0])\n let inFrontmatter = false\n let frontmatterSeen = false\n let fence: { marker: '`' | '~'; length: number } | undefined\n for (const [index, match] of lines.entries()) {\n const raw = match[0]\n const line = raw.replace(/\\r?\\n$/, '')\n const content = index === 0 ? line.replace(/^\\uFEFF/, '') : line\n if (index === 0 && content === '---') {\n inFrontmatter = true\n frontmatterSeen = true\n continue\n }\n if (inFrontmatter) {\n if (frontmatterSeen && /^(?:---|\\.\\.\\.)\\s*$/.test(content)) inFrontmatter = false\n continue\n }\n const fenceMatch = content.match(/^ {0,3}(`{3,}|~{3,})/)\n if (fenceMatch?.[1]) {\n const marker = fenceMatch[1][0] as '`' | '~'\n if (!fence) fence = { marker, length: fenceMatch[1].length }\n else if (fence.marker === marker && fenceMatch[1].length >= fence.length) fence = undefined\n continue\n }\n if (fence || !/^ {0,3}#(?:[\\t ]+|$)/.test(content)) continue\n const start = match.index ?? 0\n const newline = raw.endsWith('\\r\\n') ? '\\r\\n' : raw.endsWith('\\n') ? '\\n' : ''\n return `${source.slice(0, start)}${newline}${source.slice(start + raw.length)}`\n }\n return source\n}\n\nexport function parseMarkdown(source: string, file: string): ParsedMarkdown {\n const { frontmatter, body } = parseFrontmatter(source, file)\n validateExecutableMdx(body, file)\n\n const placeholders: string[] = []\n let prepared = protectCode(body.replace(/^\\uFEFF/, ''), placeholders)\n for (const name of [...LEAF_COMPONENTS, ...WRAPPER_COMPONENTS]) {\n prepared = replaceComponentBlocks(prepared, name, placeholders)\n }\n\n const rendered = String(markdownRenderer.parse(prepared, { gfm: true, breaks: false }))\n let restored = rendered\n for (let pass = 0; pass < placeholders.length + 1; pass++) {\n let changed = false\n restored = restored.replace(\n /(?:<p>)?@@DEEPSPACE_COMPONENT_(\\d+)@@(?:<\\/p>)?/g,\n (_match, indexRaw: string) => {\n const replacement = placeholders[Number(indexRaw)]\n if (replacement === undefined) return ''\n changed = true\n return replacement\n },\n )\n if (!changed) break\n }\n restored = restored.replace(\n /<div class=\"documentation-code-group\" data-code-group-pending data-code-group-title=\"([^\"]*)\">([\\s\\S]*?)<\\/div>/g,\n (_match, title: string, innerHtml: string) => renderCodeGroup(innerHtml, title),\n )\n\n const safe = sanitizeHtml(restored, {\n allowedTags: [\n ...sanitizeHtml.defaults.allowedTags,\n 'article',\n 'aside',\n 'button',\n 'details',\n 'div',\n 'figure',\n 'figcaption',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'input',\n 'label',\n 'section',\n 'span',\n 'summary',\n 'table',\n 'thead',\n 'tbody',\n 'tr',\n 'th',\n 'td',\n ],\n allowedAttributes: {\n a: ['href', 'title', 'target', 'rel', 'class'],\n aside: ['class'],\n button: ['type', 'class', 'data-copy-code'],\n code: ['class'],\n details: ['class', 'open'],\n div: ['class', 'data-tab-group', 'data-tab-persist'],\n img: ['src', 'alt', 'title', 'width', 'height', 'loading'],\n input: ['type', 'checked', 'disabled'],\n pre: ['class', 'data-code-title'],\n section: ['class', 'data-tab', 'data-tab-title'],\n span: ['class'],\n summary: ['class'],\n table: ['class'],\n '*': ['id', 'aria-label', 'aria-hidden', 'role'],\n },\n allowedSchemes: ['http', 'https', 'mailto'],\n allowProtocolRelative: false,\n disallowedTagsMode: 'escape',\n transformTags: {\n a: (_tagName, attributes) => {\n const external = /^https?:\\/\\//i.test(attributes.href ?? '')\n return {\n tagName: 'a',\n attribs: external\n ? { ...attributes, target: '_blank', rel: 'noopener noreferrer' }\n : attributes,\n }\n },\n img: (_tagName, attributes) => ({\n tagName: 'img',\n attribs: { ...attributes, loading: attributes.loading ?? 'lazy' },\n }),\n },\n })\n\n const { html, headings } = addHeadingIds(safe)\n return {\n frontmatter,\n markdown: body.trim(),\n html,\n text: htmlToText(html),\n headings,\n }\n}\n\nexport function parseFrontmatter(\n source: string,\n file: string,\n): { frontmatter: DocumentationFrontmatter; body: string } {\n if (!source.startsWith('---\\n') && !source.startsWith('---\\r\\n')) {\n return { frontmatter: {}, body: source }\n }\n const normalized = source.replace(/\\r\\n/g, '\\n')\n const end = normalized.indexOf('\\n---\\n', 4)\n if (end === -1) {\n throw new DocumentationError(\n `Unclosed front matter in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_unclosed', message: 'Expected a closing --- line', file, line: 1 }],\n )\n }\n\n let value: unknown\n try {\n value = parseYaml(normalized.slice(4, end), { maxAliasCount: 20 })\n } catch (error) {\n throw new DocumentationError(\n `Invalid front matter in ${file}: ${errorMessage(error)}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_yaml', message: errorMessage(error), file, line: 1 }],\n )\n }\n if (value === null) value = {}\n if (typeof value !== 'object' || Array.isArray(value)) {\n throw new DocumentationError(\n `Front matter must be a mapping in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_shape', message: 'Expected key/value front matter', file, line: 1 }],\n )\n }\n const raw = value as Record<string, unknown>\n const frontmatter: DocumentationFrontmatter = {}\n for (const key of ['title', 'description', 'slug'] as const) {\n if (raw[key] !== undefined && typeof raw[key] !== 'string') {\n throw frontmatterTypeError(file, key, 'string')\n }\n if (typeof raw[key] === 'string') frontmatter[key] = raw[key]\n }\n for (const key of ['hidden', 'noindex'] as const) {\n if (raw[key] !== undefined && typeof raw[key] !== 'boolean') {\n throw frontmatterTypeError(file, key, 'boolean')\n }\n if (typeof raw[key] === 'boolean') frontmatter[key] = raw[key]\n }\n return { frontmatter, body: normalized.slice(end + 5) }\n}\n\nfunction replaceComponentBlocks(\n source: string,\n name: ComponentName,\n placeholders: string[],\n): string {\n const pattern = new RegExp(`<${name}(\\\\s[^>]*)?>([\\\\s\\\\S]*?)<\\\\/${name}>`, 'g')\n return source.replace(pattern, (_match, attributesRaw: string | undefined, inner: string) => {\n const attributes = parseAttributes(attributesRaw ?? '')\n const innerHtml = String(markdownRenderer.parse(inner.trim(), { gfm: true, breaks: false }))\n const html = renderComponent(name, attributes, innerHtml)\n const index = placeholders.push(html) - 1\n return `\\n\\n@@DEEPSPACE_COMPONENT_${index}@@\\n\\n`\n })\n}\n\nfunction renderComponent(\n name: ComponentName,\n attributes: Record<string, string>,\n innerHtml: string,\n): string {\n const title = escapeHtml(attributes.title ?? attributes.label ?? '')\n switch (name) {\n case 'Note':\n case 'Tip':\n case 'Warning':\n case 'Info':\n return `<aside class=\"documentation-callout documentation-callout-${name.toLowerCase()}\">` +\n `${title ? `<strong>${title}</strong>` : `<strong>${name}</strong>`}${innerHtml}</aside>`\n case 'Card': {\n const href = safeHref(attributes.href)\n const content = `${title ? `<strong>${title}</strong>` : ''}${innerHtml}`\n return href\n ? `<a class=\"documentation-card\" href=\"${escapeHtml(href)}\">${content}<span aria-hidden=\"true\">→</span></a>`\n : `<div class=\"documentation-card\">${content}</div>`\n }\n case 'Accordion':\n return `<details class=\"documentation-accordion\"><summary>${title || 'Details'}</summary>${innerHtml}</details>`\n case 'AccordionGroup':\n return `<div class=\"documentation-accordion-group\">${innerHtml}</div>`\n case 'Step':\n return `<section class=\"documentation-step\">${title ? `<h3>${title}</h3>` : ''}${innerHtml}</section>`\n case 'Steps':\n return `<div class=\"documentation-steps\">${innerHtml}</div>`\n case 'Tab':\n return `<section class=\"documentation-tab\" data-tab data-tab-title=\"${title || 'Tab'}\">${innerHtml}</section>`\n case 'Tabs':\n return `<div class=\"documentation-tabs\" data-tab-group>${innerHtml}</div>`\n case 'CodeGroup':\n return `<div class=\"documentation-code-group\" data-code-group-pending data-code-group-title=\"${title}\">${innerHtml}</div>`\n }\n}\n\nfunction renderCodeGroup(innerHtml: string, title: string): string {\n const blocks = [...innerHtml.matchAll(/<pre([^>]*)>([\\s\\S]*?)<\\/pre>/g)]\n if (blocks.length === 0) {\n return `<div class=\"documentation-code-group\">${title ? `<div class=\"documentation-code-group-title\">${title}</div>` : ''}${innerHtml}</div>`\n }\n const tabs = blocks.map((match, index) => {\n const attributes = match[1] ?? ''\n const explicit = attributes.match(/\\sdata-code-title=\"([^\"]+)\"/)?.[1]\n const language = match[2]?.match(/class=\"language-([^\\s\"]+)/)?.[1]\n const label = explicit ?? codeLanguageLabel(language) ?? `Example ${index + 1}`\n return `<section class=\"documentation-code-tab\" data-tab data-tab-title=\"${escapeHtml(label)}\"><pre${attributes}>${match[2]}</pre></section>`\n }).join('')\n return `<div class=\"documentation-code-group\" data-tab-group data-tab-persist=\"code\">${title ? `<div class=\"documentation-code-group-title\">${title}</div>` : ''}${tabs}</div>`\n}\n\nexport function parseCodeFenceInfo(value: string | undefined): { language?: string; title?: string } {\n const raw = value?.trim() ?? ''\n if (!raw) return {}\n const language = raw.split(/\\s+/, 1)[0]?.toLowerCase()\n const metadata = raw.slice(language?.length ?? 0).trim()\n const quotedTitle = metadata.match(/(?:^|\\s)title=(?:\"([^\"]+)\"|'([^']+)')/i)\n // A bare token is a title (or code-group tab label) unless it is an option\n // shape: {1,3-4} ranges, key=value pairs, or a known option keyword — those\n // must never render as a header bar.\n const optionKeyword = /^(?:wrap|expandable|twoslash|focus)$/i.test(metadata)\n const bareTitle = metadata && !metadata.includes('=') && !metadata.startsWith('{') && !optionKeyword\n ? metadata\n : undefined\n const title = quotedTitle?.[1] ?? quotedTitle?.[2] ?? bareTitle\n return {\n ...(language ? { language } : {}),\n ...(title ? { title: title.trim() } : {}),\n }\n}\n\nfunction codeLanguageLabel(language: string | undefined): string | undefined {\n if (!language) return undefined\n const names: Record<string, string> = {\n bash: 'Shell',\n javascript: 'JavaScript',\n js: 'JavaScript',\n jsx: 'React',\n shell: 'Shell',\n sh: 'Shell',\n ts: 'TypeScript',\n tsx: 'React',\n typescript: 'TypeScript',\n }\n return names[language] ?? language.toUpperCase()\n}\n\nfunction parseAttributes(raw: string): Record<string, string> {\n const attributes: Record<string, string> = {}\n const pattern = /([A-Za-z][A-Za-z0-9_-]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g\n for (const match of raw.matchAll(pattern)) {\n attributes[match[1]] = match[2] ?? match[3] ?? ''\n }\n return attributes\n}\n\nfunction validateExecutableMdx(body: string, file: string): void {\n const validationBody = stripCodeForValidation(body)\n const lines = validationBody.split('\\n')\n for (let index = 0; index < lines.length; index++) {\n const line = lines[index]\n if (/^\\s*(?:import|export)\\s/.test(line)) {\n throw new DocumentationError(\n `Executable MDX is not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'mdx_module_syntax',\n message: 'Use the built-in documentation component vocabulary instead of import/export',\n file,\n line: index + 1,\n }],\n )\n }\n if (/<[A-Za-z][^>]*\\son[A-Za-z]+\\s*=/.test(line) || /<script\\b/i.test(line)) {\n throw new DocumentationError(\n `Active HTML is not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'active_html',\n message: 'Scripts and inline event handlers are prohibited',\n file,\n line: index + 1,\n }],\n )\n }\n if (/<[A-Z][A-Za-z0-9]*[^>]*=\\s*\\{/.test(line)) {\n throw new DocumentationError(\n `JSX expressions are not supported in ${file}:${index + 1}`,\n 'documentation_mdx_unsafe',\n [{\n code: 'jsx_expression',\n message: 'Component attributes must use quoted string values',\n file,\n line: index + 1,\n }],\n )\n }\n }\n\n const componentPattern = /<\\/?([A-Z][A-Za-z0-9]*)\\b/g\n for (const match of validationBody.matchAll(componentPattern)) {\n if (!COMPONENT_NAMES.includes(match[1] as ComponentName)) {\n const line = validationBody.slice(0, match.index).split('\\n').length\n throw new DocumentationError(\n `Unknown documentation component <${match[1]}> in ${file}:${line}`,\n 'documentation_mdx_component_unknown',\n [{\n code: 'unknown_component',\n message: `Supported components: ${COMPONENT_NAMES.join(', ')}`,\n file,\n line,\n }],\n )\n }\n }\n}\n\nfunction protectCode(source: string, placeholders: string[]): string {\n const fenced = source.replace(\n /^([ \\t]*)(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^\\1\\2[ \\t]*(?=\\n|$)/gm,\n (block, indentation: string) => {\n const normalized = indentation\n ? block.split('\\n').map((line) => line.startsWith(indentation) ? line.slice(indentation.length) : line).join('\\n')\n : block\n const html = String(markdownRenderer.parse(normalized, { gfm: true, breaks: false }))\n const index = placeholders.push(html) - 1\n return `\\n\\n@@DEEPSPACE_COMPONENT_${index}@@\\n\\n`\n },\n )\n return fenced.replace(/`([^`\\n]+)`/g, (_match, code: string) => {\n const index = placeholders.push(`<code>${escapeHtml(code)}</code>`) - 1\n return `@@DEEPSPACE_COMPONENT_${index}@@`\n })\n}\n\nfunction stripCodeForValidation(source: string): string {\n return source\n .replace(\n /^([ \\t]*)(`{3,}|~{3,})[^\\n]*\\n[\\s\\S]*?^\\1\\2[ \\t]*(?=\\n|$)/gm,\n (block) => block.replace(/[^\\n]/g, ' '),\n )\n .replace(/`[^`\\n]+`/g, (code) => ' '.repeat(code.length))\n}\n\nfunction addHeadingIds(html: string): { html: string; headings: DocumentationHeading[] } {\n const headings: DocumentationHeading[] = []\n const slug = createSlugger()\n const output = html.replace(/<h([1-6])>([\\s\\S]*?)<\\/h\\1>/g, (_match, depthRaw, content) => {\n const text = htmlToText(content)\n const id = slug(text)\n const depth = Number(depthRaw)\n headings.push({ depth, id, text })\n return `<h${depth} id=\"${id}\">${content}<a class=\"documentation-heading-anchor\" href=\"#${id}\" aria-label=\"Link to ${escapeHtml(text)}\">#</a></h${depth}>`\n })\n return { html: output, headings }\n}\n\nexport { slugify } from './text'\n\nexport function htmlToText(html: string): string {\n return decodeEntities(\n html\n .replace(/<pre[\\s\\S]*?<\\/pre>/g, ' ')\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim(),\n )\n}\n\nfunction decodeEntities(value: string): string {\n return value\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n}\n\nfunction safeHref(value: string | undefined): string {\n if (!value) return ''\n if (/^(?:https?:|mailto:|\\/|#)/i.test(value)) return value\n return ''\n}\n\nfunction frontmatterTypeError(file: string, key: string, type: string): DocumentationError {\n return new DocumentationError(\n `Front matter ${key} must be a ${type} in ${file}`,\n 'documentation_frontmatter_invalid',\n [{ code: 'frontmatter_type', message: `${key} must be a ${type}`, file, line: 1 }],\n )\n}\n","/** Render an unknown failure without unsafe structural assumptions. */\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nexport function escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n}\n\nexport function escapeXml(value: string): string {\n return escapeHtml(value).replace(/&#39;/g, '&apos;')\n}\n\nexport function slugify(value: string): string {\n return value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n}\n\n/** Add the documentation qualifier exactly once in user- and agent-facing copy. */\nexport function documentationSubject(name: string): string {\n const normalized = name.trim()\n if (!normalized || /^documentation$/i.test(normalized)) return 'documentation'\n return /(?:\\bdocs?|documentation)$/i.test(normalized) ? normalized : `${normalized} documentation`\n}\n\n/** Allocate stable, collision-free ids with the same rules in Markdown and MDX. */\nexport function createSlugger(fallback = 'section'): (value: string) => string {\n const seen = new Map<string, number>()\n return (value) => {\n const base = slugify(value) || fallback\n const count = seen.get(base) ?? 0\n seen.set(base, count + 1)\n return count === 0 ? base : `${base}-${count + 1}`\n }\n}\n","import type { z } from 'zod'\nimport type { themeObjectSchema } from './config/schema'\n\nexport const DOCUMENTATION_CONFIG_FILE = 'documentation.json'\nexport const DOCUMENTATION_MANIFEST_VERSION = 2\n\nexport type DocumentationAssistantAccess = 'disabled' | 'public' | 'authenticated'\nexport type DocumentationMcpAccess = 'disabled' | 'public'\nexport const DOCUMENTATION_CONTEXTUAL_ACTIONS = [\n 'copy',\n 'view',\n 'assistant',\n 'chatgpt',\n 'claude',\n 'mcp',\n 'add-mcp',\n 'cursor',\n 'vscode',\n] as const\nexport type DocumentationContextualAction = (typeof DOCUMENTATION_CONTEXTUAL_ACTIONS)[number]\nexport const DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS: readonly DocumentationContextualAction[] =\n DOCUMENTATION_CONTEXTUAL_ACTIONS\n\nexport interface DocumentationFontConfig {\n family: string\n weight?: number | string\n source?: string\n format?: string\n}\n\n/**\n * The `theme` object as authored in documentation.json — exactly the keys\n * the config schema accepts under `theme.*`, derived from that schema so\n * the two can never drift. Everything else (fonts, background decoration,\n * styling, logo href) is configured through the Mintlify-style top-level\n * keys and only exists on the resolved theme.\n */\nexport type DocumentationThemeConfig = z.infer<typeof themeObjectSchema>\n\n/**\n * The fully resolved theme after config loading merges `theme.*` with the\n * Mintlify top-level keys (`colors`, `logo`, `favicon`, `appearance`,\n * `background`, `fonts`, `styling`). This is what the template and runtime\n * consume; it is an output shape, never accepted as `theme.*` input.\n */\nexport interface ResolvedDocumentationTheme extends DocumentationThemeConfig {\n backgroundDark?: string\n backgroundDecoration?: 'none' | 'gradient' | 'grid'\n bodyFont?: DocumentationFontConfig\n headingFont?: DocumentationFontConfig\n monoFont?: DocumentationFontConfig\n codeBlockMode?: 'dark' | 'system'\n eyebrowStyle?: 'section' | 'breadcrumbs' | 'none'\n logoHref?: string\n}\n\nexport interface DocumentationLinkConfig {\n label: string\n href: string\n}\n\nexport interface DocumentationNavGroup {\n group: string\n pages: DocumentationNavigationItem[]\n}\n\nexport type DocumentationNavigationItem = string | DocumentationLinkConfig | DocumentationNavGroup\n\nexport const DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES = ['curl', 'javascript', 'python', 'go'] as const\nexport type DocumentationOpenApiSampleLanguage = (typeof DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES)[number]\nexport type DocumentationOpenApiSampleDefaults = 'required' | 'all'\n\nexport interface DocumentationOpenApiExamplesConfig {\n languages: DocumentationOpenApiSampleLanguage[]\n defaults: DocumentationOpenApiSampleDefaults\n autogenerate: boolean\n}\n\nexport const DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES = {\n languages: ['curl', 'python', 'javascript', 'go'],\n defaults: 'all',\n autogenerate: true,\n} as const satisfies Omit<DocumentationOpenApiExamplesConfig, 'languages'> & {\n languages: readonly DocumentationOpenApiSampleLanguage[]\n}\n\nexport interface DocumentationOpenApiConfig {\n source: string\n route?: string\n label?: string\n playground?: boolean\n baseUrl?: string\n examples?: DocumentationOpenApiExamplesConfig\n}\n\nexport interface DocumentationAssistantConfig {\n access: DocumentationAssistantAccess\n model?: string\n suggestions?: string[]\n}\n\nexport interface DocumentationMcpConfig {\n access: DocumentationMcpAccess\n}\n\nexport interface DocumentationContextualConfig {\n actions: DocumentationContextualAction[]\n}\n\nexport interface DocumentationSeoConfig {\n noindex?: boolean\n ogImage?: string\n metaTags?: Record<string, string>\n}\n\nexport interface DocumentationConfig {\n $schema?: string\n name: string\n description?: string\n source: string\n output: string\n url?: string\n /** Explicit custom hostnames that mount this documentation at `/`. */\n domains: string[]\n theme: ResolvedDocumentationTheme\n navigation?: DocumentationNavigationItem[]\n links: DocumentationLinkConfig[]\n footer: DocumentationLinkConfig[]\n redirects: Record<string, string>\n openapi: DocumentationOpenApiConfig[]\n assistant: DocumentationAssistantConfig\n mcp: DocumentationMcpConfig\n contextual: DocumentationContextualConfig\n seo: DocumentationSeoConfig\n}\n\nexport interface DocumentationFrontmatter {\n title?: string\n description?: string\n slug?: string\n hidden?: boolean\n noindex?: boolean\n}\n\nexport interface DocumentationHeading {\n depth: number\n id: string\n text: string\n}\n\nexport interface DocumentationPage {\n sourcePath: string\n relativePath: string\n route: string\n title: string\n description?: string\n hidden: boolean\n noindex: boolean\n markdown: string\n html: string\n text: string\n headings: DocumentationHeading[]\n sourceFormat: 'markdown' | 'mdx' | 'generated'\n kind: 'page' | 'openapi'\n openapi?: DocumentationOpenApiOperation\n}\n\nexport interface DocumentationNavigationPage {\n kind: 'page'\n route: string\n label: string\n}\n\nexport interface DocumentationNavigationLink {\n kind: 'link'\n href: string\n label: string\n}\n\nexport interface DocumentationNavigationGroup {\n kind: 'group'\n label: string\n items: DocumentationNavigationNode[]\n}\n\nexport type DocumentationNavigationNode = DocumentationNavigationPage | DocumentationNavigationLink | DocumentationNavigationGroup\n\nexport interface DocumentationOpenApiParameter {\n name: string\n in: string\n required: boolean\n description?: string\n schema?: unknown\n example?: unknown\n}\n\nexport interface DocumentationOpenApiResponse {\n status: string\n description: string\n schema?: unknown\n}\n\nexport interface DocumentationOpenApiCodeSample {\n language: string\n label: string\n syntax: string\n code: string\n generated: boolean\n}\n\nexport interface DocumentationOpenApiOperation {\n method: string\n path: string\n operationId: string\n summary: string\n description?: string\n tags: string[]\n parameters: DocumentationOpenApiParameter[]\n requestBody?: unknown\n responses: DocumentationOpenApiResponse[]\n security?: unknown\n baseUrl?: string\n playground: boolean\n codeSamples: DocumentationOpenApiCodeSample[]\n}\n\nexport interface DocumentationSearchEntry {\n route: string\n title: string\n description?: string\n /** Carries ids so search can offer section results, not only whole pages. */\n headings: DocumentationHeading[]\n text: string\n}\n\nexport interface DocumentationAssistantChunk {\n id: string\n route: string\n title: string\n heading?: string\n text: string\n}\n\nexport interface DocumentationGraph {\n config: DocumentationConfig\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n sourceHash: string\n}\n\nexport interface DocumentationBuildManifest {\n version: typeof DOCUMENTATION_MANIFEST_VERSION\n sourceHash: string\n outputHash: string\n /** Version of the `deepspace` package that compiled this output. */\n sdkVersion: string\n name: string\n pageCount: number\n /** Authored pages plus configured redirect entry points. */\n routes: string[]\n /** Exact non-HTML artifacts that may be served from the public mount. */\n resources: string[]\n assistant: DocumentationAssistantConfig\n mcp: DocumentationMcpConfig\n domains: string[]\n /** Default public mount on the ordinary app hostname. */\n basePath: string\n}\n\nexport interface DocumentationDiagnostic {\n code: string\n message: string\n file?: string\n line?: number\n}\n\nexport interface DocumentationValidationResult {\n appDir: string\n configPath: string\n sourceDir: string\n outputDir: string\n graph: DocumentationGraph\n warnings: DocumentationDiagnostic[]\n}\n\nexport interface DocumentationBuildResult extends DocumentationValidationResult {\n manifest: DocumentationBuildManifest\n files: string[]\n}\n\nexport interface DocumentationRuntimePageLink {\n route: string\n title: string\n}\n\nexport interface DocumentationRuntimePage {\n route: string\n title: string\n description?: string\n html: string\n headings: DocumentationHeading[]\n kind: DocumentationPage['kind']\n markdownUrl: string\n openapi?: DocumentationOpenApiOperation\n}\n\nexport interface DocumentationRuntimeData {\n /** Public mount (`/docs` on an app host, empty on an explicit documentation domain). */\n basePath: string\n config: Pick<\n DocumentationConfig,\n 'name' | 'description' | 'theme' | 'links' | 'footer' | 'assistant' | 'mcp' | 'contextual'\n >\n page: DocumentationRuntimePage\n navigation: DocumentationNavigationNode[]\n breadcrumbs: string[]\n previous?: DocumentationRuntimePageLink\n next?: DocumentationRuntimePageLink\n}\n\nexport type DocumentationRuntimeRouteData = Omit<DocumentationRuntimeData, 'config' | 'navigation'>\n\n/** Small per-route payload used by the hydrated documentation router. */\nexport interface DocumentationRuntimeRouteDocument {\n canonical: string | null\n data: DocumentationRuntimeRouteData\n description: string | null\n openGraph: Record<'og:title' | 'og:description' | 'og:url', string | null>\n robots: string | null\n title: string\n}\n\nexport class DocumentationError extends Error {\n readonly code: string\n readonly diagnostics: DocumentationDiagnostic[]\n\n constructor(message: string, code: string, diagnostics: DocumentationDiagnostic[] = []) {\n super(message)\n this.name = 'DocumentationError'\n this.code = code\n this.diagnostics = diagnostics\n }\n}\n","import { DocumentationError } from './types'\n\n/** Slash-collapsing shared by the compiler's strict normalizer and the\n * worker's lenient normalizer for untrusted lookup input, which must miss\n * rather than throw. */\nexport function collapseRoute(value: string): string {\n let route = `/${value}`.replace(/\\/{2,}/g, '/')\n if (route.length > 1) route = route.replace(/\\/$/, '')\n return route\n}\n\n/** Normalize and validate every public documentation route in one place. */\nexport function normalizeRoute(value: string): string {\n assertSafeRoute(value)\n let route = collapseRoute(value)\n route = route.replace(/\\.(?:md|mdx)$/i, '')\n route = route.replace(/\\/index$/i, '')\n return route || '/'\n}\n\nexport function routeFromRelativePath(relativePath: string): string {\n let path = relativePath.replace(/\\.(?:md|mdx)$/i, '')\n if (path === 'index') path = ''\n else path = path.replace(/\\/index$/i, '')\n return normalizeRoute(path)\n}\n\n/** Normalize the public mount for native documentation. Empty means a custom documentation host. */\nexport function normalizeDocumentationBasePath(value: string | undefined): string {\n if (!value || value === '/') return ''\n const normalized = normalizeRoute(value)\n if (normalized === '/_documentation') {\n throw new DocumentationError('The internal /_documentation namespace cannot be a public documentation base', 'documentation_base_invalid')\n }\n return normalized\n}\n\n/** Convert a logical documentation route/resource into its public URL path. */\nexport function documentationPublicPath(basePath: string, path: string): string {\n const base = normalizeDocumentationBasePath(basePath)\n const suffix = path.startsWith('/') ? path : `/${path}`\n if (suffix === '/') return base || '/'\n return `${base}${suffix}`\n}\n\n/** Project logical root-relative references onto the active public mount. */\nexport function publicDocumentationReferences(source: string, basePath: string): string {\n const base = normalizeDocumentationBasePath(basePath)\n if (!base) return source\n const publicPath = (value: string): string =>\n value === base || value.startsWith(`${base}/`) ? value : `${base}${value}`\n return source\n .replace(\n /(\\]\\()(\\/(?!\\/)[^)\\s]*)/g,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n .replace(\n /^(\\s*\\[[^\\]]+\\]:\\s*)(\\/(?!\\/)\\S*)/gm,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n .replace(\n /(\\b(?:href|src)=[\"'])(\\/(?!\\/)[^\"']*)/g,\n (_match, prefix: string, value: string) => `${prefix}${publicPath(value)}`,\n )\n}\n\n/** Convert a public request pathname back to a logical documentation route. */\nexport function documentationLogicalPath(basePath: string, pathname: string): string | null {\n const base = normalizeDocumentationBasePath(basePath)\n if (!base) return pathname.startsWith('/') ? pathname : `/${pathname}`\n if (pathname === base) return '/'\n if (!pathname.startsWith(`${base}/`)) return null\n return pathname.slice(base.length) || '/'\n}\n\n/** Canonical public Markdown projection for a page route. */\nexport function markdownUrlForRoute(route: string, basePath = ''): string {\n const logical = route === '/' ? '/index.md' : `${normalizeRoute(route)}.md`\n return documentationPublicPath(basePath, logical)\n}\n\n/** Deterministic build artifact paths for one canonical page route. */\nexport function artifactPathsForRoute(route: string): {\n data: string\n html: string\n markdown: string\n} {\n const clean = normalizeRoute(route).replace(/^\\//, '')\n return clean\n ? {\n data: `data/${clean}.json`,\n html: `${clean}/index.html`,\n markdown: `${clean}.md`,\n }\n : {\n data: 'data/index.json',\n html: 'index.html',\n markdown: 'index.md',\n }\n}\n\nexport function routeArtifactId(route: string): string {\n return route === '/'\n ? 'index'\n : normalizeRoute(route).replace(/^\\//, '').replace(/[^a-z0-9]+/gi, '-')\n}\n\nexport function joinSiteUrl(base: string, route: string): string {\n const path = route.startsWith('/') ? route : `/${route}`\n return `${base.replace(/\\/$/, '')}${path}`\n}\n\nfunction assertSafeRoute(value: string): void {\n if (value.includes('\\\\') || value.includes('\\0')) throw unsafeRoute(value)\n\n let decoded = value\n for (let pass = 0; pass < 5; pass++) {\n let next: string\n try {\n next = decodeURIComponent(decoded)\n } catch {\n throw unsafeRoute(value)\n }\n if (next === decoded) break\n decoded = next\n }\n if (\n decoded.includes('\\\\') ||\n decoded.includes('\\0') ||\n decoded.split('/').some((segment) => segment === '.' || segment === '..')\n ) throw unsafeRoute(value)\n}\n\nfunction unsafeRoute(value: string): DocumentationError {\n return new DocumentationError(\n `Documentation route contains an unsafe path segment: ${value}`,\n 'documentation_route_invalid',\n [{ code: 'route_path_escape', message: value }],\n )\n}\n","import { htmlToText } from './markdown'\nimport {\n joinSiteUrl,\n markdownUrlForRoute,\n publicDocumentationReferences,\n routeArtifactId,\n} from './routing'\nimport { escapeXml } from './text'\nimport type {\n DocumentationAssistantChunk,\n DocumentationNavigationNode,\n DocumentationPage,\n DocumentationSearchEntry,\n} from './types'\n\nexport function pageMarkdown(page: DocumentationPage, basePath = '/docs'): string {\n const title = `# ${page.title}`\n const body = publicDocumentationReferences(page.markdown, basePath).trim()\n return `${title}\\n${page.description ? `\\n${page.description}\\n` : ''}${body ? `\\n${body}\\n` : '\\n'}`\n}\n\nexport function createSearchEntries(pages: DocumentationPage[]): DocumentationSearchEntry[] {\n return pages\n .filter((page) => !page.hidden)\n .map((page) => ({\n route: page.route,\n title: page.title,\n ...(page.description ? { description: page.description } : {}),\n headings: page.headings.filter((heading) => heading.depth > 1),\n text: page.text.slice(0, 12_000),\n }))\n}\n\nexport function createAssistantChunks(pages: DocumentationPage[]): DocumentationAssistantChunk[] {\n return pages.flatMap((page) => {\n if (page.hidden) return []\n const chunks: DocumentationAssistantChunk[] = []\n let index = 0\n const sections = page.html.split(/(?=<h[23]\\b)/)\n for (const section of sections) {\n const headingMatch = section.match(/^<h[23] id=\"([^\"]+)\">/)\n const heading = headingMatch\n ? page.headings.find((candidate) => candidate.id === headingMatch[1])\n : undefined\n const route = heading ? `${page.route}#${heading.id}` : page.route\n const paragraphs = htmlToText(section).split(/(?<=[.!?])\\s+(?=[A-Z0-9])/)\n let current = ''\n const flush = (): void => {\n const text = current.trim()\n if (!text) return\n chunks.push({\n id: `${routeArtifactId(page.route)}:${index++}`,\n route,\n title: page.title,\n ...(heading ? { heading: heading.text } : {}),\n text,\n })\n current = ''\n }\n for (const paragraph of paragraphs) {\n if (current.length + paragraph.length > 1_800) flush()\n current += `${current ? ' ' : ''}${paragraph}`\n }\n flush()\n }\n return chunks\n })\n}\n\nexport function pagesInNavigationOrder(\n pages: DocumentationPage[],\n navigation: DocumentationNavigationNode[],\n): DocumentationPage[] {\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const ordered: DocumentationPage[] = []\n const seen = new Set<string>()\n const visit = (nodes: DocumentationNavigationNode[]): void => {\n for (const node of nodes) {\n if (node.kind === 'group') {\n visit(node.items)\n continue\n }\n if (node.kind !== 'page' || seen.has(node.route)) continue\n const page = byRoute.get(node.route)\n if (page) ordered.push(page)\n seen.add(node.route)\n }\n }\n visit(navigation)\n for (const page of pages) {\n if (!seen.has(page.route)) ordered.push(page)\n }\n return ordered\n}\n\nexport function renderLlmsIndex(pages: DocumentationPage[], name: string, basePath = '/docs'): string {\n const lines = [`# ${name}`, '', '> Documentation index generated by DeepSpace Documentation.', '']\n for (const page of pages.filter((candidate) => !candidate.hidden)) {\n lines.push(\n `- [${page.title}](${markdownUrlForRoute(page.route, basePath)})` +\n `${page.description ? `: ${page.description}` : ''}`,\n )\n }\n return `${lines.join('\\n')}\\n`\n}\n\nexport function renderLlmsFull(\n pages: DocumentationPage[],\n name: string,\n basePath = '/docs',\n): string {\n return `# ${name}\\n\\n${pages\n .filter((page) => !page.hidden)\n .map((page) =>\n `${pageMarkdown(page, basePath).trim()}\\n\\nSource: ${markdownUrlForRoute(page.route, basePath)}`,\n )\n .join('\\n\\n---\\n\\n')}\\n`\n}\n\nexport function renderSitemap(pages: DocumentationPage[], baseUrl: string | undefined): string {\n const urls = baseUrl\n ? pages\n .filter((page) => !page.hidden && !page.noindex)\n .map((page) => ` <url><loc>${escapeXml(joinSiteUrl(baseUrl, page.route))}</loc></url>`)\n .join('\\n')\n : ''\n return `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\\n${urls}${urls ? '\\n' : ''}</urlset>\\n`\n}\n\nexport function renderRobots(baseUrl: string | undefined, noindex: boolean | undefined): string {\n if (noindex) return 'User-agent: *\\nDisallow: /\\n'\n return `User-agent: *\\nAllow: /\\n${baseUrl ? `Sitemap: ${joinSiteUrl(baseUrl, '/sitemap.xml')}\\n` : ''}`\n}\n\nexport function stableJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`\n}\n","import { createHash } from 'node:crypto'\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { basename, dirname, extname, join, posix, relative, resolve, sep } from 'node:path'\nimport { loadDocumentationConfig, type LoadedDocumentationConfig } from './config'\nimport { parseMarkdown, slugify, stripFirstMarkdownH1 } from './markdown'\nimport { parseMdx } from './mdx'\nimport { operationMarkdown, parseOpenApi } from './openapi'\nimport { normalizeRoute, routeFromRelativePath } from './routing'\nimport {\n DocumentationError,\n type DocumentationConfig,\n type DocumentationDiagnostic,\n type DocumentationGraph,\n type DocumentationNavigationItem,\n type DocumentationNavigationNode,\n type DocumentationPage,\n type DocumentationValidationResult,\n} from './types'\n\nexport function validateDocumentation(appDir: string): DocumentationValidationResult {\n const loaded = loadDocumentationConfig(appDir)\n if (!existsSync(loaded.sourceDir)) {\n throw new DocumentationError(\n `Documentation source directory not found: ${loaded.config.source}`,\n 'documentation_source_missing',\n [{ code: 'source_missing', message: loaded.config.source, file: loaded.sourceDir }],\n )\n }\n const warnings: DocumentationDiagnostic[] = [...loaded.warnings]\n const contentFiles = collectContentFiles(loaded.sourceDir)\n const sourceFiles = contentFiles.filter((path) => ['.md', '.mdx'].includes(extname(path).toLowerCase()))\n if (sourceFiles.length === 0 && loaded.config.openapi.length === 0) {\n throw new DocumentationError(\n `No .md or .mdx pages found in ${loaded.config.source}`,\n 'documentation_pages_missing',\n [{ code: 'pages_missing', message: loaded.config.source, file: loaded.sourceDir }],\n )\n }\n\n const pages = sourceFiles.map((sourcePath) => pageFromSource(loaded, sourcePath))\n const openApiHashes: string[] = []\n const openApiGroups: DocumentationNavigationNode[] = []\n for (const openapiConfig of loaded.config.openapi) {\n const api = parseOpenApi(resolve(appDir), openapiConfig)\n openApiHashes.push(api.raw)\n const apiPages = api.operations.map((operation) => {\n const markdown = operationMarkdown(operation)\n const parsed = parseMarkdown(markdown, `${api.sourcePath}#${operation.operationId}`)\n return {\n sourcePath: api.sourcePath,\n relativePath: `${relative(resolve(appDir), api.sourcePath)}#${operation.operationId}`,\n route: joinRoute(api.route, operation.operationId),\n title: operation.summary,\n description: operation.description,\n hidden: false,\n noindex: loaded.config.seo.noindex === true,\n markdown,\n html: parsed.html,\n text: parsed.text,\n headings: parsed.headings,\n sourceFormat: 'generated' as const,\n kind: 'openapi' as const,\n openapi: operation,\n } satisfies DocumentationPage\n })\n pages.push(...apiPages)\n openApiGroups.push({\n kind: 'group',\n label: api.title,\n items: apiPages.map((page) => ({ kind: 'page', route: page.route, label: page.title })),\n })\n }\n\n assertUniqueRoutes(pages)\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const navigation = loaded.config.navigation\n ? normalizeNavigation(loaded.config.navigation, byRoute, loaded.config)\n : automaticNavigation(pages.filter((page) => page.kind === 'page'))\n navigation.push(...openApiGroups)\n assertNavigationCoverage(navigation, pages, loaded.config)\n validatePageLinks(pages, byRoute, loaded.config.redirects)\n validateRedirectTargets(loaded.config, byRoute)\n\n const hash = createHash('sha256')\n hash.update(loaded.raw)\n for (const contentPath of contentFiles) {\n hash.update(relative(resolve(appDir), contentPath).split(sep).join('/'))\n hash.update(readFileSync(contentPath))\n }\n for (const raw of openApiHashes) hash.update(raw)\n const graph: DocumentationGraph = {\n config: loaded.config,\n pages: pages.sort((a, b) => a.route.localeCompare(b.route)),\n navigation,\n sourceHash: hash.digest('hex'),\n }\n return {\n appDir: resolve(appDir),\n configPath: loaded.configPath,\n sourceDir: loaded.sourceDir,\n outputDir: loaded.outputDir,\n graph,\n warnings,\n }\n}\n\nfunction pageFromSource(loaded: LoadedDocumentationConfig, sourcePath: string): DocumentationPage {\n const source = readFileSync(sourcePath, 'utf8')\n const relativePath = relative(loaded.sourceDir, sourcePath).split(sep).join('/')\n const rewritten = rewriteLocalReferences(source, relativePath, loaded.sourceDir, sourcePath)\n const sourceFormat = extname(sourcePath).toLowerCase() === '.mdx' ? 'mdx' : 'markdown'\n const authored = sourceFormat === 'mdx'\n ? parseMdx(rewritten, sourcePath)\n : parseMarkdown(rewritten, sourcePath)\n const route = authored.frontmatter.slug\n ? normalizeRoute(authored.frontmatter.slug)\n : routeFromRelativePath(relativePath)\n const title = authored.frontmatter.title\n ?? authored.headings.find((heading) => heading.depth === 1)?.text\n ?? titleFromFile(relativePath)\n const normalizedSource = stripFirstMarkdownH1(rewritten)\n const parsed = sourceFormat === 'mdx'\n ? parseMdx(normalizedSource, sourcePath)\n : parseMarkdown(normalizedSource, sourcePath)\n return {\n sourcePath,\n relativePath,\n route,\n title,\n description: parsed.frontmatter.description,\n hidden: parsed.frontmatter.hidden === true,\n noindex: loaded.config.seo.noindex === true || parsed.frontmatter.noindex === true,\n markdown: parsed.markdown,\n html: parsed.html,\n text: parsed.text,\n headings: parsed.headings,\n sourceFormat,\n kind: 'page',\n }\n}\n\nfunction collectContentFiles(sourceDir: string): string[] {\n const files: string[] = []\n const walk = (directory: string): void => {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'node_modules') continue\n const path = join(directory, entry.name)\n if (entry.isSymbolicLink()) {\n throw new DocumentationError(\n `Documentation content may not contain symbolic links: ${path}`,\n 'documentation_source_unsafe',\n [{ code: 'source_symlink', message: path, file: path }],\n )\n }\n if (entry.isDirectory()) walk(path)\n else if (entry.isFile()) files.push(path)\n }\n }\n walk(sourceDir)\n return files.sort()\n}\n\nfunction normalizeNavigation(\n items: DocumentationNavigationItem[],\n pages: Map<string, DocumentationPage>,\n config: DocumentationConfig,\n): DocumentationNavigationNode[] {\n return items.map((item): DocumentationNavigationNode => {\n if (typeof item === 'string') {\n const route = navigationReferenceToRoute(item)\n const page = pages.get(route)\n if (!page) {\n throw new DocumentationError(\n `Navigation references a missing page: ${item}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_missing_page', message: item }],\n )\n }\n return { kind: 'page', route, label: page.title }\n }\n if ('group' in item) {\n return {\n kind: 'group',\n label: item.group,\n items: normalizeNavigation(item.pages, pages, config),\n }\n }\n if (!isSafeLink(item.href)) {\n throw new DocumentationError(\n `Unsafe navigation link: ${item.href}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_unsafe_link', message: item.href }],\n )\n }\n if (item.href.startsWith('/')) {\n const route = normalizeRoute(item.href)\n if (!pages.has(route) && !config.redirects[route]) {\n throw new DocumentationError(\n `Navigation link points to an unknown internal route: ${item.href}`,\n 'documentation_navigation_invalid',\n [{ code: 'navigation_missing_route', message: item.href }],\n )\n }\n return { kind: 'link', href: route, label: item.label }\n }\n return { kind: 'link', href: item.href, label: item.label }\n })\n}\n\nfunction automaticNavigation(pages: DocumentationPage[]): DocumentationNavigationNode[] {\n return pages\n .filter((page) => !page.hidden)\n .sort((a, b) => a.route.localeCompare(b.route))\n .map((page) => ({ kind: 'page', route: page.route, label: page.title }))\n}\n\nfunction assertNavigationCoverage(\n navigation: DocumentationNavigationNode[],\n pages: DocumentationPage[],\n config: DocumentationConfig,\n): void {\n if (!config.navigation) return\n const routes = new Set<string>()\n const visit = (nodes: DocumentationNavigationNode[]): void => {\n for (const node of nodes) {\n if (node.kind === 'page') routes.add(node.route)\n else if (node.kind === 'group') visit(node.items)\n }\n }\n visit(navigation)\n const orphaned = pages.filter((page) => page.kind === 'page' && !page.hidden && !routes.has(page.route))\n if (orphaned.length > 0) {\n throw new DocumentationError(\n `${orphaned.length} public page(s) are missing from navigation`,\n 'documentation_navigation_incomplete',\n orphaned.map((page) => ({\n code: 'navigation_orphan',\n message: page.route,\n file: page.sourcePath,\n })),\n )\n }\n}\n\nfunction validatePageLinks(\n pages: DocumentationPage[],\n byRoute: Map<string, DocumentationPage>,\n redirects: Record<string, string>,\n): void {\n const diagnostics: DocumentationDiagnostic[] = []\n for (const page of pages) {\n if (page.kind !== 'page') continue\n const pattern = /(!?)\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+[\"'][^\"']*[\"'])?\\)/g\n for (const match of page.markdown.matchAll(pattern)) {\n const isImage = match[1] === '!'\n const href = match[2]\n if (isImage || href.startsWith('/media/')) continue\n if (/^(?:https?:|mailto:|#|data:)/i.test(href)) continue\n const routePart = href.split('#')[0].split('?')[0]\n if (!routePart) continue\n const target = routePart.startsWith('/')\n ? normalizeRoute(routePart)\n : normalizeRoute(posix.join(dirname(page.route), routePart))\n const normalized = navigationReferenceToRoute(target)\n if (!byRoute.has(normalized) && !redirects[normalized]) {\n diagnostics.push({\n code: 'broken_internal_link',\n message: `${href} resolves to ${normalized}`,\n file: page.sourcePath,\n line: page.markdown.slice(0, match.index).split('\\n').length,\n })\n }\n }\n }\n if (diagnostics.length > 0) {\n throw new DocumentationError(\n `${diagnostics.length} broken internal documentation link(s)`,\n 'documentation_links_invalid',\n diagnostics,\n )\n }\n}\n\nexport function rewriteLocalReferences(\n source: string,\n relativePath: string,\n sourceDir: string,\n sourcePath: string,\n): string {\n const pageDirectory = posix.dirname(relativePath)\n return source.replace(\n /(!?)\\[([^\\]]*)\\]\\(([^)\\s]+)((?:\\s+[\"'][^\"']*[\"'])?)\\)/g,\n (match, imageMarker: string, label: string, href: string, title: string) => {\n if (/^(?:https?:|mailto:|data:|#)/i.test(href)) return match\n const [pathPart, suffix = ''] = href.split(/(?=[?#])/)\n if (!pathPart) return match\n const relativeTarget = pathPart.startsWith('/')\n ? pathPart.replace(/^\\//, '')\n : posix.normalize(posix.join(pageDirectory, pathPart))\n if (relativeTarget === '..' || relativeTarget.startsWith('../')) {\n throw new DocumentationError(\n `Documentation reference escapes the source directory: ${href}`,\n 'documentation_link_unsafe',\n [{ code: 'link_path_escape', message: href, file: sourcePath }],\n )\n }\n const absoluteTarget = resolve(sourceDir, relativeTarget)\n if (imageMarker === '!') {\n if (!existsSync(absoluteTarget)) {\n throw new DocumentationError(\n `Documentation image not found: ${href}`,\n 'documentation_asset_missing',\n [{ code: 'asset_missing', message: href, file: sourcePath }],\n )\n }\n return `![${label}](/media/${relativeTarget}${suffix}${title})`\n }\n if (/\\.(?:md|mdx)$/i.test(relativeTarget)) {\n return `[${label}](${routeFromRelativePath(relativeTarget)}${suffix}${title})`\n }\n const markdownTarget = [\n `${absoluteTarget}.mdx`,\n `${absoluteTarget}.md`,\n join(absoluteTarget, 'index.mdx'),\n join(absoluteTarget, 'index.md'),\n ].find(existsSync)\n if (markdownTarget) {\n const targetRelative = relative(sourceDir, markdownTarget).split(sep).join('/')\n return `[${label}](${routeFromRelativePath(targetRelative)}${suffix}${title})`\n }\n if (existsSync(absoluteTarget)) {\n return `[${label}](/media/${relativeTarget}${suffix}${title})`\n }\n return match\n },\n )\n}\n\nfunction validateRedirectTargets(config: DocumentationConfig, byRoute: Map<string, DocumentationPage>): void {\n for (const [from, to] of Object.entries(config.redirects)) {\n const normalizedFrom = normalizeRoute(from)\n if (byRoute.has(normalizedFrom)) {\n throw new DocumentationError(\n `Redirect source collides with a page: ${from}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_page_collision', message: from }],\n )\n }\n const finalTarget = followRedirects(to, config.redirects)\n if (!byRoute.has(normalizeRoute(finalTarget))) {\n throw new DocumentationError(\n `Redirect target does not exist: ${from} -> ${to}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_missing_target', message: `${from} -> ${to}` }],\n )\n }\n }\n}\n\nfunction followRedirects(route: string, redirects: Record<string, string>): string {\n let cursor = route\n const seen = new Set<string>()\n while (redirects[cursor] && !seen.has(cursor)) {\n seen.add(cursor)\n cursor = redirects[cursor]\n }\n return cursor\n}\n\nfunction assertUniqueRoutes(pages: DocumentationPage[]): void {\n const seen = new Map<string, DocumentationPage>()\n for (const page of pages) {\n const existing = seen.get(page.route)\n if (existing) {\n throw new DocumentationError(\n `Multiple documentation pages resolve to ${page.route}`,\n 'documentation_route_collision',\n [existing, page].map((candidate) => ({\n code: 'route_collision',\n message: candidate.route,\n file: candidate.sourcePath,\n })),\n )\n }\n if (\n ['/api', '/assets', '/data', '/media', '/mcp', '/.well-known'].some(\n (reserved) => page.route === reserved || page.route.startsWith(`${reserved}/`),\n )\n ) {\n throw new DocumentationError(\n `Documentation route uses a reserved prefix: ${page.route}`,\n 'documentation_route_reserved',\n [{ code: 'reserved_route', message: page.route, file: page.sourcePath }],\n )\n }\n seen.set(page.route, page)\n }\n}\n\nfunction navigationReferenceToRoute(value: string): string {\n return normalizeRoute(value)\n}\n\nfunction titleFromFile(relativePath: string): string {\n const stem = basename(relativePath, extname(relativePath))\n const candidate = stem.toLowerCase() === 'index' ? basename(dirname(relativePath)) : stem\n if (!candidate || candidate === '.') return 'Overview'\n return candidate.split(/[-_]/).filter(Boolean).map(capitalize).join(' ')\n}\n\nfunction capitalize(value: string): string {\n return value.charAt(0).toUpperCase() + value.slice(1)\n}\n\nfunction joinRoute(left: string, right: string): string {\n return normalizeRoute(`${left}/${slugify(right)}`)\n}\n\nfunction isSafeLink(value: string): boolean {\n return /^(?:https?:\\/\\/|mailto:|\\/|#)/i.test(value)\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { z } from 'zod'\nimport {\n getDeepSpaceAIModel,\n listDeepSpaceAgentModels,\n resolveDeepSpaceAgentModel,\n} from '../shared/ai-models'\nimport {\n DOCUMENTATION_CONFIG_FILE,\n DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES,\n DocumentationError,\n type DocumentationConfig,\n type DocumentationDiagnostic,\n type DocumentationNavigationItem,\n type DocumentationOpenApiConfig,\n} from './types'\nimport { RAW_CONFIG_KEYS, THEME_CONFIG_KEYS, openapiItemSchema, rawConfigSchema } from './config/schema'\nimport {\n humanize,\n isWithin,\n safeChildPath,\n validateLinks,\n validateRedirects,\n} from './config/validation'\nimport { errorMessage } from './text'\n\nexport interface LoadedDocumentationConfig {\n config: DocumentationConfig\n configPath: string\n sourceDir: string\n outputDir: string\n raw: string\n warnings: DocumentationDiagnostic[]\n}\n\nexport function loadDocumentationConfig(appDir: string): LoadedDocumentationConfig {\n const resolvedAppDir = resolve(appDir)\n const configPath = resolve(resolvedAppDir, DOCUMENTATION_CONFIG_FILE)\n if (!existsSync(configPath)) {\n throw new DocumentationError(\n `No ${DOCUMENTATION_CONFIG_FILE} found in ${resolvedAppDir}`,\n 'documentation_config_missing',\n [{ code: 'documentation_config_missing', message: `Create ${DOCUMENTATION_CONFIG_FILE}`, file: configPath }],\n )\n }\n\n const raw = readFileSync(configPath, 'utf8')\n let input: unknown\n try {\n input = JSON.parse(raw)\n } catch (error) {\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} is not valid JSON: ${errorMessage(error)}`,\n 'documentation_config_invalid',\n [{ code: 'invalid_json', message: errorMessage(error), file: configPath }],\n )\n }\n\n const parsed = rawConfigSchema.safeParse(input)\n if (!parsed.success) {\n const diagnostics = parsed.error.issues.map((issue) => ({\n code: 'invalid_config_value',\n message: `${issue.path.join('.') || '<root>'}: ${issue.message}`,\n file: configPath,\n }))\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} has ${diagnostics.length} validation error(s)`,\n 'documentation_config_invalid',\n diagnostics,\n )\n }\n\n const data = parsed.data\n if (\n data.assistant.model !== undefined &&\n !resolveDeepSpaceAgentModel(data.assistant.model, 'documentation')\n ) {\n const catalogModel = getDeepSpaceAIModel(data.assistant.model)\n const reason = catalogModel\n ? `does not support the multi-step documentation agent (${catalogModel.note ?? 'incompatible runtime contract'})`\n : 'is not in the DeepSpace model catalog'\n const supported = listDeepSpaceAgentModels('documentation')\n .map((model) => model.id)\n .join(', ')\n throw new DocumentationError(\n `${DOCUMENTATION_CONFIG_FILE} has an unsupported assistant model`,\n 'documentation_config_invalid',\n [\n {\n code: 'unsupported_assistant_model',\n message: `assistant.model '${data.assistant.model}' ${reason}. Supported models: ${supported}`,\n file: configPath,\n },\n ],\n )\n }\n const warnings: DocumentationDiagnostic[] = []\n if (input && typeof input === 'object' && !Array.isArray(input)) {\n for (const key of Object.keys(input)) {\n if (!RAW_CONFIG_KEYS.has(key)) {\n warnings.push({\n code: 'unsupported_config_key',\n message: `Unsupported Mintlify configuration key '${key}' was ignored`,\n file: configPath,\n })\n }\n }\n const rawTheme = (input as Record<string, unknown>).theme\n if (rawTheme && typeof rawTheme === 'object' && !Array.isArray(rawTheme)) {\n for (const key of Object.keys(rawTheme)) {\n if (!THEME_CONFIG_KEYS.has(key)) {\n warnings.push({\n code: 'unsupported_config_key',\n message: `Unsupported theme configuration key 'theme.${key}' was ignored`,\n file: configPath,\n })\n }\n }\n }\n }\n const themeInput = typeof data.theme === 'string' ? {} : data.theme\n if (typeof data.theme === 'string') {\n warnings.push({\n code: 'mintlify_theme_normalized',\n message: `Mintlify theme '${data.theme}' is mapped to the native Orbit surface`,\n file: configPath,\n })\n }\n const logo = typeof data.logo === 'string' ? { light: data.logo } : data.logo\n const background = data.background?.color\n const bodyFont =\n data.fonts?.body ?? (data.fonts?.family ? { family: data.fonts.family } : undefined)\n const headingFont = data.fonts?.heading ?? bodyFont\n const monoFont = data.fonts?.mono\n const navigation = Array.isArray(data.navigation) ? data.navigation : data.navigation?.groups\n if (data.navigation && !Array.isArray(data.navigation)) {\n warnings.push({\n code: 'mintlify_navigation_normalized',\n message: 'Mintlify navigation.groups was normalized to native navigation',\n file: configPath,\n })\n }\n const navbarLinks = [\n ...(data.navbar?.links ?? []),\n ...(data.navbar?.primary\n ? [{ label: data.navbar.primary.label, href: data.navbar.primary.href }]\n : []),\n ]\n const footer = Array.isArray(data.footer)\n ? data.footer\n : Object.entries(data.footer.socials ?? {}).map(([label, href]) => ({\n label: humanize(label),\n href,\n }))\n const config: DocumentationConfig = {\n $schema: data.$schema,\n name: data.name,\n description: data.description,\n source: data.source,\n output: data.output,\n url: data.url,\n domains: [...new Set(data.domains)],\n theme: {\n ...themeInput,\n accent: themeInput.accent ?? data.colors?.primary ?? data.colors?.light ?? data.colors?.dark,\n // Mintlify's colors.light is \"the anchor color used in dark mode\".\n accentDark: themeInput.accentDark ?? data.colors?.light,\n background: background?.light ?? themeInput.background,\n backgroundDark: background && 'dark' in background ? background.dark : undefined,\n backgroundDecoration: data.background?.decoration,\n bodyFont,\n headingFont,\n monoFont,\n codeBlockMode: data.styling?.codeblocks,\n eyebrowStyle: data.styling?.eyebrows,\n logo: themeInput.logo ?? logo?.light,\n logoDark: themeInput.logoDark ?? logo?.dark,\n logoHref: logo?.href,\n favicon: themeInput.favicon ?? data.favicon,\n defaultMode: data.appearance?.default ?? themeInput.defaultMode,\n strictMode: themeInput.strictMode ?? data.appearance?.strict,\n },\n navigation: navigation as DocumentationNavigationItem[] | undefined,\n links: data.links.length > 0 ? data.links : navbarLinks,\n footer,\n redirects: data.redirects,\n openapi: normalizeOpenApi(data.openapi, data.api) as DocumentationOpenApiConfig[],\n assistant: data.assistant,\n mcp: data.mcp,\n contextual: data.contextual,\n seo: {\n ...(data.seo.noindex === undefined ? {} : { noindex: data.seo.noindex }),\n ...(data.seo.ogImage ? { ogImage: data.seo.ogImage } : {}),\n ...((data.seo.metaTags ?? data.seo.metatags)\n ? { metaTags: data.seo.metaTags ?? data.seo.metatags }\n : {}),\n },\n }\n validateRedirects(config.redirects, configPath)\n validateLinks(config.links, 'links', configPath)\n validateLinks(config.footer, 'footer', configPath)\n if (config.theme.logoHref) {\n validateLinks([{ label: 'logo', href: config.theme.logoHref }], 'logo.href', configPath)\n }\n\n const sourceDir = safeChildPath(resolvedAppDir, config.source, 'source', configPath)\n const outputDir = safeChildPath(resolvedAppDir, config.output, 'output', configPath)\n if (sourceDir === outputDir || isWithin(sourceDir, outputDir)) {\n throw new DocumentationError(\n 'documentation.json output must not contain the documentation source directory',\n 'documentation_path_collision',\n [\n {\n code: 'documentation_path_collision',\n message: `source=${config.source}, output=${config.output}`,\n file: configPath,\n },\n ],\n )\n }\n\n config.theme = {\n ...config.theme,\n ...(config.theme.logo ? { logo: normalizeLocalAsset(config.theme.logo, sourceDir) } : {}),\n ...(config.theme.logoDark\n ? { logoDark: normalizeLocalAsset(config.theme.logoDark, sourceDir) }\n : {}),\n ...(config.theme.favicon\n ? { favicon: normalizeLocalAsset(config.theme.favicon, sourceDir) }\n : {}),\n ...(config.theme.bodyFont?.source\n ? {\n bodyFont: {\n ...config.theme.bodyFont,\n source: normalizeLocalAsset(config.theme.bodyFont.source, sourceDir),\n },\n }\n : {}),\n ...(config.theme.headingFont?.source\n ? {\n headingFont: {\n ...config.theme.headingFont,\n source: normalizeLocalAsset(config.theme.headingFont.source, sourceDir),\n },\n }\n : {}),\n ...(config.theme.monoFont?.source\n ? {\n monoFont: {\n ...config.theme.monoFont,\n source: normalizeLocalAsset(config.theme.monoFont.source, sourceDir),\n },\n }\n : {}),\n }\n if (config.seo.ogImage) {\n config.seo = {\n ...config.seo,\n ogImage: normalizeLocalAsset(config.seo.ogImage, sourceDir),\n }\n }\n\n return { config, configPath, sourceDir, outputDir, raw, warnings }\n}\n\nfunction normalizeLocalAsset(value: string, sourceDir: string): string {\n if (/^(?:https?:|data:|\\/media\\/)/i.test(value)) return value\n const relativePath = value.replace(/^\\.\\//, '').replace(/^\\/+/, '')\n if (!relativePath || !existsSync(resolve(sourceDir, relativePath))) return value\n return `/media/${relativePath.split('\\\\').join('/')}`\n}\n\nfunction normalizeOpenApi(\n value: z.infer<typeof openapiItemSchema> | Array<z.infer<typeof openapiItemSchema>> | undefined,\n api: z.infer<typeof rawConfigSchema>['api'],\n): Array<z.infer<typeof openapiItemSchema>> {\n if (!value) return []\n const items = Array.isArray(value) ? value : [value]\n return items.map((item) => {\n const localExamples = 'examples' in item ? item.examples : undefined\n const display = api?.playground?.display\n return {\n ...item,\n ...('playground' in item && item.playground !== undefined\n ? { playground: item.playground }\n : display\n ? { playground: display === 'interactive' }\n : {}),\n examples: {\n languages: localExamples?.languages ??\n api?.examples?.languages ?? [...DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.languages],\n defaults: localExamples?.defaults ??\n api?.examples?.defaults ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.defaults,\n autogenerate: localExamples?.autogenerate ??\n api?.examples?.autogenerate ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.autogenerate,\n },\n }\n })\n}\n","/**\n * Canonical DeepSpace model catalog and agent policy.\n *\n * Provider catalogs are discovery inputs, not a safe runtime allowlist: a\n * model is promoted here only after its tool loop, transport, pricing, and\n * streaming contract have been verified end to end through the DeepSpace\n * proxy. Every client picker and server agent profile consumes this module.\n */\n\nexport type DeepSpaceAIProvider = 'anthropic' | 'openai' | 'cerebras'\nexport type DeepSpaceAgentProfileId = 'application' | 'documentation'\nexport type DeepSpaceAgentSupport = 'multi-step' | 'single-step' | 'none'\n\nexport interface DeepSpaceAIModel {\n id: string\n label: string\n provider: DeepSpaceAIProvider\n providerLabel: string\n family: string\n /** Whether the model is eligible for DeepSpace's server-owned agent loop. */\n agentSupport: DeepSpaceAgentSupport\n /** Profiles in which the model has passed the complete runtime contract. */\n agentProfiles: readonly DeepSpaceAgentProfileId[]\n /** Provider transport currently used by the DeepSpace proxy adapter. */\n transport: 'messages' | 'chat-completions'\n recommendation: 'frontier' | 'balanced' | 'fast' | 'available' | 'limited'\n note?: string\n}\n\nexport interface DeepSpaceAgentProfile {\n id: DeepSpaceAgentProfileId\n defaultModel: string\n maxSteps: number\n maxToolCalls?: number\n allowedTools: 'application-defined' | readonly string[]\n}\n\n/**\n * Versioned provenance for the provider catalogs used during the latest\n * promotion review. Keeping this in the shipped artifact makes selection\n * policy auditable without allowing a mutable upstream list to change a\n * deployed app underneath a commit.\n */\nexport const DEEPSPACE_MODEL_CATALOG_PROVENANCE = {\n version: '2026-08-04',\n verifiedAt: '2026-08-04',\n sources: {\n anthropic: 'https://platform.claude.com/docs/en/api/beta/models/list',\n openai: 'https://developers.openai.com/api/docs/models/all',\n cerebras: 'https://inference-docs.cerebras.ai/models/overview',\n },\n} as const\n\nconst MULTI_STEP_AGENT_PROFILES = ['application', 'documentation'] as const\n\ntype MultiStepModelInput = Pick<DeepSpaceAIModel, 'id' | 'label' | 'family' | 'recommendation'>\ntype MultiStepProvider = Pick<DeepSpaceAIModel, 'provider' | 'providerLabel' | 'transport'>\n\nfunction createMultiStepModelFactory<const Provider extends MultiStepProvider>(provider: Provider) {\n return <const Model extends MultiStepModelInput>(model: Model) => ({\n ...model,\n ...provider,\n agentSupport: 'multi-step' as const,\n agentProfiles: MULTI_STEP_AGENT_PROFILES,\n })\n}\n\nconst anthropicModel = createMultiStepModelFactory({\n provider: 'anthropic',\n providerLabel: 'Anthropic',\n transport: 'messages',\n})\n\nconst openAIModel = createMultiStepModelFactory({\n provider: 'openai',\n providerLabel: 'OpenAI',\n transport: 'chat-completions',\n})\n\nexport const DEEPSPACE_AI_MODELS = [\n anthropicModel({\n id: 'claude-fable-5',\n label: 'Claude Fable 5',\n family: 'Claude 5',\n recommendation: 'frontier',\n }),\n anthropicModel({\n id: 'claude-opus-5',\n label: 'Claude Opus 5',\n family: 'Claude 5',\n recommendation: 'frontier',\n }),\n anthropicModel({\n id: 'claude-sonnet-5',\n label: 'Claude Sonnet 5',\n family: 'Claude 5',\n recommendation: 'balanced',\n }),\n anthropicModel({\n id: 'claude-haiku-4-5',\n label: 'Claude Haiku 4.5',\n family: 'Claude 4.5',\n recommendation: 'fast',\n }),\n openAIModel({\n id: 'gpt-5.6-sol',\n label: 'GPT-5.6 Sol',\n family: 'GPT-5.6',\n recommendation: 'frontier',\n }),\n openAIModel({\n id: 'gpt-5.6-terra',\n label: 'GPT-5.6 Terra',\n family: 'GPT-5.6',\n recommendation: 'balanced',\n }),\n openAIModel({\n id: 'gpt-5.6-luna',\n label: 'GPT-5.6 Luna',\n family: 'GPT-5.6',\n recommendation: 'fast',\n }),\n {\n id: 'gpt-oss-120b',\n label: 'GPT-OSS 120B',\n provider: 'cerebras',\n providerLabel: 'Cerebras',\n family: 'GPT-OSS',\n agentSupport: 'single-step',\n agentProfiles: [],\n transport: 'chat-completions',\n recommendation: 'limited',\n note: 'Available for direct generation; the current proxy adapter has not passed multi-step tool-result continuation.',\n },\n] as const satisfies readonly DeepSpaceAIModel[]\n\nexport const DEEPSPACE_AI_DEFAULTS = {\n agent: 'claude-sonnet-5',\n directGeneration: 'claude-sonnet-5',\n summarization: 'claude-haiku-4-5',\n} as const satisfies Record<string, DeepSpaceAIModelId>\n\nexport const DEEPSPACE_AGENT_PROFILES = {\n application: {\n id: 'application',\n defaultModel: DEEPSPACE_AI_DEFAULTS.agent,\n maxSteps: 21,\n maxToolCalls: 20,\n allowedTools: 'application-defined',\n },\n documentation: {\n id: 'documentation',\n defaultModel: DEEPSPACE_AI_DEFAULTS.agent,\n // Permit up to twenty completed read-only tools plus one final synthesis\n // step. The runner disables tools once the tool-call budget is exhausted.\n maxSteps: 21,\n maxToolCalls: 20,\n allowedTools: ['documentation_search', 'documentation_read'],\n },\n} as const satisfies Record<DeepSpaceAgentProfileId, DeepSpaceAgentProfile>\n\nexport type DeepSpaceAIModelId = (typeof DEEPSPACE_AI_MODELS)[number]['id']\n\nexport function getDeepSpaceAIModel(modelId: unknown): DeepSpaceAIModel | null {\n if (typeof modelId !== 'string') return null\n return DEEPSPACE_AI_MODELS.find((model) => model.id === modelId) ?? null\n}\n\nexport function listDeepSpaceAgentModels(\n profileId: DeepSpaceAgentProfileId = 'application',\n): readonly DeepSpaceAIModel[] {\n const defaultModel = DEEPSPACE_AGENT_PROFILES[profileId].defaultModel\n return DEEPSPACE_AI_MODELS.filter((model) =>\n (model.agentProfiles as readonly DeepSpaceAgentProfileId[]).includes(profileId),\n ).sort((left, right) => Number(right.id === defaultModel) - Number(left.id === defaultModel))\n}\n\nexport interface ResolvedDeepSpaceAgentModel {\n modelId: string\n provider: DeepSpaceAIProvider\n model: DeepSpaceAIModel\n profile: DeepSpaceAgentProfile\n}\n\nexport function resolveDeepSpaceAgentModel(\n modelId: unknown,\n profileId: DeepSpaceAgentProfileId = 'application',\n): ResolvedDeepSpaceAgentModel | null {\n const profile = DEEPSPACE_AGENT_PROFILES[profileId]\n const resolvedId = modelId === undefined ? profile.defaultModel : modelId\n const model = getDeepSpaceAIModel(resolvedId)\n if (!model || !model.agentProfiles.includes(profileId)) return null\n return { modelId: model.id, provider: model.provider, model, profile }\n}\n","import { z } from 'zod'\nimport {\n DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS,\n DOCUMENTATION_CONTEXTUAL_ACTIONS,\n DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES,\n} from '../types'\n\nconst linkSchema = z.object({\n label: z.string().trim().min(1),\n href: z.string().trim().min(1),\n})\n\ntype NavigationInput =\n | string\n | z.infer<typeof linkSchema>\n | {\n group: string\n pages: NavigationInput[]\n }\n\nconst navigationSchema: z.ZodType<NavigationInput> = z.lazy(() =>\n z.union([\n z.string().trim().min(1),\n linkSchema,\n z.object({\n group: z.string().trim().min(1),\n pages: z.array(navigationSchema).min(1),\n }),\n ]),\n)\n\nconst openApiExamplesSchema = z.object({\n languages: z.array(z.enum(DOCUMENTATION_OPENAPI_SAMPLE_LANGUAGES)).min(1).optional(),\n defaults: z.enum(['required', 'all']).optional(),\n autogenerate: z.boolean().optional(),\n})\n\nexport const openapiItemSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((source) => ({ source })),\n z.object({\n source: z.string().trim().min(1),\n route: z.string().trim().optional(),\n label: z.string().trim().min(1).optional(),\n playground: z.boolean().optional(),\n baseUrl: z.string().url().optional(),\n examples: openApiExamplesSchema.optional(),\n }),\n])\n\nexport const themeObjectSchema = z.object({\n accent: z.string().trim().optional(),\n accentDark: z.string().trim().optional(),\n background: z.string().trim().optional(),\n density: z.enum(['comfortable', 'compact']).optional(),\n logo: z.string().trim().optional(),\n logoDark: z.string().trim().optional(),\n favicon: z.string().trim().optional(),\n defaultMode: z.enum(['light', 'dark', 'system']).optional(),\n strictMode: z.boolean().optional(),\n})\n\n/** Derived from the schema so the unknown-key sweep can never drift from it. */\nexport const THEME_CONFIG_KEYS = new Set(Object.keys(themeObjectSchema.shape))\n\nconst fontSpecSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((family) => ({ family })),\n z.object({\n family: z.string().trim().min(1),\n weight: z.union([z.number().int().min(100).max(900), z.string().trim().min(1)]).optional(),\n source: z.string().trim().min(1).optional(),\n format: z.string().trim().min(1).optional(),\n }),\n])\n\nconst colorPairSchema = z.union([\n z\n .string()\n .trim()\n .min(1)\n .transform((color) => ({ light: color })),\n z.object({\n light: z.string().trim().min(1).optional(),\n dark: z.string().trim().min(1).optional(),\n }),\n])\n\nconst navigationRootSchema = z.union([\n z.array(navigationSchema),\n z.object({\n groups: z.array(\n z.object({\n group: z.string().trim().min(1),\n pages: z.array(navigationSchema).min(1),\n }),\n ),\n }),\n])\n\nconst navbarSchema = z\n .object({\n links: z.array(linkSchema).optional(),\n primary: z\n .object({\n type: z.string().optional(),\n label: z.string().trim().min(1),\n href: z.string().trim().min(1),\n })\n .optional(),\n })\n .optional()\n\nconst footerSchema = z.union([\n z.array(linkSchema),\n z.object({ socials: z.record(z.string(), z.string().trim().min(1)).optional() }),\n])\n\nconst logoSchema = z\n .union([\n z.string().trim().min(1),\n z.object({\n light: z.string().trim().min(1),\n dark: z.string().trim().min(1).optional(),\n href: z.string().trim().min(1).optional(),\n }),\n ])\n .optional()\n\nconst contextualActionsSchema = z\n .array(z.enum(DOCUMENTATION_CONTEXTUAL_ACTIONS))\n .min(1)\n .max(DOCUMENTATION_CONTEXTUAL_ACTIONS.length)\n .refine((actions) => new Set(actions).size === actions.length, {\n message: 'actions must not contain duplicates',\n })\n\nconst hostnameSchema = z\n .hostname('must be a hostname such as docs.example.com')\n .trim()\n .toLowerCase()\n .refine((value) => value.includes('.'), 'must include a public suffix')\n\nexport const rawConfigSchema = z.object({\n $schema: z.string().optional(),\n name: z.string().trim().min(1),\n description: z.string().trim().optional(),\n source: z.string().trim().min(1).default('documentation'),\n output: z.string().trim().min(1).default('dist/_documentation'),\n url: z.string().url().optional(),\n domains: z\n .array(hostnameSchema)\n .max(1, 'one compiled documentation surface has one canonical custom domain')\n .default([]),\n theme: z.union([z.string().trim().min(1), themeObjectSchema]).default({}),\n colors: z\n .object({\n primary: z.string().trim().optional(),\n light: z.string().trim().optional(),\n dark: z.string().trim().optional(),\n })\n .optional(),\n logo: logoSchema,\n favicon: z.string().trim().min(1).optional(),\n appearance: z\n .object({\n default: z.enum(['light', 'dark', 'system']).optional(),\n strict: z.boolean().optional(),\n })\n .optional(),\n background: z\n .object({\n color: colorPairSchema.optional(),\n decoration: z.enum(['none', 'gradient', 'grid']).optional(),\n })\n .optional(),\n fonts: z\n .object({\n family: z.string().trim().min(1).optional(),\n body: fontSpecSchema.optional(),\n heading: fontSpecSchema.optional(),\n mono: fontSpecSchema.optional(),\n })\n .optional(),\n styling: z\n .object({\n codeblocks: z.enum(['dark', 'system']).optional(),\n eyebrows: z.enum(['section', 'breadcrumbs', 'none']).optional(),\n })\n .optional(),\n navigation: navigationRootSchema.optional(),\n navbar: navbarSchema,\n links: z.array(linkSchema).default([]),\n footer: footerSchema.default([]),\n redirects: z.record(z.string(), z.string()).default({}),\n api: z\n .object({\n playground: z\n .object({\n display: z.enum(['interactive', 'simple', 'none']).optional(),\n })\n .optional(),\n examples: openApiExamplesSchema.optional(),\n })\n .optional(),\n openapi: z.union([openapiItemSchema, z.array(openapiItemSchema)]).optional(),\n assistant: z\n .object({\n access: z.enum(['disabled', 'public', 'authenticated']).default('disabled'),\n model: z.string().trim().min(1).optional(),\n suggestions: z.array(z.string().trim().min(1)).max(6).optional(),\n })\n .default({ access: 'disabled' }),\n mcp: z\n .object({\n access: z.enum(['disabled', 'public']).default('public'),\n })\n .default({ access: 'public' }),\n contextual: z\n .object({\n actions: contextualActionsSchema.default([...DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS]),\n })\n .default({ actions: [...DEFAULT_DOCUMENTATION_CONTEXTUAL_ACTIONS] }),\n seo: z\n .object({\n noindex: z.boolean().optional(),\n ogImage: z.string().trim().optional(),\n metaTags: z.record(z.string(), z.string()).optional(),\n metatags: z.record(z.string(), z.string()).optional(),\n })\n .default({}),\n})\n\nexport const RAW_CONFIG_KEYS = new Set([\n '$schema',\n 'name',\n 'description',\n 'source',\n 'output',\n 'url',\n 'domains',\n 'theme',\n 'colors',\n 'logo',\n 'favicon',\n 'appearance',\n 'background',\n 'fonts',\n 'styling',\n 'navigation',\n 'navbar',\n 'links',\n 'footer',\n 'redirects',\n 'api',\n 'openapi',\n 'assistant',\n 'mcp',\n 'contextual',\n 'seo',\n])\n","import { existsSync, realpathSync } from 'node:fs'\nimport { isAbsolute, relative, resolve } from 'node:path'\nimport { DocumentationError } from '../types'\n\nexport function validateLinks(\n links: Array<{ label: string; href: string }>,\n field: string,\n configPath: string,\n): void {\n for (const link of links) {\n if (!/^(?:https?:\\/\\/|mailto:|\\/|#)/i.test(link.href)) {\n throw new DocumentationError(\n `Unsafe ${field} link: ${link.href}`,\n 'documentation_config_invalid',\n [{ code: 'unsafe_link', message: `${field}: ${link.href}`, file: configPath }],\n )\n }\n }\n}\n\nexport function safeChildPath(appDir: string, configured: string, field: string, configPath: string): string {\n if (isAbsolute(configured)) {\n throw new DocumentationError(\n `documentation.json ${field} must be relative to the app directory`,\n 'documentation_path_invalid',\n [{ code: 'absolute_path', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n const path = resolve(appDir, configured)\n const rel = relative(appDir, path)\n if (rel === '..' || rel.startsWith(`..${pathSeparator()}`)) {\n throw new DocumentationError(\n `documentation.json ${field} escapes the app directory`,\n 'documentation_path_invalid',\n [{ code: 'path_escape', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n if (existsSync(path)) {\n const realRoot = realpathSync(appDir)\n const realPath = realpathSync(path)\n const realRelative = relative(realRoot, realPath)\n if (realRelative === '..' || realRelative.startsWith(`..${pathSeparator()}`)) {\n throw new DocumentationError(\n `documentation.json ${field} resolves outside the app directory`,\n 'documentation_path_invalid',\n [{ code: 'path_symlink_escape', message: `${field}: ${configured}`, file: configPath }],\n )\n }\n }\n return path\n}\n\nfunction pathSeparator(): string {\n return process.platform === 'win32' ? '\\\\' : '/'\n}\n\nexport function isWithin(parent: string, child: string): boolean {\n const rel = relative(parent, child)\n return rel !== '' && rel !== '..' && !rel.startsWith(`..${pathSeparator()}`)\n}\n\nexport function validateRedirects(redirects: Record<string, string>, configPath: string): void {\n for (const [from, to] of Object.entries(redirects)) {\n if (!from.startsWith('/') || !to.startsWith('/')) {\n throw new DocumentationError(\n `Redirects must use absolute site paths: ${from} -> ${to}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_path', message: `${from} -> ${to}`, file: configPath }],\n )\n }\n if (from === to) {\n throw new DocumentationError(\n `Redirect points to itself: ${from}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_loop', message: from, file: configPath }],\n )\n }\n const seen = new Set([from])\n let cursor: string | undefined = to\n while (cursor && redirects[cursor]) {\n if (seen.has(cursor)) {\n throw new DocumentationError(\n `Redirect loop includes ${cursor}`,\n 'documentation_redirect_invalid',\n [{ code: 'redirect_loop', message: [...seen, cursor].join(' -> '), file: configPath }],\n )\n }\n seen.add(cursor)\n cursor = redirects[cursor]\n }\n }\n}\n\nexport function humanize(value: string): string {\n return value\n .split(/[-_]/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ')\n}\n","import { createProcessor, type CompileOptions } from '@mdx-js/mdx'\nimport { gfmToMarkdown } from 'mdast-util-gfm'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport remarkFrontmatter from 'remark-frontmatter'\nimport remarkGfm from 'remark-gfm'\nimport rehypeHighlight from 'rehype-highlight'\nimport { parseCodeFenceInfo, parseFrontmatter, parseMarkdown, type ParsedMarkdown } from './markdown'\nimport { createSlugger, errorMessage } from './text'\nimport { DocumentationError } from './types'\n\ninterface SyntaxNode {\n type: string\n value?: string\n depth?: number\n lang?: string | null\n meta?: string | null\n name?: string | null\n attributes?: Array<{ type?: string; name?: string; value?: unknown }>\n children?: SyntaxNode[]\n data?: Record<string, unknown>\n position?: { start?: { line?: number } }\n}\n\nconst EXECUTABLE_NODE_TYPES = new Set([\n 'mdxjsEsm',\n 'mdxFlowExpression',\n 'mdxTextExpression',\n])\n\nexport function parseMdx(source: string, file: string): ParsedMarkdown {\n const { frontmatter, body } = parseFrontmatter(source, file)\n try {\n const processor = createProcessor({ remarkPlugins: [remarkGfm] })\n const tree = processor.parse(body) as unknown as SyntaxNode\n const staticTree = projectStaticMarkdown(tree)\n const markdown = toMarkdown(staticTree as unknown as Parameters<typeof toMarkdown>[0], {\n extensions: [gfmToMarkdown()],\n })\n return { ...parseMarkdown(markdown, file), frontmatter }\n } catch (error) {\n if (error instanceof DocumentationError) throw error\n const line = diagnosticLine(error)\n throw new DocumentationError(\n `Invalid MDX in ${file}: ${errorMessage(error)}`,\n 'documentation_mdx_invalid',\n [{ code: 'mdx_syntax', message: errorMessage(error), file, ...(line ? { line } : {}) }],\n )\n }\n}\n\n/** Shared compile settings keep graph headings and executable MDX output identical. */\nexport function mdxCompileOptions(): CompileOptions {\n return {\n jsx: false,\n outputFormat: 'program',\n remarkPlugins: [remarkGfm, remarkFrontmatter, removeFrontmatter, addRuntimeMetadata],\n rehypePlugins: [rehypeHighlight],\n }\n}\n\nfunction projectStaticMarkdown(node: SyntaxNode): SyntaxNode {\n const projected: SyntaxNode = { ...node }\n delete projected.attributes\n delete projected.name\n projected.children = (node.children ?? []).flatMap(projectStaticNode)\n return projected\n}\n\nfunction projectStaticNode(node: SyntaxNode): SyntaxNode[] {\n if (EXECUTABLE_NODE_TYPES.has(node.type)) return []\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n const title = jsxTitle(node)\n const titleNode = title\n ? [{\n type: 'paragraph',\n children: [{ type: 'text', value: title }],\n } satisfies SyntaxNode]\n : []\n return [...titleNode, ...(node.children ?? []).flatMap(projectStaticNode)]\n }\n return [projectStaticMarkdown(node)]\n}\n\nfunction jsxTitle(node: SyntaxNode): string | undefined {\n const attribute = node.attributes?.find((candidate) =>\n candidate.type === 'mdxJsxAttribute' && (candidate.name === 'title' || candidate.name === 'label'),\n )\n return typeof attribute?.value === 'string' ? attribute.value : undefined\n}\n\nfunction removeFrontmatter() {\n return (tree: SyntaxNode): void => {\n tree.children = tree.children?.filter((node) => node.type !== 'yaml')\n }\n}\n\nfunction addRuntimeMetadata() {\n return (tree: SyntaxNode): void => {\n const slug = createSlugger()\n visit(tree, (node) => {\n if (node.type === 'heading') {\n const text = staticText(node)\n const id = slug(text)\n node.data = {\n ...node.data,\n hProperties: {\n ...asRecord(node.data?.hProperties),\n id,\n },\n }\n }\n if (node.type === 'code' && typeof node.meta === 'string' && node.meta.trim()) {\n // Same fence-info grammar as the Markdown path: a bare word or a\n // title=\"…\" pair after the language becomes the block title.\n const { title } = parseCodeFenceInfo(`${node.lang ?? ''} ${node.meta}`.trim())\n if (title) {\n node.data = {\n ...node.data,\n hProperties: {\n ...asRecord(node.data?.hProperties),\n 'data-code-title': title,\n },\n }\n }\n }\n })\n }\n}\n\nfunction staticText(node: SyntaxNode): string {\n if (node.type === 'text' || node.type === 'inlineCode') return node.value ?? ''\n if (EXECUTABLE_NODE_TYPES.has(node.type)) return ''\n return (node.children ?? []).map(staticText).join('')\n}\n\nfunction visit(node: SyntaxNode, visitor: (node: SyntaxNode) => void): void {\n visitor(node)\n for (const child of node.children ?? []) visit(child, visitor)\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? value as Record<string, unknown>\n : {}\n}\n\nfunction diagnosticLine(error: unknown): number | undefined {\n if (!error || typeof error !== 'object' || !('line' in error)) return undefined\n return typeof error.line === 'number' ? error.line : undefined\n}\n","import { existsSync, readFileSync, realpathSync } from 'node:fs'\nimport { basename, extname, relative, resolve, sep } from 'node:path'\nimport { parse as parseYaml } from 'yaml'\nimport {\n DocumentationError,\n type DocumentationOpenApiConfig,\n type DocumentationOpenApiOperation,\n type DocumentationOpenApiParameter,\n} from './types'\nimport { slugify } from './markdown'\nimport { normalizeRoute } from './routing'\nimport { errorMessage } from './text'\nimport { createOpenApiCodeSamples } from './openapi-samples'\nimport { asOpenApiObject, resolveOpenApiObject } from './openapi-object'\n\nconst HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete', 'options', 'head', 'trace'] as const\n\ninterface OpenApiDocument {\n openapi?: unknown\n swagger?: unknown\n info?: { title?: unknown; description?: unknown }\n servers?: Array<{ url?: unknown }>\n host?: unknown\n basePath?: unknown\n schemes?: unknown\n security?: unknown\n paths?: Record<string, Record<string, unknown>>\n}\n\nexport interface ParsedOpenApi {\n sourcePath: string\n title: string\n route: string\n raw: string\n operations: DocumentationOpenApiOperation[]\n}\n\nexport function parseOpenApi(appDir: string, config: DocumentationOpenApiConfig): ParsedOpenApi {\n const sourcePath = resolve(appDir, config.source)\n assertOpenApiSourcePath(appDir, sourcePath, config.source)\n if (!existsSync(sourcePath)) {\n throw new DocumentationError(`OpenAPI source not found: ${config.source}`, 'documentation_openapi_missing', [\n { code: 'openapi_missing', message: config.source, file: sourcePath },\n ])\n }\n assertOpenApiSourcePath(appDir, realpathSync(sourcePath), config.source)\n const raw = readFileSync(sourcePath, 'utf8')\n let parsed: unknown\n try {\n parsed = ['.yaml', '.yml'].includes(extname(sourcePath).toLowerCase())\n ? parseYaml(raw, { maxAliasCount: 50 })\n : JSON.parse(raw)\n } catch (error) {\n throw new DocumentationError(\n `Invalid OpenAPI document ${config.source}: ${errorMessage(error)}`,\n 'documentation_openapi_invalid',\n [{ code: 'openapi_parse', message: errorMessage(error), file: sourcePath }],\n )\n }\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n throw invalidOpenApi(sourcePath, 'Document root must be an object')\n }\n const document = parsed as OpenApiDocument\n if (typeof document.openapi !== 'string' && typeof document.swagger !== 'string') {\n throw invalidOpenApi(sourcePath, 'Expected an openapi or swagger version field')\n }\n if (!document.paths || typeof document.paths !== 'object') {\n throw invalidOpenApi(sourcePath, 'Expected a paths object')\n }\n\n const documentServer = firstServerUrl(document.servers) ?? swaggerServerUrl(document)\n const operations: DocumentationOpenApiOperation[] = []\n const ids = new Set<string>()\n for (const [path, pathItem] of Object.entries(document.paths)) {\n const normalizedPathItem = resolveOpenApiObject(pathItem, document as Record<string, unknown>)\n if (!normalizedPathItem) continue\n for (const method of HTTP_METHODS) {\n const operation = resolveOpenApiObject(\n normalizedPathItem[method],\n document as Record<string, unknown>,\n )\n if (!operation) continue\n const baseUrl =\n config.baseUrl ??\n firstServerUrl(operation.servers) ??\n firstServerUrl(normalizedPathItem.servers) ??\n documentServer\n const fallbackId = `${method}-${path}`\n const operationId = slugify(\n typeof operation.operationId === 'string' ? operation.operationId : fallbackId,\n )\n if (!operationId)\n throw invalidOpenApi(sourcePath, `Could not derive id for ${method} ${path}`)\n if (ids.has(operationId)) {\n throw invalidOpenApi(sourcePath, `Duplicate operation id: ${operationId}`)\n }\n ids.add(operationId)\n const summary =\n typeof operation.summary === 'string'\n ? operation.summary\n : `${method.toUpperCase()} ${path}`\n const parameters = mergeParameters(\n normalizedPathItem.parameters,\n operation.parameters,\n document as Record<string, unknown>,\n )\n const security = 'security' in operation ? operation.security : document.security\n const normalized = {\n method: method.toUpperCase(),\n path,\n operationId,\n summary,\n ...(typeof operation.description === 'string'\n ? { description: operation.description }\n : {}),\n tags: Array.isArray(operation.tags)\n ? operation.tags.filter((tag): tag is string => typeof tag === 'string')\n : [],\n parameters,\n ...('requestBody' in operation ? { requestBody: operation.requestBody } : {}),\n responses: normalizeResponses(operation.responses, document as Record<string, unknown>),\n ...(security === undefined ? {} : { security }),\n ...(baseUrl ? { baseUrl } : {}),\n playground: config.playground === true && Boolean(baseUrl),\n } satisfies Omit<DocumentationOpenApiOperation, 'codeSamples'>\n operations.push({\n ...normalized,\n codeSamples: createOpenApiCodeSamples(\n normalized,\n document as Record<string, unknown>,\n config.examples,\n operation['x-codeSamples'] ?? operation['x-code-samples'],\n ),\n })\n }\n }\n if (operations.length === 0) {\n throw invalidOpenApi(sourcePath, 'No HTTP operations found')\n }\n\n const route = normalizeRoute(config.route ?? '/api-reference')\n const title =\n config.label ??\n (typeof document.info?.title === 'string'\n ? document.info.title\n : basename(config.source, extname(config.source)))\n return { sourcePath, title, route, raw, operations }\n}\n\nfunction assertOpenApiSourcePath(appDir: string, sourcePath: string, configured: string): void {\n const sourceIsReal = existsSync(sourcePath)\n const root =\n sourceIsReal && existsSync(appDir) && sourcePath === realpathSync(sourcePath)\n ? realpathSync(appDir)\n : resolve(appDir)\n const rel = relative(root, sourcePath)\n if (rel === '..' || rel.startsWith(`..${sep}`) || rel === '') {\n throw new DocumentationError(\n `OpenAPI source must be a file inside the app directory: ${configured}`,\n 'documentation_openapi_path_invalid',\n [{ code: 'openapi_path_escape', message: configured, file: sourcePath }],\n )\n }\n}\n\nexport function operationMarkdown(operation: DocumentationOpenApiOperation): string {\n const lines = [\n `<div class=\"documentation-api-badge\"><span class=\"method method-${operation.method.toLowerCase()}\">${operation.method}</span><code>${operation.path}</code></div>`,\n '',\n ]\n if (operation.description) lines.push(operation.description, '')\n if (operation.parameters.length > 0) {\n lines.push(\n '## Parameters',\n '',\n '| Name | In | Required | Description |',\n '| --- | --- | --- | --- |',\n )\n for (const parameter of operation.parameters) {\n lines.push(\n `| \\`${escapeTable(parameter.name)}\\` | ${escapeTable(parameter.in)} | ` +\n `${parameter.required ? 'yes' : 'no'} | ${escapeTable(parameter.description ?? '')} |`,\n )\n }\n lines.push('')\n }\n if (operation.requestBody !== undefined) {\n lines.push('## Request body', '', '```json', prettyJson(operation.requestBody), '```', '')\n }\n if (operation.security !== undefined) {\n lines.push('## Security', '', '```json', prettyJson(operation.security), '```', '')\n }\n lines.push('## Responses', '')\n if (operation.responses.length === 0) {\n lines.push('No response schema is declared.', '')\n } else {\n for (const response of operation.responses) {\n lines.push(`### ${response.status}`, '', response.description || 'Response', '')\n if (response.schema !== undefined) {\n lines.push('```json', prettyJson(response.schema), '```', '')\n }\n }\n }\n if (operation.codeSamples.length > 0) {\n lines.push('## Request examples', '', '<CodeGroup title=\"Request\">', '')\n for (const sample of operation.codeSamples) {\n const fence = codeFence(sample.code)\n const label = sample.label.replace(/[\"\\r\\n]/g, \"'\")\n lines.push(`${fence}${sample.syntax} title=\"${label}\"`, sample.code, fence, '')\n }\n lines.push('</CodeGroup>', '')\n }\n return lines.join('\\n')\n}\n\nfunction mergeParameters(\n pathParameters: unknown,\n operationParameters: unknown,\n document: Record<string, unknown>,\n): DocumentationOpenApiParameter[] {\n const merged = new Map<string, DocumentationOpenApiParameter>()\n for (const values of [pathParameters, operationParameters]) {\n if (!Array.isArray(values)) continue\n for (const value of values) {\n for (const parameter of normalizeParameter(value, document)) {\n merged.set(`${parameter.in}\\0${parameter.name}`, parameter)\n }\n }\n }\n return [...merged.values()]\n}\n\nfunction normalizeParameter(\n value: unknown,\n document: Record<string, unknown>,\n): DocumentationOpenApiParameter[] {\n const parameter = resolveOpenApiObject(value, document)\n if (!parameter) return []\n if (typeof parameter.name !== 'string' || typeof parameter.in !== 'string') return []\n return [\n {\n name: parameter.name,\n in: parameter.in,\n required: parameter.required === true,\n ...(typeof parameter.description === 'string' ? { description: parameter.description } : {}),\n ...('schema' in parameter ? { schema: parameter.schema } : {}),\n ...('example' in parameter ? { example: parameter.example } : {}),\n },\n ]\n}\n\nfunction normalizeResponses(value: unknown, document: Record<string, unknown>) {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return []\n return Object.entries(value as Record<string, unknown>).map(([status, response]) => {\n const data = resolveOpenApiObject(response, document)\n if (!data) {\n return { status, description: '' }\n }\n return {\n status,\n description: typeof data.description === 'string' ? data.description : '',\n ...('content' in data ? { schema: data.content } : {}),\n }\n })\n}\n\nfunction invalidOpenApi(file: string, message: string): DocumentationError {\n return new DocumentationError(`Invalid OpenAPI document: ${message}`, 'documentation_openapi_invalid', [\n { code: 'openapi_shape', message, file },\n ])\n}\n\nfunction prettyJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return String(value)\n }\n}\n\nfunction escapeTable(value: string): string {\n return value.replace(/\\|/g, '\\\\|').replace(/\\n/g, ' ')\n}\n\nfunction codeFence(source: string): string {\n const longest = Math.max(0, ...[...source.matchAll(/`+/g)].map((match) => match[0].length))\n return '`'.repeat(Math.max(3, longest + 1))\n}\n\nfunction firstServerUrl(value: unknown): string | undefined {\n if (!Array.isArray(value)) return undefined\n for (const server of value) {\n const object = asOpenApiObject(server)\n if (typeof object?.url === 'string') return object.url\n }\n return undefined\n}\n\nfunction swaggerServerUrl(document: OpenApiDocument): string | undefined {\n if (typeof document.host !== 'string' || !document.host) return undefined\n const scheme = Array.isArray(document.schemes)\n ? document.schemes.find((value): value is string => typeof value === 'string')\n : undefined\n const basePath = typeof document.basePath === 'string' ? document.basePath : ''\n return `${scheme ?? 'https'}://${document.host}${basePath}`\n}\n","export type OpenApiObject = Record<string, unknown>\n\nexport function asOpenApiObject(value: unknown): OpenApiObject | undefined {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as OpenApiObject)\n : undefined\n}\n\nexport function resolveOpenApiObject(\n value: unknown,\n document: OpenApiObject,\n seen: Set<string> = new Set(),\n): OpenApiObject | undefined {\n const object = asOpenApiObject(value)\n if (!object || typeof object.$ref !== 'string') return object\n const reference = object.$ref\n if (!reference.startsWith('#/') || seen.has(reference)) return undefined\n seen.add(reference)\n let resolved: unknown = document\n for (const segment of reference.slice(2).split('/')) {\n resolved = asOpenApiObject(resolved)?.[segment.replace(/~1/g, '/').replace(/~0/g, '~')]\n }\n const target = asOpenApiObject(resolved)\n if (!target) return undefined\n const siblings = Object.fromEntries(Object.entries(object).filter(([key]) => key !== '$ref'))\n return { ...target, ...siblings }\n}\n","import {\n DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES,\n type DocumentationOpenApiCodeSample,\n type DocumentationOpenApiExamplesConfig,\n type DocumentationOpenApiParameter,\n type DocumentationOpenApiSampleLanguage,\n} from './types'\nimport { asOpenApiObject, resolveOpenApiObject, type OpenApiObject } from './openapi-object'\n\ninterface SampleOperation {\n method: string\n path: string\n baseUrl?: string\n parameters: DocumentationOpenApiParameter[]\n requestBody?: unknown\n security?: unknown\n}\n\nconst LANGUAGE_METADATA: Record<DocumentationOpenApiSampleLanguage, { label: string; syntax: string }> = {\n curl: { label: 'cURL', syntax: 'bash' },\n javascript: { label: 'JavaScript', syntax: 'javascript' },\n python: { label: 'Python', syntax: 'python' },\n go: { label: 'Go', syntax: 'go' },\n}\n\nexport function createOpenApiCodeSamples(\n operation: SampleOperation,\n document: OpenApiObject,\n examples: DocumentationOpenApiExamplesConfig | undefined,\n customSamples: unknown,\n): DocumentationOpenApiCodeSample[] {\n const custom = normalizeCustomSamples(customSamples)\n if (examples?.autogenerate === false || !operation.baseUrl) return custom\n\n const languages = examples?.languages ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.languages\n const defaults = examples?.defaults ?? DEFAULT_DOCUMENTATION_OPENAPI_EXAMPLES.defaults\n const request = buildSampleRequest(operation, document, defaults === 'all')\n const customLanguages = new Set(custom.map((sample) => knownLanguage(sample.language)))\n const generated = languages\n .filter((language) => !customLanguages.has(language))\n .map(\n (language): DocumentationOpenApiCodeSample => ({\n language,\n label: LANGUAGE_METADATA[language].label,\n syntax: LANGUAGE_METADATA[language].syntax,\n code: renderSample(language, request),\n generated: true,\n }),\n )\n return [...custom, ...generated]\n}\n\ninterface SampleRequest {\n method: string\n url: string\n headers: Record<string, string>\n body?: unknown\n}\n\nfunction buildSampleRequest(\n operation: SampleOperation,\n document: OpenApiObject,\n includeOptional: boolean,\n): SampleRequest {\n let path = operation.path\n const query = new URLSearchParams()\n const headers: Record<string, string> = { Accept: 'application/json' }\n const cookies: string[] = []\n const parameters = operation.parameters.filter(\n (parameter) => parameter.required || includeOptional,\n )\n\n for (const parameter of parameters) {\n const value = sampleParameterValue(parameter, document)\n if (parameter.in === 'path') {\n path = path.replaceAll(`{${parameter.name}}`, encodeURIComponent(String(value)))\n } else if (parameter.in === 'query') {\n query.set(parameter.name, String(value))\n } else if (parameter.in === 'header') {\n headers[parameter.name] = String(value)\n } else if (parameter.in === 'cookie') {\n cookies.push(`${parameter.name}=${String(value)}`)\n }\n }\n path = path.replace(/\\{([^}]+)\\}/g, (_match, name: string) =>\n encodeURIComponent(`example-${slugPart(name)}`),\n )\n\n applySecurity(operation.security ?? document.security, document, headers, query, cookies)\n if (cookies.length > 0) headers.Cookie = cookies.join('; ')\n\n const body = requestBodyExample(operation.requestBody, document, includeOptional)\n if (body !== undefined) headers['Content-Type'] = 'application/json'\n const separator = path.includes('?') ? '&' : '?'\n const search = query.toString()\n const url = `${operation.baseUrl?.replace(/\\/$/, '') ?? ''}${path}${search ? `${separator}${search}` : ''}`\n return { method: operation.method, url, headers, ...(body === undefined ? {} : { body }) }\n}\n\nfunction sampleParameterValue(parameter: DocumentationOpenApiParameter, document: OpenApiObject): unknown {\n if (parameter.example !== undefined) return parameter.example\n const schema = resolveOpenApiObject(parameter.schema, document)\n if (schema) {\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0]\n if (schema.type === 'boolean') return true\n if (schema.type === 'integer' || schema.type === 'number') return 1\n }\n return `example-${slugPart(parameter.name)}`\n}\n\nfunction requestBodyExample(\n value: unknown,\n document: OpenApiObject,\n includeOptional: boolean,\n): unknown {\n const requestBody = resolveOpenApiObject(value, document)\n if (!requestBody) return undefined\n const content = asOpenApiObject(requestBody.content)\n if (!content) return undefined\n const jsonMedia = Object.entries(content).find(([contentType]) => contentType.endsWith('+json'))\n const media = asOpenApiObject(content['application/json']) ?? asOpenApiObject(jsonMedia?.[1])\n if (!media) return undefined\n if (media.example !== undefined) return media.example\n const namedExamples = asOpenApiObject(media.examples)\n if (namedExamples) {\n for (const example of Object.values(namedExamples)) {\n const resolved = resolveOpenApiObject(example, document)\n if (resolved && resolved.value !== undefined) return resolved.value\n }\n }\n return schemaExample(media.schema, document, includeOptional, new Set(), 0)\n}\n\nfunction schemaExample(\n value: unknown,\n document: OpenApiObject,\n includeOptional: boolean,\n seen: Set<string>,\n depth: number,\n): unknown {\n if (depth > 8) return undefined\n const schema = resolveOpenApiObject(value, document, seen)\n if (!schema) return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length > 0) return schema.enum[0]\n const alternatives = Array.isArray(schema.oneOf)\n ? schema.oneOf\n : Array.isArray(schema.anyOf)\n ? schema.anyOf\n : undefined\n if (alternatives?.[0] !== undefined) {\n return schemaExample(alternatives[0], document, includeOptional, seen, depth + 1)\n }\n if (Array.isArray(schema.allOf)) {\n return Object.assign(\n {},\n ...schema.allOf.map((part) => {\n const example = schemaExample(part, document, includeOptional, seen, depth + 1)\n return asOpenApiObject(example) ?? {}\n }),\n )\n }\n const properties = asOpenApiObject(schema.properties)\n if (schema.type === 'object' || properties) {\n const required = new Set(\n Array.isArray(schema.required)\n ? schema.required.filter((name): name is string => typeof name === 'string')\n : [],\n )\n return Object.fromEntries(\n Object.entries(properties ?? {})\n .filter(([name]) => includeOptional || required.has(name))\n .map(([name, property]) => [\n name,\n schemaExample(property, document, includeOptional, new Set(seen), depth + 1),\n ])\n .filter((entry) => entry[1] !== undefined),\n )\n }\n if (schema.type === 'array' || schema.items !== undefined) {\n const item = schemaExample(schema.items, document, includeOptional, seen, depth + 1)\n return item === undefined ? [] : [item]\n }\n if (schema.type === 'boolean') return true\n if (schema.type === 'integer' || schema.type === 'number') return 1\n if (schema.type === 'string') return stringExample(schema.format)\n return undefined\n}\n\nfunction stringExample(format: unknown): string {\n switch (format) {\n case 'date-time':\n return '2026-01-01T00:00:00Z'\n case 'date':\n return '2026-01-01'\n case 'email':\n return 'user@example.com'\n case 'uuid':\n return '00000000-0000-4000-8000-000000000000'\n case 'uri':\n case 'url':\n return 'https://example.com'\n default:\n return 'string'\n }\n}\n\nfunction applySecurity(\n value: unknown,\n document: OpenApiObject,\n headers: Record<string, string>,\n query: URLSearchParams,\n cookies: string[],\n): void {\n if (!Array.isArray(value)) return\n const requirement = value.map(asOpenApiObject).find(Boolean)\n if (!requirement) return\n const schemes = asOpenApiObject(asOpenApiObject(document.components)?.securitySchemes)\n for (const name of Object.keys(requirement)) {\n const scheme = resolveOpenApiObject(schemes?.[name], document)\n if (!scheme) continue\n if (scheme.type === 'http' && scheme.scheme === 'bearer') {\n headers.Authorization = 'Bearer <token>'\n } else if (scheme.type === 'http' && scheme.scheme === 'basic') {\n headers.Authorization = 'Basic <credentials>'\n } else if (scheme.type === 'apiKey' && typeof scheme.name === 'string') {\n if (scheme.in === 'query') query.set(scheme.name, '<api-key>')\n else if (scheme.in === 'cookie') cookies.push(`${scheme.name}=<api-key>`)\n else headers[scheme.name] = '<api-key>'\n }\n }\n}\n\nfunction renderSample(language: DocumentationOpenApiSampleLanguage, request: SampleRequest): string {\n switch (language) {\n case 'curl':\n return renderCurl(request)\n case 'javascript':\n return renderJavaScript(request)\n case 'python':\n return renderPython(request)\n case 'go':\n return renderGo(request)\n }\n}\n\nfunction renderCurl(request: SampleRequest): string {\n const lines = [`curl --request ${request.method} \\\\`, ` --url '${escapeShell(request.url)}'`]\n for (const [name, value] of Object.entries(request.headers)) {\n lines[lines.length - 1] += ' \\\\'\n lines.push(` --header '${escapeShell(`${name}: ${value}`)}'`)\n }\n if (request.body !== undefined) {\n lines[lines.length - 1] += ' \\\\'\n lines.push(` --data '${escapeShell(prettyJson(request.body))}'`)\n }\n return lines.join('\\n')\n}\n\nfunction renderJavaScript(request: SampleRequest): string {\n const options = [\n `method: ${JSON.stringify(request.method)}`,\n `headers: ${indent(prettyJson(request.headers), 2).trimStart()}`,\n ...(request.body === undefined\n ? []\n : [`body: JSON.stringify(${indent(prettyJson(request.body), 2).trimStart()})`]),\n ]\n return [\n `const response = await fetch(${JSON.stringify(request.url)}, {`,\n options.map((option) => ` ${option},`).join('\\n'),\n '})',\n '',\n 'if (!response.ok) throw new Error(`Request failed: ${response.status}`)',\n 'const data = await response.json()',\n 'console.log(data)',\n ].join('\\n')\n}\n\nfunction renderPython(request: SampleRequest): string {\n const arguments_ = [\n JSON.stringify(request.method),\n JSON.stringify(request.url),\n `headers=${pythonValue(request.headers)}`,\n ...(request.body === undefined ? [] : [`json=${pythonValue(request.body)}`]),\n ]\n return [\n 'import requests',\n '',\n 'response = requests.request(',\n arguments_.map((argument) => ` ${argument},`).join('\\n'),\n ')',\n 'response.raise_for_status()',\n 'print(response.json())',\n ].join('\\n')\n}\n\nfunction renderGo(request: SampleRequest): string {\n const requestBody =\n request.body === undefined\n ? 'nil'\n : `strings.NewReader(${JSON.stringify(prettyJson(request.body))})`\n const imports = ['\"fmt\"', '\"io\"', '\"net/http\"']\n if (request.body !== undefined) imports.push('\"strings\"')\n return [\n 'package main',\n '',\n 'import (',\n ...imports.map((value) => `\\t${value}`),\n ')',\n '',\n 'func main() {',\n `\\treq, err := http.NewRequest(${JSON.stringify(request.method)}, ${JSON.stringify(request.url)}, ${requestBody})`,\n '\\tif err != nil { panic(err) }',\n ...Object.entries(request.headers).map(\n ([name, value]) => `\\treq.Header.Set(${JSON.stringify(name)}, ${JSON.stringify(value)})`,\n ),\n '',\n '\\tres, err := http.DefaultClient.Do(req)',\n '\\tif err != nil { panic(err) }',\n '\\tdefer res.Body.Close()',\n '',\n '\\tbody, err := io.ReadAll(res.Body)',\n '\\tif err != nil { panic(err) }',\n '\\tfmt.Println(string(body))',\n '}',\n ].join('\\n')\n}\n\nfunction normalizeCustomSamples(value: unknown): DocumentationOpenApiCodeSample[] {\n if (!Array.isArray(value)) return []\n return value.flatMap((entry): DocumentationOpenApiCodeSample[] => {\n const sample = asOpenApiObject(entry)\n const language = typeof sample?.lang === 'string' ? sample.lang.trim().toLowerCase() : ''\n const source = typeof sample?.source === 'string' ? sample.source.trim() : ''\n if (!language || !source) return []\n const normalizedLanguage = knownLanguage(language)\n const label =\n typeof sample?.label === 'string' && sample.label.trim()\n ? sample.label.trim()\n : normalizedLanguage\n ? LANGUAGE_METADATA[normalizedLanguage].label\n : language\n return [\n {\n language,\n label,\n syntax: syntaxForLanguage(language),\n code: source,\n generated: false,\n },\n ]\n })\n}\n\nfunction knownLanguage(value: string): DocumentationOpenApiSampleLanguage | undefined {\n if (['curl', 'bash', 'shell', 'sh'].includes(value)) return 'curl'\n if (['javascript', 'js', 'node', 'nodejs'].includes(value)) return 'javascript'\n if (['python', 'py'].includes(value)) return 'python'\n if (['go', 'golang'].includes(value)) return 'go'\n return undefined\n}\n\nfunction syntaxForLanguage(value: string): string {\n const known = knownLanguage(value)\n return known ? LANGUAGE_METADATA[known].syntax : value.replace(/[^a-z0-9_+#.-]/g, '') || 'text'\n}\n\nfunction prettyJson(value: unknown): string {\n return JSON.stringify(value, null, 2)\n}\n\nfunction pythonValue(value: unknown): string {\n return prettyJson(value)\n .replace(/\\btrue\\b/g, 'True')\n .replace(/\\bfalse\\b/g, 'False')\n .replace(/\\bnull\\b/g, 'None')\n}\n\nfunction escapeShell(value: string): string {\n return value.replace(/'/g, `'\"'\"'`)\n}\n\nfunction indent(value: string, spaces: number): string {\n const prefix = ' '.repeat(spaces)\n return value\n .split('\\n')\n .map((line) => `${prefix}${line}`)\n .join('\\n')\n}\n\nfunction slugPart(value: string): string {\n return (\n value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '') || 'value'\n )\n}\n","import { compileSync } from '@mdx-js/mdx'\nimport { parse as parseJavaScript } from 'acorn'\nimport { buildSync, type BuildOptions, type BuildResult, type OutputFile } from 'esbuild'\nimport { createRequire } from 'node:module'\nimport { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { dirname, extname, join, relative, resolve, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { rewriteLocalReferences } from './graph'\nimport { stripFirstMarkdownH1 } from './markdown'\nimport { mdxCompileOptions } from './mdx'\nimport { documentationPublicPath, publicDocumentationReferences } from './routing'\nimport { errorMessage } from './text'\nimport { DocumentationError, type DocumentationRuntimeData, type DocumentationValidationResult } from './types'\n\nexport interface CustomDocumentationRuntime {\n browserAssets: Array<{ path: string; content: string }>\n stylesheets: string[]\n render(data: DocumentationRuntimeData, route: string): string\n}\n\ninterface JavaScriptNode {\n type: string\n start?: number\n end?: number\n source?: JavaScriptNode\n value?: unknown\n [key: string]: unknown\n}\n\nexport function buildCustomDocumentationRuntime(\n validation: DocumentationValidationResult,\n basePath: string,\n): CustomDocumentationRuntime | null {\n const sitePath = resolve(validation.appDir, 'documentation.tsx')\n const mdxPages = validation.graph.pages.filter((page) => page.sourceFormat === 'mdx')\n if (!existsSync(sitePath) && mdxPages.length === 0) return null\n\n const temporaryDir = mkdtempSync(join(tmpdir(), 'deepspace-documentation-runtime-'))\n try {\n const compiledPages = mdxPages.map((page, index) => {\n const source = readFileSync(page.sourcePath, 'utf8')\n const rewritten = rewriteLocalReferences(\n source,\n page.relativePath,\n validation.sourceDir,\n page.sourcePath,\n )\n const compiled = compileSync(\n publicDocumentationReferences(stripFirstMarkdownH1(rewritten), basePath),\n mdxCompileOptions(),\n )\n const path = join(temporaryDir, `page-${index}.mjs`)\n writeFileSync(path, resolveCompiledImports(String(compiled), page.sourcePath, validation.appDir))\n return { path, route: page.route }\n })\n\n const clientEntry = runtimeEntry('documentation-client-core.js', 'runtime/client.tsx')\n const publicEntry = runtimeEntry('documentation-react.js', 'runtime/public.tsx')\n const serverEntry = runtimeEntry('documentation-server-core.js', 'runtime/server.tsx')\n const browserEntry = join(temporaryDir, 'browser-entry.ts')\n const serverBundleEntry = join(temporaryDir, 'server-entry.ts')\n writeFileSync(browserEntry, generatedBrowserEntry(clientEntry, publicEntry, sitePath, compiledPages))\n writeFileSync(serverBundleEntry, generatedServerEntry(serverEntry, sitePath, compiledPages))\n\n const reactAliases = runtimeDependencyAliases(validation.appDir)\n const alias = { ...reactAliases, 'deepspace/documentation/react': publicEntry }\n const browserOutDir = join(temporaryDir, 'browser')\n const sharedBuildOptions: BuildOptions = {\n absWorkingDir: temporaryDir,\n bundle: true,\n define: { 'process.env.NODE_ENV': '\"production\"' },\n jsx: 'automatic',\n target: ['es2022'],\n ...(existsSync(resolve(validation.appDir, 'tsconfig.json'))\n ? { tsconfig: resolve(validation.appDir, 'tsconfig.json') }\n : {}),\n write: false,\n }\n const browser = buildSync({\n ...sharedBuildOptions,\n alias,\n entryPoints: ['browser-entry.ts'],\n chunkNames: 'documentation-page-[hash]',\n entryNames: 'documentation-custom-runtime',\n format: 'esm',\n loader: assetLoaders('dataurl'),\n minify: true,\n outdir: browserOutDir,\n platform: 'browser',\n splitting: true,\n })\n const server = buildSync({\n ...sharedBuildOptions,\n alias: { ...reactAliases, 'deepspace/documentation/react': serverEntry },\n entryPoints: ['server-entry.ts'],\n format: 'cjs',\n loader: { ...assetLoaders('dataurl'), '.css': 'text' },\n logLevel: 'silent',\n minify: false,\n outdir: join(temporaryDir, 'server'),\n platform: 'node',\n target: ['node22'],\n })\n const browserAssets = (browser.outputFiles ?? []).map((output) => ({\n path: relative(browserOutDir, output.path).split(sep).join('/'),\n content: output.text,\n }))\n if (!browserAssets.some((asset) => asset.path === 'documentation-custom-runtime.js')) {\n throw new Error('Executable documentation build did not emit documentation-custom-runtime.js')\n }\n const stylesheets = browserAssets\n .filter((asset) => extname(asset.path) === '.css')\n .map((asset) => documentationPublicPath(basePath, `/assets/${asset.path}`))\n const serverJavaScript = outputWithExtension(server, '.js').text\n const module = { exports: {} as { render?: (route: string, data: DocumentationRuntimeData) => string } }\n const evaluate = new Function('require', 'module', 'exports', serverJavaScript)\n evaluate(createRequire(join(validation.appDir, 'package.json')), module, module.exports)\n if (typeof module.exports.render !== 'function') {\n throw new Error('The generated documentation server renderer did not export render()')\n }\n return {\n browserAssets,\n stylesheets,\n render: (data, route) => module.exports.render?.(route, data) ?? '',\n }\n } catch (error) {\n if (error instanceof DocumentationError) throw error\n throw new DocumentationError(\n `Unable to compile executable documentation: ${errorMessage(error)}`,\n 'documentation_runtime_build_failed',\n [{ code: 'runtime_compile', message: errorMessage(error), file: existsSync(sitePath) ? sitePath : undefined }],\n )\n } finally {\n rmSync(temporaryDir, { recursive: true, force: true })\n }\n}\n\nfunction generatedBrowserEntry(\n clientEntry: string,\n publicEntry: string,\n sitePath: string,\n pages: Array<{ path: string; route: string }>,\n): string {\n const siteImport = existsSync(sitePath)\n ? `import Site from ${quote(sitePath)}`\n : `import { DefaultDocumentation as Site } from ${quote(publicEntry)}`\n const pageLoaders = pages.map((page) => `${quote(page.route)}: () => import(${quote(page.path)})`).join(',\\n')\n return `import { hydrateDocumentation } from ${quote(clientEntry)}\n${siteImport}\nconst loaders = { ${pageLoaders} }\nconst pages = {}\nasync function loadPage(route) {\n const loader = loaders[route]\n if (loader && !pages[route]) pages[route] = (await loader()).default\n}\nconst payload = document.getElementById('deepspace-documentation-data')\nif (payload?.textContent) await loadPage(JSON.parse(payload.textContent).page.route)\nhydrateDocumentation({ Site, pages, loadPage })\n`\n}\n\nfunction generatedServerEntry(\n serverEntry: string,\n sitePath: string,\n pages: Array<{ path: string; route: string }>,\n): string {\n const imports = pages.map((page, index) => `import Page${index} from ${quote(page.path)}`).join('\\n')\n const siteImport = existsSync(sitePath)\n ? `import Site from ${quote(sitePath)}`\n : `import { DefaultDocumentation as Site } from ${quote(serverEntry)}`\n const pageMap = pages.map((page, index) => `${quote(page.route)}: Page${index}`).join(',\\n')\n return `import { renderDocumentation } from ${quote(serverEntry)}\n${siteImport}\n${imports}\nconst pages = { ${pageMap} }\nexport function render(route, data) {\n return renderDocumentation({ data, Page: pages[route], Site })\n}\n`\n}\n\nfunction resolveCompiledImports(code: string, sourcePath: string, appDir: string): string {\n const tree = parseJavaScript(code, { ecmaVersion: 'latest', sourceType: 'module' }) as unknown as JavaScriptNode\n const replacements: Array<{ start: number; end: number; value: string }> = []\n const appRequire = createRequire(join(appDir, 'package.json'))\n const resolveAlias = tsconfigAliasResolver(appDir)\n visitJavaScript(tree, (node) => {\n const source = importSource(node)\n if (!source || typeof source.value !== 'string' || source.start === undefined || source.end === undefined) {\n return\n }\n const specifier = source.value\n if (/^(?:data:|https?:|node:)/.test(specifier)) return\n const resolved = specifier.startsWith('.')\n ? resolve(dirname(sourcePath), specifier)\n : specifier === 'deepspace/documentation/react' || specifier === 'react' || specifier.startsWith('react/')\n ? specifier\n : (resolveAlias(specifier) ?? appRequire.resolve(specifier))\n replacements.push({ start: source.start, end: source.end, value: quote(resolved.split(sep).join('/')) })\n })\n return replacements\n .sort((left, right) => right.start - left.start)\n .reduce(\n (output, replacement) =>\n `${output.slice(0, replacement.start)}${replacement.value}${output.slice(replacement.end)}`,\n code,\n )\n}\n\n/** Map tsconfig `paths` aliases (e.g. `@/*`) to app-rooted absolute paths,\n * like relative imports: the emitted path stays extensionless and esbuild\n * performs extension/tsconfig resolution. First target per pattern only. */\nfunction tsconfigAliasResolver(appDir: string): (specifier: string) => string | undefined {\n let base = appDir\n let aliases: Array<{ prefix: string; exact: boolean; target: string }> = []\n try {\n const raw = readFileSync(join(appDir, 'tsconfig.json'), 'utf8')\n const parsed = JSON.parse(\n raw.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').replace(/^\\s*\\/\\/.*$/gm, ''),\n ) as { compilerOptions?: { baseUrl?: string; paths?: Record<string, string[]> } }\n const options = parsed.compilerOptions\n if (options?.paths) {\n base = resolve(appDir, options.baseUrl ?? '.')\n aliases = Object.entries(options.paths)\n .filter(([, targets]) => typeof targets?.[0] === 'string')\n .map(([pattern, targets]) => ({\n exact: !pattern.includes('*'),\n prefix: pattern.replace(/\\*$/, ''),\n target: targets[0].replace(/\\*$/, ''),\n }))\n .sort((left, right) => right.prefix.length - left.prefix.length)\n }\n } catch {\n // An unreadable tsconfig means no aliases; aliased imports then fail\n // loudly through appRequire.resolve with the original specifier.\n }\n return (specifier) => {\n for (const alias of aliases) {\n if (alias.exact ? specifier === alias.prefix : specifier.startsWith(alias.prefix)) {\n return resolve(base, `${alias.target}${alias.exact ? '' : specifier.slice(alias.prefix.length)}`)\n }\n }\n return undefined\n }\n}\n\nfunction importSource(node: JavaScriptNode): JavaScriptNode | undefined {\n if (\n node.type === 'ImportDeclaration' ||\n node.type === 'ExportAllDeclaration' ||\n node.type === 'ExportNamedDeclaration' ||\n node.type === 'ImportExpression'\n ) return node.source\n return undefined\n}\n\nfunction visitJavaScript(node: JavaScriptNode, visitor: (node: JavaScriptNode) => void): void {\n visitor(node)\n for (const value of Object.values(node)) {\n if (Array.isArray(value)) {\n for (const child of value) {\n if (isJavaScriptNode(child)) visitJavaScript(child, visitor)\n }\n } else if (isJavaScriptNode(value)) {\n visitJavaScript(value, visitor)\n }\n }\n}\n\nfunction isJavaScriptNode(value: unknown): value is JavaScriptNode {\n return Boolean(value && typeof value === 'object' && 'type' in value && typeof value.type === 'string')\n}\n\n/** Resolve a runtime artifact beside this module, or its source in a repo\n * checkout. A published package has no sources, so a missing artifact fails\n * by name instead of self-compiling. */\nexport function runtimeEntry(builtName: string, sourceRelativePath: string): string {\n const built = fileURLToPath(new URL(`./${builtName}`, import.meta.url))\n if (existsSync(built)) return built\n const source = fileURLToPath(new URL(`./${sourceRelativePath}`, import.meta.url))\n if (!existsSync(source)) {\n throw new Error(`${builtName} is missing from this deepspace installation; reinstall the package`)\n }\n return source\n}\n\nfunction runtimeDependencyAliases(appDir: string): Record<string, string> {\n const require = createRequire(join(appDir, 'package.json'))\n return Object.fromEntries(\n ['react', 'react/jsx-runtime', 'react-dom', 'react-dom/client', 'react-dom/server']\n .map((specifier) => [specifier, require.resolve(specifier)]),\n )\n}\n\nfunction outputWithExtension(result: BuildResult, extension: string): OutputFile {\n const output = optionalOutputWithExtension(result, extension)\n if (!output) throw new Error(`Executable documentation build did not emit a ${extension} file`)\n return output\n}\n\nfunction optionalOutputWithExtension(result: BuildResult, extension: string): OutputFile | undefined {\n return result.outputFiles?.find((output) => extname(output.path) === extension)\n}\n\nfunction assetLoaders(imageLoader: 'dataurl'): Record<string, 'css' | 'dataurl'> {\n return {\n '.avif': imageLoader,\n '.css': 'css',\n '.gif': imageLoader,\n '.jpeg': imageLoader,\n '.jpg': imageLoader,\n '.png': imageLoader,\n '.svg': imageLoader,\n '.webp': imageLoader,\n '.woff': imageLoader,\n '.woff2': imageLoader,\n }\n}\n\nfunction quote(value: string): string {\n return JSON.stringify(value)\n}\n","import { existsSync, readFileSync } from 'node:fs'\nimport { fileURLToPath } from 'node:url'\nimport { documentationPublicPath } from './routing'\nimport type { DocumentationFontConfig, ResolvedDocumentationTheme } from './types'\n\nexport interface DocumentationBundledFont {\n family: string\n fileName: string\n /** Variable axis range, so one file serves every weight the stylesheet asks for. */\n weight: string\n}\n\nexport const DOCUMENTATION_BUNDLED_BODY_FONT: DocumentationBundledFont = {\n family: 'Inter',\n fileName: 'inter-variable.woff2',\n weight: '100 900',\n}\n\nexport const DOCUMENTATION_BUNDLED_MONO_FONT: DocumentationBundledFont = {\n family: 'Geist Mono',\n fileName: 'geist-mono-variable.woff2',\n weight: '100 900',\n}\n\nexport const DOCUMENTATION_BUNDLED_FONTS: readonly DocumentationBundledFont[] = [\n DOCUMENTATION_BUNDLED_BODY_FONT,\n DOCUMENTATION_BUNDLED_MONO_FONT,\n]\n\nexport interface DocumentationResolvedFont {\n family: string\n source: string\n weight: string\n format: string\n /** Set when the bytes come from this package rather than the app's media directory. */\n bundled?: DocumentationBundledFont\n}\n\n/**\n * One ordered list of faces the page must load, whether they are bundled with the\n * SDK or supplied by the app. `renderFontFaces`, `renderFontPreloads`, and the\n * build's asset emission all read this so a face can never be declared without\n * its bytes being written, or written without being declared.\n *\n * A slot the author configured without a `source` names a font they provide\n * themselves (system-installed or a custom stylesheet); it contributes no face.\n */\nexport function resolveDocumentationFonts(\n theme: ResolvedDocumentationTheme,\n basePath: string,\n): DocumentationResolvedFont[] {\n const resolved: DocumentationResolvedFont[] = []\n const seen = new Set<string>()\n const add = (font: DocumentationResolvedFont): void => {\n const key = `${font.family}:${font.source}:${font.weight}`\n if (seen.has(key)) return\n seen.add(key)\n resolved.push(font)\n }\n const addAuthored = (font: DocumentationFontConfig | undefined, fallbackFamily: string): void => {\n if (!font?.source || !validFontSource(font.source)) return\n add({\n family: safeFontFamily(font.family, fallbackFamily),\n source: font.source,\n weight: safeFontWeight(font.weight),\n format: safeFontFormat(font.format),\n })\n }\n const addBundled = (bundled: DocumentationBundledFont): void => add({\n family: bundled.family,\n source: bundledFontHref(basePath, bundled),\n weight: bundled.weight,\n format: 'woff2',\n bundled,\n })\n\n // An absent heading slot inherits the body family, so it needs no face of its own.\n if (theme.bodyFont) addAuthored(theme.bodyFont, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n else addBundled(DOCUMENTATION_BUNDLED_BODY_FONT)\n addAuthored(theme.headingFont, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n if (theme.monoFont) addAuthored(theme.monoFont, DOCUMENTATION_BUNDLED_MONO_FONT.family)\n else addBundled(DOCUMENTATION_BUNDLED_MONO_FONT)\n return resolved\n}\n\nexport function bundledFontHref(basePath: string, font: DocumentationBundledFont): string {\n return documentationPublicPath(basePath, `/assets/fonts/${font.fileName}`)\n}\n\n/**\n * The build copies these woff2 files to `dist/fonts`, so one module-relative\n * path serves both a published install and a source checkout.\n */\nexport function readBundledFont(font: DocumentationBundledFont): Uint8Array {\n const path = fileURLToPath(new URL(`./fonts/${font.fileName}`, import.meta.url))\n if (!existsSync(path)) {\n throw new Error(`${font.fileName} is missing from this deepspace installation; reinstall the package`)\n }\n return readFileSync(path)\n}\n\n/** Guard against CSS injection through a configured family name. */\nexport function safeFontFamily(\n value: string | undefined,\n fallback = DOCUMENTATION_BUNDLED_BODY_FONT.family,\n): string {\n return value && /^[a-z0-9 ,.'-]{1,80}$/i.test(value) ? value : fallback\n}\n\nexport function validFontSource(value: string): boolean {\n return /^(?:\\/[a-z0-9_./%-]+|https:\\/\\/[^\\s\"'()<>]+)$/i.test(value)\n}\n\nfunction safeFontWeight(value: DocumentationFontConfig['weight']): string {\n if (typeof value === 'number') return String(value)\n return /^(?:normal|bold|[1-9]00|[1-9]00\\s+[1-9]00)$/i.test(String(value ?? '')) ? String(value) : 'normal'\n}\n\nfunction safeFontFormat(value: string | undefined): string {\n return value && /^[a-z0-9-]{2,20}$/i.test(value) ? value : ''\n}\n","import { createHash } from 'node:crypto'\nimport {\n existsSync,\n mkdirSync,\n readFileSync,\n readdirSync,\n rmSync,\n writeFileSync,\n} from 'node:fs'\nimport { dirname, extname, join, relative, resolve, sep } from 'node:path'\nimport sanitizeHtml from 'sanitize-html'\nimport { DocumentationError } from './types'\n\nconst MEDIA_EXTENSIONS = new Set([\n '.avif',\n '.gif',\n '.ico',\n '.jpeg',\n '.jpg',\n '.png',\n '.svg',\n '.webp',\n '.woff',\n '.woff2',\n])\n\nconst SOURCE_EXTENSIONS = new Set(['.css', '.js', '.jsx', '.md', '.mdx', '.ts', '.tsx'])\n\n/** Owns all filesystem mutation and hashing for one deterministic documentation build. */\nexport class DocumentationOutput {\n readonly files = new Set<string>()\n\n constructor(\n readonly outputDir: string,\n appDir: string,\n sourceDir: string,\n ) {\n assertSafeOutput(appDir, sourceDir, outputDir)\n if (existsSync(outputDir)) rmSync(outputDir, { recursive: true, force: true })\n mkdirSync(outputDir, { recursive: true })\n }\n\n write(relativePath: string, content: string | Uint8Array): void {\n const path = this.safePath(relativePath)\n mkdirSync(dirname(path), { recursive: true })\n writeFileSync(path, content)\n this.files.add(normalizeRelativePath(relativePath))\n }\n\n copyMedia(sourceDir: string, auxiliarySources: Set<string>): void {\n const walk = (directory: string): void => {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n if (entry.name.startsWith('.') || entry.name === 'node_modules') continue\n const sourcePath = join(directory, entry.name)\n if (entry.isDirectory()) {\n walk(sourcePath)\n continue\n }\n const extension = extname(entry.name).toLowerCase()\n if (SOURCE_EXTENSIONS.has(extension) || auxiliarySources.has(resolve(sourcePath))) continue\n if (!MEDIA_EXTENSIONS.has(extension)) {\n throw new DocumentationError(\n `Unsupported documentation media type: ${relative(sourceDir, sourcePath)}`,\n 'documentation_media_unsupported',\n [{\n code: 'media_type_unsupported',\n message: extension || '(no extension)',\n file: sourcePath,\n }],\n )\n }\n const mediaPath = `media/${normalizeRelativePath(relative(sourceDir, sourcePath))}`\n const content = extension === '.svg'\n ? sanitizeSvg(readFileSync(sourcePath, 'utf8'), sourcePath)\n : readFileSync(sourcePath)\n this.write(mediaPath, content)\n }\n }\n walk(sourceDir)\n }\n\n hash(): string {\n const hash = createHash('sha256')\n for (const file of [...this.files].sort()) {\n hash.update(file)\n hash.update(readFileSync(join(this.outputDir, file)))\n }\n return hash.digest('hex')\n }\n\n private safePath(relativePath: string): string {\n const path = resolve(this.outputDir, relativePath)\n const rel = relative(this.outputDir, path)\n if (rel === '..' || rel.startsWith(`..${sep}`) || rel === '') {\n throw new DocumentationError(\n `Refusing documentation artifact outside the output directory: ${relativePath}`,\n 'documentation_output_unsafe',\n [{ code: 'artifact_path_escape', message: relativePath }],\n )\n }\n return path\n }\n}\n\nfunction assertSafeOutput(appDir: string, sourceDir: string, outputDir: string): void {\n const appRelative = relative(appDir, outputDir)\n const sourceRelative = relative(sourceDir, outputDir)\n if (\n outputDir === appDir ||\n outputDir === sourceDir ||\n appRelative === '..' ||\n appRelative.startsWith(`..${sep}`) ||\n sourceRelative === '' ||\n (!sourceRelative.startsWith('..') && sourceRelative !== '')\n ) {\n throw new DocumentationError(\n `Refusing unsafe documentation output directory: ${outputDir}`,\n 'documentation_output_unsafe',\n [{ code: 'unsafe_output', message: outputDir }],\n )\n }\n}\n\nfunction sanitizeSvg(source: string, sourcePath: string): string {\n const safe = sanitizeHtml(source, {\n allowedTags: [\n 'svg', 'g', 'path', 'circle', 'ellipse', 'line', 'polyline', 'polygon',\n 'rect', 'image', 'defs', 'linearGradient', 'radialGradient', 'stop',\n 'clipPath', 'mask', 'title', 'desc', 'text', 'tspan',\n ],\n allowedAttributes: {\n svg: [\n 'xmlns', 'xmlns:xlink', 'viewBox', 'width', 'height', 'fill', 'stroke',\n 'role', 'aria-label',\n ],\n image: ['href', 'xlink:href', 'x', 'y', 'width', 'height', 'preserveAspectRatio'],\n '*': [\n 'id', 'class', 'd', 'x', 'y', 'x1', 'x2', 'y1', 'y2', 'cx', 'cy',\n 'r', 'rx', 'ry', 'points', 'width', 'height', 'viewBox', 'fill',\n 'fill-rule', 'fill-opacity', 'stroke', 'stroke-width', 'stroke-linecap',\n 'stroke-linejoin', 'stroke-opacity', 'opacity', 'transform', 'offset',\n 'stop-color', 'stop-opacity', 'clip-path', 'mask', 'role', 'aria-label',\n 'aria-hidden', 'font-family', 'font-size', 'font-style', 'font-weight',\n 'letter-spacing', 'text-anchor', 'dominant-baseline',\n ],\n },\n allowedSchemes: ['data'],\n allowProtocolRelative: false,\n disallowedTagsMode: 'discard',\n parser: { lowerCaseTags: false, lowerCaseAttributeNames: false },\n })\n if (!/<svg\\b/i.test(safe)) {\n throw new DocumentationError(\n `Invalid documentation SVG: ${relative(process.cwd(), sourcePath)}`,\n 'documentation_media_invalid',\n [{ code: 'svg_invalid', message: 'Expected an SVG root element', file: sourcePath }],\n )\n }\n return safe\n}\n\nfunction normalizeRelativePath(path: string): string {\n return path.split(sep).join('/')\n}\n","const RESOURCE_EXTENSIONS = new Set([\n '7z', 'avif', 'css', 'csv', 'gif', 'gz', 'ico', 'jpeg', 'jpg', 'js', 'json', 'map',\n 'md', 'mjs', 'mp3', 'mp4', 'pdf', 'png', 'svg', 'tar', 'txt', 'wasm', 'webm',\n 'webp', 'woff', 'woff2', 'xml', 'yaml', 'yml', 'zip',\n])\n\n/** Distinguish generated documentation resources from authored page routes. */\nexport function isNativeDocumentationResourcePath(pathname: string): boolean {\n const leaf = pathname.slice(pathname.lastIndexOf('/') + 1)\n const extension = leaf.includes('.') ? leaf.slice(leaf.lastIndexOf('.') + 1).toLowerCase() : ''\n return extension !== '' && RESOURCE_EXTENSIONS.has(extension)\n}\n\n/** Encode a compiler-owned logical path without collapsing its segment boundaries. */\nexport function encodeNativeDocumentationPath(pathname: string): string {\n return pathname.split('/').map((segment) => encodeURIComponent(segment)).join('/')\n}\n\n/** Normalize one URL pathname while preserving encoded slashes as data, not separators. */\nexport function canonicalNativeDocumentationRequestPath(pathname: string): string | null {\n try {\n return pathname\n .split('/')\n .map((segment) => encodeURIComponent(decodeURIComponent(segment)))\n .join('/')\n } catch {\n return null\n }\n}\n","import { createHash } from 'node:crypto'\nimport { documentationPublicPath, markdownUrlForRoute } from './routing'\nimport { documentationSubject } from './text'\nimport type { DocumentationGraph, DocumentationNavigationNode, DocumentationPage } from './types'\n\nexport const AGENT_SKILLS_SCHEMA = 'https://schemas.agentskills.io/discovery/0.2.0/schema.json'\n\nexport interface DocumentationSkillArtifacts {\n name: string\n description: string\n markdown: string\n legacyIndex: Record<string, unknown>\n discoveryIndex: Record<string, unknown>\n}\n\n/** Build one deterministic, installable skill from the same graph as the site. */\nexport function createDocumentationSkillArtifacts(\n graph: DocumentationGraph,\n baseUrl?: string,\n basePath = '/docs',\n): DocumentationSkillArtifacts {\n const name = documentationSkillName(graph.config.name)\n const description = documentationSkillDescription(graph.config.name, graph.config.description)\n const root = baseUrl?.replace(/\\/$/, '') ?? ''\n const markdown = renderDocumentationSkill(graph, name, description, root)\n const digest = createHash('sha256').update(markdown).digest('hex')\n\n return {\n name,\n description,\n markdown,\n legacyIndex: {\n skills: [{ name, description, files: ['SKILL.md'] }],\n },\n discoveryIndex: {\n $schema: AGENT_SKILLS_SCHEMA,\n skills: [\n {\n name,\n type: 'skill-md',\n description,\n url: documentationPublicPath(basePath, `/.well-known/agent-skills/${name}/skill.md`),\n digest: `sha256:${digest}`,\n },\n ],\n },\n }\n}\n\nexport function documentationSkillName(value: string): string {\n const normalized = value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .replace(/-{2,}/g, '-')\n return normalized.slice(0, 64).replace(/-+$/g, '') || 'documentation'\n}\n\nfunction documentationSkillDescription(name: string, description?: string): string {\n const detail = description?.replace(/\\s+/g, ' ').trim()\n const value = detail\n ? `Use when answering questions, integrating, or implementing work with ${name}. ${detail}`\n : `Use when answering questions, integrating, or implementing work with ${name}.`\n return value.slice(0, 1_024).trim()\n}\n\nfunction renderDocumentationSkill(\n graph: DocumentationGraph,\n name: string,\n description: string,\n root: string,\n): string {\n const lines = [\n '---',\n `name: ${JSON.stringify(name)}`,\n `description: ${JSON.stringify(description)}`,\n 'metadata:',\n ' version: \"1.0\"',\n ` source-hash: ${JSON.stringify(graph.sourceHash)}`,\n '---',\n '',\n `# ${graph.config.name}`,\n '',\n graph.config.description ??\n `Use the published ${documentationSubject(graph.config.name)} as the source of truth.`,\n '',\n '## Grounding workflow',\n '',\n `1. Read [the documentation index](${root}/llms.txt) to discover the available pages.`,\n graph.config.mcp.access === 'public'\n ? `2. Prefer the read-only MCP server at \\`${root}/mcp\\` for ranked search and exact page reads.`\n : `2. Search the index, then open the relevant page Markdown directly.`,\n `3. Read a page's canonical Markdown before making implementation claims or quoting commands.`,\n `4. Treat this release as authoritative; do not mix instructions from another version or hostname.`,\n '',\n '## Documentation map',\n '',\n ...renderNavigation(graph.navigation, graph.pages, root),\n '## Constraints',\n '',\n '- Do not invent APIs, commands, configuration keys, or supported behavior.',\n '- Preserve security, authentication, billing, and deployment boundaries stated in the documentation.',\n '- When pages disagree, prefer the more specific page and report the conflict.',\n '- Link the exact source page in the final answer when the client supports citations.',\n '',\n ]\n return lines.join('\\n')\n}\n\nfunction renderNavigation(\n navigation: DocumentationNavigationNode[],\n pages: DocumentationPage[],\n root: string,\n): string[] {\n const byRoute = new Map(pages.map((page) => [page.route, page]))\n const lines: string[] = []\n const seen = new Set<string>()\n\n const visit = (nodes: DocumentationNavigationNode[], depth: number): void => {\n for (const node of nodes) {\n if (node.kind === 'group') {\n lines.push(`${'#'.repeat(Math.min(depth + 2, 6))} ${node.label}`, '')\n visit(node.items, depth + 1)\n continue\n }\n if (node.kind !== 'page' || seen.has(node.route)) continue\n const page = byRoute.get(node.route)\n if (!page || page.hidden) continue\n seen.add(page.route)\n const markdownRoute = markdownUrlForRoute(page.route)\n lines.push(renderPageLink(page, root, markdownRoute))\n }\n }\n\n visit(navigation, 1)\n const remaining = pages.filter((page) => !page.hidden && !seen.has(page.route))\n if (remaining.length > 0) {\n lines.push('### More', '')\n for (const page of remaining) {\n const markdownRoute = markdownUrlForRoute(page.route)\n lines.push(renderPageLink(page, root, markdownRoute))\n }\n }\n lines.push('')\n return lines\n}\n\nfunction renderPageLink(page: DocumentationPage, root: string, markdownRoute: string): string {\n return (\n `- [${page.title}](${root}${markdownRoute})` +\n `${page.description ? ` — ${page.description}` : ''}`\n )\n}\n","import { buildSync } from 'esbuild'\nimport { createRequire } from 'node:module'\nimport { runtimeEntry } from './custom-runtime'\nimport type { DocumentationRuntimeData } from './types'\n\ninterface DefaultRendererModule {\n renderDefaultDocumentation(data: DocumentationRuntimeData): string\n}\n\nlet cachedRenderer: DefaultRendererModule | undefined\n\n/**\n * Load default React SSR behind a runtime boundary. The native documentation compiler\n * and the DeepSpace CLI can be imported without evaluating React or\n * react-dom/server.\n */\nexport function renderDefaultDocumentation(data: DocumentationRuntimeData): string {\n cachedRenderer ??= loadDefaultRenderer()\n return cachedRenderer.renderDefaultDocumentation(data)\n}\n\nfunction loadDefaultRenderer(): DefaultRendererModule {\n const entry = runtimeEntry('documentation-default-renderer.cjs', 'runtime/default-renderer.tsx')\n if (entry.endsWith('.cjs')) {\n return createRequire(import.meta.url)(entry) as DefaultRendererModule\n }\n\n const result = buildSync({\n entryPoints: [entry],\n bundle: true,\n write: false,\n minify: false,\n platform: 'node',\n format: 'cjs',\n target: ['node22'],\n jsx: 'automatic',\n define: { 'process.env.NODE_ENV': '\"production\"' },\n })\n const source = result.outputFiles?.[0]?.text\n if (!source) throw new Error('Default documentation renderer did not emit JavaScript')\n\n const module = { exports: {} as DefaultRendererModule }\n const evaluate = new Function('require', 'module', 'exports', source)\n evaluate(createRequire(import.meta.url), module, module.exports)\n return module.exports\n}\n","export const DOCUMENTATION_BASE_CSS = String.raw`\n:root {\n /* The configured accent is injected as --documentation-accent-light; the\n * dark theme swaps in --documentation-accent-dark, which defaults to a\n * readable lightened derivative so a site that configures only one accent\n * never ships invisible links on the dark background. */\n --documentation-accent-light: #635bff;\n --documentation-accent-dark: color-mix(in oklab, var(--documentation-accent-light) 52%, white);\n --documentation-accent: var(--documentation-accent-light);\n /* Glyphs painted directly on the accent. Dark lightens the accent, so the\n * readable ink on it flips from white to near-black. */\n --documentation-accent-contrast: #ffffff;\n --documentation-brand-bg: #f8fafc;\n --documentation-brand-bg-dark: #0c0e14;\n --documentation-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --documentation-font-heading: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --documentation-font-mono: \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n --documentation-bg: #fbfcfe;\n --documentation-surface: #ffffff;\n --documentation-surface-raised: #ffffff;\n --documentation-panel: #f4f6fa;\n --documentation-panel-strong: #edf0f6;\n --documentation-text: #11131a;\n --documentation-text-soft: #353a47;\n --documentation-muted: #5c6270;\n --documentation-faint: #646a78;\n --documentation-border: #e4e7ed;\n --documentation-border-strong: #d7dbe4;\n --documentation-code-bg: #11131a;\n --documentation-code-panel: #171a23;\n --documentation-code-text: #e8ebf5;\n --documentation-shadow-sm: 0 1px 2px rgba(15, 18, 28, .04), 0 2px 8px rgba(15, 18, 28, .03);\n --documentation-shadow-lg: 0 24px 80px rgba(15, 18, 28, .18), 0 6px 24px rgba(15, 18, 28, .08);\n /* Honest glass: used only where content physically passes beneath a surface\n * (the launcher pill, the floating/mobile assistant panel). High-opacity\n * tint plus blur keeps the surface legible over prose, dark code, and\n * images without any protective gradient; the inset highlight is the lit\n * top edge that makes the pane read as material rather than mist. */\n --documentation-glass-bg: color-mix(in srgb, var(--documentation-surface-raised) 86%, transparent);\n --documentation-glass-border: color-mix(in srgb, var(--documentation-border-strong) 90%, var(--documentation-accent));\n --documentation-glass-highlight: rgba(255, 255, 255, .6);\n --documentation-font-size: 17px;\n --documentation-line-height: 1.65;\n --documentation-content-width: 720px;\n --documentation-reader-pad: 62px 52px 96px;\n --documentation-header-height: 66px;\n --documentation-sidebar-width: 292px;\n --documentation-assistant-width: 420px;\n /* Darkened against the light page; the dark theme lightens it instead. */\n --documentation-focus-ring: color-mix(in srgb, var(--documentation-accent) 82%, var(--documentation-text));\n color-scheme: light;\n font-family: var(--documentation-font-body);\n}\n\n:root[data-theme=\"dark\"] {\n --documentation-accent: var(--documentation-accent-dark);\n --documentation-accent-contrast: #0c0e14;\n --documentation-brand-bg: var(--documentation-brand-bg-dark);\n --documentation-bg: var(--documentation-brand-bg-dark);\n --documentation-surface: #10131b;\n --documentation-surface-raised: #151923;\n --documentation-panel: #171b25;\n --documentation-panel-strong: #1e2330;\n --documentation-text: #f2f4fa;\n --documentation-text-soft: #cbd0dc;\n --documentation-muted: #999fad;\n --documentation-faint: #808797;\n --documentation-border: #252a36;\n --documentation-border-strong: #343a49;\n --documentation-code-bg: #080a0f;\n --documentation-code-panel: #10131a;\n --documentation-code-text: #eef0f7;\n --documentation-shadow-sm: 0 1px 2px rgba(0, 0, 0, .24);\n --documentation-shadow-lg: 0 28px 90px rgba(0, 0, 0, .55), 0 8px 24px rgba(0, 0, 0, .35);\n --documentation-glass-bg: color-mix(in srgb, var(--documentation-surface-raised) 80%, transparent);\n --documentation-glass-border: color-mix(in srgb, var(--documentation-border-strong) 86%, var(--documentation-accent));\n --documentation-glass-highlight: rgba(255, 255, 255, .07);\n --documentation-focus-ring: color-mix(in srgb, var(--documentation-accent) 74%, white);\n color-scheme: dark;\n}\n\n/* theme.density, stamped by the template as data-density. Compact reworks the\n * whole reading measure through the tokens alone so no layout rule forks. */\n:root[data-density=\"compact\"] {\n --documentation-font-size: 15px;\n --documentation-line-height: 1.6;\n --documentation-content-width: 680px;\n --documentation-reader-pad: 44px 44px 80px;\n --documentation-header-height: 58px;\n --documentation-sidebar-width: 264px;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-gutter: stable; }\nbody { margin: 0; background: var(--documentation-brand-bg); color: var(--documentation-text); font-family: var(--documentation-font-body); font-size: var(--documentation-font-size); line-height: var(--documentation-line-height); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }\n:root[data-background-decoration=\"gradient\"] body { background-image: radial-gradient(circle at 58% 7%, color-mix(in srgb, var(--documentation-accent) 7%, transparent), transparent 32%); background-attachment: fixed; }\n:root[data-background-decoration=\"grid\"] body { background-image: linear-gradient(color-mix(in srgb, var(--documentation-border) 26%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--documentation-border) 26%, transparent) 1px, transparent 1px); background-attachment: fixed; background-size: 32px 32px; }\nbody:has(.documentation-modal-layer), body:has(.documentation-mobile-nav) { overflow: hidden; }\nbutton, input, textarea { font: inherit; }\nbutton, a, summary, label { -webkit-tap-highlight-color: transparent; }\na { color: inherit; }\nbutton:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--documentation-focus-ring); outline-offset: 3px; }\n::selection { background: color-mix(in srgb, var(--documentation-accent) 24%, transparent); }\n/* Chrome is an instrument, not a document: its labels never select and its\n * links never spawn the native drag ghost. The article prose, assistant\n * answers, and every input stay fully selectable. (The router's dragstart\n * chokepoint enforces the no-ghost rule in engines without -webkit-user-drag.) */\n.documentation-header, .documentation-sidebar, .documentation-mobile-nav, .documentation-outline, .documentation-outline-disclosure > summary, .documentation-breadcrumbs, .documentation-article-meta, .documentation-pagination, .documentation-search-dialog, .documentation-launcher-dock, .documentation-assistant > header, .documentation-assistant-suggestions, .documentation-assistant > footer, .documentation-tab-buttons, .documentation-code-actions, .documentation-theme-controls { user-select: none; -webkit-user-select: none; }\n.documentation-search-dialog input, .documentation-launcher-dock input, .documentation-search-results { user-select: text; -webkit-user-select: text; }\n:is(.documentation-header, .documentation-sidebar, .documentation-mobile-nav, .documentation-outline, .documentation-breadcrumbs, .documentation-article-meta, .documentation-pagination, .documentation-search-dialog) :is(a, img) { -webkit-user-drag: none; }\n\n.documentation-skip-link { position: fixed; z-index: 200; top: -64px; left: 16px; padding: 9px 13px; border-radius: 8px; background: var(--documentation-text); color: var(--documentation-bg); font-weight: 650; text-decoration: none; }\n.documentation-skip-link:focus { top: 12px; }\n/* The only navigation feedback. The article itself never animates: a route\n * swap is a hard cut committed in one frame, because any overlap of two text\n * layers — any fade, slide, or view transition — reads as ghosting. */\n.documentation-app.is-navigating::before { content: \"\"; position: fixed; z-index: 240; inset: 0 auto auto 0; width: 42%; height: 2px; background: var(--documentation-accent); animation: documentation-navigation-progress .8s ease-in-out infinite alternate; }\n\n`\n","export const DOCUMENTATION_CONTENT_CSS = String.raw`\n.documentation-main { min-width: 0; margin-left: var(--documentation-sidebar-width); margin-right: 0; transition: margin-right .24s ease; }\n.documentation-reader-grid { display: grid; grid-template-columns: minmax(0, var(--documentation-content-width)) 250px; justify-content: center; gap: 70px; width: 100%; padding: var(--documentation-reader-pad); }\n.documentation-reader-column { display: flex; min-width: 0; min-height: calc(100vh - var(--documentation-header-height) - 158px); flex-direction: column; }\n.documentation-article { display: flex; min-width: 0; flex: 1; flex-direction: column; }\n.documentation-breadcrumbs { display: none; align-items: center; gap: 5px; margin-bottom: 24px; color: var(--documentation-muted); font-size: 13px; }\n.documentation-breadcrumbs span { display: inline-flex; align-items: center; gap: 5px; }\n.documentation-breadcrumbs svg { width: 12px; height: 12px; }\n.documentation-article-header { margin-bottom: 38px; }\n.documentation-article-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 32px; margin-bottom: 7px; }\n.documentation-eyebrow { color: color-mix(in srgb, var(--documentation-accent) 76%, var(--documentation-text)); font-size: 13px; font-weight: 700; letter-spacing: .035em; }\n.documentation-contextual-actions { position: relative; display: inline-flex; flex: 0 0 auto; align-items: stretch; height: 32px; border: 1px solid var(--documentation-border); border-radius: 8px; background: color-mix(in srgb, var(--documentation-surface) 92%, transparent); box-shadow: var(--documentation-shadow-sm); }\n.documentation-contextual-actions button, .documentation-contextual-actions a, .documentation-contextual-actions summary { display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 30px; padding: 0 10px; border: 0; background: transparent; color: var(--documentation-muted); cursor: pointer; font: 590 12.5px/1 var(--documentation-font-body); text-decoration: none; white-space: nowrap; }\n.documentation-contextual-actions button:hover, .documentation-contextual-actions a:hover, .documentation-contextual-actions summary:hover { color: var(--documentation-text); }\n.documentation-contextual-actions svg { flex: 0 0 auto; width: 13px; height: 13px; }\n.documentation-contextual-actions details { position: relative; border-left: 1px solid var(--documentation-border); }\n.documentation-contextual-actions summary { width: 30px; padding: 0; justify-content: center; list-style: none; }\n.documentation-contextual-actions summary::-webkit-details-marker { display: none; }\n.documentation-contextual-actions details[open] summary { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-contextual-actions details[open] summary svg { transform: rotate(180deg); }\n.documentation-contextual-menu { position: absolute; z-index: 35; top: calc(100% + 7px); right: -1px; display: grid; width: min(344px, calc(100vw - 32px)); max-height: min(510px, calc(100vh - 120px)); overflow: auto; padding: 6px; border: 1px solid var(--documentation-border-strong); border-radius: 12px; background: var(--documentation-surface-raised); box-shadow: var(--documentation-shadow-lg); }\n.documentation-contextual-menu button, .documentation-contextual-menu a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; height: auto; min-height: 52px; padding: 7px 8px; border-radius: 8px; text-align: left; white-space: normal; }\n.documentation-contextual-menu button:hover, .documentation-contextual-menu a:hover { background: var(--documentation-panel); }\n.documentation-contextual-action-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--documentation-border); border-radius: 7px; background: var(--documentation-surface); color: var(--documentation-text-soft); }\n.documentation-contextual-action-icon svg { width: 15px; height: 15px; }\n.documentation-contextual-action-copy { display: grid; min-width: 0; gap: 2px; }\n.documentation-contextual-action-copy strong { color: var(--documentation-text); font-size: 13px; font-weight: 640; line-height: 1.25; }\n.documentation-contextual-action-copy small { color: var(--documentation-muted); font-size: 12px; font-weight: 450; line-height: 1.3; }\n.documentation-contextual-menu .documentation-contextual-action-external { width: 12px; height: 12px; color: var(--documentation-faint); }\n.documentation-article-header h1 { margin: 0; color: var(--documentation-text); font-family: var(--documentation-font-heading); font-size: clamp(34px, 3vw, 40px); font-weight: 650; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }\n.documentation-article-header h1:focus { outline: none; }\n.documentation-lede { max-width: 680px; margin: 14px 0 0; color: var(--documentation-text-soft); font-size: 19px; letter-spacing: -.01em; line-height: 1.55; }\n\n.documentation-prose { color: var(--documentation-text-soft); }\n.documentation-prose > :first-child { margin-top: 0; }\n/* Anchor clearance is owned once, by scroll-padding-top on the html element\n * — a per-heading scroll-margin here stacked with it and landed anchors a\n * full header-height too low. */\n.documentation-prose h1, .documentation-prose h2, .documentation-prose h3, .documentation-prose h4, .documentation-prose h5, .documentation-prose h6 { position: relative; color: var(--documentation-text); font-family: var(--documentation-font-heading); }\n.documentation-prose h1 { margin: 48px 0 18px; font-size: 30px; letter-spacing: -.025em; line-height: 1.2; }\n.documentation-prose h2 { margin: 50px 0 16px; padding-top: 5px; font-size: 25px; font-weight: 625; letter-spacing: -.025em; line-height: 1.28; }\n.documentation-prose h3 { margin: 34px 0 12px; font-size: 20px; font-weight: 620; letter-spacing: -.015em; line-height: 1.4; }\n.documentation-prose h4 { margin: 28px 0 10px; font-size: 17px; font-weight: 620; }\n/* Parked in the gutter so revealing it on hover never reflows the heading. The\n * bare class selector loses to the prose link rule, hence the descendant form. */\n.documentation-prose .documentation-heading-anchor { position: absolute; top: 0; left: -.82em; display: flex; align-items: center; height: 100%; padding-right: .25em; color: var(--documentation-faint); font-size: .8em; font-weight: 500; opacity: 0; text-decoration: none; transition: opacity .12s; }\n.documentation-prose :is(h1, h2, h3, h4, h5, h6):hover .documentation-heading-anchor, .documentation-prose .documentation-heading-anchor:focus-visible { opacity: 1; }\n.documentation-prose p { margin: 0 0 20px; }\n.documentation-prose ul, .documentation-prose ol { margin: 0 0 22px; padding-left: 26px; }\n.documentation-prose li { margin: 6px 0; padding-left: 3px; }\n.documentation-prose li::marker { color: var(--documentation-faint); }\n.documentation-prose strong { color: var(--documentation-text); font-weight: 610; }\n.documentation-prose a { color: color-mix(in srgb, var(--documentation-accent) 78%, var(--documentation-text)); font-weight: 560; text-decoration-color: color-mix(in srgb, var(--documentation-accent) 38%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.documentation-prose a:hover { text-decoration-color: currentColor; }\n.documentation-prose img { display: block; max-width: 100%; height: auto; margin: 26px 0; border: 1px solid var(--documentation-border); border-radius: 12px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); }\n.documentation-prose blockquote { margin: 25px 0; padding: 4px 0 4px 18px; border-left: 2px solid color-mix(in srgb, var(--documentation-accent) 45%, var(--documentation-border)); color: var(--documentation-muted); }\n.documentation-prose blockquote p:last-child { margin-bottom: 0; }\n.documentation-prose hr { margin: 44px 0; border: 0; border-top: 1px solid var(--documentation-border); }\n.documentation-prose :not(pre) > code, .documentation-assistant-message code { padding: 2px 6px; border-radius: 6px; background: var(--documentation-panel); color: var(--documentation-text); font: 520 .86em/1.4 var(--documentation-font-mono); overflow-wrap: anywhere; }\n.documentation-code-block { position: relative; margin: 24px 0; }\n.documentation-prose .documentation-code-block pre { margin: 0; }\n.documentation-prose pre { position: relative; overflow: auto; margin: 24px 0; padding: 20px; border: 1px solid color-mix(in srgb, var(--documentation-border-strong) 50%, #000); border-radius: 12px; background: linear-gradient(145deg, var(--documentation-code-panel), var(--documentation-code-bg)); color: var(--documentation-code-text); box-shadow: 0 12px 34px rgba(7, 9, 14, .12); font: 14px/1.65 var(--documentation-font-mono); tab-size: 2; }\n.documentation-prose pre code { display: block; min-width: max-content; background: transparent; }\n/* Actions overlay the code rather than floating inside its text flow, so no line\n * needs padding reserved for them and horizontal scrolling stays exact. */\n.documentation-code-actions { position: absolute; z-index: 2; top: 10px; right: 10px; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .14s; }\n.documentation-code-block:hover .documentation-code-actions, .documentation-code-actions:focus-within { opacity: 1; }\n.documentation-code-actions button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: color-mix(in srgb, var(--documentation-code-panel) 88%, transparent); color: #aeb5c6; cursor: pointer; backdrop-filter: blur(6px); }\n.documentation-code-actions button:hover { background: rgba(255, 255, 255, .14); color: #fff; }\n.documentation-code-actions svg { width: 15px; height: 15px; }\n/* The language rides in the hover actions row as a passive chip instead of a\n * permanently visible label that cost every block 38px of top padding. */\n.documentation-code-language { display: inline-flex; align-items: center; height: 30px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; background: color-mix(in srgb, var(--documentation-code-panel) 88%, transparent); color: #7f889c; font: 650 11px/1 var(--documentation-font-mono); letter-spacing: .06em; text-transform: uppercase; pointer-events: none; backdrop-filter: blur(6px); }\n/* Fence titles (filenames) get a slim header bar above the code. */\n.documentation-code-title { display: flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--documentation-border-strong) 50%, #000); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--documentation-code-panel); color: #aeb5c6; font: 600 12px/1.3 var(--documentation-font-mono); }\n.documentation-code-block:has(.documentation-code-title) pre { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }\n\n.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link { color: #b7a7ff; }\n.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition { color: #73dfb4; }\n.hljs-number, .hljs-meta, .hljs-built_in, .hljs-builtin-name, .hljs-params { color: #f0b96b; }\n.hljs-comment, .hljs-quote, .hljs-deletion { color: #767f93; font-style: italic; }\n.hljs-variable, .hljs-template-variable, .hljs-regexp { color: #ff95b4; }\n\n/* Light code blocks re-tint every token group above; a partial override would\n * leave the dark palette's colors on a near-white background. */\n:root[data-code-mode=\"system\"][data-theme=\"light\"] {\n --documentation-code-plain: #252936;\n --documentation-code-keyword: #6f42c1;\n --documentation-code-string: #0a7d55;\n --documentation-code-number: #8a4b00;\n --documentation-code-comment: #636a78;\n --documentation-code-variable: #b3246b;\n}\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-prose pre { border-color: var(--documentation-border); background: linear-gradient(145deg, #f7f8fb, #f1f3f7); color: var(--documentation-code-plain); box-shadow: 0 8px 26px rgba(15, 18, 28, .06); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-actions button { border-color: rgba(17, 19, 26, .12); background: rgba(255, 255, 255, .82); color: #606675; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-actions button:hover { background: #fff; color: #11131a; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-language { border-color: rgba(17, 19, 26, .12); background: rgba(255, 255, 255, .82); color: #757c8c; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] .documentation-code-title { border-color: var(--documentation-border); background: #eef1f6; color: #5c6270; }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link) { color: var(--documentation-code-keyword); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition) { color: var(--documentation-code-string); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-number, .hljs-meta, .hljs-built_in, .hljs-builtin-name, .hljs-params) { color: var(--documentation-code-number); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-comment, .hljs-quote, .hljs-deletion) { color: var(--documentation-code-comment); }\n:root[data-code-mode=\"system\"][data-theme=\"light\"] :is(.hljs-variable, .hljs-template-variable, .hljs-regexp) { color: var(--documentation-code-variable); }\n\n.documentation-prose table { display: block; width: 100%; overflow: auto; margin: 25px 0 29px; border: 1px solid var(--documentation-border); border-radius: 10px; border-collapse: separate; border-spacing: 0; background: var(--documentation-surface); font-size: 15px; }\n.documentation-prose thead { background: var(--documentation-panel); }\n.documentation-prose th, .documentation-prose td { min-width: 130px; padding: 11px 14px; border-right: 1px solid var(--documentation-border); border-bottom: 1px solid var(--documentation-border); text-align: left; vertical-align: top; }\n.documentation-prose th:last-child, .documentation-prose td:last-child { border-right: 0; }\n.documentation-prose tr:last-child td { border-bottom: 0; }\n.documentation-prose th { color: var(--documentation-text); font-size: 13px; font-weight: 700; letter-spacing: .02em; }\n\n.documentation-callout { --callout-accent: var(--documentation-accent); position: relative; margin: 24px 0; padding: 16px 18px 16px 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--callout-accent) 25%, var(--documentation-border)); border-radius: 11px; background: color-mix(in srgb, var(--callout-accent) 6%, var(--documentation-surface)); }\n.documentation-callout::before { content: \"\"; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--callout-accent); }\n.documentation-callout > strong { display: block; margin-bottom: 3px; color: color-mix(in srgb, var(--callout-accent) 72%, var(--documentation-text)); font-size: 14px; }\n.documentation-callout > :last-child { margin-bottom: 0; }\n.documentation-callout-warning { --callout-accent: #c9771a; }\n.documentation-callout-tip { --callout-accent: #17a673; }\n.documentation-callout-info { --callout-accent: #278fdb; }\n.documentation-callout-note { --callout-accent: var(--documentation-accent); }\n/* Card bodies are body copy, not links — without this the anchor's link color\n * bleeds into every description. */\n.documentation-card { color: var(--documentation-text-soft); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 14px 0; padding: 16px 17px; border: 1px solid var(--documentation-border); border-radius: 11px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); text-decoration: none !important; transition: border-color .16s, box-shadow .16s, transform .16s; }\n.documentation-card:hover { border-color: color-mix(in srgb, var(--documentation-accent) 42%, var(--documentation-border)); box-shadow: 0 7px 24px rgba(15, 18, 28, .07); transform: translateY(-1px); }\n.documentation-card strong { display: block; margin-bottom: 2px; }\n.documentation-accordion-group { margin: 21px 0; border: 1px solid var(--documentation-border); border-radius: 11px; overflow: hidden; }\n.documentation-accordion-group .documentation-accordion { margin: 0; border: 0; border-bottom: 1px solid var(--documentation-border); border-radius: 0; }\n.documentation-accordion-group .documentation-accordion:last-child { border-bottom: 0; }\n.documentation-accordion { margin: 14px 0; padding: 0 16px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); }\n.documentation-accordion summary { padding: 14px 25px 14px 0; color: var(--documentation-text); cursor: pointer; font-weight: 650; list-style: none; }\n.documentation-accordion summary::-webkit-details-marker { display: none; }\n.documentation-accordion summary::after { content: \"+\"; float: right; margin-right: -20px; color: var(--documentation-faint); font-size: 18px; font-weight: 400; line-height: 1; }\n.documentation-accordion[open] summary::after { content: \"−\"; }\n.documentation-accordion > :last-child { margin-bottom: 15px; }\n.documentation-steps { margin: 25px 0; counter-reset: documentation-step; }\n.documentation-step { position: relative; margin-left: 13px; padding: 0 0 29px 34px; border-left: 1px solid var(--documentation-border-strong); counter-increment: documentation-step; }\n.documentation-step:last-child { padding-bottom: 3px; border-color: transparent; }\n.documentation-step::before { content: counter(documentation-step); position: absolute; left: -14px; top: -1px; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid color-mix(in srgb, var(--documentation-accent) 46%, var(--documentation-border)); border-radius: 50%; background: var(--documentation-surface); color: color-mix(in srgb, var(--documentation-accent) 78%, var(--documentation-text)); box-shadow: 0 0 0 5px var(--documentation-bg); font-size: 11px; font-weight: 740; }\n.documentation-step h3 { margin-top: 0; }\n.documentation-tabs { margin: 23px 0; overflow: hidden; border: 1px solid var(--documentation-border); border-radius: 11px; background: var(--documentation-surface); }\n.documentation-tab-buttons { display: flex; gap: 2px; overflow-x: auto; padding: 6px; border-bottom: 1px solid var(--documentation-border); background: var(--documentation-panel); }\n.documentation-tab-buttons button { flex: 0 0 auto; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--documentation-muted); cursor: pointer; font-size: 13.5px; font-weight: 620; }\n.documentation-tab-buttons button[aria-selected=\"true\"] { background: var(--documentation-surface); color: var(--documentation-text); box-shadow: var(--documentation-shadow-sm); }\n.documentation-tab { padding: 16px 18px 2px; }\n.documentation-tab > :first-child { margin-top: 0; }\n.documentation-code-group { margin: 23px 0; overflow: hidden; border: 1px solid var(--documentation-border-strong); border-radius: 12px; background: var(--documentation-surface); }\n.documentation-code-group-title { padding: 8px 13px; border-bottom: 1px solid var(--documentation-border); background: var(--documentation-panel); color: var(--documentation-muted); font-size: 12px; font-weight: 650; }\n.documentation-code-group .documentation-tab-buttons { border-color: color-mix(in srgb, var(--documentation-border) 72%, transparent); background: var(--documentation-panel); }\n.documentation-code-tab { padding: 0; }\n.documentation-code-group .documentation-code-block { margin: 0; }\n.documentation-prose .documentation-code-group pre { margin: 0; border: 0; border-radius: 0; box-shadow: none; }\n\n.documentation-api-badge { display: flex; align-items: center; gap: 9px; margin: 0 0 25px; padding: 11px 13px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-panel); }\n.method { display: inline-grid; place-items: center; min-width: 52px; padding: 4px 7px; border-radius: 6px; background: #3178e8; color: white; font: 750 10px/1.3 var(--documentation-font-mono); letter-spacing: .035em; }\n.method-post { background: #138b5b; }\n.method-put, .method-patch { background: #bd7215; }\n.method-delete { background: #cd464d; }\n.documentation-playground { margin: 48px 0 30px; padding: 20px; border: 1px solid var(--documentation-border); border-radius: 12px; background: var(--documentation-panel); }\n.documentation-playground-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n.documentation-playground-title > div { display: flex; align-items: center; gap: 9px; }\n.documentation-playground-title code { overflow: hidden; color: var(--documentation-muted); font: 11px var(--documentation-font-mono); text-overflow: ellipsis; white-space: nowrap; }\n.documentation-playground > p { color: var(--documentation-muted); font-size: 12px; }\n.documentation-playground label { display: grid; gap: 5px; margin: 13px 0; color: var(--documentation-muted); font-size: 11px; font-weight: 650; }\n.documentation-playground input, .documentation-playground textarea { width: 100%; padding: 10px; border: 1px solid var(--documentation-border-strong); border-radius: 8px; background: var(--documentation-surface); color: var(--documentation-text); font: 12.5px/1.55 var(--documentation-font-mono); resize: vertical; }\n.documentation-playground > button { padding: 9px 13px; border: 0; border-radius: 8px; background: var(--documentation-accent); color: var(--documentation-accent-contrast); cursor: pointer; font-size: 12px; font-weight: 680; }\n.documentation-playground > button:disabled { opacity: .58; cursor: wait; }\n.documentation-playground > pre { max-height: 320px; overflow: auto; margin: 14px 0 0; padding: 13px; border-radius: 8px; background: var(--documentation-code-bg); color: var(--documentation-code-text); font: 11.5px/1.55 var(--documentation-font-mono); white-space: pre-wrap; }\n\n.documentation-context-rail { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; padding-left: 18px; }\n.documentation-outline { display: grid; gap: 2px; }\n.documentation-outline h2 { margin: 0 0 9px; color: var(--documentation-text); font-size: 13.5px; font-weight: 650; }\n.documentation-outline a { padding: 5px 0; color: var(--documentation-muted); font-size: 13.5px; line-height: 1.45; text-decoration: none; transition: color .12s; }\n.documentation-outline a:hover, .documentation-outline a.is-active { color: var(--documentation-text); }\n.documentation-outline a.is-active { color: color-mix(in srgb, var(--documentation-accent) 74%, var(--documentation-text)); font-weight: 640; }\n.documentation-outline a.depth-3 { padding-left: 13px; }\n/* The outline for viewports that have no room for the sticky rail. */\n.documentation-outline-disclosure { display: none; margin: 0 0 32px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); }\n.documentation-outline-disclosure > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--documentation-text); cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }\n.documentation-outline-disclosure > summary::-webkit-details-marker { display: none; }\n.documentation-outline-disclosure > summary svg { width: 15px; height: 15px; color: var(--documentation-muted); }\n.documentation-outline-disclosure .documentation-outline { padding: 0 14px 12px; }\n.documentation-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: auto; padding-top: 28px; }\n.documentation-pagination a { display: flex; flex-direction: column; min-height: 86px; padding: 14px 16px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-surface); text-decoration: none; transition: border-color .15s, transform .15s; }\n.documentation-pagination a:hover { border-color: color-mix(in srgb, var(--documentation-accent) 38%, var(--documentation-border)); transform: translateY(-1px); }\n.documentation-pagination a:last-child { text-align: right; }\n.documentation-pagination small { margin-bottom: 7px; color: var(--documentation-faint); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }\n.documentation-pagination span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--documentation-text); font-size: 15px; font-weight: 650; }\n.documentation-pagination a:last-child span { justify-content: flex-end; }\n.documentation-pagination svg { flex: 0 0 auto; width: 15px; }\n.documentation-pagination svg.is-back { transform: rotate(180deg); }\n\n`\n","export const DOCUMENTATION_NAVIGATION_CSS = String.raw`\n.documentation-header { position: fixed; z-index: 50; inset: 0 0 auto; display: grid; grid-template-columns: var(--documentation-sidebar-width) minmax(300px, 1fr) auto; align-items: center; height: var(--documentation-header-height); border-bottom: 1px solid color-mix(in srgb, var(--documentation-border) 84%, transparent); background: color-mix(in srgb, var(--documentation-bg) 91%, transparent); backdrop-filter: blur(18px) saturate(1.15); transition: right .24s ease; }\n.documentation-brand { display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; padding: 0 23px; color: var(--documentation-text); text-decoration: none; }\n.documentation-brand-mark { position: relative; display: grid; place-items: center; width: 27px; height: 27px; color: var(--documentation-accent); }\n.documentation-brand-mark svg { position: relative; width: 27px; height: 27px; }\n.documentation-brand-name { overflow: hidden; font-size: 16px; font-weight: 720; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-brand-product { padding-left: 10px; border-left: 1px solid var(--documentation-border-strong); color: var(--documentation-muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; }\n.documentation-brand-logo { max-width: 145px; max-height: 26px; object-fit: contain; object-position: left center; }\n.documentation-brand-logo-dark { display: none; }\n:root[data-theme=\"dark\"] .documentation-brand-logo-light { display: none; }\n:root[data-theme=\"dark\"] .documentation-brand-logo-dark { display: block; }\n\n.documentation-header-center { display: flex; align-items: center; justify-content: center; padding: 0 20px; }\n.documentation-search-trigger { display: flex; align-items: center; width: min(380px, 38vw); height: 38px; gap: 9px; padding: 0 10px 0 12px; font-size: 14px; border: 1px solid var(--documentation-border); border-radius: 10px; background: color-mix(in srgb, var(--documentation-surface) 88%, transparent); color: var(--documentation-muted); box-shadow: var(--documentation-shadow-sm); cursor: pointer; text-align: left; transition: border-color .15s, color .15s, transform .15s; }\n.documentation-search-trigger:hover { border-color: var(--documentation-border-strong); color: var(--documentation-text); transform: translateY(-1px); }\n.documentation-search-trigger > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-trigger svg { width: 16px; }\n.documentation-search-trigger kbd { padding: 2px 6px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 12px/1.3 var(--documentation-font-mono); }\n\n.documentation-top-links { display: flex; align-items: center; gap: 18px; height: 100%; padding: 0 24px 0 10px; }\n.documentation-top-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--documentation-muted); font-size: 14px; font-weight: 560; text-decoration: none; white-space: nowrap; }\n.documentation-top-links a:hover { color: var(--documentation-text); }\n.documentation-top-links svg { width: 12px; height: 12px; }\n.documentation-mobile-actions { display: none; align-items: center; gap: 3px; padding-right: 12px; }\n.documentation-icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--documentation-muted); cursor: pointer; }\n.documentation-icon-button:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n\n.documentation-frame { min-height: 100vh; padding-top: var(--documentation-header-height); }\n.documentation-sidebar { position: fixed; z-index: 30; inset: var(--documentation-header-height) auto 0 0; display: flex; flex-direction: column; width: var(--documentation-sidebar-width); border-right: 1px solid var(--documentation-border); background: var(--documentation-bg); }\n.documentation-page-tree { flex: 1; overflow: auto; padding: 26px 18px 36px 22px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--documentation-border-strong) transparent; }\n.documentation-nav-section { margin: 0 0 25px; }\n.documentation-nav-section > h2 { margin: 0 0 8px; padding: 0 9px; color: var(--documentation-text); font-size: 14px; font-weight: 650; }\n.documentation-nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; margin: 1px 0; padding: 6px 9px; border-radius: 8px; color: var(--documentation-muted); font-size: 14px; line-height: 1.4; text-decoration: none; transition: background .12s, color .12s; }\n.documentation-nav-link > span { min-width: 0; overflow-wrap: anywhere; }\n.documentation-nav-link > svg { flex: 0 0 auto; width: 12px; height: 12px; }\n.documentation-nav-link:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n/* Paper, not neon: the active state is a flat tint and a solid hairline —\n * no gradients, no glow. */\n.documentation-nav-link.is-active { position: relative; background: color-mix(in srgb, var(--documentation-accent) 10%, transparent); color: color-mix(in srgb, var(--documentation-accent) 72%, var(--documentation-text)); font-weight: 650; }\n.documentation-nav-link.is-active::before { content: \"\"; position: absolute; inset: 8px auto 8px -5px; width: 2px; border-radius: 4px; background: var(--documentation-accent); }\n.documentation-nav-folder { margin: 2px 0; }\n.documentation-nav-folder > summary { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 6px 9px; border-radius: 8px; color: var(--documentation-muted); cursor: pointer; font-size: 14px; font-weight: 620; list-style: none; }\n.documentation-nav-folder > summary::-webkit-details-marker { display: none; }\n.documentation-nav-folder > summary:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-nav-folder > summary svg { width: 13px; transition: transform .16s; }\n.documentation-nav-folder:not([open]) > summary svg { transform: rotate(-90deg); }\n.documentation-nav-folder > div { margin-left: 8px; padding-left: 9px; border-left: 1px solid var(--documentation-border); }\n\n.documentation-sidebar-footer { flex: 0 0 auto; display: grid; gap: 11px; padding: 13px 20px 16px 22px; border-top: 1px solid var(--documentation-border); background: color-mix(in srgb, var(--documentation-panel) 46%, var(--documentation-bg)); }\n.documentation-sidebar-footer > nav { display: flex; flex-wrap: wrap; gap: 8px 13px; }\n.documentation-sidebar-footer a, .documentation-sidebar-footer > span { color: var(--documentation-faint); font-size: 12px; text-decoration: none; }\n.documentation-sidebar-footer a:hover { color: var(--documentation-text); }\n.documentation-theme-controls { display: inline-flex; width: max-content; gap: 2px; padding: 2px; border: 1px solid var(--documentation-border); border-radius: 9px; background: var(--documentation-surface); box-shadow: var(--documentation-shadow-sm); }\n.documentation-theme-controls button { display: grid; place-items: center; width: 28px; height: 25px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--documentation-faint); cursor: pointer; }\n.documentation-theme-controls button:hover { color: var(--documentation-text); }\n.documentation-theme-controls button[aria-pressed=\"true\"] { background: var(--documentation-panel-strong); color: var(--documentation-text); }\n.documentation-theme-controls svg { width: 14px; height: 14px; }\n\n`\n","export const DOCUMENTATION_OVERLAYS_CSS = String.raw`\n.documentation-modal-layer { position: fixed; z-index: 100; inset: 0; display: flex; background: rgba(9, 11, 17, .48); backdrop-filter: blur(5px); animation: documentation-fade-in .14s ease-out; }\n.documentation-search-layer { align-items: flex-start; justify-content: center; padding: min(12vh, 100px) 16px 16px; }\n.documentation-search-dialog { width: min(680px, 100%); overflow: hidden; border: 1px solid var(--documentation-border-strong); border-radius: 14px; background: var(--documentation-surface-raised); box-shadow: var(--documentation-shadow-lg); animation: documentation-dialog-in .18s ease-out; }\n.documentation-search-input { display: flex; align-items: center; gap: 11px; height: 56px; padding: 0 15px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-search-input > svg { flex: 0 0 auto; width: 18px; color: var(--documentation-muted); }\n.documentation-search-input input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 16px; }\n.documentation-search-input input::placeholder { color: var(--documentation-faint); }\n.documentation-search-input kbd, .documentation-search-dialog footer kbd { padding: 2px 6px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 11px/1.4 var(--documentation-font-mono); }\n.documentation-search-results { min-height: 180px; max-height: min(56vh, 500px); overflow: auto; padding: 7px; }\n.documentation-search-empty { display: grid; place-items: center; min-height: 180px; padding: 25px; color: var(--documentation-muted); text-align: center; }\n.documentation-search-empty svg { width: 29px; height: 29px; margin-bottom: 8px; color: var(--documentation-accent); }\n.documentation-search-empty strong { color: var(--documentation-text); font-size: 15px; }\n.documentation-search-empty span { font-size: 13px; }\n.documentation-search-state { padding: 28px 16px; color: var(--documentation-muted); font-size: 14px; text-align: center; }\n.documentation-search-result, .documentation-search-assistant { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--documentation-text); cursor: pointer; text-align: left; text-decoration: none; }\n.documentation-search-result.is-active, .documentation-search-assistant.is-active { background: var(--documentation-panel); }\n.documentation-search-copy, .documentation-search-assistant > span { min-width: 0; flex: 1; display: grid; gap: 2px; }\n.documentation-search-copy strong, .documentation-search-assistant strong { overflow: hidden; font-size: 15px; font-weight: 660; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-copy small, .documentation-search-assistant small { overflow: hidden; color: var(--documentation-muted); font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }\n.documentation-search-crumbs { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; color: var(--documentation-muted); font-size: 13px; line-height: 1.45; white-space: nowrap; }\n.documentation-search-crumbs svg { flex: 0 0 auto; width: 11px; height: 11px; color: var(--documentation-faint); }\n.documentation-search-kind { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--documentation-panel); color: var(--documentation-muted); }\n.documentation-search-kind svg { width: 14px; height: 14px; }\n.documentation-search-result > svg, .documentation-search-assistant > svg:last-child { flex: 0 0 auto; width: 14px; color: var(--documentation-faint); }\n.documentation-search-assistant { border-top: 1px solid var(--documentation-border); border-radius: 0 0 9px 9px; color: color-mix(in srgb, var(--documentation-accent) 76%, var(--documentation-text)); }\n.documentation-search-assistant > svg:first-child { flex: 0 0 auto; width: 19px; }\n.documentation-search-result mark { border-radius: 3px; background: color-mix(in srgb, var(--documentation-accent) 18%, transparent); color: inherit; font-weight: 700; }\n.documentation-search-dialog > footer { display: flex; gap: 17px; padding: 9px 14px; border-top: 1px solid var(--documentation-border); background: var(--documentation-panel); color: var(--documentation-faint); font-size: 12px; }\n.documentation-search-dialog > footer span { display: flex; align-items: center; gap: 3px; }\n\n.documentation-mobile-nav { display: flex; flex-direction: column; width: min(342px, 88vw); height: 100%; border-right: 1px solid var(--documentation-border); background: var(--documentation-bg); box-shadow: var(--documentation-shadow-lg); animation: documentation-drawer-in .2s ease-out; }\n.documentation-mobile-nav > header { display: flex; align-items: center; justify-content: space-between; min-height: 64px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-mobile-nav > header .documentation-brand { border: 0; padding-left: 20px; }\n.documentation-mobile-nav > header .documentation-icon-button { margin-right: 12px; }\n.documentation-mobile-nav > .documentation-page-tree { padding-top: 22px; }\n.documentation-mobile-nav > footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; padding: 13px 18px; border-top: 1px solid var(--documentation-border); }\n.documentation-mobile-nav > footer a { color: var(--documentation-muted); font-size: 13px; text-decoration: none; }\n\n/* The launcher owns a reserved slot in the reading column: sticky at the\n * viewport bottom while reading, ordinary flow above the pagination once the\n * end of the article arrives. It is present on the whole page — no auto-hide,\n * no protective gradient, no mask. The pill's own glass is its legibility\n * over prose, dark code, and images, and its in-flow slot means it never\n * crosses the pagination. */\n.documentation-launcher-dock { position: sticky; z-index: 40; bottom: 0; display: flex; justify-content: center; margin-top: auto; padding: 30px 0 18px; pointer-events: none; }\n.documentation-launcher-dock + .documentation-pagination { margin-top: 0; }\n.documentation-assistant-launcher { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0; width: min(452px, 100%); min-height: 48px; padding: 5px; border: 1px solid var(--documentation-glass-border); border-radius: 15px; background: var(--documentation-glass-bg); color: var(--documentation-text); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 16px 40px rgba(15, 18, 28, .12), 0 2px 8px rgba(15, 18, 28, .05); pointer-events: auto; backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); transition: border-color .16s, box-shadow .16s, transform .22s cubic-bezier(.4, 0, .2, 1); }\n.documentation-assistant-launcher:hover { border-color: color-mix(in srgb, var(--documentation-accent) 32%, var(--documentation-border-strong)); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 20px 48px rgba(15, 18, 28, .15), 0 2px 8px rgba(15, 18, 28, .06); transform: translateY(-1px); }\n.documentation-assistant-launcher:focus-within { border-color: color-mix(in srgb, var(--documentation-accent) 48%, var(--documentation-border-strong)); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 10%, transparent), 0 16px 40px rgba(15, 18, 28, .12); }\n.documentation-assistant-launcher input { min-width: 0; height: 36px; padding: 0 6px 0 14px; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 14px; }\n.documentation-assistant-launcher input::placeholder { color: var(--documentation-muted); }\n/* The 40% cap lives on the grid track: a percentage max-width here would\n * resolve against that track instead of the launcher. */\n.documentation-launcher-hint { display: grid; grid-auto-flow: column; gap: 3px; padding-right: 8px; }\n.documentation-launcher-hint kbd { padding: 2px 5px; border: 1px solid var(--documentation-border); border-radius: 5px; background: var(--documentation-panel); color: var(--documentation-faint); font: 600 11px/1.3 var(--documentation-font-mono); }\n/* One send-button spec for the launcher and the composer: a circular accent\n * button with a gentle press cycle, dim while empty. */\n.documentation-launcher-send, .documentation-assistant-composer > button { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: var(--documentation-accent); color: var(--documentation-accent-contrast); cursor: pointer; transition: background-color .15s ease, color .15s ease, transform .15s ease; }\n.documentation-launcher-send { width: 36px; height: 36px; }\n.documentation-launcher-send:hover:not(:disabled), .documentation-assistant-composer > button:hover:not(:disabled) { transform: scale(1.06); }\n.documentation-launcher-send:active:not(:disabled), .documentation-assistant-composer > button:active:not(:disabled) { transform: scale(.96); }\n.documentation-launcher-send:disabled, .documentation-assistant-composer > button:disabled { background: var(--documentation-panel-strong); color: var(--documentation-faint); cursor: default; }\n.documentation-launcher-send svg, .documentation-assistant-composer > button svg { width: 14px; height: 14px; }\n/* Docked beside the article on desktop so the page being asked about stays\n * readable; the narrow breakpoints below restore the floating card and sheet. */\n.documentation-assistant { position: fixed; z-index: 90; inset: var(--documentation-header-height) 0 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: var(--documentation-assistant-width); overflow: hidden; border-left: 1px solid var(--documentation-border-strong); background: var(--documentation-surface); box-shadow: -18px 0 48px rgba(15, 18, 28, .06); animation: documentation-assistant-dock-in .2s ease-out; }\n.documentation-app.is-assistant-open .documentation-main { margin-right: var(--documentation-assistant-width); }\n.documentation-app.is-assistant-open .documentation-header { right: var(--documentation-assistant-width); }\n.documentation-assistant > header { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 11px 0 18px; border-bottom: 1px solid var(--documentation-border); }\n.documentation-assistant > header > div { display: flex; align-items: center; }\n.documentation-assistant > header > div > span { display: grid; gap: 1px; }\n.documentation-assistant > header strong { font-size: 14px; font-weight: 620; letter-spacing: -.01em; }\n.documentation-assistant > header small { color: var(--documentation-muted); font-size: 12px; }\n.documentation-assistant > header button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--documentation-muted); cursor: pointer; }\n.documentation-assistant > header button:hover { background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant > header button:focus-visible { outline-width: 1px; outline-offset: 1px; }\n.documentation-assistant > header button svg { width: 15px; height: 15px; }\n.documentation-assistant-messages { overflow: auto; padding: 20px 20px 14px; overscroll-behavior: contain; }\n.documentation-assistant-message { display: flex; align-items: flex-start; margin: 0 0 20px; color: var(--documentation-text-soft); font-size: 14.5px; line-height: 1.62; }\n.documentation-assistant-message > div { min-width: 0; max-width: 590px; }\n.documentation-assistant-message.is-user { justify-content: flex-end; margin-left: 54px; }\n.documentation-assistant-message.is-user > div { padding: 8px 11px; border: 1px solid var(--documentation-border); border-radius: 10px; background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant-message.is-error > div { padding: 10px 13px; border: 1px solid color-mix(in srgb, #d05a60 32%, var(--documentation-border)); border-radius: 10px; background: color-mix(in srgb, #d05a60 7%, var(--documentation-surface)); color: color-mix(in srgb, #d05a60 58%, var(--documentation-text)); font-size: 13.5px; }\n.documentation-assistant-message a { color: color-mix(in srgb, var(--documentation-accent) 79%, var(--documentation-text)); font-weight: 580; text-underline-offset: 3px; }\n.documentation-assistant-markdown > :first-child { margin-top: 0; }\n.documentation-assistant-markdown > :last-child { margin-bottom: 0; }\n.documentation-assistant-markdown p { margin: 0 0 11px; }\n.documentation-assistant-markdown ul, .documentation-assistant-markdown ol { margin: 0 0 12px; padding-left: 20px; }\n.documentation-assistant-markdown li { margin: 3px 0; }\n.documentation-assistant-heading { display: block; margin: 15px 0 6px; color: var(--documentation-text); font-family: var(--documentation-font-heading); font-size: 14.5px; }\n.documentation-assistant-code { overflow: hidden; margin: 12px 0; border: 1px solid var(--documentation-border-strong); border-radius: 10px; background: var(--documentation-code-bg); color: var(--documentation-code-text); }\n.documentation-assistant-code figcaption { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 8px 0 12px; border-bottom: 1px solid rgba(255,255,255,.09); background: var(--documentation-code-panel); color: #aeb5c6; font: 600 12px/1.3 var(--documentation-font-mono); }\n.documentation-assistant-code button { padding: 4px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; background: rgba(255,255,255,.06); color: inherit; cursor: pointer; font-size: 12px; }\n.documentation-assistant-code pre { overflow: auto; margin: 0; padding: 13px; font: 13px/1.6 var(--documentation-font-mono); }\n.documentation-assistant-code code { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; white-space: pre; }\n.documentation-assistant-activity { display: inline-flex; align-items: center; gap: 8px; color: var(--documentation-muted); font-size: 13px; }\n.documentation-assistant-activity > span { width: 6px; height: 6px; border-radius: 50%; background: var(--documentation-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 10%, transparent); animation: documentation-activity 1.25s ease-in-out infinite; }\n.documentation-assistant-suggestions { display: grid; gap: 7px; margin-top: 26px; }\n.documentation-assistant-suggestions p { margin: 0 0 1px; color: var(--documentation-faint); font-size: 12px; font-weight: 650; letter-spacing: .035em; text-transform: uppercase; }\n.documentation-assistant-suggestions button { min-height: 40px; padding: 9px 12px; border: 1px solid var(--documentation-border); border-radius: 9px; background: var(--documentation-bg); color: var(--documentation-muted); cursor: pointer; font-size: 13.5px; text-align: left; transition: border-color .14s, background .14s, color .14s; }\n.documentation-assistant-suggestions button:hover { border-color: var(--documentation-border-strong); background: var(--documentation-panel); color: var(--documentation-text); }\n.documentation-assistant-composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 16px 10px; padding: 8px; border: 1px solid var(--documentation-border-strong); border-radius: 16px; background: var(--documentation-surface-raised); box-shadow: 0 3px 12px rgba(15, 18, 28, .045); transition: border-color .15s ease, box-shadow .15s ease; }\n.documentation-assistant-composer:focus-within { border-color: color-mix(in srgb, var(--documentation-accent) 52%, var(--documentation-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--documentation-accent) 9%, transparent); }\n/* The field grows with its content (the runtime sets the height); it never\n * shows a scrollbar until the growth cap, and never clips a glyph. */\n.documentation-assistant-composer textarea { min-height: 24px; max-height: 160px; flex: 1; padding: 5px 6px; resize: none; border: 0; outline: 0; background: transparent; color: var(--documentation-text); font-size: 14px; line-height: 1.5; overflow-y: hidden; scrollbar-width: thin; }\n.documentation-assistant > footer { padding: 0 18px 12px; color: var(--documentation-faint); font-size: 12px; text-align: center; }\n@keyframes documentation-fade-in { from { opacity: 0; } }\n@keyframes documentation-dialog-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } }\n@keyframes documentation-drawer-in { from { transform: translateX(-24px); } }\n@keyframes documentation-assistant-dock-in { from { transform: translateX(24px); opacity: .5; } }\n@keyframes documentation-assistant-in { from { transform: translateX(-50%) translateY(18px) scale(.985); opacity: .7; } }\n@keyframes documentation-activity { 50% { opacity: .42; transform: scale(.82); } }\n@keyframes documentation-navigation-progress { from { transform: translateX(-20%); } to { transform: translateX(155%); } }\n\n`\n","export const DOCUMENTATION_RESPONSIVE_CSS = String.raw`\n@media (max-width: 1320px) {\n .documentation-reader-grid { grid-template-columns: minmax(0, 680px) 224px; gap: 48px; padding-inline: 70px; }\n .documentation-top-links { gap: 13px; padding-right: 16px; }\n .documentation-top-links a { font-size: 13px; }\n}\n\n/* The rail's own cut-off is 1140px; a docked panel takes that much again out of\n * the row, so the same choice applies that much earlier while it is open. */\n@media (max-width: 1560px) {\n .documentation-app.is-assistant-open .documentation-reader-grid { grid-template-columns: minmax(0, 760px); }\n .documentation-app.is-assistant-open .documentation-context-rail { display: none; }\n}\n\n@media (max-width: 1140px) {\n .documentation-reader-grid { grid-template-columns: minmax(0, 760px); }\n .documentation-context-rail { display: none; }\n .documentation-header { grid-template-columns: var(--documentation-sidebar-width) 1fr auto; }\n .documentation-top-links { display: none; }\n .documentation-breadcrumbs { display: flex; }\n .documentation-outline-disclosure { display: block; }\n /* Too narrow to dock beside the article; fall back to the floating card.\n * The article passes beneath it, so this surface is honest glass. */\n .documentation-assistant { inset: auto auto 18px 50%; width: min(620px, calc(100vw - 36px)); height: min(570px, calc(100vh - 94px)); border: 1px solid var(--documentation-glass-border); border-radius: 16px; background: var(--documentation-glass-bg); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2); box-shadow: inset 0 1px 0 var(--documentation-glass-highlight), var(--documentation-shadow-lg); transform: translateX(-50%); animation: documentation-assistant-in .2s ease-out; }\n .documentation-app.is-assistant-open .documentation-main { margin-right: 0; }\n .documentation-app.is-assistant-open .documentation-header { right: 0; }\n}\n\n@media (max-width: 900px) {\n :root { --documentation-sidebar-width: 0px; }\n .documentation-header { grid-template-columns: minmax(0, 1fr) auto; }\n .documentation-header > .documentation-brand { padding-left: 17px; border-right: 0; }\n .documentation-header-center, .documentation-sidebar { display: none; }\n .documentation-mobile-actions { display: flex; }\n .documentation-main { margin-left: 0; }\n .documentation-reader-grid { padding: 44px 30px 64px; }\n .documentation-assistant { width: min(660px, calc(100vw - 24px)); }\n}\n\n@media (max-width: 600px) {\n body { font-size: 16px; }\n .documentation-brand { padding-right: 8px; }\n .documentation-brand-product { display: none; }\n .documentation-mobile-actions { padding-right: 8px; }\n .documentation-icon-button { width: 44px; height: 44px; }\n .documentation-reader-grid { padding: 31px 19px 48px; }\n .documentation-breadcrumbs { margin-bottom: 19px; overflow: hidden; white-space: nowrap; }\n .documentation-breadcrumbs span { flex: 0 0 auto; }\n .documentation-article-header { margin-bottom: 30px; }\n .documentation-article-meta { align-items: flex-start; }\n .documentation-eyebrow { padding-top: 8px; }\n .documentation-contextual-primary button, .documentation-contextual-primary a { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }\n .documentation-article-header h1 { font-size: 32px; line-height: 1.15; }\n .documentation-lede { font-size: 18px; line-height: 1.52; }\n .documentation-prose h2 { margin-top: 42px; font-size: 23px; }\n .documentation-prose h3 { font-size: 19px; }\n .documentation-prose pre { margin-inline: -5px; padding: 17px; border-radius: 10px; font-size: 13px; }\n .documentation-pagination { grid-template-columns: 1fr; }\n .documentation-search-layer { padding: 8px; align-items: stretch; }\n .documentation-search-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; border-radius: 12px; }\n .documentation-search-results { max-height: none; }\n .documentation-search-dialog > footer { justify-content: center; }\n .documentation-launcher-dock { padding-bottom: 12px; }\n .documentation-launcher-hint { display: none; }\n .documentation-assistant { inset: auto auto 0 0; width: 100%; height: calc(100vh - 8px); transform: none; border-width: 1px 0 0; border-radius: 18px 18px 0 0; }\n .documentation-assistant-suggestions { grid-template-columns: 1fr; }\n .documentation-playground-title { align-items: flex-start; flex-direction: column; }\n}\n\n/* Hover-only affordances: touch users get no reveal, so keep the space clear. */\n@media (hover: none) {\n .documentation-prose .documentation-heading-anchor { display: none; }\n .documentation-code-actions { opacity: 1; }\n .documentation-launcher-hint { display: none; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n html { scroll-behavior: auto; }\n *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }\n}\n`\n","import { DOCUMENTATION_BASE_CSS } from './styles/base'\nimport { DOCUMENTATION_CONTENT_CSS } from './styles/content'\nimport { DOCUMENTATION_NAVIGATION_CSS } from './styles/navigation'\nimport { DOCUMENTATION_OVERLAYS_CSS } from './styles/overlays'\nimport { DOCUMENTATION_RESPONSIVE_CSS } from './styles/responsive'\n\n/** One emitted stylesheet, assembled from independently customizable feature layers. */\nexport const DOCUMENTATION_CSS =\n DOCUMENTATION_BASE_CSS +\n DOCUMENTATION_NAVIGATION_CSS +\n DOCUMENTATION_CONTENT_CSS +\n DOCUMENTATION_OVERLAYS_CSS +\n DOCUMENTATION_RESPONSIVE_CSS\n","import type {\n DocumentationConfig,\n DocumentationNavigationNode,\n DocumentationPage,\n DocumentationRuntimeData,\n DocumentationRuntimeRouteDocument,\n ResolvedDocumentationTheme,\n} from './types'\nimport {\n DOCUMENTATION_BUNDLED_BODY_FONT,\n DOCUMENTATION_BUNDLED_MONO_FONT,\n resolveDocumentationFonts,\n safeFontFamily,\n type DocumentationResolvedFont,\n} from './fonts'\nimport { renderDefaultDocumentation } from './renderer'\nimport { documentationPublicPath, joinSiteUrl, markdownUrlForRoute } from './routing'\nimport { escapeHtml } from './text'\nexport { DOCUMENTATION_CSS } from './runtime/styles'\n\nexport interface DocumentationPageRenderOptions {\n config: DocumentationConfig\n basePath: string\n page: DocumentationPage\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n}\n\nexport interface DocumentationPageRuntime {\n data: DocumentationRuntimeData\n document: DocumentationRuntimeRouteDocument\n}\n\nexport function renderPage(options: DocumentationPageRenderOptions, assets: {\n customStylesheets?: string[]\n markup?: string\n runtimeModule?: boolean\n runtimeScript?: string\n} = {}, runtime = createPageRuntime(options)): string {\n const { config, page } = options\n const { data: runtimeData, document: runtimeDocument } = runtime\n const theme = runtimeData.config.theme\n const accent = documentationAccent(theme)\n const accentDark = validCssColor(theme.accentDark) ? theme.accentDark : undefined\n const background = validCssColor(theme.background) ? theme.background : '#fbfcfe'\n const backgroundDark = validCssColor(theme.backgroundDark) ? theme.backgroundDark : '#0c0e14'\n const defaultMode = theme.defaultMode ?? 'system'\n const bodyFont = cssFontStack(theme.bodyFont?.family)\n const headingFont = cssFontStack(theme.headingFont?.family ?? theme.bodyFont?.family)\n const monoFont = cssMonoFontStack(theme.monoFont?.family)\n const fonts = resolveDocumentationFonts(theme, options.basePath)\n const fontFaces = renderFontFaces(fonts)\n const fontPreloads = renderFontPreloads(fonts)\n const markup = assets.markup ?? renderDefaultDocumentation(runtimeData)\n const assetRoot = documentationPublicPath(options.basePath, '/assets')\n const favicon = theme.favicon ?? documentationPublicPath(options.basePath, '/assets/favicon.svg')\n\n return `<!doctype html>\n<html lang=\"en\" data-theme-mode=\"${defaultMode}\" data-theme-strict=\"${theme.strictMode ? 'true' : 'false'}\" data-code-mode=\"${theme.codeBlockMode ?? 'dark'}\" data-density=\"${theme.density ?? 'comfortable'}\" data-background-decoration=\"${theme.backgroundDecoration ?? 'none'}\" data-eyebrow-style=\"${theme.eyebrowStyle ?? 'section'}\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>${escapeHtml(runtimeDocument.title)}</title>\n <meta name=\"description\" content=\"${escapeHtml(runtimeDocument.description ?? '')}\">\n <meta name=\"generator\" content=\"DeepSpace Documentation Orbit\">\n <meta name=\"color-scheme\" content=\"light dark\">\n ${runtimeDocument.robots ? `<meta name=\"robots\" content=\"${escapeHtml(runtimeDocument.robots)}\">` : ''}\n ${runtimeDocument.canonical ? `<link rel=\"canonical\" href=\"${escapeHtml(runtimeDocument.canonical)}\">` : ''}\n <meta property=\"og:type\" content=\"article\">\n <meta property=\"og:title\" content=\"${escapeHtml(runtimeDocument.openGraph['og:title'] ?? '')}\">\n <meta property=\"og:description\" content=\"${escapeHtml(runtimeDocument.openGraph['og:description'] ?? '')}\">\n ${runtimeDocument.openGraph['og:url'] ? `<meta property=\"og:url\" content=\"${escapeHtml(runtimeDocument.openGraph['og:url'])}\">` : ''}\n ${config.seo.ogImage ? `<meta property=\"og:image\" content=\"${escapeHtml(config.seo.ogImage)}\">` : ''}\n ${config.seo.ogImage ? `<meta name=\"twitter:image\" content=\"${escapeHtml(config.seo.ogImage)}\">` : ''}\n <meta name=\"twitter:card\" content=\"${config.seo.ogImage ? 'summary_large_image' : 'summary'}\">\n <meta name=\"theme-color\" media=\"(prefers-color-scheme: light)\" content=\"${background}\">\n <meta name=\"theme-color\" media=\"(prefers-color-scheme: dark)\" content=\"${backgroundDark}\">\n ${renderCustomMeta(config.seo.metaTags)}\n <link rel=\"icon\" href=\"${escapeHtml(favicon)}\">\n ${fontPreloads}\n <link rel=\"stylesheet\" href=\"${assetRoot}/documentation.css\">\n ${(assets.customStylesheets ?? []).map((href) => `<link rel=\"stylesheet\" href=\"${escapeHtml(href)}\">`).join('\\n ')}\n <style>${fontFaces}:root{--documentation-accent-light:${accent};${accentDark ? `--documentation-accent-dark:${accentDark};` : ''}--documentation-brand-bg:${background};--documentation-brand-bg-dark:${backgroundDark};--documentation-font-body:${bodyFont};--documentation-font-heading:${headingFont};--documentation-font-mono:${monoFont}}</style>\n <script src=\"${assetRoot}/documentation-theme.js\"></script>\n</head>\n<body data-route=\"${escapeHtml(page.route)}\">\n <div id=\"deepspace-documentation-root\">${markup}</div>\n <script id=\"deepspace-documentation-data\" type=\"application/json\">${serializeBootstrap(runtimeData)}</script>\n <script${assets.runtimeModule ? ' type=\"module\"' : ''} src=\"${escapeHtml(assets.runtimeScript ?? `${assetRoot}/documentation-runtime.js`)}\" defer></script>\n</body>\n</html>`\n}\n\nfunction renderFontFaces(fonts: DocumentationResolvedFont[]): string {\n return fonts\n .map((font) => {\n const format = font.format ? ` format(\"${font.format}\")` : ''\n return `@font-face{font-family:\"${font.family}\";src:url(\"${font.source}\")${format};font-weight:${font.weight};font-display:swap}`\n })\n .join('')\n}\n\nfunction renderFontPreloads(fonts: DocumentationResolvedFont[]): string {\n return fonts\n .map((font) => `<link rel=\"preload\" href=\"${escapeHtml(font.source)}\" as=\"font\" type=\"font/woff2\" crossorigin>`)\n .join('\\n ')\n}\n\nexport function documentationAccent(theme: ResolvedDocumentationTheme): string {\n return validCssColor(theme.accent) ? theme.accent : '#635bff'\n}\n\n/**\n * Default mark, themed from the configured accent so a site that sets no favicon\n * still gets a tab icon that matches its own palette.\n */\nexport function renderDocumentationFavicon(theme: ResolvedDocumentationTheme): string {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><path d=\"M16 2.5c.5 7.7 5.8 13 13.5 13.5-7.7.5-13 5.8-13.5 13.5C15.5 21.8 10.2 16.5 2.5 16 10.2 15.5 15.5 10.2 16 2.5Z\" fill=\"${escapeHtml(documentationAccent(theme))}\"/></svg>\\n`\n}\n\nfunction renderCustomMeta(metaTags: Record<string, string> | undefined): string {\n if (!metaTags) return ''\n return Object.entries(metaTags)\n .filter(([name]) => /^[a-z0-9][a-z0-9._:-]*$/i.test(name))\n .map(([name, content]) => `<meta name=\"${escapeHtml(name)}\" content=\"${escapeHtml(content)}\">`)\n .join('\\n ')\n}\n\nexport function createNotFoundPage(): DocumentationPage {\n return {\n sourcePath: '',\n relativePath: '',\n route: '/404',\n title: 'Page not found',\n description: 'The documentation page you requested does not exist.',\n hidden: true,\n noindex: true,\n markdown: '',\n html: '<p>The page may have moved. Search this documentation or return to the documentation home.</p><p><a href=\"/\">Go to documentation home</a></p>',\n text: 'Page not found',\n headings: [],\n sourceFormat: 'generated',\n kind: 'page',\n }\n}\n\nexport function renderNotFound(\n config: DocumentationConfig,\n navigation: DocumentationNavigationNode[],\n assets: Parameters<typeof renderPage>[1] = {},\n basePath = '/docs',\n): string {\n const page = createNotFoundPage()\n return renderPage({ config, basePath, page, pages: [page], navigation }, assets)\n}\n\nexport function createRuntimeRouteDocument(options: {\n config: DocumentationConfig\n basePath: string\n page: DocumentationPage\n pages: DocumentationPage[]\n navigation: DocumentationNavigationNode[]\n}): DocumentationRuntimeRouteDocument {\n return createPageRuntime(options).document\n}\n\nexport function createPageRuntime(options: DocumentationPageRenderOptions): DocumentationPageRuntime {\n const { config, page, pages, navigation } = options\n const data = createRuntimeData(config, page, pages, navigation, options.basePath)\n return {\n data,\n document: createRuntimeRouteDocumentFromData(config, page, data),\n }\n}\n\nfunction createRuntimeRouteDocumentFromData(\n config: DocumentationConfig,\n page: DocumentationPage,\n runtimeData: DocumentationRuntimeData,\n): DocumentationRuntimeRouteDocument {\n const data = {\n basePath: runtimeData.basePath,\n page: runtimeData.page,\n breadcrumbs: runtimeData.breadcrumbs,\n ...(runtimeData.previous ? { previous: runtimeData.previous } : {}),\n ...(runtimeData.next ? { next: runtimeData.next } : {}),\n }\n const canonical = config.url ? joinSiteUrl(config.url, page.route) : null\n const description = page.description ?? config.description ?? `${page.title} — ${config.name}`\n return {\n canonical,\n data,\n description,\n openGraph: {\n 'og:title': page.title,\n 'og:description': description,\n 'og:url': canonical,\n },\n robots: page.noindex ? 'noindex, nofollow' : null,\n title: `${page.title} · ${config.name}`,\n }\n}\n\nexport function renderRedirect(to: string, basePath = '/docs'): string {\n const safe = escapeHtml(documentationPublicPath(basePath, to))\n return `<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"robots\" content=\"noindex\"><meta http-equiv=\"refresh\" content=\"0;url=${safe}\"><link rel=\"canonical\" href=\"${safe}\"><title>Redirecting…</title></head><body><p>Redirecting to <a href=\"${safe}\">${safe}</a>.</p></body></html>`\n}\n\nfunction publicTheme(theme: ResolvedDocumentationTheme, basePath: string): ResolvedDocumentationTheme {\n const publicAsset = (value: string | undefined): string | undefined => {\n if (!value) return value\n const logical = value.startsWith('/_documentation/') ? value.slice('/_documentation'.length) : value\n return logical.startsWith('/media/') ? documentationPublicPath(basePath, logical) : logical\n }\n const publicFont = (font: ResolvedDocumentationTheme['bodyFont']): ResolvedDocumentationTheme['bodyFont'] =>\n font ? { ...font, source: publicAsset(font.source) } : font\n return {\n ...theme,\n logo: publicAsset(theme.logo),\n logoDark: publicAsset(theme.logoDark),\n favicon: publicAsset(theme.favicon),\n bodyFont: publicFont(theme.bodyFont),\n headingFont: publicFont(theme.headingFont),\n monoFont: publicFont(theme.monoFont),\n }\n}\n\nfunction publicPageHtml(html: string, basePath: string): string {\n return html.replace(\n /(\\b(?:href|src)=[\"'])(\\/(?!\\/)[^\"']*)([\"'])/gi,\n (_match, prefix: string, value: string, suffix: string) => {\n const logical = value.startsWith('/_documentation/') ? value.slice('/_documentation'.length) : value\n const publicValue = basePath && (logical === basePath || logical.startsWith(`${basePath}/`))\n ? logical\n : documentationPublicPath(basePath, logical)\n return `${prefix}${publicValue}${suffix}`\n },\n )\n}\n\nexport function createRuntimeData(\n config: DocumentationConfig,\n page: DocumentationPage,\n pages: DocumentationPage[],\n navigation: DocumentationNavigationNode[],\n basePath: string,\n): DocumentationRuntimeData {\n const ordered = orderedRoutes(navigation)\n const pageIndex = ordered.indexOf(page.route)\n const previous = pageIndex > 0\n ? pages.find((candidate) => candidate.route === ordered[pageIndex - 1])\n : undefined\n const next = pageIndex >= 0\n ? pages.find((candidate) => candidate.route === ordered[pageIndex + 1])\n : undefined\n return {\n basePath,\n config: {\n name: config.name,\n ...(config.description ? { description: config.description } : {}),\n theme: publicTheme(config.theme, basePath),\n links: config.links,\n footer: config.footer,\n assistant: config.assistant,\n mcp: config.mcp,\n contextual: config.contextual,\n },\n page: {\n route: page.route,\n title: page.title,\n ...(page.description ? { description: page.description } : {}),\n html: publicPageHtml(page.html, basePath),\n headings: page.headings,\n kind: page.kind,\n markdownUrl: markdownUrlForRoute(page.route, basePath),\n ...(page.openapi ? { openapi: page.openapi } : {}),\n },\n navigation,\n breadcrumbs: findBreadcrumbs(navigation, page.route) ?? [config.name, page.title],\n ...(previous ? { previous: { route: previous.route, title: previous.title } } : {}),\n ...(next ? { next: { route: next.route, title: next.title } } : {}),\n }\n}\n\nfunction findBreadcrumbs(\n nodes: DocumentationNavigationNode[],\n route: string,\n parents: string[] = [],\n): string[] | undefined {\n for (const node of nodes) {\n if (node.kind === 'page' && node.route === route) return [...parents, node.label]\n if (node.kind === 'group') {\n const result = findBreadcrumbs(node.items, route, [...parents, node.label])\n if (result) return result\n }\n }\n return undefined\n}\n\nfunction orderedRoutes(nodes: DocumentationNavigationNode[]): string[] {\n return nodes.flatMap((node): string[] => {\n if (node.kind === 'page') return [node.route]\n if (node.kind === 'group') return orderedRoutes(node.items)\n return []\n })\n}\n\nfunction serializeBootstrap(data: DocumentationRuntimeData): string {\n return JSON.stringify(data)\n .replace(/</g, '\\\\u003c')\n .replace(/>/g, '\\\\u003e')\n .replace(/&/g, '\\\\u0026')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029')\n}\n\nfunction validCssColor(value: string | undefined): value is string {\n if (!value) return false\n return /^(?:#[0-9a-f]{3,8}|(?:rgb|hsl)a?\\([0-9.,%\\s]+\\)|[a-z]{3,20})$/i.test(value)\n}\n\nfunction cssFontStack(value: string | undefined): string {\n const family = safeFontFamily(value, DOCUMENTATION_BUNDLED_BODY_FONT.family)\n return `${family},ui-sans-serif,-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif`\n}\n\nfunction cssMonoFontStack(value: string | undefined): string {\n const family = safeFontFamily(value, DOCUMENTATION_BUNDLED_MONO_FONT.family)\n return `${family},ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace`\n}\n\nfunction themeBootstrap(): void {\n try {\n const stored = localStorage.getItem('deepspace-documentation-theme')\n const configured = document.documentElement.dataset.themeMode || 'system'\n const strict = document.documentElement.dataset.themeStrict === 'true'\n const mode = !strict && (stored === 'light' || stored === 'dark' || stored === 'system')\n ? stored\n : configured\n document.documentElement.dataset.themeMode = mode\n document.documentElement.dataset.theme = mode === 'system'\n ? (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n : mode\n } catch {\n document.documentElement.dataset.theme = 'light'\n }\n}\n\nexport const DOCUMENTATION_THEME_BOOTSTRAP = `(${themeBootstrap.toString()})()\\n`\n","import { existsSync, readdirSync, realpathSync, rmSync } from 'node:fs'\nimport { relative, resolve, sep } from 'node:path'\nimport { buildDocumentation } from './build'\nimport { DOCUMENTATION_CONFIG_FILE, type DocumentationBuildResult } from './types'\n\nconst IGNORED_DOCUMENTATION_WATCH_PATH =\n /^(?:\\.deepspace|\\.git|\\.wrangler|dist|node_modules|public\\/_documentation(?:-root)?|src\\/router\\.ts)(?:\\/|$)/\n\ninterface DocumentationViteServer {\n restart(): Promise<void>\n watcher: {\n add(paths: string[]): void\n on(event: 'all', handler: (event: string, path: string) => void): void\n on(event: 'ready', handler: () => void): void\n }\n config: {\n logger: {\n info(message: string): void\n error(message: string): void\n }\n }\n}\n\n/**\n * Vite bridge for the app Worker's ASSETS binding.\n *\n * Both development and production write Vite's reserved public namespace so\n * the Cloudflare ASSETS binding has one identical source in both environments.\n * Documentation's feature metadata sets `run_worker_first = true`, leaving the\n * app Worker as the single router while binding reads bypass it as assets.\n */\nexport function deepSpaceDocumentation(): {\n name: string\n config(\n config: { root?: string },\n _environment: { command: 'build' | 'serve' },\n ): {\n server: { watch: { ignored: string[] } }\n }\n configResolved(config: { root: string }): void\n configureServer(server: DocumentationViteServer): void\n} {\n let appDir = process.cwd()\n let outputDir = resolve(appDir, '.deepspace', 'documentation')\n let result: DocumentationBuildResult | null = null\n\n const rebuild = (): DocumentationBuildResult | null => {\n if (!existsSync(resolve(appDir, DOCUMENTATION_CONFIG_FILE))) {\n rmSync(outputDir, { recursive: true, force: true })\n rmSync(`${outputDir}-root`, { recursive: true, force: true })\n result = null\n return null\n }\n // Deploy supplies the public origin so this one compile is the release\n // artifact; development leaves it unset and keeps relative URLs.\n const baseUrl = process.env.DEEPSPACE_DOCUMENTATION_BASE_URL\n result = buildDocumentation({\n appDir,\n outputDir,\n ...(baseUrl ? { baseUrl } : {}),\n })\n if (result.manifest.domains.length) {\n buildDocumentation({\n appDir,\n outputDir: `${outputDir}-root`,\n basePath: '',\n baseUrl: `https://${result.manifest.domains[0]}`,\n })\n } else rmSync(`${outputDir}-root`, { recursive: true, force: true })\n return result\n }\n\n return {\n name: 'deepspace-documentation',\n config(config, environment) {\n appDir = resolve(config.root ?? process.cwd())\n outputDir = resolve(appDir, 'public', '_documentation')\n if (environment.command === 'serve') {\n rmSync(resolve(appDir, '.deepspace', 'documentation'), { recursive: true, force: true })\n rmSync(resolve(appDir, '.deepspace', 'documentation-root'), {\n recursive: true,\n force: true,\n })\n }\n try {\n rebuild()\n } catch (error) {\n // Vite reports only the message; keep the per-file diagnostics.\n throw new Error(documentationBuildErrorMessage(error), { cause: error })\n }\n return {\n server: {\n watch: {\n ignored: ['**/.deepspace/documentation*/**', '**/public/_documentation*/**'],\n },\n },\n }\n },\n configResolved(config) {\n const resolvedRoot = resolve(config.root)\n const rootChanged = !pathsReferToSameDirectory(appDir, resolvedRoot)\n appDir = resolvedRoot\n outputDir = resolve(appDir, 'public', '_documentation')\n if (rootChanged) rebuild()\n },\n configureServer(server) {\n if (!result) return\n\n const configPath = resolve(appDir, DOCUMENTATION_CONFIG_FILE)\n const customRuntimePath = resolve(appDir, 'documentation.tsx')\n const watchedPaths = [configPath, customRuntimePath, result.sourceDir]\n const initialPaths = currentDocumentationPaths(appDir)\n server.watcher.add(watchedPaths)\n const initialReplayTimeout = setTimeout(() => initialPaths.clear(), 10_000)\n initialReplayTimeout.unref()\n server.watcher.on('ready', () => {\n clearTimeout(initialReplayTimeout)\n initialPaths.clear()\n })\n let timer: ReturnType<typeof setTimeout> | undefined\n server.watcher.on('all', (event, path) => {\n const changed = canonicalPath(path)\n if ((event === 'add' || event === 'addDir') && initialPaths.delete(changed)) return\n if (!shouldRebuildDocumentation(appDir, configPath, result?.sourceDir ?? '', changed))\n return\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n try {\n const previousDomains = result?.manifest.domains ?? []\n const next = rebuild()\n if (next) {\n server.config.logger.info(\n `[deepspace] rebuilt ${next.manifest.pageCount} documentation page(s)`,\n )\n if (\n changed === canonicalPath(configPath) &&\n !sameDomains(previousDomains, next.manifest.domains)\n ) {\n void server.restart().catch((error) => {\n server.config.logger.error(\n `[deepspace] development Worker restart failed: ${error instanceof Error ? error.message : String(error)}`,\n )\n })\n }\n }\n } catch (error) {\n server.config.logger.error(\n `[deepspace] documentation rebuild failed: ${documentationBuildErrorMessage(error)}`,\n )\n }\n }, 120)\n })\n },\n }\n}\n\nexport function documentationBuildErrorMessage(error: unknown): string {\n const diagnostics =\n error && typeof error === 'object' && 'diagnostics' in error\n ? (error as { diagnostics?: Array<{ file?: string; line?: number; message: string }> })\n .diagnostics\n : undefined\n if (!diagnostics?.length) return error instanceof Error ? error.message : String(error)\n return diagnostics\n .map(\n (diagnostic) =>\n `${diagnostic.file ?? 'documentation.json'}${diagnostic.line ? `:${diagnostic.line}` : ''}: ${diagnostic.message}`,\n )\n .join('\\n')\n}\n\nfunction sameDomains(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) return false\n const expected = new Set(right)\n return left.every((domain) => expected.has(domain))\n}\n\nfunction currentDocumentationPaths(appDir: string): Set<string> {\n const paths = new Set<string>()\n const directories = [appDir]\n for (const directory of directories) {\n for (const entry of readdirSync(directory, { withFileTypes: true })) {\n const path = resolve(directory, entry.name)\n const relativePath = relative(appDir, path).split(sep).join('/')\n if (IGNORED_DOCUMENTATION_WATCH_PATH.test(relativePath)) continue\n paths.add(canonicalPath(path))\n if (entry.isDirectory()) directories.push(path)\n }\n }\n return paths\n}\n\nfunction canonicalPath(path: string): string {\n try {\n return realpathSync(path)\n } catch {\n return resolve(path)\n }\n}\n\nfunction pathsReferToSameDirectory(left: string, right: string): boolean {\n return canonicalPath(left) === canonicalPath(right)\n}\n\nfunction isWithinPath(root: string, candidate: string): boolean {\n if (!root) return false\n const path = relative(resolve(root), resolve(candidate))\n return path !== '..' && !path.startsWith(`..${sep}`)\n}\n\nfunction shouldRebuildDocumentation(\n appDir: string,\n configPath: string,\n sourceDir: string,\n changed: string,\n): boolean {\n appDir = canonicalPath(appDir)\n configPath = canonicalPath(configPath)\n sourceDir = canonicalPath(sourceDir)\n if (\n changed === configPath ||\n changed === resolve(appDir, 'documentation.tsx') ||\n isWithinPath(sourceDir, changed)\n ) {\n return true\n }\n if (!isWithinPath(appDir, changed) || !/\\.(?:css|js|jsx|ts|tsx)$/i.test(changed)) return false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CAAiC,KAAK,YAAY;AAC5D;","names":["buildSync","readFileSync","resolve","visit","existsSync","readFileSync","basename","extname","relative","resolve","sep","existsSync","resolve","resolve","existsSync","markdown","existsSync","readFileSync","realpathSync","relative","resolve","parseYaml","document","document","resolve","existsSync","realpathSync","readFileSync","parseYaml","document","relative","prettyJson","existsSync","extname","resolve","markdown","relative","sep","readFileSync","visit","basename","existsSync","readFileSync","dirname","extname","join","relative","resolve","sep","resolve","existsSync","join","readFileSync","relative","sep","extname","dirname","require","existsSync","readFileSync","fileURLToPath","fileURLToPath","existsSync","readFileSync","createHash","existsSync","readFileSync","readdirSync","rmSync","writeFileSync","dirname","extname","join","relative","resolve","sep","sanitizeHtml","existsSync","rmSync","dirname","writeFileSync","readdirSync","join","extname","resolve","relative","readFileSync","createHash","sep","sanitizeHtml","createHash","markdown","createHash","visit","buildSync","createRequire","createRequire","buildSync","resolve","readFileSync","buildSync","existsSync","readdirSync","realpathSync","rmSync","relative","resolve","sep","resolve","existsSync","rmSync","readdirSync","relative","sep","realpathSync"]}