@publish.os/nextjs 0.0.1-alpha.2 → 0.0.1-alpha.3
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.
- package/dist/cache/tags.cjs +3 -0
- package/dist/cache/tags.d.cts +1 -0
- package/dist/cache/tags.d.ts +1 -0
- package/dist/cache/tags.js +3 -0
- package/dist/config.cjs +78 -0
- package/dist/config.d.cts +101 -0
- package/dist/config.d.ts +101 -0
- package/dist/config.js +48 -0
- package/dist/index.cjs +1039 -123
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +1027 -110
- package/dist/kernel/components/blocks/AgentActions.cjs +425 -0
- package/dist/kernel/components/blocks/AgentActions.d.cts +52 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +52 -0
- package/dist/kernel/components/blocks/AgentActions.js +429 -0
- package/dist/kernel/components/blocks/animated-icon-swap.cjs +101 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.cts +16 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +16 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +74 -0
- package/dist/kernel/components/blocks/color-palette.cjs +413 -0
- package/dist/kernel/components/blocks/color-palette.d.cts +7 -0
- package/dist/kernel/components/blocks/color-palette.d.ts +7 -0
- package/dist/kernel/components/blocks/color-palette.js +407 -0
- package/dist/kernel/components/blocks/design-system-preview.cjs +592 -0
- package/dist/kernel/components/blocks/design-system-preview.d.cts +29 -0
- package/dist/kernel/components/blocks/design-system-preview.d.ts +29 -0
- package/dist/kernel/components/blocks/design-system-preview.js +655 -0
- package/dist/kernel/components/blocks/link-playground.cjs +816 -0
- package/dist/kernel/components/blocks/link-playground.d.cts +5 -0
- package/dist/kernel/components/blocks/link-playground.d.ts +5 -0
- package/dist/kernel/components/blocks/link-playground.js +792 -0
- package/dist/kernel/components/blocks/logo-block.cjs +156 -0
- package/dist/kernel/components/blocks/logo-block.d.cts +21 -0
- package/dist/kernel/components/blocks/logo-block.d.ts +21 -0
- package/dist/kernel/components/blocks/logo-block.js +129 -0
- package/dist/{components → kernel/components/blocks}/nav-breadcrumb.cjs +19 -38
- package/dist/kernel/components/blocks/nav-breadcrumb.d.cts +11 -0
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +11 -0
- package/dist/{components → kernel/components/blocks}/nav-breadcrumb.js +22 -30
- package/dist/kernel/components/blocks/navbar.cjs +154 -0
- package/dist/kernel/components/blocks/navbar.d.cts +16 -0
- package/dist/kernel/components/blocks/navbar.d.ts +16 -0
- package/dist/kernel/components/blocks/navbar.js +122 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.cjs +735 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.d.cts +5 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +5 -0
- package/dist/kernel/components/blocks/navigation-progress-playground.js +722 -0
- package/dist/kernel/components/blocks/navigation-progress.cjs +270 -0
- package/dist/kernel/components/blocks/navigation-progress.d.cts +16 -0
- package/dist/kernel/components/blocks/navigation-progress.d.ts +16 -0
- package/dist/kernel/components/blocks/navigation-progress.js +249 -0
- package/dist/kernel/components/blocks/next-prev.cjs +142 -0
- package/dist/kernel/components/blocks/next-prev.d.cts +11 -0
- package/dist/kernel/components/blocks/next-prev.d.ts +11 -0
- package/dist/kernel/components/blocks/next-prev.js +105 -0
- package/dist/{components → kernel/components/blocks}/page-list.cjs +7 -16
- package/dist/{components → kernel/components/blocks}/page-list.d.cts +1 -1
- package/dist/{components → kernel/components/blocks}/page-list.d.ts +1 -1
- package/dist/{components → kernel/components/blocks}/page-list.js +6 -5
- package/dist/kernel/components/blocks/search.cjs +717 -0
- package/dist/kernel/components/blocks/search.d.cts +77 -0
- package/dist/kernel/components/blocks/search.d.ts +77 -0
- package/dist/kernel/components/blocks/search.js +697 -0
- package/dist/kernel/components/blocks/sidebar-node.cjs +309 -0
- package/dist/kernel/components/blocks/sidebar-node.d.cts +8 -0
- package/dist/kernel/components/blocks/sidebar-node.d.ts +8 -0
- package/dist/kernel/components/blocks/sidebar-node.js +272 -0
- package/dist/kernel/components/blocks/sidebar.cjs +317 -0
- package/dist/kernel/components/blocks/sidebar.d.cts +33 -0
- package/dist/kernel/components/blocks/sidebar.d.ts +33 -0
- package/dist/kernel/components/blocks/sidebar.js +302 -0
- package/dist/kernel/components/blocks/theme-toggle.cjs +31 -0
- package/dist/kernel/components/blocks/theme-toggle.d.cts +6 -0
- package/dist/kernel/components/blocks/theme-toggle.d.ts +6 -0
- package/dist/kernel/components/blocks/theme-toggle.js +7 -0
- package/dist/kernel/components/blocks/toc.cjs +356 -0
- package/dist/kernel/components/blocks/toc.d.cts +10 -0
- package/dist/kernel/components/blocks/toc.d.ts +10 -0
- package/dist/kernel/components/blocks/toc.js +330 -0
- package/dist/kernel/components/mdx/components/blockquote.cjs +66 -0
- package/dist/kernel/components/mdx/components/blockquote.d.cts +6 -0
- package/dist/kernel/components/mdx/components/blockquote.d.ts +6 -0
- package/dist/kernel/components/mdx/components/blockquote.js +39 -0
- package/dist/kernel/components/mdx/components/callout.cjs +137 -0
- package/dist/kernel/components/mdx/components/callout.d.cts +18 -0
- package/dist/kernel/components/mdx/components/callout.d.ts +18 -0
- package/dist/kernel/components/mdx/components/callout.js +109 -0
- package/dist/kernel/components/mdx/components/code-block.cjs +39 -0
- package/dist/kernel/components/mdx/components/code-block.d.cts +9 -0
- package/dist/kernel/components/mdx/components/code-block.d.ts +9 -0
- package/dist/kernel/components/mdx/components/code-block.js +14 -0
- package/dist/kernel/components/mdx/components/figure-caption.cjs +63 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.cts +6 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +6 -0
- package/dist/kernel/components/mdx/components/figure-caption.js +36 -0
- package/dist/kernel/components/mdx/components/figure.cjs +78 -0
- package/dist/kernel/components/mdx/components/figure.d.cts +10 -0
- package/dist/kernel/components/mdx/components/figure.d.ts +10 -0
- package/dist/kernel/components/mdx/components/figure.js +53 -0
- package/dist/kernel/components/mdx/components/footnotes.cjs +66 -0
- package/dist/kernel/components/mdx/components/footnotes.d.cts +6 -0
- package/dist/kernel/components/mdx/components/footnotes.d.ts +6 -0
- package/dist/kernel/components/mdx/components/footnotes.js +39 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.cjs +108 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.d.cts +23 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +23 -0
- package/dist/kernel/components/mdx/components/heading-copy-link.js +81 -0
- package/dist/kernel/components/mdx/components/heading.cjs +166 -0
- package/dist/kernel/components/mdx/components/heading.d.cts +8 -0
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -0
- package/dist/kernel/components/mdx/components/heading.js +144 -0
- package/dist/kernel/components/mdx/components/hr.cjs +34 -0
- package/dist/kernel/components/mdx/components/hr.d.cts +9 -0
- package/dist/kernel/components/mdx/components/hr.d.ts +9 -0
- package/dist/kernel/components/mdx/components/hr.js +9 -0
- package/dist/kernel/components/mdx/components/image-zoom.cjs +49 -0
- package/dist/kernel/components/mdx/components/image-zoom.d.cts +10 -0
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +10 -0
- package/dist/kernel/components/mdx/components/image-zoom.js +15 -0
- package/dist/kernel/components/mdx/components/image.cjs +192 -0
- package/dist/kernel/components/mdx/components/image.d.cts +21 -0
- package/dist/kernel/components/mdx/components/image.d.ts +21 -0
- package/dist/kernel/components/mdx/components/image.js +157 -0
- package/dist/kernel/components/mdx/components/inline-code.cjs +66 -0
- package/dist/kernel/components/mdx/components/inline-code.d.cts +6 -0
- package/dist/kernel/components/mdx/components/inline-code.d.ts +6 -0
- package/dist/kernel/components/mdx/components/inline-code.js +39 -0
- package/dist/kernel/components/mdx/components/kbd.cjs +34 -0
- package/dist/kernel/components/mdx/components/kbd.d.cts +10 -0
- package/dist/kernel/components/mdx/components/kbd.d.ts +10 -0
- package/dist/kernel/components/mdx/components/kbd.js +9 -0
- package/dist/{components/providers.cjs → kernel/components/mdx/components/link.cjs} +20 -15
- package/dist/kernel/components/mdx/components/link.d.cts +11 -0
- package/dist/kernel/components/mdx/components/link.d.ts +11 -0
- package/dist/kernel/components/mdx/components/link.js +26 -0
- package/dist/kernel/components/mdx/components/paragraph.cjs +87 -0
- package/dist/kernel/components/mdx/components/paragraph.d.cts +5 -0
- package/dist/kernel/components/mdx/components/paragraph.d.ts +5 -0
- package/dist/kernel/components/mdx/components/paragraph.js +60 -0
- package/dist/kernel/components/mdx/components/pre.cjs +66 -0
- package/dist/kernel/components/mdx/components/pre.d.cts +6 -0
- package/dist/kernel/components/mdx/components/pre.d.ts +6 -0
- package/dist/kernel/components/mdx/components/pre.js +39 -0
- package/dist/kernel/components/mdx/components/strikethrough.cjs +63 -0
- package/dist/kernel/components/mdx/components/strikethrough.d.cts +6 -0
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +6 -0
- package/dist/kernel/components/mdx/components/strikethrough.js +36 -0
- package/dist/kernel/components/mdx/components/table.cjs +59 -0
- package/dist/kernel/components/mdx/components/table.d.cts +10 -0
- package/dist/kernel/components/mdx/components/table.d.ts +10 -0
- package/dist/kernel/components/mdx/components/table.js +36 -0
- package/dist/kernel/components/mdx/components/task-list.cjs +88 -0
- package/dist/kernel/components/mdx/components/task-list.d.cts +8 -0
- package/dist/kernel/components/mdx/components/task-list.d.ts +8 -0
- package/dist/kernel/components/mdx/components/task-list.js +60 -0
- package/dist/kernel/components/mdx/components/video-player.cjs +173 -0
- package/dist/kernel/components/mdx/components/video-player.d.cts +18 -0
- package/dist/kernel/components/mdx/components/video-player.d.ts +18 -0
- package/dist/kernel/components/mdx/components/video-player.js +147 -0
- package/dist/kernel/components/mdx/components/video.cjs +185 -0
- package/dist/kernel/components/mdx/components/video.d.cts +15 -0
- package/dist/kernel/components/mdx/components/video.d.ts +15 -0
- package/dist/kernel/components/mdx/components/video.js +162 -0
- package/dist/kernel/components/mdx/error-boundary.cjs +62 -0
- package/dist/{mdx → kernel/components/mdx}/error-boundary.d.cts +3 -8
- package/dist/{mdx → kernel/components/mdx}/error-boundary.d.ts +3 -8
- package/dist/kernel/components/mdx/error-boundary.js +38 -0
- package/dist/{mdx → kernel/components/mdx}/error-fallback.cjs +8 -8
- package/dist/{mdx → kernel/components/mdx}/error-fallback.js +8 -8
- package/dist/kernel/components/mdx/mdx.cjs +141 -0
- package/dist/kernel/components/mdx/mdx.d.cts +22 -0
- package/dist/kernel/components/mdx/mdx.d.ts +22 -0
- package/dist/kernel/components/mdx/mdx.js +109 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.cjs +113 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.d.cts +10 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +10 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +86 -0
- package/dist/kernel/components/mdx/types.cjs +18 -0
- package/dist/kernel/components/mdx/types.d.cts +18 -0
- package/dist/kernel/components/mdx/types.d.ts +18 -0
- package/dist/kernel/components/mdx/types.js +0 -0
- package/dist/kernel/components/ui/accordion.cjs +104 -0
- package/dist/kernel/components/ui/accordion.d.cts +16 -0
- package/dist/kernel/components/ui/accordion.d.ts +16 -0
- package/dist/kernel/components/ui/accordion.js +76 -0
- package/dist/kernel/components/ui/badge.cjs +75 -0
- package/dist/kernel/components/ui/badge.d.cts +12 -0
- package/dist/kernel/components/ui/badge.d.ts +12 -0
- package/dist/kernel/components/ui/badge.js +47 -0
- package/dist/kernel/components/ui/breadcrumb-trail.cjs +238 -0
- package/dist/kernel/components/ui/breadcrumb-trail.d.cts +13 -0
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +13 -0
- package/dist/kernel/components/ui/breadcrumb-trail.js +225 -0
- package/dist/kernel/components/ui/breadcrumb.cjs +399 -0
- package/dist/kernel/components/ui/breadcrumb.d.cts +52 -0
- package/dist/kernel/components/ui/breadcrumb.d.ts +52 -0
- package/dist/kernel/components/ui/breadcrumb.js +365 -0
- package/dist/kernel/components/ui/button-group.cjs +144 -0
- package/dist/kernel/components/ui/button-group.d.cts +19 -0
- package/dist/kernel/components/ui/button-group.d.ts +19 -0
- package/dist/kernel/components/ui/button-group.js +116 -0
- package/dist/kernel/components/ui/button.cjs +147 -0
- package/dist/kernel/components/ui/button.d.cts +23 -0
- package/dist/kernel/components/ui/button.d.ts +23 -0
- package/dist/kernel/components/ui/button.js +121 -0
- package/dist/kernel/components/ui/card.cjs +133 -0
- package/dist/kernel/components/ui/card.d.cts +17 -0
- package/dist/kernel/components/ui/card.d.ts +17 -0
- package/dist/kernel/components/ui/card.js +101 -0
- package/dist/kernel/components/ui/dialog.cjs +149 -0
- package/dist/kernel/components/ui/dialog.d.cts +22 -0
- package/dist/kernel/components/ui/dialog.d.ts +22 -0
- package/dist/kernel/components/ui/dialog.js +118 -0
- package/dist/kernel/components/ui/drawer.cjs +163 -0
- package/dist/kernel/components/ui/drawer.d.cts +24 -0
- package/dist/kernel/components/ui/drawer.d.ts +24 -0
- package/dist/kernel/components/ui/drawer.js +131 -0
- package/dist/kernel/components/ui/input.cjs +96 -0
- package/dist/kernel/components/ui/input.d.cts +18 -0
- package/dist/kernel/components/ui/input.d.ts +18 -0
- package/dist/kernel/components/ui/input.js +70 -0
- package/dist/kernel/components/ui/kbd.cjs +105 -0
- package/dist/kernel/components/ui/kbd.d.cts +13 -0
- package/dist/kernel/components/ui/kbd.d.ts +13 -0
- package/dist/kernel/components/ui/kbd.js +77 -0
- package/dist/kernel/components/ui/link.cjs +253 -0
- package/dist/kernel/components/ui/link.d.cts +31 -0
- package/dist/kernel/components/ui/link.d.ts +31 -0
- package/dist/kernel/components/ui/link.js +217 -0
- package/dist/kernel/components/ui/menu.cjs +301 -0
- package/dist/kernel/components/ui/menu.d.cts +70 -0
- package/dist/kernel/components/ui/menu.d.ts +70 -0
- package/dist/kernel/components/ui/menu.js +256 -0
- package/dist/kernel/components/ui/meta-key.cjs +34 -0
- package/dist/kernel/components/ui/meta-key.d.cts +12 -0
- package/dist/kernel/components/ui/meta-key.d.ts +12 -0
- package/dist/kernel/components/ui/meta-key.js +9 -0
- package/dist/kernel/components/ui/navigation-menu.cjs +253 -0
- package/dist/kernel/components/ui/navigation-menu.d.cts +47 -0
- package/dist/kernel/components/ui/navigation-menu.d.ts +47 -0
- package/dist/kernel/components/ui/navigation-menu.js +216 -0
- package/dist/kernel/components/ui/popover.cjs +168 -0
- package/dist/kernel/components/ui/popover.d.cts +24 -0
- package/dist/kernel/components/ui/popover.d.ts +24 -0
- package/dist/kernel/components/ui/popover.js +136 -0
- package/dist/kernel/components/ui/progress.cjs +112 -0
- package/dist/kernel/components/ui/progress.d.cts +16 -0
- package/dist/kernel/components/ui/progress.d.ts +16 -0
- package/dist/kernel/components/ui/progress.js +84 -0
- package/dist/kernel/components/ui/scroll-area.cjs +413 -0
- package/dist/kernel/components/ui/scroll-area.d.cts +58 -0
- package/dist/kernel/components/ui/scroll-area.d.ts +58 -0
- package/dist/kernel/components/ui/scroll-area.js +390 -0
- package/dist/kernel/components/ui/select.cjs +244 -0
- package/dist/kernel/components/ui/select.d.cts +40 -0
- package/dist/kernel/components/ui/select.d.ts +40 -0
- package/dist/kernel/components/ui/select.js +205 -0
- package/dist/kernel/components/ui/separator.cjs +73 -0
- package/dist/kernel/components/ui/separator.d.cts +8 -0
- package/dist/kernel/components/ui/separator.d.ts +8 -0
- package/dist/kernel/components/ui/separator.js +48 -0
- package/dist/kernel/components/ui/table.cjs +131 -0
- package/dist/kernel/components/ui/table.d.cts +11 -0
- package/dist/kernel/components/ui/table.d.ts +11 -0
- package/dist/kernel/components/ui/table.js +99 -0
- package/dist/kernel/components/ui/tabs.cjs +450 -0
- package/dist/kernel/components/ui/tabs.d.cts +82 -0
- package/dist/kernel/components/ui/tabs.d.ts +82 -0
- package/dist/kernel/components/ui/tabs.js +409 -0
- package/dist/kernel/components/ui/text.cjs +184 -0
- package/dist/kernel/components/ui/text.d.cts +17 -0
- package/dist/kernel/components/ui/text.d.ts +17 -0
- package/dist/kernel/components/ui/text.js +156 -0
- package/dist/kernel/components/ui/theme-toggle.cjs +108 -0
- package/dist/kernel/components/ui/theme-toggle.d.cts +10 -0
- package/dist/kernel/components/ui/theme-toggle.d.ts +10 -0
- package/dist/kernel/components/ui/theme-toggle.js +84 -0
- package/dist/kernel/components/ui/toast.cjs +154 -0
- package/dist/kernel/components/ui/toast.d.cts +26 -0
- package/dist/kernel/components/ui/toast.d.ts +26 -0
- package/dist/kernel/components/ui/toast.js +120 -0
- package/dist/kernel/components/ui/tooltip.cjs +127 -0
- package/dist/kernel/components/ui/tooltip.d.cts +20 -0
- package/dist/kernel/components/ui/tooltip.d.ts +20 -0
- package/dist/kernel/components/ui/tooltip.js +97 -0
- package/dist/kernel/defaults.registry.cjs +541 -0
- package/dist/kernel/defaults.registry.d.cts +469 -0
- package/dist/kernel/defaults.registry.d.ts +469 -0
- package/dist/kernel/defaults.registry.js +516 -0
- package/dist/kernel/routes/agent/markdown.cjs +208 -0
- package/dist/kernel/routes/agent/markdown.d.cts +59 -0
- package/dist/kernel/routes/agent/markdown.d.ts +59 -0
- package/dist/kernel/routes/agent/markdown.js +180 -0
- package/dist/{layouts → kernel/routes/layouts}/group.cjs +39 -15
- package/dist/kernel/routes/layouts/group.d.cts +20 -0
- package/dist/kernel/routes/layouts/group.d.ts +20 -0
- package/dist/{layouts → kernel/routes/layouts}/group.js +39 -15
- package/dist/kernel/routes/metadata/feed.cjs +297 -0
- package/dist/kernel/routes/metadata/feed.d.cts +21 -0
- package/dist/kernel/routes/metadata/feed.d.ts +21 -0
- package/dist/kernel/routes/metadata/feed.js +269 -0
- package/dist/kernel/routes/metadata/llms.cjs +234 -0
- package/dist/kernel/routes/metadata/llms.d.cts +27 -0
- package/dist/kernel/routes/metadata/llms.d.ts +27 -0
- package/dist/kernel/routes/metadata/llms.js +206 -0
- package/dist/kernel/routes/metadata/og-image.cjs +630 -0
- package/dist/kernel/routes/metadata/og-image.d.cts +62 -0
- package/dist/kernel/routes/metadata/og-image.d.ts +62 -0
- package/dist/kernel/routes/metadata/og-image.js +604 -0
- package/dist/{routes → kernel/routes/metadata}/robots.cjs +48 -4
- package/dist/{routes → kernel/routes/metadata}/robots.d.cts +2 -1
- package/dist/{routes → kernel/routes/metadata}/robots.d.ts +2 -1
- package/dist/kernel/routes/metadata/robots.js +113 -0
- package/dist/kernel/routes/metadata/sitemap.cjs +182 -0
- package/dist/kernel/routes/metadata/sitemap.d.cts +8 -0
- package/dist/kernel/routes/metadata/sitemap.d.ts +8 -0
- package/dist/kernel/routes/metadata/sitemap.js +156 -0
- package/dist/{pages → kernel/routes/pages}/group.cjs +107 -6
- package/dist/{pages → kernel/routes/pages}/group.d.cts +4 -2
- package/dist/{pages → kernel/routes/pages}/group.d.ts +4 -2
- package/dist/{pages → kernel/routes/pages}/group.js +107 -6
- package/dist/kernel/routes/pages/leaf.cjs +421 -0
- package/dist/kernel/routes/pages/leaf.d.cts +36 -0
- package/dist/kernel/routes/pages/leaf.d.ts +36 -0
- package/dist/kernel/routes/pages/leaf.js +397 -0
- package/dist/{pages → kernel/routes/pages}/root.cjs +108 -6
- package/dist/{pages → kernel/routes/pages}/root.d.cts +4 -2
- package/dist/{pages → kernel/routes/pages}/root.d.ts +4 -2
- package/dist/kernel/routes/pages/root.js +203 -0
- package/dist/keyboard-shortcuts.cjs +345 -0
- package/dist/keyboard-shortcuts.d.cts +34 -0
- package/dist/keyboard-shortcuts.d.ts +34 -0
- package/dist/keyboard-shortcuts.js +326 -0
- package/dist/resolvers/manifest-resolver.cjs +7 -3
- package/dist/resolvers/manifest-resolver.d.cts +2 -2
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +7 -3
- package/dist/search.cjs +411 -0
- package/dist/search.d.cts +20 -0
- package/dist/search.d.ts +20 -0
- package/dist/search.js +393 -0
- package/dist/types.cjs +12 -0
- package/dist/types.d.cts +132 -7
- package/dist/types.d.ts +132 -7
- package/dist/types.js +5 -0
- package/dist/utils/heading-ids.cjs +119 -0
- package/dist/utils/heading-ids.d.cts +15 -0
- package/dist/utils/heading-ids.d.ts +15 -0
- package/dist/utils/heading-ids.js +90 -0
- package/package.json +36 -39
- package/dist/components/color-palette.cjs +0 -408
- package/dist/components/color-palette.d.cts +0 -5
- package/dist/components/color-palette.d.ts +0 -5
- package/dist/components/color-palette.js +0 -388
- package/dist/components/nav-breadcrumb.d.cts +0 -9
- package/dist/components/nav-breadcrumb.d.ts +0 -9
- package/dist/components/providers.d.cts +0 -8
- package/dist/components/providers.d.ts +0 -8
- package/dist/components/providers.js +0 -20
- package/dist/components/site-header.cjs +0 -302
- package/dist/components/site-header.d.cts +0 -12
- package/dist/components/site-header.d.ts +0 -12
- package/dist/components/site-header.js +0 -268
- package/dist/components/theme-toggle.cjs +0 -147
- package/dist/components/theme-toggle.d.cts +0 -5
- package/dist/components/theme-toggle.d.ts +0 -5
- package/dist/components/theme-toggle.js +0 -123
- package/dist/layouts/group.d.cts +0 -15
- package/dist/layouts/group.d.ts +0 -15
- package/dist/mdx/error-boundary.cjs +0 -94
- package/dist/mdx/error-boundary.js +0 -70
- package/dist/mdx/mdx.cjs +0 -182
- package/dist/mdx/mdx.d.cts +0 -10
- package/dist/mdx/mdx.d.ts +0 -10
- package/dist/mdx/mdx.js +0 -147
- package/dist/pages/leaf.cjs +0 -203
- package/dist/pages/leaf.d.cts +0 -23
- package/dist/pages/leaf.d.ts +0 -23
- package/dist/pages/leaf.js +0 -176
- package/dist/pages/root.js +0 -101
- package/dist/routes/llms.cjs +0 -101
- package/dist/routes/llms.d.cts +0 -7
- package/dist/routes/llms.d.ts +0 -7
- package/dist/routes/llms.js +0 -76
- package/dist/routes/robots.js +0 -69
- package/dist/routes/sitemap.cjs +0 -108
- package/dist/routes/sitemap.d.cts +0 -5
- package/dist/routes/sitemap.d.ts +0 -5
- package/dist/routes/sitemap.js +0 -83
- /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.cts +0 -0
- /package/dist/{mdx → kernel/components/mdx}/error-fallback.d.ts +0 -0
|
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
|
-
// src/routes/robots.ts
|
|
20
|
+
// src/kernel/routes/metadata/robots.ts
|
|
21
21
|
var robots_exports = {};
|
|
22
22
|
__export(robots_exports, {
|
|
23
23
|
createRobotsTxtRoute: () => createRobotsTxtRoute
|
|
@@ -71,10 +71,53 @@ var tags = {
|
|
|
71
71
|
},
|
|
72
72
|
llms(scope = "root") {
|
|
73
73
|
return assertTag(`llms:${safeSegment(scope)}`);
|
|
74
|
+
},
|
|
75
|
+
feed(format, scope = "site") {
|
|
76
|
+
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
79
|
|
|
77
|
-
// src/routes/
|
|
80
|
+
// src/kernel/routes/response.ts
|
|
81
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=86400, stale-while-revalidate=3600, must-revalidate";
|
|
82
|
+
var CDN_CACHE_CONTROL = "public, max-age=2592000, stale-while-revalidate=31536000";
|
|
83
|
+
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
84
|
+
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
85
|
+
function cacheControl(policy) {
|
|
86
|
+
if (!policy || policy === "default") return CACHE_CONTROL;
|
|
87
|
+
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
88
|
+
return policy;
|
|
89
|
+
}
|
|
90
|
+
function cdnCacheControl(policy) {
|
|
91
|
+
if (!policy || policy === "default") return CDN_CACHE_CONTROL;
|
|
92
|
+
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
93
|
+
return policy;
|
|
94
|
+
}
|
|
95
|
+
function cachedTextHeaders(contentType, options = {}) {
|
|
96
|
+
const headers = new Headers(options.headers);
|
|
97
|
+
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
98
|
+
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
99
|
+
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
100
|
+
headers.set("content-type", contentType);
|
|
101
|
+
headers.set("x-content-type-options", "nosniff");
|
|
102
|
+
if (options.etag) headers.set("etag", options.etag);
|
|
103
|
+
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
104
|
+
return headers;
|
|
105
|
+
}
|
|
106
|
+
function createCachedTextResponse(options) {
|
|
107
|
+
const status = options.status ?? 200;
|
|
108
|
+
const method = options.method ?? options.request?.method ?? "GET";
|
|
109
|
+
const headers = cachedTextHeaders(options.contentType, options);
|
|
110
|
+
const isNotModified = status === 200 && options.etag && options.request?.headers.get("if-none-match") === options.etag;
|
|
111
|
+
return new Response(
|
|
112
|
+
method === "HEAD" || isNotModified ? null : options.body,
|
|
113
|
+
{
|
|
114
|
+
headers,
|
|
115
|
+
status: isNotModified ? 304 : status
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/kernel/routes/metadata/robots.ts
|
|
78
121
|
async function robotsTxt(manifest) {
|
|
79
122
|
"use cache";
|
|
80
123
|
(0, import_cache.cacheLife)("page");
|
|
@@ -83,8 +126,9 @@ async function robotsTxt(manifest) {
|
|
|
83
126
|
}
|
|
84
127
|
function createRobotsTxtRoute(manifest) {
|
|
85
128
|
return async function GET() {
|
|
86
|
-
return
|
|
87
|
-
|
|
129
|
+
return createCachedTextResponse({
|
|
130
|
+
body: await robotsTxt(manifest),
|
|
131
|
+
contentType: "text/plain; charset=utf-8"
|
|
88
132
|
});
|
|
89
133
|
};
|
|
90
134
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// src/kernel/routes/metadata/robots.ts
|
|
2
|
+
import { cacheLife, cacheTag } from "next/cache";
|
|
3
|
+
|
|
4
|
+
// src/cache/tags.ts
|
|
5
|
+
import { createHash } from "crypto";
|
|
6
|
+
var MAX_TAG_LEN = 256;
|
|
7
|
+
var MAX_SEGMENT_LEN = 80;
|
|
8
|
+
var TAG_PATTERN = /^[a-z0-9:_./-]+$/;
|
|
9
|
+
function sha256(value) {
|
|
10
|
+
return createHash("sha256").update(value).digest("hex").slice(0, 16);
|
|
11
|
+
}
|
|
12
|
+
function safeSegment(value) {
|
|
13
|
+
const raw = value.trim().toLowerCase() || "root";
|
|
14
|
+
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
15
|
+
const segment = normalized || "root";
|
|
16
|
+
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
17
|
+
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
18
|
+
}
|
|
19
|
+
function assertTag(tag) {
|
|
20
|
+
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
21
|
+
return `tag:${sha256(tag)}`;
|
|
22
|
+
}
|
|
23
|
+
return tag;
|
|
24
|
+
}
|
|
25
|
+
var tags = {
|
|
26
|
+
site() {
|
|
27
|
+
return "site";
|
|
28
|
+
},
|
|
29
|
+
pages() {
|
|
30
|
+
return "pages";
|
|
31
|
+
},
|
|
32
|
+
group(group) {
|
|
33
|
+
return assertTag(`group:${safeSegment(group)}`);
|
|
34
|
+
},
|
|
35
|
+
page(group, slug) {
|
|
36
|
+
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
37
|
+
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
38
|
+
},
|
|
39
|
+
manifest(contentHash) {
|
|
40
|
+
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
41
|
+
},
|
|
42
|
+
sitemap() {
|
|
43
|
+
return "sitemap";
|
|
44
|
+
},
|
|
45
|
+
robots() {
|
|
46
|
+
return "robots";
|
|
47
|
+
},
|
|
48
|
+
llms(scope = "root") {
|
|
49
|
+
return assertTag(`llms:${safeSegment(scope)}`);
|
|
50
|
+
},
|
|
51
|
+
feed(format, scope = "site") {
|
|
52
|
+
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/kernel/routes/response.ts
|
|
57
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=86400, stale-while-revalidate=3600, must-revalidate";
|
|
58
|
+
var CDN_CACHE_CONTROL = "public, max-age=2592000, stale-while-revalidate=31536000";
|
|
59
|
+
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
60
|
+
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
61
|
+
function cacheControl(policy) {
|
|
62
|
+
if (!policy || policy === "default") return CACHE_CONTROL;
|
|
63
|
+
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
64
|
+
return policy;
|
|
65
|
+
}
|
|
66
|
+
function cdnCacheControl(policy) {
|
|
67
|
+
if (!policy || policy === "default") return CDN_CACHE_CONTROL;
|
|
68
|
+
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
69
|
+
return policy;
|
|
70
|
+
}
|
|
71
|
+
function cachedTextHeaders(contentType, options = {}) {
|
|
72
|
+
const headers = new Headers(options.headers);
|
|
73
|
+
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
74
|
+
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
75
|
+
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
76
|
+
headers.set("content-type", contentType);
|
|
77
|
+
headers.set("x-content-type-options", "nosniff");
|
|
78
|
+
if (options.etag) headers.set("etag", options.etag);
|
|
79
|
+
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
80
|
+
return headers;
|
|
81
|
+
}
|
|
82
|
+
function createCachedTextResponse(options) {
|
|
83
|
+
const status = options.status ?? 200;
|
|
84
|
+
const method = options.method ?? options.request?.method ?? "GET";
|
|
85
|
+
const headers = cachedTextHeaders(options.contentType, options);
|
|
86
|
+
const isNotModified = status === 200 && options.etag && options.request?.headers.get("if-none-match") === options.etag;
|
|
87
|
+
return new Response(
|
|
88
|
+
method === "HEAD" || isNotModified ? null : options.body,
|
|
89
|
+
{
|
|
90
|
+
headers,
|
|
91
|
+
status: isNotModified ? 304 : status
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/kernel/routes/metadata/robots.ts
|
|
97
|
+
async function robotsTxt(manifest) {
|
|
98
|
+
"use cache";
|
|
99
|
+
cacheLife("page");
|
|
100
|
+
cacheTag(tags.site(), tags.robots(), tags.manifest(manifest.contentHash));
|
|
101
|
+
return "User-agent: *\nAllow: /\nSitemap: /sitemap.xml\n";
|
|
102
|
+
}
|
|
103
|
+
function createRobotsTxtRoute(manifest) {
|
|
104
|
+
return async function GET() {
|
|
105
|
+
return createCachedTextResponse({
|
|
106
|
+
body: await robotsTxt(manifest),
|
|
107
|
+
contentType: "text/plain; charset=utf-8"
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
createRobotsTxtRoute
|
|
113
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/kernel/routes/metadata/sitemap.ts
|
|
21
|
+
var sitemap_exports = {};
|
|
22
|
+
__export(sitemap_exports, {
|
|
23
|
+
createSitemapMarkdownRoute: () => createSitemapMarkdownRoute,
|
|
24
|
+
createSitemapXmlRoute: () => createSitemapXmlRoute
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(sitemap_exports);
|
|
27
|
+
var import_cache = require("next/cache");
|
|
28
|
+
|
|
29
|
+
// src/cache/tags.ts
|
|
30
|
+
var import_node_crypto = require("crypto");
|
|
31
|
+
var MAX_TAG_LEN = 256;
|
|
32
|
+
var MAX_SEGMENT_LEN = 80;
|
|
33
|
+
var TAG_PATTERN = /^[a-z0-9:_./-]+$/;
|
|
34
|
+
function sha256(value) {
|
|
35
|
+
return (0, import_node_crypto.createHash)("sha256").update(value).digest("hex").slice(0, 16);
|
|
36
|
+
}
|
|
37
|
+
function safeSegment(value) {
|
|
38
|
+
const raw = value.trim().toLowerCase() || "root";
|
|
39
|
+
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
40
|
+
const segment = normalized || "root";
|
|
41
|
+
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
42
|
+
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
43
|
+
}
|
|
44
|
+
function assertTag(tag) {
|
|
45
|
+
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
46
|
+
return `tag:${sha256(tag)}`;
|
|
47
|
+
}
|
|
48
|
+
return tag;
|
|
49
|
+
}
|
|
50
|
+
var tags = {
|
|
51
|
+
site() {
|
|
52
|
+
return "site";
|
|
53
|
+
},
|
|
54
|
+
pages() {
|
|
55
|
+
return "pages";
|
|
56
|
+
},
|
|
57
|
+
group(group) {
|
|
58
|
+
return assertTag(`group:${safeSegment(group)}`);
|
|
59
|
+
},
|
|
60
|
+
page(group, slug) {
|
|
61
|
+
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
62
|
+
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
63
|
+
},
|
|
64
|
+
manifest(contentHash) {
|
|
65
|
+
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
66
|
+
},
|
|
67
|
+
sitemap() {
|
|
68
|
+
return "sitemap";
|
|
69
|
+
},
|
|
70
|
+
robots() {
|
|
71
|
+
return "robots";
|
|
72
|
+
},
|
|
73
|
+
llms(scope = "root") {
|
|
74
|
+
return assertTag(`llms:${safeSegment(scope)}`);
|
|
75
|
+
},
|
|
76
|
+
feed(format, scope = "site") {
|
|
77
|
+
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/kernel/routes/response.ts
|
|
82
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=86400, stale-while-revalidate=3600, must-revalidate";
|
|
83
|
+
var CDN_CACHE_CONTROL = "public, max-age=2592000, stale-while-revalidate=31536000";
|
|
84
|
+
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
85
|
+
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
86
|
+
function cacheControl(policy) {
|
|
87
|
+
if (!policy || policy === "default") return CACHE_CONTROL;
|
|
88
|
+
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
89
|
+
return policy;
|
|
90
|
+
}
|
|
91
|
+
function cdnCacheControl(policy) {
|
|
92
|
+
if (!policy || policy === "default") return CDN_CACHE_CONTROL;
|
|
93
|
+
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
94
|
+
return policy;
|
|
95
|
+
}
|
|
96
|
+
function cachedTextHeaders(contentType, options = {}) {
|
|
97
|
+
const headers = new Headers(options.headers);
|
|
98
|
+
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
99
|
+
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
100
|
+
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
101
|
+
headers.set("content-type", contentType);
|
|
102
|
+
headers.set("x-content-type-options", "nosniff");
|
|
103
|
+
if (options.etag) headers.set("etag", options.etag);
|
|
104
|
+
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
105
|
+
return headers;
|
|
106
|
+
}
|
|
107
|
+
function createCachedTextResponse(options) {
|
|
108
|
+
const status = options.status ?? 200;
|
|
109
|
+
const method = options.method ?? options.request?.method ?? "GET";
|
|
110
|
+
const headers = cachedTextHeaders(options.contentType, options);
|
|
111
|
+
const isNotModified = status === 200 && options.etag && options.request?.headers.get("if-none-match") === options.etag;
|
|
112
|
+
return new Response(
|
|
113
|
+
method === "HEAD" || isNotModified ? null : options.body,
|
|
114
|
+
{
|
|
115
|
+
headers,
|
|
116
|
+
status: isNotModified ? 304 : status
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/kernel/routes/metadata/sitemap.ts
|
|
122
|
+
function xmlEscape(value) {
|
|
123
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
124
|
+
}
|
|
125
|
+
async function sitemapXml(manifest) {
|
|
126
|
+
"use cache";
|
|
127
|
+
(0, import_cache.cacheLife)("page");
|
|
128
|
+
(0, import_cache.cacheTag)(tags.site(), tags.sitemap(), tags.manifest(manifest.contentHash));
|
|
129
|
+
const urls = [
|
|
130
|
+
"/",
|
|
131
|
+
...Object.values(manifest.groups).map((g) => g.path),
|
|
132
|
+
...manifest.pages.filter((page) => page.status === "published").map((page) => page.path)
|
|
133
|
+
];
|
|
134
|
+
const uniqueUrls = [...new Set(urls)];
|
|
135
|
+
const body = uniqueUrls.map((url) => ` <url><loc>${xmlEscape(url)}</loc></url>`).join("\n");
|
|
136
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
137
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
138
|
+
${body}
|
|
139
|
+
</urlset>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
function createSitemapXmlRoute(manifest) {
|
|
143
|
+
return async function GET() {
|
|
144
|
+
return createCachedTextResponse({
|
|
145
|
+
body: await sitemapXml(manifest),
|
|
146
|
+
contentType: "application/xml; charset=utf-8"
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async function sitemapMarkdown(manifest, artifactManifest) {
|
|
151
|
+
const groups = Object.values(manifest.groups).sort((a, b) => a.path.localeCompare(b.path)).map((group) => `- [${group.title}](${group.path})`);
|
|
152
|
+
const pages = manifest.pages.filter((page) => page.status === "published").sort((a, b) => a.path.localeCompare(b.path)).map((page) => {
|
|
153
|
+
const markdownPath = artifactManifest.byHtmlPath[page.path];
|
|
154
|
+
const markdown = markdownPath ? ` ([Markdown](${markdownPath}))` : "";
|
|
155
|
+
return `- [${page.title}](${page.path})${markdown}`;
|
|
156
|
+
});
|
|
157
|
+
return [
|
|
158
|
+
`# ${manifest.site.name} Sitemap`,
|
|
159
|
+
"## Agent indexes",
|
|
160
|
+
"- [LLMS index](/llms.txt)",
|
|
161
|
+
"- [Full LLMS index](/llms-full.txt)",
|
|
162
|
+
"- [XML sitemap](/sitemap.xml)",
|
|
163
|
+
"## Sections",
|
|
164
|
+
groups.length ? groups.join("\n") : "- [Home](/)",
|
|
165
|
+
"## Pages",
|
|
166
|
+
pages.length ? pages.join("\n") : "- [Home](/)",
|
|
167
|
+
""
|
|
168
|
+
].join("\n\n");
|
|
169
|
+
}
|
|
170
|
+
function createSitemapMarkdownRoute(manifest, artifactManifest) {
|
|
171
|
+
return async function GET() {
|
|
172
|
+
return createCachedTextResponse({
|
|
173
|
+
body: await sitemapMarkdown(manifest, artifactManifest),
|
|
174
|
+
contentType: "text/markdown; charset=utf-8"
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
179
|
+
0 && (module.exports = {
|
|
180
|
+
createSitemapMarkdownRoute,
|
|
181
|
+
createSitemapXmlRoute
|
|
182
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ManifestLike } from '../../../types.cjs';
|
|
2
|
+
import { MarkdownRouteArtifactManifest } from '../agent/markdown.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare function createSitemapXmlRoute(manifest: ManifestLike): () => Promise<Response>;
|
|
6
|
+
declare function createSitemapMarkdownRoute(manifest: ManifestLike, artifactManifest: MarkdownRouteArtifactManifest): () => Promise<Response>;
|
|
7
|
+
|
|
8
|
+
export { createSitemapMarkdownRoute, createSitemapXmlRoute };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ManifestLike } from '../../../types.js';
|
|
2
|
+
import { MarkdownRouteArtifactManifest } from '../agent/markdown.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare function createSitemapXmlRoute(manifest: ManifestLike): () => Promise<Response>;
|
|
6
|
+
declare function createSitemapMarkdownRoute(manifest: ManifestLike, artifactManifest: MarkdownRouteArtifactManifest): () => Promise<Response>;
|
|
7
|
+
|
|
8
|
+
export { createSitemapMarkdownRoute, createSitemapXmlRoute };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// src/kernel/routes/metadata/sitemap.ts
|
|
2
|
+
import { cacheLife, cacheTag } from "next/cache";
|
|
3
|
+
|
|
4
|
+
// src/cache/tags.ts
|
|
5
|
+
import { createHash } from "crypto";
|
|
6
|
+
var MAX_TAG_LEN = 256;
|
|
7
|
+
var MAX_SEGMENT_LEN = 80;
|
|
8
|
+
var TAG_PATTERN = /^[a-z0-9:_./-]+$/;
|
|
9
|
+
function sha256(value) {
|
|
10
|
+
return createHash("sha256").update(value).digest("hex").slice(0, 16);
|
|
11
|
+
}
|
|
12
|
+
function safeSegment(value) {
|
|
13
|
+
const raw = value.trim().toLowerCase() || "root";
|
|
14
|
+
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
15
|
+
const segment = normalized || "root";
|
|
16
|
+
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
17
|
+
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
18
|
+
}
|
|
19
|
+
function assertTag(tag) {
|
|
20
|
+
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
21
|
+
return `tag:${sha256(tag)}`;
|
|
22
|
+
}
|
|
23
|
+
return tag;
|
|
24
|
+
}
|
|
25
|
+
var tags = {
|
|
26
|
+
site() {
|
|
27
|
+
return "site";
|
|
28
|
+
},
|
|
29
|
+
pages() {
|
|
30
|
+
return "pages";
|
|
31
|
+
},
|
|
32
|
+
group(group) {
|
|
33
|
+
return assertTag(`group:${safeSegment(group)}`);
|
|
34
|
+
},
|
|
35
|
+
page(group, slug) {
|
|
36
|
+
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
37
|
+
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
38
|
+
},
|
|
39
|
+
manifest(contentHash) {
|
|
40
|
+
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
41
|
+
},
|
|
42
|
+
sitemap() {
|
|
43
|
+
return "sitemap";
|
|
44
|
+
},
|
|
45
|
+
robots() {
|
|
46
|
+
return "robots";
|
|
47
|
+
},
|
|
48
|
+
llms(scope = "root") {
|
|
49
|
+
return assertTag(`llms:${safeSegment(scope)}`);
|
|
50
|
+
},
|
|
51
|
+
feed(format, scope = "site") {
|
|
52
|
+
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/kernel/routes/response.ts
|
|
57
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=86400, stale-while-revalidate=3600, must-revalidate";
|
|
58
|
+
var CDN_CACHE_CONTROL = "public, max-age=2592000, stale-while-revalidate=31536000";
|
|
59
|
+
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
60
|
+
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
61
|
+
function cacheControl(policy) {
|
|
62
|
+
if (!policy || policy === "default") return CACHE_CONTROL;
|
|
63
|
+
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
64
|
+
return policy;
|
|
65
|
+
}
|
|
66
|
+
function cdnCacheControl(policy) {
|
|
67
|
+
if (!policy || policy === "default") return CDN_CACHE_CONTROL;
|
|
68
|
+
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
69
|
+
return policy;
|
|
70
|
+
}
|
|
71
|
+
function cachedTextHeaders(contentType, options = {}) {
|
|
72
|
+
const headers = new Headers(options.headers);
|
|
73
|
+
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
74
|
+
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
75
|
+
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
76
|
+
headers.set("content-type", contentType);
|
|
77
|
+
headers.set("x-content-type-options", "nosniff");
|
|
78
|
+
if (options.etag) headers.set("etag", options.etag);
|
|
79
|
+
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
80
|
+
return headers;
|
|
81
|
+
}
|
|
82
|
+
function createCachedTextResponse(options) {
|
|
83
|
+
const status = options.status ?? 200;
|
|
84
|
+
const method = options.method ?? options.request?.method ?? "GET";
|
|
85
|
+
const headers = cachedTextHeaders(options.contentType, options);
|
|
86
|
+
const isNotModified = status === 200 && options.etag && options.request?.headers.get("if-none-match") === options.etag;
|
|
87
|
+
return new Response(
|
|
88
|
+
method === "HEAD" || isNotModified ? null : options.body,
|
|
89
|
+
{
|
|
90
|
+
headers,
|
|
91
|
+
status: isNotModified ? 304 : status
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/kernel/routes/metadata/sitemap.ts
|
|
97
|
+
function xmlEscape(value) {
|
|
98
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
99
|
+
}
|
|
100
|
+
async function sitemapXml(manifest) {
|
|
101
|
+
"use cache";
|
|
102
|
+
cacheLife("page");
|
|
103
|
+
cacheTag(tags.site(), tags.sitemap(), tags.manifest(manifest.contentHash));
|
|
104
|
+
const urls = [
|
|
105
|
+
"/",
|
|
106
|
+
...Object.values(manifest.groups).map((g) => g.path),
|
|
107
|
+
...manifest.pages.filter((page) => page.status === "published").map((page) => page.path)
|
|
108
|
+
];
|
|
109
|
+
const uniqueUrls = [...new Set(urls)];
|
|
110
|
+
const body = uniqueUrls.map((url) => ` <url><loc>${xmlEscape(url)}</loc></url>`).join("\n");
|
|
111
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
112
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
113
|
+
${body}
|
|
114
|
+
</urlset>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
function createSitemapXmlRoute(manifest) {
|
|
118
|
+
return async function GET() {
|
|
119
|
+
return createCachedTextResponse({
|
|
120
|
+
body: await sitemapXml(manifest),
|
|
121
|
+
contentType: "application/xml; charset=utf-8"
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
async function sitemapMarkdown(manifest, artifactManifest) {
|
|
126
|
+
const groups = Object.values(manifest.groups).sort((a, b) => a.path.localeCompare(b.path)).map((group) => `- [${group.title}](${group.path})`);
|
|
127
|
+
const pages = manifest.pages.filter((page) => page.status === "published").sort((a, b) => a.path.localeCompare(b.path)).map((page) => {
|
|
128
|
+
const markdownPath = artifactManifest.byHtmlPath[page.path];
|
|
129
|
+
const markdown = markdownPath ? ` ([Markdown](${markdownPath}))` : "";
|
|
130
|
+
return `- [${page.title}](${page.path})${markdown}`;
|
|
131
|
+
});
|
|
132
|
+
return [
|
|
133
|
+
`# ${manifest.site.name} Sitemap`,
|
|
134
|
+
"## Agent indexes",
|
|
135
|
+
"- [LLMS index](/llms.txt)",
|
|
136
|
+
"- [Full LLMS index](/llms-full.txt)",
|
|
137
|
+
"- [XML sitemap](/sitemap.xml)",
|
|
138
|
+
"## Sections",
|
|
139
|
+
groups.length ? groups.join("\n") : "- [Home](/)",
|
|
140
|
+
"## Pages",
|
|
141
|
+
pages.length ? pages.join("\n") : "- [Home](/)",
|
|
142
|
+
""
|
|
143
|
+
].join("\n\n");
|
|
144
|
+
}
|
|
145
|
+
function createSitemapMarkdownRoute(manifest, artifactManifest) {
|
|
146
|
+
return async function GET() {
|
|
147
|
+
return createCachedTextResponse({
|
|
148
|
+
body: await sitemapMarkdown(manifest, artifactManifest),
|
|
149
|
+
contentType: "text/markdown; charset=utf-8"
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
createSitemapMarkdownRoute,
|
|
155
|
+
createSitemapXmlRoute
|
|
156
|
+
};
|