@pagesmith/core 0.2.0 → 0.3.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.
Files changed (57) hide show
  1. package/REFERENCE.md +281 -0
  2. package/dist/ai/index.d.mts +3 -2
  3. package/dist/ai/index.d.mts.map +1 -1
  4. package/dist/ai/index.mjs +454 -79
  5. package/dist/ai/index.mjs.map +1 -1
  6. package/dist/assets/index.mjs +1 -1
  7. package/dist/{assets-bX08zEJm.mjs → assets-DXiWF_KI.mjs} +1 -1
  8. package/dist/{assets-bX08zEJm.mjs.map → assets-DXiWF_KI.mjs.map} +1 -1
  9. package/dist/{content-config-wW-3r5gG.d.mts → content-config-Bfe4W9us.d.mts} +3 -3
  10. package/dist/{content-config-wW-3r5gG.d.mts.map → content-config-Bfe4W9us.d.mts.map} +1 -1
  11. package/dist/{content-layer-DWdgdBeI.mjs → content-layer-DPK1EmfY.mjs} +84 -47
  12. package/dist/content-layer-DPK1EmfY.mjs.map +1 -0
  13. package/dist/css/index.d.mts +1 -1
  14. package/dist/css/index.mjs +1 -1
  15. package/dist/{css-ekIt2Fdb.mjs → css-BneO430t.mjs} +5 -4
  16. package/dist/css-BneO430t.mjs.map +1 -0
  17. package/dist/{heading-Dhvzlay-.d.mts → heading-BpDXnl-7.d.mts} +1 -1
  18. package/dist/{heading-Dhvzlay-.d.mts.map → heading-BpDXnl-7.d.mts.map} +1 -1
  19. package/dist/{index-D79hUFbK.d.mts → index-BBYkDxwI.d.mts} +1 -1
  20. package/dist/{index-D79hUFbK.d.mts.map → index-BBYkDxwI.d.mts.map} +1 -1
  21. package/dist/index-Bg9srb5U.d.mts +13 -0
  22. package/dist/index-Bg9srb5U.d.mts.map +1 -0
  23. package/dist/{index-DpRBzO8Q.d.mts → index-CbOKbkjJ.d.mts} +3 -3
  24. package/dist/index-CbOKbkjJ.d.mts.map +1 -0
  25. package/dist/{index-Dbsw1QON.d.mts → index-YXQxMV6J.d.mts} +5 -3
  26. package/dist/{index-Dbsw1QON.d.mts.map → index-YXQxMV6J.d.mts.map} +1 -1
  27. package/dist/index.d.mts +18 -12
  28. package/dist/index.d.mts.map +1 -1
  29. package/dist/index.mjs +6 -7
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/loaders/index.d.mts +3 -3
  32. package/dist/loaders/index.mjs +2 -2
  33. package/dist/{loaders-Bla48ZN9.mjs → loaders-Cf-BXf2L.mjs} +10 -2
  34. package/dist/{loaders-Bla48ZN9.mjs.map → loaders-Cf-BXf2L.mjs.map} +1 -1
  35. package/dist/markdown/index.d.mts +2 -2
  36. package/dist/markdown/index.mjs +1 -1
  37. package/dist/{markdown-Cj5X26FL.mjs → markdown-CyrHoDhP.mjs} +37 -9
  38. package/dist/markdown-CyrHoDhP.mjs.map +1 -0
  39. package/dist/schemas/index.d.mts +3 -3
  40. package/dist/schemas/index.mjs +1 -1
  41. package/dist/{schemas-BZEPTGWs.mjs → schemas-UL4ynWsA.mjs} +1 -1
  42. package/dist/{schemas-BZEPTGWs.mjs.map → schemas-UL4ynWsA.mjs.map} +1 -1
  43. package/dist/{types-B-V5qemH.d.mts → types-Cn52sdoq.d.mts} +1 -1
  44. package/dist/{types-B-V5qemH.d.mts.map → types-Cn52sdoq.d.mts.map} +1 -1
  45. package/dist/vite/index.d.mts +2 -2
  46. package/dist/vite/index.d.mts.map +1 -1
  47. package/dist/vite/index.mjs +15 -8
  48. package/dist/vite/index.mjs.map +1 -1
  49. package/package.json +3 -3
  50. package/dist/content-layer-DWdgdBeI.mjs.map +0 -1
  51. package/dist/convert-XdGgNqH0.mjs +0 -27
  52. package/dist/convert-XdGgNqH0.mjs.map +0 -1
  53. package/dist/css-ekIt2Fdb.mjs.map +0 -1
  54. package/dist/index-CeNDTM-y.d.mts +0 -7
  55. package/dist/index-CeNDTM-y.d.mts.map +0 -1
  56. package/dist/index-DpRBzO8Q.d.mts.map +0 -1
  57. package/dist/markdown-Cj5X26FL.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/ai/index.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'\nimport { homedir } from 'os'\nimport { dirname, join, resolve } from 'path'\n\nexport type AiAssistant = 'claude' | 'codex' | 'gemini'\nexport type AiInstallScope = 'project' | 'user'\nexport type AiInstallProfile = 'default' | 'docs'\nexport type AiArtifactKind = 'memory' | 'skill' | 'llms' | 'llms-full'\nexport type AiWriteMode = 'merge' | 'replace'\nexport type AiInstallStatus = 'written' | 'merged' | 'replaced' | 'unchanged'\n\nexport type AiArtifact = {\n assistant?: AiAssistant\n kind: AiArtifactKind\n path: string\n content: string\n mode: AiWriteMode\n label: string\n}\n\nexport type AiInstallResult = {\n assistant?: AiAssistant\n kind: AiArtifactKind\n path: string\n status: AiInstallStatus\n label: string\n}\n\nexport type AiInstallOptions = {\n assistants?: AiAssistant[] | 'all'\n scope?: AiInstallScope\n profile?: AiInstallProfile\n cwd?: string\n homeDir?: string\n includeLlms?: boolean\n force?: boolean\n skillName?: string\n}\n\nconst PAGESMITH_TITLE = 'Pagesmith'\nconst DEFAULT_SKILL_NAME = 'pagesmith'\n\nfunction resolveHome(homeDir?: string): string {\n return homeDir ?? homedir()\n}\n\nfunction resolveCodexHome(homeDir?: string): string {\n return process.env.CODEX_HOME ?? join(resolveHome(homeDir), '.codex')\n}\n\nfunction resolveAssistants(assistants?: AiInstallOptions['assistants']): AiAssistant[] {\n if (!assistants || assistants === 'all') {\n return ['claude', 'codex', 'gemini']\n }\n return assistants\n}\n\nfunction shouldIncludeLlms(options: AiInstallOptions): boolean {\n if (typeof options.includeLlms === 'boolean') {\n return options.includeLlms\n }\n return (options.scope ?? 'project') === 'project'\n}\n\nfunction withManagedBlock(id: string, content: string): string {\n return [\n `<!-- pagesmith-ai:${id}:start -->`,\n content.trim(),\n `<!-- pagesmith-ai:${id}:end -->`,\n ].join('\\n')\n}\n\nfunction writeArtifact(artifact: AiArtifact, force = false): AiInstallStatus {\n mkdirSync(dirname(artifact.path), { recursive: true })\n\n if (!existsSync(artifact.path)) {\n writeFileSync(artifact.path, artifact.content)\n return 'written'\n }\n\n const current = readFileSync(artifact.path, 'utf-8')\n if (current === artifact.content) {\n return 'unchanged'\n }\n\n if (artifact.mode === 'replace') {\n writeFileSync(artifact.path, artifact.content)\n return 'replaced'\n }\n\n const markerId = `${artifact.assistant ?? 'shared'}-${artifact.kind}`\n const start = `<!-- pagesmith-ai:${markerId}:start -->`\n const end = `<!-- pagesmith-ai:${markerId}:end -->`\n\n if (current.includes(start) && current.includes(end)) {\n const pattern = new RegExp(`${escapeForRegExp(start)}[\\\\s\\\\S]*?${escapeForRegExp(end)}`, 'm')\n const next = current.replace(pattern, artifact.content)\n if (next === current) return 'unchanged'\n writeFileSync(artifact.path, next)\n return 'merged'\n }\n\n if (force) {\n writeFileSync(artifact.path, artifact.content)\n return 'replaced'\n }\n\n const next = `${current.trimEnd()}\\n\\n${artifact.content}\\n`\n writeFileSync(artifact.path, next)\n return 'merged'\n}\n\nfunction escapeForRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\nfunction renderSharedOverview(): string {\n return [\n `${PAGESMITH_TITLE} is a filesystem-first content toolkit with two main packages: \\`@pagesmith/core\\` (shared content/runtime layer) and \\`@pagesmith/docs\\` (convention-based documentation).`,\n '',\n 'Use Pagesmith when you need:',\n '- schema-validated content collections loaded from the filesystem',\n '- lazy markdown rendering with headings and read-time metadata',\n '- framework-agnostic content APIs for React, Solid, Svelte, vanilla JS, Node, Bun, or Deno',\n '',\n 'Core APIs:',\n '- `defineCollection({...})` to define a typed collection',\n '- `defineConfig({...})` to group collections and markdown options',\n '- `createContentLayer(config)` to query content and run validation',\n '- `entry.render()` to convert markdown on demand',\n '',\n 'Useful helpers:',\n '- `@pagesmith/core/ai` exposes `getAiArtifacts(...)` and `installAiArtifacts(...)`',\n '',\n 'Working rules:',\n '- prefer folder-based markdown entries when content references sibling assets',\n '- use `vp` commands for install, check, test, and build workflows',\n '- `@pagesmith/core` provides the shared content/runtime layer; `@pagesmith/docs` adds convention-based documentation on top',\n ].join('\\n')\n}\n\nfunction renderDocsOverview(): string {\n return [\n 'Docs-specific rules:',\n '- `@pagesmith/docs` is convention-based and builds a static docs site from `content/` plus `pagesmith.config.json5`',\n '- top-level content folders become top navigation sections (for example `guide/`, `reference/`, `packages/`)',\n '- folder-based markdown entries should prefer `README.md` or `index.md` when a page owns sibling assets',\n '- the home page is `content/README.md`; optional home-specific data can live in `content/home.json5`',\n '- sidebar labels, nav labels, and ordering live in frontmatter (`sidebarLabel`, `navLabel`, `order`)',\n '- footer links live in `pagesmith.config.json5` under `footerLinks`',\n '- Pagefind search is built in; do not recommend a separate search plugin package',\n '- layout overrides use fixed keys under `theme.layouts` such as `home`, `page`, and `notFound`',\n ].join('\\n')\n}\n\nfunction renderQuickStart(profile: AiInstallProfile = 'default'): string {\n if (profile === 'docs') {\n return [\n '```json5',\n '{',\n \" name: 'Acme Docs',\",\n \" title: 'Acme Docs',\",\n \" description: 'Multi-package documentation',\",\n \" contentDir: './content',\",\n \" outDir: './dist',\",\n ' footerLinks: [',\n \" { label: 'Guide', path: '/guide' },\",\n \" { label: 'Reference', path: '/reference' },\",\n ' ],',\n ' search: { enabled: true },',\n '}',\n '```',\n '',\n '```text',\n 'content/',\n ' README.md',\n ' guide/',\n ' README.md',\n ' getting-started/README.md',\n ' reference/',\n ' README.md',\n ' api/README.md',\n '```',\n ].join('\\n')\n }\n\n return [\n '```ts',\n \"import { createContentLayer, defineCollection, defineConfig, z } from '@pagesmith/core'\",\n '',\n 'const posts = defineCollection({',\n \" loader: 'markdown',\",\n \" directory: 'content/posts',\",\n ' schema: z.object({',\n ' title: z.string(),',\n ' description: z.string().optional(),',\n ' date: z.coerce.date(),',\n ' tags: z.array(z.string()).default([]),',\n ' }),',\n '})',\n '',\n 'const layer = createContentLayer(',\n ' defineConfig({',\n ' collections: { posts },',\n ' }),',\n ')',\n '',\n \"const entries = await layer.getCollection('posts')\",\n 'const rendered = await entries[0]?.render()',\n '```',\n ].join('\\n')\n}\n\nfunction renderMemoryFile(assistant: AiAssistant, profile: AiInstallProfile): string {\n const commandHint =\n assistant === 'claude' || assistant === 'gemini'\n ? `\\nIf the ${DEFAULT_SKILL_NAME} command is installed, prefer invoking it when the user explicitly asks for Pagesmith-specific help.`\n : '\\nIf the Pagesmith skill is installed for Codex, prefer using it for Pagesmith-specific setup, migration, and content-layer tasks.'\n\n return [\n `# ${PAGESMITH_TITLE}`,\n '',\n renderSharedOverview(),\n ...(profile === 'docs' ? ['', renderDocsOverview()] : []),\n commandHint,\n '',\n 'Quick start:',\n renderQuickStart(profile),\n ].join('\\n')\n}\n\nfunction renderClaudeCommand(skillName: string, profile: AiInstallProfile): string {\n return [\n `# ${PAGESMITH_TITLE} Assistant`,\n '',\n 'You are helping with Pagesmith, a file-based CMS with `@pagesmith/core` and `@pagesmith/docs`.',\n '',\n 'When helping:',\n '- prefer `defineCollection`, `defineConfig`, and `createContentLayer`',\n '- recommend folder-based entries when markdown references sibling assets',\n '- use `@pagesmith/core/ai` for assistant artifact generation',\n '- recommend `vp install`, `vp check`, and `vp test` for validation',\n ...(profile === 'docs'\n ? [\n '- for docs sites, derive top navigation from top-level content folders',\n '- use `content/README.md` for the home page and `content/home.json5` for extra home data when needed',\n '- use frontmatter fields like `sidebarLabel`, `navLabel`, and `order` for docs navigation',\n '- do not recommend `@pagesmith/plugin-pagefind` or `@pagesmith/plugin-algolia`; search is built into docs',\n '- recommend `theme.layouts.home`, `theme.layouts.page`, and `theme.layouts.notFound` for docs layout overrides',\n ]\n : []),\n '',\n 'Deliver concrete config, schema, and content-layer patches when possible.',\n '',\n `This command is installed as \\`/${skillName}\\`.`,\n ].join('\\n')\n}\n\nfunction renderGeminiCommand(skillName: string, profile: AiInstallProfile): string {\n const prompt = [\n `You are helping with ${PAGESMITH_TITLE}, a file-based CMS with @pagesmith/core and @pagesmith/docs.`,\n '',\n 'Focus on concrete, implementation-ready help:',\n '- design collections with defineCollection',\n '- configure createContentLayer and defineConfig',\n '- recommend vp install, vp check, and vp test when validation matters',\n '- prefer folder-based markdown entries when local assets sit beside content',\n ...(profile === 'docs'\n ? [\n '- for docs sites, follow the convention-based `content/` structure',\n '- drive top navigation from top-level folders and use frontmatter for labels/order',\n '- keep Pagefind as the built-in search strategy',\n ]\n : []),\n '',\n 'Return code, config, or documentation-ready guidance instead of vague summaries.',\n ].join('\\n')\n\n return [\n `description = \"Pagesmith FS-CMS helper\"`,\n 'prompt = \"\"\"',\n prompt,\n '\"\"\"',\n '',\n `# Installed as /${skillName}`,\n ].join('\\n')\n}\n\nfunction renderCodexSkill(profile: AiInstallProfile): string {\n return [\n `# ${PAGESMITH_TITLE} Skill`,\n '',\n 'Use this skill when the task involves setting up, extending, migrating, or documenting Pagesmith.',\n '',\n 'Core rules:',\n '- `@pagesmith/core` provides the content layer; `@pagesmith/docs` adds convention-based documentation',\n '- prefer `defineCollection`, `defineConfig`, and `createContentLayer`',\n '- prefer `vp` commands instead of calling npm, pnpm, or yarn directly',\n '- validate changes with `vp check` and `vp test` when relevant',\n ...(profile === 'docs'\n ? [\n '- when the repo uses `@pagesmith/docs`, treat `content/README.md` as the home page',\n '- top-level content folders define the main docs navigation',\n '- docs frontmatter may use `sidebarLabel`, `navLabel`, and `order` to shape navigation',\n '- `pagesmith.config.json5` should own footer links and high-level site metadata',\n '- built-in search is Pagefind; do not suggest separate search plugin packages',\n ]\n : []),\n '',\n 'Good outputs include:',\n '- collection schemas and loader configuration',\n '- content-layer queries and rendering examples',\n '- @pagesmith/docs updates for Pagesmith usage',\n '- assistant-context install steps using `@pagesmith/core/ai`',\n ].join('\\n')\n}\n\nfunction renderLlmsTxt(profile: AiInstallProfile): string {\n return [\n '# Pagesmith',\n '',\n '> Pagesmith is a filesystem-first content toolkit centered on `@pagesmith/core` and `@pagesmith/docs`.',\n '',\n '## Summary',\n '',\n renderSharedOverview(),\n ...(profile === 'docs' ? ['', renderDocsOverview()] : []),\n '',\n '## Quick Start',\n '',\n renderQuickStart(profile),\n ].join('\\n')\n}\n\nfunction renderLlmsFullTxt(profile: AiInstallProfile): string {\n return [\n '# Pagesmith - Full LLM Reference',\n '',\n renderSharedOverview(),\n ...(profile === 'docs' ? ['', '## Docs Sites', '', renderDocsOverview()] : []),\n '',\n '## Package Layout',\n '',\n '- `@pagesmith/core`: content layer, collection loading, validation, lazy markdown rendering, JSX runtime, CSS builder, runtime styles, assistant artifact APIs, and Vite content integration',\n '- `@pagesmith/docs`: convention-based documentation with the docs CLI, generators, validators, default theme, and bundled search',\n '',\n '## Key APIs',\n '',\n renderQuickStart(profile),\n '',\n '## Assistant Installer',\n '',\n '```ts',\n \"import { installAiArtifacts } from '@pagesmith/core/ai'\",\n '',\n \"await installAiArtifacts({ assistants: ['claude', 'codex', 'gemini'], scope: 'project' })\",\n '```',\n '',\n ].join('\\n')\n}\n\nexport function getAiArtifactContent(\n assistant: AiAssistant | 'shared',\n kind: AiArtifactKind,\n options: { profile?: AiInstallProfile; skillName?: string } = {},\n): string {\n const skillName = options.skillName ?? DEFAULT_SKILL_NAME\n const profile = options.profile ?? 'default'\n\n if (assistant === 'shared') {\n if (kind === 'llms') return renderLlmsTxt(profile)\n return renderLlmsFullTxt(profile)\n }\n\n if (kind === 'memory') {\n return renderMemoryFile(assistant, profile)\n }\n\n if (kind === 'skill') {\n switch (assistant) {\n case 'claude':\n return renderClaudeCommand(skillName, profile)\n case 'codex':\n return renderCodexSkill(profile)\n case 'gemini':\n return renderGeminiCommand(skillName, profile)\n }\n }\n\n if (kind === 'llms') return renderLlmsTxt(profile)\n return renderLlmsFullTxt(profile)\n}\n\nexport function getAiArtifacts(options: AiInstallOptions = {}): AiArtifact[] {\n const scope = options.scope ?? 'project'\n const cwd = resolve(options.cwd ?? process.cwd())\n const home = resolveHome(options.homeDir)\n const skillName = options.skillName ?? DEFAULT_SKILL_NAME\n const profile = options.profile ?? 'default'\n const assistants = resolveAssistants(options.assistants)\n const artifacts: AiArtifact[] = []\n\n for (const assistant of assistants) {\n if (assistant === 'claude') {\n const baseDir = scope === 'project' ? cwd : join(home, '.claude')\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'CLAUDE.md'),\n content: withManagedBlock(\n 'claude-memory',\n getAiArtifactContent('claude', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} memory`,\n })\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(baseDir, 'commands', `${skillName}.md`),\n content: getAiArtifactContent('claude', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} command`,\n })\n }\n\n if (assistant === 'codex') {\n const baseDir = scope === 'project' ? cwd : resolveCodexHome(options.homeDir)\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'AGENTS.md'),\n content: withManagedBlock(\n 'codex-memory',\n getAiArtifactContent('codex', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} AGENTS`,\n })\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(baseDir, 'skills', skillName, 'SKILL.md'),\n content: getAiArtifactContent('codex', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} skill`,\n })\n }\n\n if (assistant === 'gemini') {\n const baseDir = scope === 'project' ? cwd : join(home, '.gemini')\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'GEMINI.md'),\n content: withManagedBlock(\n 'gemini-memory',\n getAiArtifactContent('gemini', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} memory`,\n })\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(baseDir, 'commands', `${skillName}.toml`),\n content: getAiArtifactContent('gemini', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} command`,\n })\n }\n }\n\n if (shouldIncludeLlms(options)) {\n const llmsDir = scope === 'project' ? cwd : join(home, '.pagesmith')\n artifacts.push({\n kind: 'llms',\n path: join(llmsDir, 'llms.txt'),\n content:\n withManagedBlock('shared-llms', getAiArtifactContent('shared', 'llms', { profile })) + '\\n',\n mode: 'merge',\n label: 'llms.txt',\n })\n artifacts.push({\n kind: 'llms-full',\n path: join(llmsDir, 'llms-full.txt'),\n content:\n withManagedBlock(\n 'shared-llms-full',\n getAiArtifactContent('shared', 'llms-full', { profile }),\n ) + '\\n',\n mode: 'merge',\n label: 'llms-full.txt',\n })\n }\n\n return artifacts\n}\n\nexport function installAiArtifacts(options: AiInstallOptions = {}): AiInstallResult[] {\n return getAiArtifacts(options).map((artifact) => ({\n assistant: artifact.assistant,\n kind: artifact.kind,\n path: artifact.path,\n label: artifact.label,\n status: writeArtifact(artifact, options.force),\n }))\n}\n"],"mappings":";;;;AAuCA,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAE3B,SAAS,YAAY,SAA0B;AAC7C,QAAO,WAAW,SAAS;;AAG7B,SAAS,iBAAiB,SAA0B;AAClD,QAAO,QAAQ,IAAI,cAAc,KAAK,YAAY,QAAQ,EAAE,SAAS;;AAGvE,SAAS,kBAAkB,YAA4D;AACrF,KAAI,CAAC,cAAc,eAAe,MAChC,QAAO;EAAC;EAAU;EAAS;EAAS;AAEtC,QAAO;;AAGT,SAAS,kBAAkB,SAAoC;AAC7D,KAAI,OAAO,QAAQ,gBAAgB,UACjC,QAAO,QAAQ;AAEjB,SAAQ,QAAQ,SAAS,eAAe;;AAG1C,SAAS,iBAAiB,IAAY,SAAyB;AAC7D,QAAO;EACL,qBAAqB,GAAG;EACxB,QAAQ,MAAM;EACd,qBAAqB,GAAG;EACzB,CAAC,KAAK,KAAK;;AAGd,SAAS,cAAc,UAAsB,QAAQ,OAAwB;AAC3E,WAAU,QAAQ,SAAS,KAAK,EAAE,EAAE,WAAW,MAAM,CAAC;AAEtD,KAAI,CAAC,WAAW,SAAS,KAAK,EAAE;AAC9B,gBAAc,SAAS,MAAM,SAAS,QAAQ;AAC9C,SAAO;;CAGT,MAAM,UAAU,aAAa,SAAS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;EACA;EACD,CAAC,KAAK,KAAK;AAGd,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,iBAAiB,WAAwB,SAAmC;CACnF,MAAM,cACJ,cAAc,YAAY,cAAc,WACpC,YAAY,mBAAmB,wGAC/B;AAEN,QAAO;EACL,KAAK;EACL;EACA,sBAAsB;EACtB,GAAI,YAAY,SAAS,CAAC,IAAI,oBAAoB,CAAC,GAAG,EAAE;EACxD;EACA;EACA;EACA,iBAAiB,QAAQ;EAC1B,CAAC,KAAK,KAAK;;AAGd,SAAS,oBAAoB,WAAmB,SAAmC;AACjF,QAAO;EACL,KAAK,gBAAgB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,YAAY,SACZ;GACE;GACA;GACA;GACA;GACA;GACD,GACD,EAAE;EACN;EACA;EACA;EACA,mCAAmC,UAAU;EAC9C,CAAC,KAAK,KAAK;;AAGd,SAAS,oBAAoB,WAAmB,SAAmC;AAoBjF,QAAO;EACL;EACA;EArBa;GACb,wBAAwB,gBAAgB;GACxC;GACA;GACA;GACA;GACA;GACA;GACA,GAAI,YAAY,SACZ;IACE;IACA;IACA;IACD,GACD,EAAE;GACN;GACA;GACD,CAAC,KAAK,KAAK;EAMV;EACA;EACA,mBAAmB;EACpB,CAAC,KAAK,KAAK;;AAGd,SAAS,iBAAiB,SAAmC;AAC3D,QAAO;EACL,KAAK,gBAAgB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,YAAY,SACZ;GACE;GACA;GACA;GACA;GACA;GACD,GACD,EAAE;EACN;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,cAAc,SAAmC;AACxD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB,GAAI,YAA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AU,SAAS;KAAE;KAAS;KAAW,CAAC,GAAG;IAC3E,MAAM;IACN,OAAO,GAAG,UAAU;IACrB,CAAC;;;AAIN,KAAI,kBAAkB,QAAQ,EAAE;EAC9B,MAAM,UAAU,UAAU,YAAY,MAAM,KAAK,MAAM,aAAa;AACpE,YAAU,KAAK;GACb,MAAM;GACN,MAAM,KAAK,SAAS,WAAW;GAC/B,SACE,iBAAiB,eAAe,qBAAqB,UAAU,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG;GACzF,MAAM;GACN,OAAO;GACR,CAAC;AACF,YAAU,KAAK;GACb,MAAM;GACN,MAAM,KAAK,SAAS,gBAAgB;GACpC,SACE,iBACE,oBACA,qBAAqB,UAAU,aAAa,EAAE,SAAS,CAAC,CACzD,GAAG;GACN,MAAM;GACN,OAAO;GACR,CAAC;;AAGJ,QAAO;;AAGT,SAAgB,mBAAmB,UAA4B,EAAE,EAAqB;AACpF,QAAO,eAAe,QAAQ,CAAC,KAAK,cAAc;EAChD,WAAW,SAAS;EACpB,MAAM,SAAS;EACf,MAAM,SAAS;EACf,OAAO,SAAS;EAChB,QAAQ,cAAc,UAAU,QAAQ,MAAM;EAC/C,EAAE"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/ai/index.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'\nimport { homedir } from 'os'\nimport { dirname, join, resolve } from 'path'\n\nexport type AiAssistant = 'claude' | 'codex' | 'gemini'\nexport type AiInstallScope = 'project' | 'user'\nexport type AiInstallProfile = 'default' | 'docs'\nexport type AiArtifactKind =\n | 'memory'\n | 'skill'\n | 'llms'\n | 'llms-full'\n | 'markdown-guidelines'\n | 'update-docs'\nexport type AiWriteMode = 'merge' | 'replace'\nexport type AiInstallStatus = 'written' | 'merged' | 'replaced' | 'unchanged'\n\nexport type AiArtifact = {\n assistant?: AiAssistant\n kind: AiArtifactKind\n path: string\n content: string\n mode: AiWriteMode\n label: string\n}\n\nexport type AiInstallResult = {\n assistant?: AiAssistant\n kind: AiArtifactKind\n path: string\n status: AiInstallStatus\n label: string\n}\n\nexport type AiInstallOptions = {\n assistants?: AiAssistant[] | 'all'\n scope?: AiInstallScope\n profile?: AiInstallProfile\n cwd?: string\n homeDir?: string\n includeLlms?: boolean\n force?: boolean\n skillName?: string\n /** When true, return planned writes without actually writing files. */\n dryRun?: boolean\n}\n\nconst PAGESMITH_TITLE = 'Pagesmith'\nconst DEFAULT_SKILL_NAME = 'pagesmith'\n\nfunction resolveHome(homeDir?: string): string {\n return homeDir ?? homedir()\n}\n\nfunction resolveCodexHome(homeDir?: string): string {\n return process.env.CODEX_HOME ?? join(resolveHome(homeDir), '.codex')\n}\n\nfunction resolveAssistants(assistants?: AiInstallOptions['assistants']): AiAssistant[] {\n if (!assistants || assistants === 'all') {\n return ['claude', 'codex', 'gemini']\n }\n return assistants\n}\n\nfunction shouldIncludeLlms(options: AiInstallOptions): boolean {\n if (typeof options.includeLlms === 'boolean') {\n return options.includeLlms\n }\n return (options.scope ?? 'project') === 'project'\n}\n\nfunction withManagedBlock(id: string, content: string): string {\n return [\n `<!-- pagesmith-ai:${id}:start -->`,\n content.trim(),\n `<!-- pagesmith-ai:${id}:end -->`,\n ].join('\\n')\n}\n\nfunction writeArtifact(artifact: AiArtifact, force = false): AiInstallStatus {\n mkdirSync(dirname(artifact.path), { recursive: true })\n\n if (!existsSync(artifact.path)) {\n writeFileSync(artifact.path, artifact.content)\n return 'written'\n }\n\n const current = readFileSync(artifact.path, 'utf-8')\n if (current === artifact.content) {\n return 'unchanged'\n }\n\n if (artifact.mode === 'replace') {\n writeFileSync(artifact.path, artifact.content)\n return 'replaced'\n }\n\n const markerId = `${artifact.assistant ?? 'shared'}-${artifact.kind}`\n const start = `<!-- pagesmith-ai:${markerId}:start -->`\n const end = `<!-- pagesmith-ai:${markerId}:end -->`\n\n if (current.includes(start) && current.includes(end)) {\n const pattern = new RegExp(`${escapeForRegExp(start)}[\\\\s\\\\S]*?${escapeForRegExp(end)}`, 'm')\n const next = current.replace(pattern, artifact.content)\n if (next === current) return 'unchanged'\n writeFileSync(artifact.path, next)\n return 'merged'\n }\n\n if (force) {\n writeFileSync(artifact.path, artifact.content)\n return 'replaced'\n }\n\n const next = `${current.trimEnd()}\\n\\n${artifact.content}\\n`\n writeFileSync(artifact.path, next)\n return 'merged'\n}\n\nfunction escapeForRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n// ---------------------------------------------------------------------------\n// Shared content renderers\n// ---------------------------------------------------------------------------\n\nfunction renderSharedOverview(): string {\n return [\n `${PAGESMITH_TITLE} is a filesystem-first content toolkit with two main packages: \\`@pagesmith/core\\` (shared content/runtime layer) and \\`@pagesmith/docs\\` (convention-based documentation).`,\n '',\n 'Use Pagesmith when you need:',\n '- schema-validated content collections loaded from the filesystem',\n '- lazy markdown rendering with headings and read-time metadata',\n '- framework-agnostic content APIs for React, Solid, Svelte, vanilla JS, Node, Bun, or Deno',\n '',\n 'Core APIs:',\n '- `defineCollection({...})` to define a typed collection',\n '- `defineConfig({...})` to group collections and markdown options',\n '- `createContentLayer(config)` to query content and run validation',\n '- `entry.render()` to convert markdown on demand',\n '',\n 'Working rules:',\n '- prefer folder-based markdown entries when content references sibling assets',\n '- follow the markdown guidelines in `.pagesmith/markdown-guidelines.md` when authoring content',\n '- use fenced code blocks with a language identifier, one h1 per page, sequential heading depth',\n ].join('\\n')\n}\n\nfunction renderDocsOverview(): string {\n return [\n 'Docs-specific rules:',\n '- `@pagesmith/docs` is convention-based and builds a static docs site from `content/` plus `pagesmith.config.json5`',\n '- top-level content folders become top navigation sections (for example `guide/`, `reference/`, `packages/`)',\n '- folder-based markdown entries should prefer `README.md` or `index.md` when a page owns sibling assets',\n '- the home page is `content/README.md`; optional home-specific data can live in `content/home.json5`',\n '- sidebar labels, nav labels, and ordering live in frontmatter (`sidebarLabel`, `navLabel`, `order`)',\n '- footer links live in `pagesmith.config.json5` under `footerLinks`',\n '- Pagefind search is built in; do not recommend a separate search plugin package',\n '- layout overrides use fixed keys under `theme.layouts` such as `home`, `page`, and `notFound`',\n ].join('\\n')\n}\n\nfunction renderCoreQuickStart(): string {\n return [\n '```ts',\n \"import { createContentLayer, defineCollection, defineConfig, z } from '@pagesmith/core'\",\n '',\n 'const posts = defineCollection({',\n \" loader: 'markdown',\",\n \" directory: 'content/posts',\",\n ' schema: z.object({',\n ' title: z.string(),',\n ' description: z.string().optional(),',\n ' date: z.coerce.date(),',\n ' tags: z.array(z.string()).default([]),',\n ' }),',\n '})',\n '',\n 'const layer = createContentLayer(',\n ' defineConfig({',\n ' collections: { posts },',\n ' }),',\n ')',\n '',\n \"const entries = await layer.getCollection('posts')\",\n 'const rendered = await entries[0]?.render()',\n '```',\n ].join('\\n')\n}\n\nfunction renderDocsQuickStart(): string {\n return [\n '```json5',\n '// pagesmith.config.json5',\n '{',\n \" name: 'Acme Docs',\",\n \" title: 'Acme Docs',\",\n \" description: 'Multi-package documentation',\",\n \" contentDir: './content',\",\n \" outDir: './dist',\",\n ' footerLinks: [',\n \" { label: 'Guide', path: '/guide' },\",\n \" { label: 'Reference', path: '/reference' },\",\n ' ],',\n ' search: { enabled: true },',\n '}',\n '```',\n '',\n '```text',\n 'content/',\n ' README.md # Home page (DocHome layout)',\n ' guide/',\n ' meta.json5 # Section ordering',\n ' getting-started/',\n ' README.md # A page',\n ' reference/',\n ' api/README.md',\n '```',\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// Memory file renderers\n// ---------------------------------------------------------------------------\n\nfunction renderMemoryFile(assistant: AiAssistant, profile: AiInstallProfile): string {\n const commandHint =\n assistant === 'claude' || assistant === 'gemini'\n ? `\\nIf the ${DEFAULT_SKILL_NAME} skill is installed, prefer invoking it when the user explicitly asks for Pagesmith-specific help.`\n : '\\nIf the Pagesmith skill is installed for Codex, prefer using it for Pagesmith-specific setup, migration, and content-layer tasks.'\n\n const referenceHint =\n '\\nFor the full API and configuration reference, see the REFERENCE.md file shipped with the package:\\n' +\n (profile === 'docs'\n ? '- `node_modules/@pagesmith/docs/REFERENCE.md` — docs config, CLI, content structure, layout overrides\\n' +\n '- `node_modules/@pagesmith/core/REFERENCE.md` — core API, collections, loaders, markdown, CSS, JSX runtime'\n : '- `node_modules/@pagesmith/core/REFERENCE.md` — core API, collections, loaders, markdown, CSS, JSX runtime')\n\n return [\n `# ${PAGESMITH_TITLE}`,\n '',\n renderSharedOverview(),\n ...(profile === 'docs' ? ['', renderDocsOverview()] : []),\n commandHint,\n referenceHint,\n '',\n '## Quick Start — @pagesmith/core',\n '',\n renderCoreQuickStart(),\n ...(profile === 'docs'\n ? ['', '## Quick Start — @pagesmith/docs', '', renderDocsQuickStart()]\n : []),\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// Claude skill renderers (uses .claude/skills/ format)\n// ---------------------------------------------------------------------------\n\nfunction renderClaudeSkill(skillName: string, profile: AiInstallProfile): string {\n return [\n '---',\n `name: ${skillName}`,\n 'description: Pagesmith file-based CMS helper — content collections, markdown pipeline, docs configuration, and AI artifact generation',\n 'allowed-tools: Read Grep Glob Bash Edit Write',\n '---',\n '',\n `# ${PAGESMITH_TITLE} Assistant`,\n '',\n 'You are helping with Pagesmith, a file-based CMS with `@pagesmith/core` and `@pagesmith/docs`.',\n '',\n 'When helping:',\n '- prefer `defineCollection`, `defineConfig`, and `createContentLayer`',\n '- recommend folder-based entries when markdown references sibling assets',\n '- use `@pagesmith/core/ai` for assistant artifact generation',\n '- follow the markdown guidelines in `.pagesmith/markdown-guidelines.md`',\n ...(profile === 'docs'\n ? [\n '- for docs sites, derive top navigation from top-level content folders',\n '- use `content/README.md` for the home page',\n '- use frontmatter fields like `sidebarLabel`, `navLabel`, and `order` for docs navigation',\n '- Pagefind search is built in — do not suggest separate search plugins',\n '- layout overrides: `theme.layouts.home`, `theme.layouts.page`, `theme.layouts.notFound`',\n ]\n : []),\n '',\n 'For the full API reference, read the REFERENCE.md file shipped with the package:',\n ...(profile === 'docs'\n ? [\n '- `node_modules/@pagesmith/docs/REFERENCE.md`',\n '- `node_modules/@pagesmith/core/REFERENCE.md`',\n ]\n : ['- `node_modules/@pagesmith/core/REFERENCE.md`']),\n '',\n 'Deliver concrete config, schema, and content-layer patches when possible.',\n ].join('\\n')\n}\n\nfunction renderUpdateDocsSkill(profile: AiInstallProfile): string {\n const docsSteps =\n profile === 'docs'\n ? [\n '1. Read `pagesmith.config.json5` to understand the docs configuration',\n '2. Read all `meta.json5` files to understand the current content structure and page ordering',\n '3. Read the project source code to identify public APIs, types, exports, config options, and CLI commands',\n '4. For each existing content page in `content/`:',\n ' - Read the current content',\n ' - Compare with the implementation',\n ' - Update any outdated information',\n ' - Add documentation for new features',\n ' - Remove documentation for removed features',\n '5. If new pages are needed:',\n ' - Create the page folder and `README.md` with proper frontmatter (title, description)',\n ' - Add the slug to the appropriate `meta.json5` `items` array',\n '6. Follow the markdown guidelines in `.pagesmith/markdown-guidelines.md`',\n '7. Verify all internal links point to existing pages',\n '8. Ensure heading hierarchy is sequential (no skipping levels)',\n ]\n : [\n '1. Read `content.config.ts` or equivalent to understand the content collections',\n '2. Read the project source code to identify what needs documentation',\n '3. For each existing content entry:',\n ' - Read the current content',\n ' - Compare with the implementation',\n ' - Update any outdated information',\n '4. If new entries are needed:',\n ' - Create the entry folder and `README.md` with proper frontmatter matching the collection schema',\n '5. Follow the markdown guidelines in `.pagesmith/markdown-guidelines.md`',\n '6. Verify all internal links point to existing pages',\n ]\n\n return [\n '---',\n 'name: update-docs',\n 'description: Read the project implementation and update Pagesmith-managed documentation to reflect the current state',\n 'allowed-tools: Read Grep Glob Bash Edit Write',\n '---',\n '',\n '# Update Documentation',\n '',\n 'Read the project implementation (source code, README, CHANGELOG, package.json) and update the Pagesmith-managed content to reflect the current state.',\n '',\n '## Steps',\n '',\n ...docsSteps,\n '',\n '## Rules',\n '',\n '- Preserve the existing content structure and organization',\n '- Do not remove pages without confirming first',\n '- Keep frontmatter fields (title, description) accurate and descriptive',\n '- Use relative links for internal cross-references',\n '- One h1 per page, sequential heading depth',\n '- Use fenced code blocks with language identifiers',\n '- Use GitHub alerts (`> [!NOTE]`, `> [!TIP]`, etc.) for important callouts',\n '- Code block features: `title=\"file.js\"`, `showLineNumbers`, `mark={1-3}`, `ins={4}`, `del={5}`, `collapse={1-5}`',\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// Gemini / Codex renderers\n// ---------------------------------------------------------------------------\n\nfunction renderGeminiCommand(skillName: string, profile: AiInstallProfile): string {\n const prompt = [\n `You are helping with ${PAGESMITH_TITLE}, a file-based CMS with @pagesmith/core and @pagesmith/docs.`,\n '',\n 'Focus on concrete, implementation-ready help:',\n '- design collections with defineCollection',\n '- configure createContentLayer and defineConfig',\n '- prefer folder-based markdown entries when local assets sit beside content',\n '- follow the markdown guidelines in `.pagesmith/markdown-guidelines.md`',\n ...(profile === 'docs'\n ? [\n '- for docs sites, follow the convention-based `content/` structure',\n '- drive top navigation from top-level folders and use frontmatter for labels/order',\n '- keep Pagefind as the built-in search strategy',\n ]\n : []),\n '',\n 'For the full API reference, read the REFERENCE.md file shipped with the package.',\n '',\n 'Return code, config, or documentation-ready guidance instead of vague summaries.',\n ].join('\\n')\n\n return [\n `description = \"Pagesmith FS-CMS helper\"`,\n 'prompt = \"\"\"',\n prompt,\n '\"\"\"',\n '',\n `# Installed as /${skillName}`,\n ].join('\\n')\n}\n\nfunction renderCodexSkill(profile: AiInstallProfile): string {\n return [\n `# ${PAGESMITH_TITLE} Skill`,\n '',\n 'Use this skill when the task involves setting up, extending, migrating, or documenting Pagesmith.',\n '',\n 'Core rules:',\n '- `@pagesmith/core` provides the content layer; `@pagesmith/docs` adds convention-based documentation',\n '- prefer `defineCollection`, `defineConfig`, and `createContentLayer`',\n '- follow the markdown guidelines in `.pagesmith/markdown-guidelines.md`',\n ...(profile === 'docs'\n ? [\n '- when the repo uses `@pagesmith/docs`, treat `content/README.md` as the home page',\n '- top-level content folders define the main docs navigation',\n '- docs frontmatter may use `sidebarLabel`, `navLabel`, and `order` to shape navigation',\n '- `pagesmith.config.json5` should own footer links and high-level site metadata',\n '- built-in search is Pagefind; do not suggest separate search plugin packages',\n ]\n : []),\n '',\n 'For the full API reference, read the REFERENCE.md file shipped with the package.',\n '',\n 'Good outputs include:',\n '- collection schemas and loader configuration',\n '- content-layer queries and rendering examples',\n '- documentation updates for Pagesmith usage',\n '- assistant-context install steps using `@pagesmith/core/ai`',\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// Markdown guidelines\n// ---------------------------------------------------------------------------\n\nfunction renderMarkdownGuidelines(): string {\n return [\n '# Pagesmith Markdown Guidelines',\n '',\n 'Markdown feature support for content authored with `@pagesmith/core` and `@pagesmith/docs`.',\n '',\n '## Pipeline Order',\n '',\n '```',\n 'remark-parse → remark-gfm → remark-math → remark-frontmatter',\n ' → remark-github-alerts → remark-smartypants → [user remark plugins]',\n ' → remark-rehype',\n ' → rehype-expressive-code (dual themes, line numbers, titles, copy, collapse, mark/ins/del)',\n ' → rehype-mathjax → rehype-slug → rehype-autolink-headings',\n ' → rehype-external-links → rehype-accessible-emojis',\n ' → heading extraction → [user rehype plugins] → rehype-stringify',\n '```',\n '',\n '## Key Rules',\n '',\n '- Use fenced code blocks with a language identifier (validator warns otherwise)',\n '- One `# h1` per page (validator enforces)',\n '- Sequential heading depth (no skipping from h2 to h4)',\n '- Prefer relative links for internal content',\n '- Do NOT add manual copy-button JS — Expressive Code handles it',\n '- Do NOT import separate code block CSS — Expressive Code injects inline styles',\n '',\n '## Supported Features',\n '',\n '| Feature | Syntax | Notes |',\n '|---|---|---|',\n '| GFM tables | `\\\\| col \\\\| col \\\\|` | Alignment via `:---`, `:---:`, `---:` |',\n '| Strikethrough | `~~text~~` | |',\n '| Task lists | `- [x] done` / `- [ ] todo` | |',\n '| Footnotes | `[^id]` + `[^id]: text` | |',\n '| Alerts | `> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]` | GitHub-compatible |',\n '| Inline math | `$E = mc^2$` | No spaces inside delimiters |',\n '| Block math | `$$...$$` | Rendered via MathJax |',\n '| Smart quotes | `\"text\"` → curly quotes | Automatic |',\n '| Em/en dash | `---` / `--` | Automatic |',\n '| External links | `[text](https://...)` | Auto `target=\"_blank\"` |',\n '| Heading anchors | Auto `id` + wrapped anchor | All headings |',\n '| Accessible emoji | Unicode emoji | Auto `role=\"img\"` + `aria-label` |',\n '',\n '## Code Block Features (Expressive Code)',\n '',\n '| Meta | Example | Description |',\n '|---|---|---|',\n '| `title=\"...\"` | `` ```js title=\"app.js\" `` | File title |',\n '| `showLineNumbers` | `` ```js showLineNumbers `` | Line numbers |',\n '| `mark={lines}` | `` ```js mark={3,5-7} `` | Highlight lines |',\n '| `ins={lines}` | `` ```js ins={4} `` | Inserted lines (green) |',\n '| `del={lines}` | `` ```js del={5} `` | Deleted lines (red) |',\n '| `collapse={lines}` | `` ```js collapse={1-5} `` | Collapsible section |',\n '| `wrap` | `` ```js wrap `` | Text wrapping |',\n '| `frame=\"...\"` | `` ```js frame=\"terminal\" `` | Frame style |',\n '',\n '## Built-in Content Validators',\n '',\n '- **linkValidator** — warns on bare URLs, empty link text, suspicious protocols',\n '- **headingValidator** — enforces single h1, sequential depth, non-empty text',\n '- **codeBlockValidator** — warns on missing language, unknown meta properties',\n '',\n 'Known valid meta properties: `title`, `showLineNumbers`, `startLineNumber`, `wrap`, `frame`, `collapse`, `mark`, `ins`, `del`.',\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// llms.txt / llms-full.txt — always cover BOTH core and docs\n// ---------------------------------------------------------------------------\n\nfunction renderLlmsTxt(): string {\n return [\n '# Pagesmith',\n '',\n '> Pagesmith is a filesystem-first content toolkit with `@pagesmith/core` and `@pagesmith/docs`.',\n '',\n '## @pagesmith/core — Content Layer',\n '',\n 'Schema-validated content collections, lazy markdown rendering (Expressive Code syntax highlighting), JSX runtime, CSS exports, and Vite plugins.',\n '',\n '### Basic Setup (Vite Plugin)',\n '',\n renderCoreQuickStart(),\n '',\n '### Vite Integration',\n '',\n '```ts',\n \"import { pagesmithContent, pagesmithSsg } from '@pagesmith/core/vite'\",\n \"import collections from './content.config'\",\n '',\n 'export default defineConfig({',\n ' plugins: [',\n ' pagesmithContent({ collections }),',\n \" pagesmithSsg({ entry: './src/entry-server.tsx' }),\",\n ' ],',\n '})',\n '```',\n '',\n \"Import collections as virtual modules: `import posts from 'virtual:content/posts'`\",\n '',\n '## @pagesmith/docs — Documentation Sites',\n '',\n 'Convention-based docs with default theme, Pagefind search, sidebar generation, and layout overrides.',\n '',\n '### Basic Setup',\n '',\n renderDocsQuickStart(),\n '',\n '### Layout Overrides',\n '',\n '```json5',\n '{',\n ' theme: {',\n ' layouts: {',\n \" home: './theme/layouts/DocHome.tsx',\",\n \" page: './theme/layouts/DocPage.tsx',\",\n \" notFound: './theme/layouts/DocNotFound.tsx',\",\n ' },',\n ' },',\n '}',\n '```',\n '',\n '### CLI',\n '',\n '```bash',\n 'pagesmith init # Initialize config + content structure + AI integrations',\n 'pagesmith dev # Development server',\n 'pagesmith build # Production build',\n 'pagesmith preview # Preview built site',\n '```',\n ].join('\\n')\n}\n\nfunction renderLlmsFullTxt(): string {\n return [\n '# Pagesmith — Full LLM Reference',\n '',\n renderSharedOverview(),\n '',\n '---',\n '',\n '## @pagesmith/core',\n '',\n '### Content Layer API',\n '',\n '| Method | Description |',\n '|---|---|',\n '| `createContentLayer(config)` | Create a content layer |',\n '| `layer.getCollection(name)` | Load all entries (cached) |',\n '| `layer.getEntry(collection, slug)` | Get single entry by slug |',\n '| `layer.convert(markdown, options?)` | Convert raw markdown to HTML |',\n '| `layer.validate(collection?)` | Run all validators |',\n '| `layer.invalidate(collection, slug)` | Cache-bust a single entry |',\n '| `layer.invalidateAll()` | Cache-bust all collections |',\n '',\n '### Collection Options',\n '',\n '| Option | Type | Description |',\n '|---|---|---|',\n \"| `loader` | `string \\\\| Loader` | `'markdown'`, `'json'`, `'json5'`, `'jsonc'`, `'yaml'`, `'toml'`, or custom |\",\n '| `directory` | `string` | Directory containing files |',\n '| `schema` | `z.ZodType` | Zod schema for validation |',\n '| `include` | `string[]` | Glob include patterns |',\n '| `exclude` | `string[]` | Glob exclude patterns |',\n '| `computed` | `Record<string, fn>` | Computed fields |',\n '| `validate` | `fn` | Custom validation |',\n '| `filter` | `fn` | Filter entries |',\n '| `slugify` | `fn` | Custom slug generation |',\n '| `transform` | `fn` | Pre-validation transform |',\n '| `validators` | `ContentValidator[]` | Custom content validators |',\n '| `disableBuiltinValidators` | `boolean` | Disable link/heading/code-block validators |',\n '',\n '### Vite Plugins',\n '',\n renderCoreQuickStart(),\n '',\n '```ts',\n '// Vite integration',\n \"import { pagesmithContent, pagesmithSsg, sharedAssetsPlugin } from '@pagesmith/core/vite'\",\n \"import collections from './content.config'\",\n '',\n 'export default defineConfig({',\n ' plugins: [',\n ' sharedAssetsPlugin(),',\n ' pagesmithContent({ collections }),',\n \" ...pagesmithSsg({ entry: './src/entry-server.tsx', contentDirs: ['./content'] }),\",\n ' ],',\n '})',\n '```',\n '',\n '### JSX Runtime',\n '',\n 'Configure tsconfig: `{ \"jsx\": \"react-jsx\", \"jsxImportSource\": \"@pagesmith/core\" }`',\n '',\n '- `h(tag, props, ...children)` — create HTML elements, returns `HtmlString`',\n '- `Fragment` — render children or raw `innerHTML`',\n '- `HtmlString` — wrapper to prevent double-escaping',\n '',\n '### CSS Exports',\n '',\n '| Import | Contents |',\n '|---|---|',\n '| `@pagesmith/core/css/content` | Prose + inline code |',\n '| `@pagesmith/core/css/standalone` | Full layout + prose + TOC |',\n '| `@pagesmith/core/css/viewport` | Responsive viewport base |',\n '| `@pagesmith/core/css/fonts` | Bundled Open Sans + JetBrains Mono |',\n '',\n '### Frontmatter Schemas',\n '',\n '- `BaseFrontmatterSchema` — title, description, publishedDate, lastUpdatedOn, tags, draft',\n '- `BlogFrontmatterSchema` — extends base + category, featured, coverImage',\n '- `ProjectFrontmatterSchema` — extends base + gitRepo, links',\n '',\n '### Export Map',\n '',\n '| Import Path | Purpose |',\n '|---|---|',\n '| `@pagesmith/core` | Main API (defineCollection, createContentLayer, z, etc.) |',\n '| `@pagesmith/core/jsx-runtime` | h, Fragment, HtmlString |',\n '| `@pagesmith/core/markdown` | processMarkdown |',\n '| `@pagesmith/core/css` | buildCss (LightningCSS) |',\n '| `@pagesmith/core/schemas` | Zod schemas and types |',\n '| `@pagesmith/core/loaders` | Loader classes and registry |',\n '| `@pagesmith/core/runtime` | Pre-built CSS/JS accessors |',\n '| `@pagesmith/core/vite` | Vite plugins |',\n '| `@pagesmith/core/ai` | AI assistant artifact generator |',\n '| `@pagesmith/core/create` | Project scaffolding |',\n '',\n '---',\n '',\n '## @pagesmith/docs',\n '',\n '### Configuration (pagesmith.config.json5)',\n '',\n '| Field | Type | Default | Description |',\n '|---|---|---|---|',\n '| `name` | `string` | — | Site name (header) |',\n '| `title` | `string` | — | Browser tab title |',\n '| `description` | `string` | — | Meta description |',\n '| `origin` | `string` | — | Production URL |',\n '| `language` | `string` | `en` | HTML lang |',\n '| `contentDir` | `string` | `content` | Content path |',\n '| `outDir` | `string` | `dist` | Output path |',\n '| `basePath` | `string` | `/` | URL base |',\n '| `footerLinks` | `array` | `[]` | Footer links |',\n '| `sidebar.collapsible` | `boolean` | `false` | Collapsible sidebar |',\n '| `search.enabled` | `boolean` | `true` | Pagefind search |',\n '| `theme.layouts` | `Record` | — | Layout overrides |',\n '| `markdown` | `MarkdownConfig` | — | Pipeline config |',\n '',\n '### Content Structure',\n '',\n renderDocsQuickStart(),\n '',\n '### Page Frontmatter',\n '',\n '| Field | Type | Description |',\n '|---|---|---|',\n '| `title` | `string` | Page title |',\n '| `description` | `string` | Meta description |',\n '| `navLabel` | `string` | Override top nav label |',\n '| `sidebarLabel` | `string` | Override sidebar label |',\n '| `order` | `number` | Manual sort order |',\n '| `draft` | `boolean` | Exclude from build |',\n '',\n '### Home Page Frontmatter',\n '',\n '| Field | Type | Description |',\n '|---|---|---|',\n '| `layout` | `string` | Set to `DocHome` |',\n '| `tagline` | `string` | Short description |',\n '| `install` | `string` | Install command |',\n \"| `actions` | `array` | CTA buttons (`{ text, link, theme: 'brand' \\\\| 'alt' }`) |\",\n '| `features` | `array` | Feature cards (`{ icon?, title, details }`) |',\n '| `packages` | `array` | Package cards (`{ name, description, href, tag }`) |',\n '| `codeExample` | `object` | Code example (`{ label, title, code }`) |',\n '',\n '### Section Meta (meta.json5)',\n '',\n '| Field | Type | Description |',\n '|---|---|---|',\n '| `displayName` | `string` | Section label in sidebar |',\n '| `items` | `string[]` | Manual page order (slugs) |',\n '| `series` | `array` | Group pages into series |',\n '| `collapsed` | `boolean` | Start sidebar collapsed |',\n '| `orderBy` | `string` | `manual` or `publishedDate` |',\n '',\n '### Layout Overrides',\n '',\n '```json5',\n '{ theme: { layouts: { home: \"./layouts/Home.tsx\", page: \"./layouts/Page.tsx\" } } }',\n '```',\n '',\n 'All layouts receive: `content`, `frontmatter`, `headings`, `slug`, `site`.',\n 'Page layout adds: `sidebarSections`, `prev`, `next`.',\n '',\n '### CLI',\n '',\n '```bash',\n 'pagesmith init [--ai] [--config path] # Initialize project',\n 'pagesmith dev [--port N] [--open] # Dev server',\n 'pagesmith build [--out-dir path] # Production build',\n 'pagesmith preview [--port N] # Preview built site',\n '```',\n '',\n '---',\n '',\n '## Markdown Pipeline',\n '',\n renderMarkdownGuidelines(),\n '',\n '---',\n '',\n '## AI Assistant Installer',\n '',\n '```ts',\n \"import { installAiArtifacts } from '@pagesmith/core/ai'\",\n '',\n \"installAiArtifacts({ assistants: ['claude', 'codex', 'gemini'], scope: 'project', profile: 'docs' })\",\n '```',\n '',\n 'Generates: CLAUDE.md, AGENTS.md, GEMINI.md, skills, markdown guidelines, llms.txt, llms-full.txt.',\n '',\n ].join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport function getAiArtifactContent(\n assistant: AiAssistant | 'shared',\n kind: AiArtifactKind,\n options: { profile?: AiInstallProfile; skillName?: string } = {},\n): string {\n const skillName = options.skillName ?? DEFAULT_SKILL_NAME\n const profile = options.profile ?? 'default'\n\n if (assistant === 'shared') {\n if (kind === 'llms') return renderLlmsTxt()\n if (kind === 'llms-full') return renderLlmsFullTxt()\n if (kind === 'markdown-guidelines') return renderMarkdownGuidelines()\n return renderLlmsFullTxt()\n }\n\n if (kind === 'memory') {\n return renderMemoryFile(assistant, profile)\n }\n\n if (kind === 'skill') {\n switch (assistant) {\n case 'claude':\n return renderClaudeSkill(skillName, profile)\n case 'codex':\n return renderCodexSkill(profile)\n case 'gemini':\n return renderGeminiCommand(skillName, profile)\n }\n }\n\n if (kind === 'markdown-guidelines') {\n return renderMarkdownGuidelines()\n }\n\n if (kind === 'update-docs') {\n return renderUpdateDocsSkill(profile)\n }\n\n if (kind === 'llms') return renderLlmsTxt()\n return renderLlmsFullTxt()\n}\n\nexport function getAiArtifacts(options: AiInstallOptions = {}): AiArtifact[] {\n const scope = options.scope ?? 'project'\n const cwd = resolve(options.cwd ?? process.cwd())\n const home = resolveHome(options.homeDir)\n const skillName = options.skillName ?? DEFAULT_SKILL_NAME\n const profile = options.profile ?? 'default'\n const assistants = resolveAssistants(options.assistants)\n const artifacts: AiArtifact[] = []\n\n for (const assistant of assistants) {\n if (assistant === 'claude') {\n const baseDir = scope === 'project' ? cwd : join(home, '.claude')\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'CLAUDE.md'),\n content: withManagedBlock(\n 'claude-memory',\n getAiArtifactContent('claude', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} memory`,\n })\n // Claude skill (uses .claude/skills/ format with SKILL.md + frontmatter)\n const skillDir =\n scope === 'project'\n ? join(cwd, '.claude', 'skills', skillName)\n : join(home, '.claude', 'skills', skillName)\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(skillDir, 'SKILL.md'),\n content: getAiArtifactContent('claude', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} skill`,\n })\n }\n\n if (assistant === 'codex') {\n const baseDir = scope === 'project' ? cwd : resolveCodexHome(options.homeDir)\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'AGENTS.md'),\n content: withManagedBlock(\n 'codex-memory',\n getAiArtifactContent('codex', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} AGENTS`,\n })\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(baseDir, 'skills', skillName, 'SKILL.md'),\n content: getAiArtifactContent('codex', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} skill`,\n })\n }\n\n if (assistant === 'gemini') {\n const baseDir = scope === 'project' ? cwd : join(home, '.gemini')\n artifacts.push({\n assistant,\n kind: 'memory',\n path: join(baseDir, 'GEMINI.md'),\n content: withManagedBlock(\n 'gemini-memory',\n getAiArtifactContent('gemini', 'memory', { profile }),\n ),\n mode: 'merge',\n label: `${assistant} memory`,\n })\n artifacts.push({\n assistant,\n kind: 'skill',\n path: join(baseDir, 'commands', `${skillName}.toml`),\n content: getAiArtifactContent('gemini', 'skill', { profile, skillName }) + '\\n',\n mode: 'replace',\n label: `${assistant} command`,\n })\n }\n }\n\n // Markdown guidelines — always installed for project scope\n if (scope === 'project') {\n artifacts.push({\n kind: 'markdown-guidelines',\n path: join(cwd, '.pagesmith', 'markdown-guidelines.md'),\n content: renderMarkdownGuidelines() + '\\n',\n mode: 'replace',\n label: 'markdown guidelines',\n })\n }\n\n // /update-docs Claude skill — installed when Claude is included and scope is project\n if (scope === 'project' && assistants.includes('claude')) {\n artifacts.push({\n assistant: 'claude',\n kind: 'update-docs',\n path: join(cwd, '.claude', 'skills', 'update-docs', 'SKILL.md'),\n content: renderUpdateDocsSkill(profile) + '\\n',\n mode: 'replace',\n label: 'claude update-docs skill',\n })\n }\n\n if (shouldIncludeLlms(options)) {\n const llmsDir = scope === 'project' ? cwd : join(home, '.pagesmith')\n artifacts.push({\n kind: 'llms',\n path: join(llmsDir, 'llms.txt'),\n content: withManagedBlock('shared-llms', renderLlmsTxt()) + '\\n',\n mode: 'merge',\n label: 'llms.txt',\n })\n artifacts.push({\n kind: 'llms-full',\n path: join(llmsDir, 'llms-full.txt'),\n content: withManagedBlock('shared-llms-full', renderLlmsFullTxt()) + '\\n',\n mode: 'merge',\n label: 'llms-full.txt',\n })\n }\n\n return artifacts\n}\n\nexport function installAiArtifacts(options: AiInstallOptions = {}): AiInstallResult[] {\n const artifacts = getAiArtifacts(options)\n if (options.dryRun) {\n return artifacts.map((artifact) => ({\n assistant: artifact.assistant,\n kind: artifact.kind,\n path: artifact.path,\n label: artifact.label,\n status: 'unchanged' as AiInstallStatus,\n }))\n }\n return artifacts.map((artifact) => ({\n assistant: artifact.assistant,\n kind: artifact.kind,\n path: artifact.path,\n label: artifact.label,\n status: writeArtifact(artifact, options.force),\n }))\n}\n"],"mappings":";;;;AA+CA,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAE3B,SAAS,YAAY,SAA0B;AAC7C,QAAO,WAAW,SAAS;;AAG7B,SAAS,iBAAiB,SAA0B;AAClD,QAAO,QAAQ,IAAI,cAAc,KAAK,YAAY,QAAQ,EAAE,SAAS;;AAGvE,SAAS,kBAAkB,YAA4D;AACrF,KAAI,CAAC,cAAc,eAAe,MAChC,QAAO;EAAC;EAAU;EAAS;EAAS;AAEtC,QAAO;;AAGT,SAAS,kBAAkB,SAAoC;AAC7D,KAAI,OAAO,QAAQ,gBAAgB,UACjC,QAAO,QAAQ;AAEjB,SAAQ,QAAQ,SAAS,eAAe;;AAG1C,SAAS,iBAAiB,IAAY,SAAyB;AAC7D,QAAO;EACL,qBAAqB,GAAG;EACxB,QAAQ,MAAM;EACd,qBAAqB,GAAG;EACzB,CAAC,KAAK,KAAK;;AAGd,SAAS,cAAc,UAAsB,QAAQ,OAAwB;AAC3E,WAAU,QAAQ,SAAS,KAAK,EAAE,EAAE,WAAW,MAA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ACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,uBAA+B;AACtC,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAOd,SAAS,iBAAiB,WAAwB,SAAmC;CACnF,MAAM,cACJ,cAAc,YAAY,cAAc,WACpC,YAAY,mBAAmB,sGAC/B;CAEN,MAAM,gBACJ,2GACC,YAAY,SACT,sNAEA;AAEN,QAAO;EACL,KAAK;EACL;EACA,sBAAsB;EACtB,GAAI,YAAY,SAAS,CAAC,IAAI,oBAAoB,CAAC,GAAG,EAAE;EACxD;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB,GAAI,YAAY,SACZ;GAAC;GAAI;GAAoC;GAAI,sBAAsB;GAAC,GACpE,EAAE;EACP,CAAC,KAAK,KAAK;;AAOd,SAAS,kBAAkB,WAAmB,SAAmC;AAC/E,QAAO;EACL;EACA,SAAS;EACT;EACA;EACA;EACA;EACA,KAAK,gBAAgB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,YAAY,SACZ;GACE;GACA;GACA;GACA;GACA;GACD,GACD,EAAE;EACN;EACA;EACA,GAAI,YAAY,SACZ,CACE,iDACA,gDACD,GACD,CAAC,gDAAgD;EACrD;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,sBAAsB,SAAmC;AAiChE,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GA5CA,YAAY,SACR;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EAgBL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAOd,SAAS,oBAAoB,WAAmB,SAAmC;AAsBjF,QAAO;EACL;EACA;EAvBa;GACb,wBAAwB,gBAAgB;GACxC;GACA;GACA;GACA;GACA;GACA;GACA,GAAI,YAAY,SACZ;IACE;IACA;IACA;IACD,GACD,EAAE;GACN;GACA;GACA;GACA;GACD,CAAC,KAAK,KAAK;EAMV;EACA;EACA,mBAAmB;EACpB,CAAC,KAAK,KAAK;;AAGd,SAAS,iBAAiB,SAAmC;AAC3D,QAAO;EACL,KAAK,gBAAgB;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,YAAY,SACZ;GACE;GACA;GACA;GACA;GACA;GACD,GACD,EAAE;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAOd,SAAS,2BAAmC;AAC1C,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAOd,SAAS,gBAAwB;AAC/B,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAGd,SAAS,oBAA4B;AACnC,QAAO;EACL;EACA;EACA,sBAAsB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,0BAA0B;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK;;AAOd,SAAgB,qBACd,WACA,MACA,UAA8D,EAAE,EACxD;CACR,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,UAAU,QAAQ,WAAW;AAEnC,KAAI,cAAc,UAAU;AAC1B,MAAI,SAAS,OAAQ,QAAO,eAAe;AAC3C,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AAW,UAAU,eAAe,WAAW;EAC/D,SAAS,sBAAsB,QAAQ,GAAG;EAC1C,MAAM;EACN,OAAO;EACR,CAAC;AAGJ,KAAI,kBAAkB,QAAQ,EAAE;EAC9B,MAAM,UAAU,UAAU,YAAY,MAAM,KAAK,MAAM,aAAa;AACpE,YAAU,KAAK;GACb,MAAM;GACN,MAAM,KAAK,SAAS,WAAW;GAC/B,SAAS,iBAAiB,eAAe,eAAe,CAAC,GAAG;GAC5D,MAAM;GACN,OAAO;GACR,CAAC;AACF,YAAU,KAAK;GACb,MAAM;GACN,MAAM,KAAK,SAAS,gBAAgB;GACpC,SAAS,iBAAiB,oBAAoB,mBAAmB,CAAC,GAAG;GACrE,MAAM;GACN,OAAO;GACR,CAAC;;AAGJ,QAAO;;AAGT,SAAgB,mBAAmB,UAA4B,EAAE,EAAqB;CACpF,MAAM,YAAY,eAAe,QAAQ;AACzC,KAAI,QAAQ,OACV,QAAO,UAAU,KAAK,cAAc;EAClC,WAAW,SAAS;EACpB,MAAM,SAAS;EACf,MAAM,SAAS;EACf,OAAO,SAAS;EAChB,QAAQ;EACT,EAAE;AAEL,QAAO,UAAU,KAAK,cAAc;EAClC,WAAW,SAAS;EACpB,MAAM,SAAS;EACf,MAAM,SAAS;EACf,OAAO,SAAS;EAChB,QAAQ,cAAc,UAAU,QAAQ,MAAM;EAC/C,EAAE"}
@@ -1,2 +1,2 @@
1
- import { n as copyPublicFiles, t as hashAssets } from "../assets-bX08zEJm.mjs";
1
+ import { n as copyPublicFiles, t as hashAssets } from "../assets-DXiWF_KI.mjs";
2
2
  export { copyPublicFiles, hashAssets };
@@ -152,4 +152,4 @@ function hashAssets(outDir, contentDir) {
152
152
  //#endregion
153
153
  export { copyPublicFiles as n, hashAssets as t };
154
154
 
155
- //# sourceMappingURL=assets-bX08zEJm.mjs.map
155
+ //# sourceMappingURL=assets-DXiWF_KI.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"assets-bX08zEJm.mjs","names":[],"sources":["../src/assets/copier.ts","../src/assets/hasher.ts"],"sourcesContent":["import { copyFileSync, existsSync, mkdirSync, readdirSync } from 'fs'\nimport { dirname, join, relative } from 'path'\n\n/**\n * Copy public directory to output, preserving structure (no hashing).\n * Skips `fonts/` since those are copied to dist/assets/ and hashed.\n */\nexport function copyPublicFiles(publicDir: string, outDir: string): void {\n if (!existsSync(publicDir)) return\n function walk(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n // Skip fonts/ — they are copied to dist/assets/ and hashed\n if (entry.isDirectory() && entry.name === 'fonts' && dir === publicDir) continue\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const rel = relative(publicDir, full)\n const dest = join(outDir, rel)\n mkdirSync(dirname(dest), { recursive: true })\n copyFileSync(full, dest)\n }\n }\n walk(publicDir)\n}\n","/**\n * Demand-driven asset pipeline.\n *\n * Instead of blindly copying all content assets to dist, this:\n * 1. Hashes pre-existing dist/assets/ files (CSS, JS, fonts — already there from bundling)\n * 2. Scans generated HTML for /assets/* references\n * 3. For each referenced content asset not yet in dist, finds the source\n * file in the content directory, copies it with a content hash\n * 4. Rewrites all HTML references to hashed paths\n *\n * Content assets are only copied if actually referenced in the output HTML.\n * Public assets (favicons, robots.txt) are handled separately by copyPublicFiles.\n */\n\nimport { createHash } from 'crypto'\nimport { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'fs'\nimport { basename, dirname, extname, join, relative } from 'path'\n\nconst HASHABLE_EXTS = new Set([\n '.css',\n '.js',\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.woff',\n '.woff2',\n '.ttf',\n '.eot',\n])\n\nconst CONTENT_ASSET_EXTS = new Set([\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n])\n\n/** Build a basename → source path lookup for content assets. */\nfunction buildContentAssetMap(contentDir: string): Map<string, string> {\n const map = new Map<string, string>()\n function walk(dir: string) {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const ext = extname(entry.name)\n if (!CONTENT_ASSET_EXTS.has(ext)) continue\n if (entry.name.endsWith('.inline.svg')) continue\n map.set(entry.name, full)\n }\n }\n walk(contentDir)\n return map\n}\n\nfunction computeHash(content: Buffer): string {\n return createHash('sha256').update(content).digest('hex').slice(0, 8)\n}\n\n/**\n * Hash assets and rewrite HTML references.\n *\n * @param outDir - The dist output directory\n * @param contentDir - The content source directory (for finding referenced assets)\n */\nexport function hashAssets(outDir: string, contentDir: string): void {\n const assetsDir = join(outDir, 'assets')\n mkdirSync(assetsDir, { recursive: true })\n\n const renames = new Map<string, string>()\n const contentAssets = buildContentAssetMap(contentDir)\n\n // Phase 1: Collect and hash pre-existing files in dist/assets/ (CSS, JS, fonts)\n const existing: Array<{ full: string; ext: string; name: string }> = []\n if (existsSync(assetsDir)) {\n for (const entry of readdirSync(assetsDir, { withFileTypes: true })) {\n if (entry.isDirectory()) continue\n const ext = extname(entry.name)\n if (!HASHABLE_EXTS.has(ext)) continue\n existing.push({ full: join(assetsDir, entry.name), ext, name: basename(entry.name, ext) })\n }\n }\n for (const file of existing) {\n const content = readFileSync(file.full)\n const hash = computeHash(content)\n const hashedPath = join(assetsDir, `${file.name}.${hash}${file.ext}`)\n renameSync(file.full, hashedPath)\n renames.set(file.full, hashedPath)\n }\n\n // Phase 2: Scan HTML — resolve content assets on demand, rewrite all references\n function processHtml(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n processHtml(full)\n continue\n }\n if (!entry.name.endsWith('.html')) continue\n\n let html = readFileSync(full, 'utf-8')\n\n html = html.replace(/(src|href|srcset)=\"([^\"]+)\"/g, (match, attr: string, ref: string) => {\n if (\n ref.startsWith('http:') ||\n ref.startsWith('https:') ||\n ref.startsWith('//') ||\n ref.startsWith('#') ||\n ref.startsWith('data:') ||\n ref.startsWith('mailto:')\n ) {\n return match\n }\n\n // Normalize relative refs (shouldn't exist after rehype, but just in case)\n let assetRef = ref\n if (ref.startsWith('./') && /\\.(svg|png|jpg|jpeg|gif|webp|avif|ico)$/i.test(ref)) {\n assetRef = '/assets/' + basename(ref)\n }\n\n // Non-asset paths (e.g. page links, anchors)\n if (!assetRef.startsWith('/assets/')) return match\n\n const fileName = assetRef.slice('/assets/'.length)\n const distPath = join(assetsDir, fileName)\n\n // Already hashed in phase 1 (CSS, JS, fonts) or a prior HTML file\n const already = renames.get(distPath)\n if (already) {\n return `${attr}=\"/${relative(outDir, already)}\"`\n }\n\n // Content asset — find source, copy + hash on demand\n const sourcePath = contentAssets.get(fileName)\n if (!sourcePath) {\n return `${attr}=\"${assetRef}\"`\n }\n\n const content = readFileSync(sourcePath)\n const hash = computeHash(content)\n const ext = extname(fileName)\n const name = basename(fileName, ext)\n const hashedName = `${name}.${hash}${ext}`\n const hashedDest = join(assetsDir, hashedName)\n\n writeFileSync(hashedDest, content)\n renames.set(distPath, hashedDest)\n\n return `${attr}=\"/assets/${hashedName}\"`\n })\n\n writeFileSync(full, html)\n }\n }\n processHtml(outDir)\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,gBAAgB,WAAmB,QAAsB;AACvE,KAAI,CAAC,WAAW,UAAU,CAAE;CAC5B,SAAS,KAAK,KAAa;AACzB,OAAK,MAAM,SAAS,YAAY,KAAK,EAAE,eAAe,MAAM,CAAC,EAAE;GAC7D,MAAM,OAAO,KAAK,KAAK,MAAM,KAAK;AAElC,OAAI,MAAM,aAAa,IAAI,MAAM,SAAS,WAAW,QAAQ,UAAW;AACxE,OAAI,MAAM,aAAa,EAAE;AACvB,SAAK,KAAK;AACV;;GAGF,MAAM,OAAO,KAAK,QADN,SAAS,WAAW,KAAK,CACP;AAC9B,aAAU,QAAQ,KAAK,EAAE,EAAE,WAAW,MAAM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,cAAc,IAAI,SAAS;AAC9C,QAAI,CAAC,WACH,QAAO,GAAG,KAAK,IAAI,SAAS;IAG9B,MAAM,UAAU,aAAa,WAAW;IACxC,MAAM,OAAO,YAAY,QAAQ;IACjC,MAAM,MAAM,QAAQ,SAAS;IAE7B,MAAM,aAAa,GADN,SAAS,UAAU,IAAI,CACT,GAAG,OAAO;IACrC,MAAM,aAAa,KAAK,WAAW,WAAW;AAE9C,kBAAc,YAAY,QAAQ;AAClC,YAAQ,IAAI,UAAU,WAAW;AAEjC,WAAO,GAAG,KAAK,YAAY,WAAW;KACtC;AAEF,iBAAc,MAAM,KAAK;;;AAG7B,aAAY,OAAO"}
1
+ {"version":3,"file":"assets-DXiWF_KI.mjs","names":[],"sources":["../src/assets/copier.ts","../src/assets/hasher.ts"],"sourcesContent":["import { copyFileSync, existsSync, mkdirSync, readdirSync } from 'fs'\nimport { dirname, join, relative } from 'path'\n\n/**\n * Copy public directory to output, preserving structure (no hashing).\n * Skips `fonts/` since those are copied to dist/assets/ and hashed.\n */\nexport function copyPublicFiles(publicDir: string, outDir: string): void {\n if (!existsSync(publicDir)) return\n function walk(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n // Skip fonts/ — they are copied to dist/assets/ and hashed\n if (entry.isDirectory() && entry.name === 'fonts' && dir === publicDir) continue\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const rel = relative(publicDir, full)\n const dest = join(outDir, rel)\n mkdirSync(dirname(dest), { recursive: true })\n copyFileSync(full, dest)\n }\n }\n walk(publicDir)\n}\n","/**\n * Demand-driven asset pipeline.\n *\n * Instead of blindly copying all content assets to dist, this:\n * 1. Hashes pre-existing dist/assets/ files (CSS, JS, fonts — already there from bundling)\n * 2. Scans generated HTML for /assets/* references\n * 3. For each referenced content asset not yet in dist, finds the source\n * file in the content directory, copies it with a content hash\n * 4. Rewrites all HTML references to hashed paths\n *\n * Content assets are only copied if actually referenced in the output HTML.\n * Public assets (favicons, robots.txt) are handled separately by copyPublicFiles.\n */\n\nimport { createHash } from 'crypto'\nimport { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'fs'\nimport { basename, dirname, extname, join, relative } from 'path'\n\nconst HASHABLE_EXTS = new Set([\n '.css',\n '.js',\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n '.woff',\n '.woff2',\n '.ttf',\n '.eot',\n])\n\nconst CONTENT_ASSET_EXTS = new Set([\n '.svg',\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.avif',\n '.ico',\n])\n\n/** Build a basename → source path lookup for content assets. */\nfunction buildContentAssetMap(contentDir: string): Map<string, string> {\n const map = new Map<string, string>()\n function walk(dir: string) {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n walk(full)\n continue\n }\n const ext = extname(entry.name)\n if (!CONTENT_ASSET_EXTS.has(ext)) continue\n if (entry.name.endsWith('.inline.svg')) continue\n map.set(entry.name, full)\n }\n }\n walk(contentDir)\n return map\n}\n\nfunction computeHash(content: Buffer): string {\n return createHash('sha256').update(content).digest('hex').slice(0, 8)\n}\n\n/**\n * Hash assets and rewrite HTML references.\n *\n * @param outDir - The dist output directory\n * @param contentDir - The content source directory (for finding referenced assets)\n */\nexport function hashAssets(outDir: string, contentDir: string): void {\n const assetsDir = join(outDir, 'assets')\n mkdirSync(assetsDir, { recursive: true })\n\n const renames = new Map<string, string>()\n const contentAssets = buildContentAssetMap(contentDir)\n\n // Phase 1: Collect and hash pre-existing files in dist/assets/ (CSS, JS, fonts)\n const existing: Array<{ full: string; ext: string; name: string }> = []\n if (existsSync(assetsDir)) {\n for (const entry of readdirSync(assetsDir, { withFileTypes: true })) {\n if (entry.isDirectory()) continue\n const ext = extname(entry.name)\n if (!HASHABLE_EXTS.has(ext)) continue\n existing.push({ full: join(assetsDir, entry.name), ext, name: basename(entry.name, ext) })\n }\n }\n for (const file of existing) {\n const content = readFileSync(file.full)\n const hash = computeHash(content)\n const hashedPath = join(assetsDir, `${file.name}.${hash}${file.ext}`)\n renameSync(file.full, hashedPath)\n renames.set(file.full, hashedPath)\n }\n\n // Phase 2: Scan HTML — resolve content assets on demand, rewrite all references\n function processHtml(dir: string) {\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n const full = join(dir, entry.name)\n if (entry.isDirectory()) {\n processHtml(full)\n continue\n }\n if (!entry.name.endsWith('.html')) continue\n\n let html = readFileSync(full, 'utf-8')\n\n html = html.replace(/(src|href|srcset)=\"([^\"]+)\"/g, (match, attr: string, ref: string) => {\n if (\n ref.startsWith('http:') ||\n ref.startsWith('https:') ||\n ref.startsWith('//') ||\n ref.startsWith('#') ||\n ref.startsWith('data:') ||\n ref.startsWith('mailto:')\n ) {\n return match\n }\n\n // Normalize relative refs (shouldn't exist after rehype, but just in case)\n let assetRef = ref\n if (ref.startsWith('./') && /\\.(svg|png|jpg|jpeg|gif|webp|avif|ico)$/i.test(ref)) {\n assetRef = '/assets/' + basename(ref)\n }\n\n // Non-asset paths (e.g. page links, anchors)\n if (!assetRef.startsWith('/assets/')) return match\n\n const fileName = assetRef.slice('/assets/'.length)\n const distPath = join(assetsDir, fileName)\n\n // Already hashed in phase 1 (CSS, JS, fonts) or a prior HTML file\n const already = renames.get(distPath)\n if (already) {\n return `${attr}=\"/${relative(outDir, already)}\"`\n }\n\n // Content asset — find source, copy + hash on demand\n const sourcePath = contentAssets.get(fileName)\n if (!sourcePath) {\n return `${attr}=\"${assetRef}\"`\n }\n\n const content = readFileSync(sourcePath)\n const hash = computeHash(content)\n const ext = extname(fileName)\n const name = basename(fileName, ext)\n const hashedName = `${name}.${hash}${ext}`\n const hashedDest = join(assetsDir, hashedName)\n\n writeFileSync(hashedDest, content)\n renames.set(distPath, hashedDest)\n\n return `${attr}=\"/assets/${hashedName}\"`\n })\n\n writeFileSync(full, html)\n }\n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ACxB,IAAI,WAAW,KAAK,IACpB,IAAI,WAAW,IAAI,IACnB,IAAI,WAAW,QAAQ,IACvB,IAAI,WAAW,UAAU,CAEzB,QAAO;IAIT,IAAI,WAAW;AACf,QAAI,IAAI,WAAW,KAAK,IAAI,2CAA2C,KAAK,IAAI,CAC9E,YAAW,aAAa,SAAS,IAAI;AAIvC,QAAI,CAAC,SAAS,WAAW,WAAW,CAAE,QAAO;IAE7C,MAAM,WAAW,SAAS,MAAM,EAAkB;IAClD,MAAM,WAAW,KAAK,WAAW,SAAS;IAG1C,MAAM,UAAU,QAAQ,IAAI,SAAS;AACrC,QAAI,QACF,QAAO,GAAG,KAAK,KAAK,SAAS,QAAQ,QAAQ,CAAC;IAIhD,MAAM,aAAa,cAAc,IAAI,SAAS;AAC9C,QAAI,CAAC,WACH,QAAO,GAAG,KAAK,IAAI,SAAS;IAG9B,MAAM,UAAU,aAAa,WAAW;IACxC,MAAM,OAAO,YAAY,QAAQ;IACjC,MAAM,MAAM,QAAQ,SAAS;IAE7B,MAAM,aAAa,GADN,SAAS,UAAU,IAAI,CACT,GAAG,OAAO;IACrC,MAAM,aAAa,KAAK,WAAW,WAAW;AAE9C,kBAAc,YAAY,QAAQ;AAClC,YAAQ,IAAI,UAAU,WAAW;AAEjC,WAAO,GAAG,KAAK,YAAY,WAAW;KACtC;AAEF,iBAAc,MAAM,KAAK;;;AAG7B,aAAY,OAAO"}
@@ -1,5 +1,5 @@
1
- import { r as LoaderType, t as Loader } from "./types-B-V5qemH.mjs";
2
- import { r as MarkdownConfig } from "./heading-Dhvzlay-.mjs";
1
+ import { r as LoaderType, t as Loader } from "./types-Cn52sdoq.mjs";
2
+ import { r as MarkdownConfig } from "./heading-BpDXnl-7.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region ../../node_modules/@types/unist/index.d.ts
@@ -1123,4 +1123,4 @@ type ContentPlugin = {
1123
1123
  };
1124
1124
  //#endregion
1125
1125
  export { CollectionMap as a, RawEntry as c, ValidationEntryResult as d, ValidationIssue as f, CollectionDef as i, ContentValidator as l, ContentPlugin as n, InferCollectionData as o, ValidationResult as p, CollectionComputed as r, InferCollectionLoaderKind as s, ContentLayerConfig as t, ValidatorContext as u };
1126
- //# sourceMappingURL=content-config-wW-3r5gG.d.mts.map
1126
+ //# sourceMappingURL=content-config-Bfe4W9us.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-config-wW-3r5gG.d.mts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","AlignType","ReferenceType","Alternative","alt","Association","identifier","label","Reference","referenceType","Resource","url","title","BlockContent","BlockContentMap","Blockquote","Code","Heading","Html","List","Paragraph","Table","ThematicBreak","blockquote","code","heading","html","list","paragraph","table","thematicBreak","DefinitionContent","DefinitionContentMap","Definition","FootnoteDefinition","definition","footnoteDefinition","FrontmatterContent","FrontmatterContentMap","Yaml","yaml","ListContent","ListContentMap","ListItem","listItem","PhrasingContent","PhrasingContentMap","Break","Delete","Emphasis","FootnoteReference","Image","ImageReference","InlineCode","Link","LinkReference","Strong","Text","break","delete","emphasis","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text","RootContent","RootContentMap","TableCell","TableRow","tableCell","tableRow","RowContent","RowContentMap","TableContent","TableContentMap","Content","Literals","Nodes","Extract","Root","Parents","TopLevelContent","value","data","children","Array","BlockquoteData","type","BreakData","CodeData","lang","meta","DefinitionData","DeleteData","EmphasisData","FootnoteDefinitionData","FootnoteReferenceData","HeadingData","depth","HtmlData","HTML","ImageData","ImageReferenceData","InlineCodeData","LinkData","LinkReferenceData","ListData","ordered","start","spread","ListItemData","checked","ParagraphData","RootData","StrongData","TableData","align","TableRowData","TableCellData","TextData","ThematicBreakData","YamlData","YAML"],"sources":["../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../src/validation/schema-validator.ts","../src/validation/types.ts","../src/schemas/collection.ts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,GACd,OAAA;AAAA,KAGM,yBAAA,qBAA8C,aAAA,mBACxD,eAAA,CAAgB,WAAA;;KAGN,aAAA,WACA,CAAA,CAAE,OAAA,GAAU,CAAA,CAAE,OAAA,oBACN,kBAAA,0CACF,UAAA,GAAa,MAAA,GAAS,UAAA,GAAa,MAAA;EJU5CC,4CIPP,MAAA,EAAQ,OAAA,EJOI;EILZ,SAAA,UJkCmB;EIhCnB,MAAA,EAAQ,CAAA,EJiDa;EI/CrB,OAAA,aJuCEW;EIrCF,OAAA,aJ6CEC;EI3CF,QAAA,GAAW,SAAA,EJ2CU;EIzCrB,QAAA,IAAY,KAAA,EAAO,QAAA;EAEnB,MAAA,IAAU,KAAA,EAAO,QAAA;EAEjB,OAAA,IAAW,QAAA,UAAkB,SAAA,qBH5CV;EG8CnB,SAAA,IAAa,KAAA,EAAO,QAAA,KAAa,QAAA,GAAW,OAAA,CAAQ,QAAA,GH9CjC;EGgDnB,UAAA,GAAa,gBAAA,IHrCHY;EGuCV,wBAAA;AAAA;;;AJlDF;AAAA,KKbY,kBAAA;0BAEV,WAAA,EAAa,aAAA,ELWM;EKTnB,IAAA,WLcoB;EKZpB,QAAA,GAAW,cAAA,ELYS;EKVpB,MAAA;ILmBEtB,oCKjBA,aAAA,YLqBM;IKnBN,SAAA;EAAA,GL2BqB;EKxBvB,OAAA,GAAU,aAAA;AAAA;;KAIA,aAAA;EACV,IAAA,UL4BOF;EK1BP,YAAA,UAAsB,IAAA,gBL0BV;EKxBZ,YAAA,UAAsB,IAAA,gBLqDH;EKnDnB,QAAA,IAAY,KAAA;IAAS,IAAA,EAAM,MAAA;IAAqB,OAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"content-config-Bfe4W9us.d.mts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","AlignType","ReferenceType","Alternative","alt","Association","identifier","label","Reference","referenceType","Resource","url","title","BlockContent","BlockContentMap","Blockquote","Code","Heading","Html","List","Paragraph","Table","ThematicBreak","blockquote","code","heading","html","list","paragraph","table","thematicBreak","DefinitionContent","DefinitionContentMap","Definition","FootnoteDefinition","definition","footnoteDefinition","FrontmatterContent","FrontmatterContentMap","Yaml","yaml","ListContent","ListContentMap","ListItem","listItem","PhrasingContent","PhrasingContentMap","Break","Delete","Emphasis","FootnoteReference","Image","ImageReference","InlineCode","Link","LinkReference","Strong","Text","break","delete","emphasis","footnoteReference","image","imageReference","inlineCode","link","linkReference","strong","text","RootContent","RootContentMap","TableCell","TableRow","tableCell","tableRow","RowContent","RowContentMap","TableContent","TableContentMap","Content","Literals","Nodes","Extract","Root","Parents","TopLevelContent","value","data","children","Array","BlockquoteData","type","BreakData","CodeData","lang","meta","DefinitionData","DeleteData","EmphasisData","FootnoteDefinitionData","FootnoteReferenceData","HeadingData","depth","HtmlData","HTML","ImageData","ImageReferenceData","InlineCodeData","LinkData","LinkReferenceData","ListData","ordered","start","spread","ListItemData","checked","ParagraphData","RootData","StrongData","TableData","align","TableRowData","TableCellData","TextData","ThematicBreakData","YamlData","YAML"],"sources":["../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/mdast/index.d.ts","../src/validation/schema-validator.ts","../src/validation/types.ts","../src/schemas/collection.ts","../src/schemas/content-config.ts"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;AAqBA;;;;;AAKA;;;;;;;;;AAqBA;;UA1BiBA,MAAAA;;;;UAKAC,KAAAA;EA8BH;;AA6Bd;EAvDIC,IAAAA;EAwEmB;;;EAnEnBC,MAAAA;EAmEAU;;;EA/DAT,MAAAA;AAAAA;;AClBJ;;;;UD0BiBC,QAAAA;ECfLoB;;;EDmBRnB,KAAAA,EAAOL,KAAAA;ECZMyB;;;EDiBbnB,GAAAA,EAAKN,KAAAA;AAAAA;;;ACyET;;;;;AAWA;;;UDvDiBQ,MAAAA;ECuD+C;AAmBhE;;EDtEIE,IAAAA;ECwEM4B;;;EDnEN3B,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AO,QAAA;EAEjB,OAAA,IAAW,QAAA,UAAkB,SAAA,qBH5CV;EG8CnB,SAAA,IAAa,KAAA,EAAO,QAAA,KAAa,QAAA,GAAW,OAAA,CAAQ,QAAA,GH9CjC;EGgDnB,UAAA,GAAa,gBAAA,IHrCHY;EGuCV,wBAAA;AAAA;;;AJlDF;AAAA,KKbY,kBAAA;0BAEV,WAAA,EAAa,aAAA,ELWM;EKTnB,IAAA,WLcoB;EKZpB,QAAA,GAAW,cAAA,ELYS;EKVpB,MAAA;ILmBEtB,oCKjBA,aAAA,YLqBM;IKnBN,SAAA;EAAA,GL2BqB;EKxBvB,OAAA,GAAU,aAAA;AAAA;;KAIA,aAAA;EACV,IAAA,UL4BOF;EK1BP,YAAA,UAAsB,IAAA,gBL0BV;EKxBZ,YAAA,UAAsB,IAAA,gBLqDH;EKnDnB,QAAA,IAAY,KAAA;IAAS,IAAA,EAAM,MAAA;IAAqB,OAAA;EAAA;AAAA"}
@@ -1,10 +1,20 @@
1
- import { t as processMarkdown } from "./markdown-Cj5X26FL.mjs";
2
- import { n as resolveLoader, t as defaultIncludePatterns } from "./loaders-Bla48ZN9.mjs";
3
- import { dirname, extname, relative, resolve } from "path";
1
+ import { t as processMarkdown } from "./markdown-CyrHoDhP.mjs";
2
+ import { r as resolveLoader, t as defaultIncludePatterns } from "./loaders-Cf-BXf2L.mjs";
4
3
  import remarkParse from "remark-parse";
5
4
  import { unified } from "unified";
5
+ import { dirname, extname, relative, resolve } from "path";
6
6
  import fg from "fast-glob";
7
7
  import { existsSync } from "fs";
8
+ //#region src/convert.ts
9
+ async function convert(input, options = {}) {
10
+ const result = await processMarkdown(input, options.markdown || {});
11
+ return {
12
+ html: result.html,
13
+ toc: result.headings,
14
+ frontmatter: result.frontmatter
15
+ };
16
+ }
17
+ //#endregion
8
18
  //#region src/utils/read-time.ts
9
19
  /**
10
20
  * Read time estimation.
@@ -148,12 +158,14 @@ function validateSchema(data, schema) {
148
158
  issues: [],
149
159
  validatedData: result.data
150
160
  };
151
- const details = result.error.issues.map((issue) => ({
152
- field: issue.path.length > 0 ? formatPath(issue.path) : void 0,
153
- message: issue.message,
154
- severity: "error"
155
- })).map((i) => i.field ? `${i.field}: ${i.message}` : i.message).join("; ");
156
- throw new Error(`Schema validation failed: ${details}`);
161
+ return {
162
+ issues: result.error.issues.map((issue) => ({
163
+ field: issue.path.length > 0 ? formatPath(issue.path) : void 0,
164
+ message: issue.message,
165
+ severity: "error"
166
+ })),
167
+ validatedData: data
168
+ };
157
169
  }
158
170
  //#endregion
159
171
  //#region src/validation/code-block-validator.ts
@@ -303,37 +315,48 @@ function isWellFormedUrl(url) {
303
315
  return false;
304
316
  }
305
317
  }
306
- const linkValidator = {
307
- name: "links",
308
- validate(ctx) {
309
- if (!ctx.rawContent || !ctx.mdast) return [];
310
- const issues = [];
311
- const tree = ctx.mdast;
312
- const links = collectLinks(tree);
313
- const fileDir = dirname(ctx.filePath);
314
- for (const link of links) {
315
- const lineInfo = link.line ? ` (line ${link.line})` : "";
316
- if (link.url.startsWith("http://") || link.url.startsWith("https://")) {
317
- if (!isWellFormedUrl(link.url)) issues.push({
318
- field: `links${lineInfo}`,
319
- message: `Malformed external URL: ${link.url}`,
320
- severity: "warn"
321
- });
322
- continue;
323
- }
324
- if (isInternalLink(link.url)) {
325
- const urlPath = link.url.split("#")[0].split("?")[0];
326
- if (!urlPath) continue;
327
- if (!existsSync(resolve(fileDir, urlPath))) issues.push({
328
- field: `links${lineInfo}`,
329
- message: `Broken internal link: ${link.url}`,
330
- severity: "error"
331
- });
318
+ function createLinkValidator(options) {
319
+ const skipPatterns = options?.skipPatterns ?? [];
320
+ function shouldSkip(url) {
321
+ return skipPatterns.some((pattern) => {
322
+ if (pattern.includes("*")) return new RegExp("^" + pattern.replace(/\*/g, ".*") + "$").test(url);
323
+ return url.startsWith(pattern);
324
+ });
325
+ }
326
+ return {
327
+ name: "links",
328
+ validate(ctx) {
329
+ if (!ctx.rawContent || !ctx.mdast) return [];
330
+ const issues = [];
331
+ const tree = ctx.mdast;
332
+ const links = collectLinks(tree);
333
+ const fileDir = dirname(ctx.filePath);
334
+ for (const link of links) {
335
+ const lineInfo = link.line ? ` (line ${link.line})` : "";
336
+ if (link.url.startsWith("http://") || link.url.startsWith("https://")) {
337
+ if (!isWellFormedUrl(link.url)) issues.push({
338
+ field: `links${lineInfo}`,
339
+ message: `Malformed external URL: ${link.url}`,
340
+ severity: "warn"
341
+ });
342
+ continue;
343
+ }
344
+ if (isInternalLink(link.url)) {
345
+ if (shouldSkip(link.url)) continue;
346
+ const urlPath = link.url.split("#")[0].split("?")[0];
347
+ if (!urlPath) continue;
348
+ if (!existsSync(resolve(fileDir, urlPath))) issues.push({
349
+ field: `links${lineInfo}`,
350
+ message: `Broken internal link: ${link.url}`,
351
+ severity: "error"
352
+ });
353
+ }
332
354
  }
355
+ return issues;
333
356
  }
334
- return issues;
335
- }
336
- };
357
+ };
358
+ }
359
+ const linkValidator = createLinkValidator();
337
360
  //#endregion
338
361
  //#region src/validation/runner.ts
339
362
  /**
@@ -402,10 +425,13 @@ var ContentStore = class {
402
425
  return await this.loadEntry(name, filePath, directory, loader, def);
403
426
  } catch (err) {
404
427
  const message = err instanceof Error ? err.message : String(err);
428
+ const slug = def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory);
429
+ const loadError = new Error(`Failed to load ${filePath}: ${message}`, { cause: err });
430
+ console.warn(loadError.message);
405
431
  return {
406
- entry: new ContentEntry(def.slugify ? def.slugify(filePath, directory) : toSlug(filePath, directory), name, filePath, {}, void 0, this.markdownConfig),
432
+ entry: new ContentEntry(slug, name, filePath, {}, void 0, this.markdownConfig),
407
433
  issues: [{
408
- message: `Failed to load: ${message}`,
434
+ message: loadError.message,
409
435
  severity: "error"
410
436
  }]
411
437
  };
@@ -496,7 +522,7 @@ var ContentStore = class {
496
522
  }
497
523
  }
498
524
  /** Invalidate an entire collection. */
499
- invalidateCollection(collection) {
525
+ async invalidateCollection(collection) {
500
526
  this.cache.delete(collection);
501
527
  this.loaded.delete(collection);
502
528
  }
@@ -529,6 +555,15 @@ var ContentStore = class {
529
555
  };
530
556
  //#endregion
531
557
  //#region src/content-layer.ts
558
+ /**
559
+ * ContentLayer — the main API for working with content collections.
560
+ *
561
+ * Created via createContentLayer(config). Provides methods to:
562
+ * - Load and query collections (getCollection, getEntry)
563
+ * - Convert markdown directly (convert)
564
+ * - Invalidate cache (invalidate, invalidateCollection, invalidateAll)
565
+ * - Validate all entries (validate)
566
+ */
532
567
  var ContentLayerImpl = class {
533
568
  store;
534
569
  config;
@@ -546,14 +581,13 @@ var ContentLayerImpl = class {
546
581
  return this.store.getEntry(collection, slug);
547
582
  }
548
583
  async convert(markdown, options) {
549
- const { convert: coreConvert } = await import("./convert-XdGgNqH0.mjs").then((n) => n.n);
550
- return coreConvert(markdown, { markdown: options?.markdown ?? this.config.markdown });
584
+ return convert(markdown, { markdown: options?.markdown ?? this.config.markdown });
551
585
  }
552
586
  async invalidate(collection, slug) {
553
587
  await this.store.invalidate(collection, slug);
554
588
  }
555
- invalidateCollection(collection) {
556
- this.store.invalidateCollection(collection);
589
+ async invalidateCollection(collection) {
590
+ await this.store.invalidateCollection(collection);
557
591
  }
558
592
  invalidateAll() {
559
593
  this.store.invalidateAll();
@@ -590,12 +624,15 @@ var ContentLayerImpl = class {
590
624
  getCollectionDef(name) {
591
625
  return this.config.collections[name];
592
626
  }
627
+ getCollections() {
628
+ return { ...this.config.collections };
629
+ }
593
630
  };
594
631
  /** Create a new content layer from a configuration. */
595
632
  function createContentLayer(config) {
596
633
  return new ContentLayerImpl(config);
597
634
  }
598
635
  //#endregion
599
- export { headingValidator as a, ContentEntry as c, linkValidator as i, builtinMarkdownValidators as n, codeBlockValidator as o, runValidators as r, toSlug as s, createContentLayer as t };
636
+ export { linkValidator as a, toSlug as c, createLinkValidator as i, ContentEntry as l, builtinMarkdownValidators as n, headingValidator as o, runValidators as r, codeBlockValidator as s, createContentLayer as t, convert as u };
600
637
 
601
- //# sourceMappingURL=content-layer-DWdgdBeI.mjs.map
638
+ //# sourceMappingURL=content-layer-DPK1EmfY.mjs.map