@takazudo/zudo-doc 5.28.2 → 6.0.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.
- package/CHANGELOG.md +22 -0
- package/README.md +49 -16
- package/bin/gen-z-index.mjs +18 -18
- package/dist/agent-docs/identity.d.ts +4 -0
- package/dist/agent-docs/identity.js +24 -0
- package/dist/agent-docs/index.d.ts +5 -0
- package/dist/agent-docs/index.js +5 -0
- package/dist/agent-docs/limits.d.ts +11 -0
- package/dist/agent-docs/limits.js +24 -0
- package/dist/agent-docs/search.d.ts +14 -0
- package/dist/agent-docs/search.js +82 -0
- package/dist/agent-docs/tokenize.d.ts +2 -0
- package/dist/agent-docs/tokenize.js +22 -0
- package/dist/agent-docs/types.d.ts +68 -0
- package/dist/agent-docs/types.js +0 -0
- package/dist/ai-chat-modal/index.d.ts +1 -4
- package/dist/ai-chat-modal/index.js +183 -123
- package/dist/asset-components/asset-card.d.ts +1 -2
- package/dist/asset-components/asset-card.js +12 -12
- package/dist/asset-components/asset-code.d.ts +1 -2
- package/dist/asset-components/asset-code.js +10 -10
- package/dist/asset-components/shared.d.ts +3 -4
- package/dist/asset-components/shared.js +4 -4
- package/dist/asset-index-page/body.d.ts +5 -6
- package/dist/asset-index-page/body.js +6 -6
- package/dist/asset-index-page/index.d.ts +1 -2
- package/dist/asset-index-page/index.js +1 -1
- package/dist/asset-page/body.d.ts +5 -9
- package/dist/asset-page/body.js +3 -3
- package/dist/asset-page/components.d.ts +16 -17
- package/dist/asset-page/components.js +10 -9
- package/dist/asset-page/index.d.ts +1 -2
- package/dist/asset-page/index.js +1 -1
- package/dist/auto-logo/index.d.ts +1 -2
- package/dist/auto-logo/index.js +2 -2
- package/dist/body-foot-util/body-foot-util-area.d.ts +3 -4
- package/dist/body-foot-util/body-foot-util-area.js +1 -2
- package/dist/body-foot-util/edit-link.d.ts +2 -3
- package/dist/body-foot-util/edit-link.js +1 -2
- package/dist/breadcrumb/breadcrumb.d.ts +6 -6
- package/dist/breadcrumb/breadcrumb.js +3 -4
- package/dist/category-nav/index.d.ts +1 -2
- package/dist/category-nav/index.js +11 -5
- package/dist/category-tree-nav/index.d.ts +1 -2
- package/dist/category-tree-nav/index.js +3 -3
- package/dist/chrome/derive.d.ts +18 -27
- package/dist/chrome/derive.js +47 -29
- package/dist/chrome/index.d.ts +5 -5
- package/dist/chrome/index.js +1 -1
- package/dist/chrome/island-data.d.ts +4 -0
- package/dist/chrome/island-data.js +52 -0
- package/dist/chrome/primary-slots.d.ts +2 -3
- package/dist/chrome-bindings.d.ts +28 -22
- package/dist/code-group/index.d.ts +3 -4
- package/dist/code-group/index.js +3 -7
- package/dist/code-syntax/code-block-enhancer.d.ts +1 -2
- package/dist/code-syntax/code-block-enhancer.js +2 -2
- package/dist/code-syntax/mermaid-init.d.ts +1 -2
- package/dist/code-syntax/mermaid-init.js +5 -2
- package/dist/code-syntax/tabs-init-script.js +1 -1
- package/dist/code-syntax/tabs-init.d.ts +1 -2
- package/dist/code-syntax/tabs-init.js +2 -2
- package/dist/code-syntax/tabs.d.ts +6 -6
- package/dist/code-syntax/tabs.js +8 -8
- package/dist/compiled.css +2933 -2943
- package/dist/config-assertions/index.d.ts +13 -0
- package/dist/config-assertions/index.js +14 -0
- package/dist/config.d.ts +36 -17
- package/dist/config.js +23 -95
- package/dist/content/content-blockquote.d.ts +2 -3
- package/dist/content/content-blockquote.js +3 -3
- package/dist/content/content-code.d.ts +3 -4
- package/dist/content/content-code.js +5 -5
- package/dist/content/content-link.d.ts +3 -4
- package/dist/content/content-link.js +10 -10
- package/dist/content/content-ol.d.ts +2 -3
- package/dist/content/content-ol.js +5 -4
- package/dist/content/content-paragraph.d.ts +2 -3
- package/dist/content/content-paragraph.js +1 -1
- package/dist/content/content-strong.d.ts +2 -3
- package/dist/content/content-strong.js +3 -3
- package/dist/content/content-table.d.ts +2 -3
- package/dist/content/content-table.js +4 -4
- package/dist/content/content-ul.d.ts +2 -3
- package/dist/content/content-ul.js +4 -4
- package/dist/content/heading-h2.d.ts +2 -3
- package/dist/content/heading-h2.js +4 -4
- package/dist/content/heading-h3.d.ts +2 -3
- package/dist/content/heading-h3.js +4 -4
- package/dist/content/heading-h4.d.ts +2 -3
- package/dist/content/heading-h4.js +4 -4
- package/dist/content-admonition/index.d.ts +3 -4
- package/dist/content-admonition/index.js +2 -2
- package/dist/content.css +35 -33
- package/dist/design-token-panel-bootstrap-controller.d.ts +178 -0
- package/dist/design-token-panel-bootstrap-controller.js +359 -0
- package/dist/design-token-panel-bootstrap-island.d.ts +5 -0
- package/dist/design-token-panel-bootstrap-island.js +19 -0
- package/dist/design-token-panel-bootstrap.d.ts +5 -195
- package/dist/design-token-panel-bootstrap.js +3 -288
- package/dist/desktop-sidebar-toggle-island/index.d.ts +2 -7
- package/dist/desktop-sidebar-toggle-island/index.js +2 -58
- package/dist/desktop-sidebar-toggle-island/island.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/island.js +43 -0
- package/dist/desktop-sidebar-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-sidebar-toggle-island/storage.js +29 -0
- package/dist/desktop-toc-toggle-island/index.d.ts +2 -7
- package/dist/desktop-toc-toggle-island/index.js +2 -58
- package/dist/desktop-toc-toggle-island/island.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/island.js +43 -0
- package/dist/desktop-toc-toggle-island/storage.d.ts +4 -0
- package/dist/desktop-toc-toggle-island/storage.js +29 -0
- package/dist/details/details.d.ts +3 -4
- package/dist/details/details.js +1 -1
- package/dist/doc-body-end/index.d.ts +1 -2
- package/dist/doc-body-end/index.js +1 -1
- package/dist/doc-body-end-islands/design-token-panel-island.d.ts +2 -2
- package/dist/doc-body-end-islands/design-token-panel-island.js +3 -7
- package/dist/doc-body-end-islands/index.d.ts +4 -21
- package/dist/doc-body-end-islands/index.js +5 -3
- package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +3 -13
- package/dist/doc-body-end-islands/theme-pack-switcher-island.js +11 -13
- package/dist/doc-content-header/index.d.ts +1 -2
- package/dist/doc-content-header/index.js +1 -1
- package/dist/doc-history/index.d.ts +1 -1
- package/dist/doc-history/index.js +166 -141
- package/dist/doc-history-area/index.d.ts +6 -4
- package/dist/doc-history-area/index.js +17 -16
- package/dist/doc-metainfo-area/index.d.ts +2 -3
- package/dist/doc-metainfo-area/index.js +1 -1
- package/dist/doc-page-renderer/index.d.ts +13 -7
- package/dist/doc-page-renderer/index.js +10 -1
- package/dist/doc-page-shell/index.d.ts +20 -7
- package/dist/doc-page-shell/index.js +17 -6
- package/dist/doc-pager/index.d.ts +1 -2
- package/dist/doc-pager/index.js +3 -3
- package/dist/doc-tags-area/index.d.ts +2 -3
- package/dist/doc-tags-area/index.js +1 -1
- package/dist/doclayout/doc-layout-with-defaults.d.ts +9 -9
- package/dist/doclayout/doc-layout-with-defaults.js +5 -15
- package/dist/doclayout/doc-layout.d.ts +26 -27
- package/dist/doclayout/doc-layout.js +23 -14
- package/dist/docs-schema/index.d.ts +4 -0
- package/dist/docs-schema/index.js +1 -0
- package/dist/extract-headings/index.js +43 -12
- package/dist/factory-context/index.d.ts +22 -19
- package/dist/features.css +70 -8
- package/dist/find-in-page/find-bar.d.ts +4 -2
- package/dist/find-in-page/find-bar.js +58 -69
- package/dist/find-in-page/index.d.ts +2 -8
- package/dist/find-in-page/index.js +33 -30
- package/dist/footer/footer.d.ts +3 -4
- package/dist/footer/footer.js +3 -3
- package/dist/footer-with-defaults/index.d.ts +2 -3
- package/dist/footer-with-defaults/index.js +1 -1
- package/dist/frontmatter-preview-defaults/index.js +1 -0
- package/dist/head/doc-head.d.ts +1 -1
- package/dist/head/doc-head.js +24 -32
- package/dist/head/og-tags.d.ts +1 -1
- package/dist/head/og-tags.js +8 -7
- package/dist/head/twitter-card.d.ts +1 -1
- package/dist/head/twitter-card.js +1 -1
- package/dist/head-with-defaults/index.d.ts +7 -2
- package/dist/head-with-defaults/index.js +46 -32
- package/dist/header/header.d.ts +8 -8
- package/dist/header/header.js +9 -11
- package/dist/header/types.d.ts +7 -7
- package/dist/header-with-defaults/index.d.ts +1 -2
- package/dist/header-with-defaults/index.js +18 -8
- package/dist/home-intro/index.d.ts +2 -5
- package/dist/home-intro/index.js +7 -5
- package/dist/home-intro/prepare.js +4 -3
- package/dist/home-page/index.d.ts +3 -3
- package/dist/home-page/index.js +19 -17
- package/dist/html-preview-wrapper/highlighted-code.d.ts +3 -4
- package/dist/html-preview-wrapper/highlighted-code.js +19 -17
- package/dist/html-preview-wrapper/html-preview-wrapper.d.ts +4 -25
- package/dist/html-preview-wrapper/html-preview-wrapper.js +2 -87
- package/dist/html-preview-wrapper/html-preview.d.ts +3 -10
- package/dist/html-preview-wrapper/html-preview.js +13 -37
- package/dist/html-preview-wrapper/index.d.ts +2 -1
- package/dist/html-preview-wrapper/index.js +1 -1
- package/dist/html-preview-wrapper/preview-base.d.ts +3 -5
- package/dist/html-preview-wrapper/preview-base.js +56 -59
- package/dist/html-preview-wrapper/wrapper.d.ts +20 -0
- package/dist/html-preview-wrapper/wrapper.js +37 -0
- package/dist/hydration-pending.d.ts +3 -5
- package/dist/hydration-pending.js +7 -5
- package/dist/i18n-version/language-switcher.d.ts +5 -32
- package/dist/i18n-version/language-switcher.js +5 -106
- package/dist/i18n-version/switcher-generated-scripts.d.ts +2 -0
- package/dist/i18n-version/switcher-generated-scripts.js +107 -0
- package/dist/i18n-version/switcher-url-state.d.ts +76 -0
- package/dist/i18n-version/switcher-url-state.js +103 -0
- package/dist/i18n-version/version-banner.d.ts +2 -3
- package/dist/i18n-version/version-banner.js +1 -1
- package/dist/i18n-version/version-switcher.d.ts +5 -50
- package/dist/i18n-version/version-switcher.js +5 -157
- package/dist/icons/index.d.ts +18 -19
- package/dist/icons/index.js +17 -33
- package/dist/image-enlarge/index.d.ts +1 -10
- package/dist/image-enlarge/index.js +80 -55
- package/dist/image-enlarge/public.d.ts +2 -0
- package/dist/image-enlarge/public.js +6 -0
- package/dist/image-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/image-enlarge/ssr-fallback.js +8 -0
- package/dist/index.d.ts +11 -4
- package/dist/inline-version-switcher/index.d.ts +1 -2
- package/dist/inline-version-switcher/index.js +1 -1
- package/dist/island-types/index.d.ts +2 -2
- package/dist/island-types/index.js +1 -5
- package/dist/math-block/index.d.ts +4 -7
- package/dist/math-block/index.js +5 -5
- package/dist/mcp/handler.d.ts +8 -0
- package/dist/mcp/handler.js +129 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/loader.d.ts +19 -0
- package/dist/mcp/loader.js +202 -0
- package/dist/mdx-components/index.js +40 -108
- package/dist/mermaid-enlarge/index.d.ts +1 -8
- package/dist/mermaid-enlarge/index.js +174 -158
- package/dist/mermaid-enlarge/public.d.ts +2 -0
- package/dist/mermaid-enlarge/public.js +6 -0
- package/dist/mermaid-enlarge/ssr-fallback.d.ts +2 -0
- package/dist/mermaid-enlarge/ssr-fallback.js +8 -0
- package/dist/metainfo/doc-metainfo.d.ts +2 -3
- package/dist/metainfo/doc-metainfo.js +1 -4
- package/dist/metainfo/doc-tags.d.ts +2 -3
- package/dist/metainfo/doc-tags.js +1 -1
- package/dist/metainfo/frontmatter-preview.d.ts +3 -4
- package/dist/metainfo/frontmatter-preview.js +1 -1
- package/dist/nav-data-prep/index.js +6 -4
- package/dist/nav-indexing/category-nav.d.ts +2 -3
- package/dist/nav-indexing/category-nav.js +1 -2
- package/dist/nav-indexing/category-tree-nav.d.ts +2 -3
- package/dist/nav-indexing/category-tree-nav.js +1 -1
- package/dist/nav-indexing/doc-card-grid.d.ts +2 -3
- package/dist/nav-indexing/doc-card-grid.js +1 -2
- package/dist/nav-indexing/docs-sitemap.d.ts +2 -3
- package/dist/nav-indexing/docs-sitemap.js +2 -2
- package/dist/nav-indexing/index.d.ts +1 -1
- package/dist/nav-indexing/nav-card-grid.d.ts +2 -3
- package/dist/nav-indexing/nav-card-grid.js +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/card-list.js +4 -4
- package/dist/nav-indexing/note-tray-index-parts/date-line.d.ts +2 -3
- package/dist/nav-indexing/note-tray-index-parts/date-line.js +1 -1
- package/dist/nav-indexing/note-tray-index-parts/index-list.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/index-list.js +2 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index-parts/timeline.js +2 -2
- package/dist/nav-indexing/note-tray-index.d.ts +1 -2
- package/dist/nav-indexing/note-tray-index.js +1 -1
- package/dist/nav-indexing/site-tree-nav-demo.d.ts +2 -3
- package/dist/nav-indexing/site-tree-nav-demo.js +2 -2
- package/dist/nav-indexing/tag-nav.d.ts +1 -2
- package/dist/nav-indexing/tag-nav.js +1 -1
- package/dist/nav-indexing/types.d.ts +2 -2
- package/dist/nav-indexing/versions-page-content.d.ts +2 -3
- package/dist/nav-indexing/versions-page-content.js +8 -8
- package/dist/note-tray-index/index.d.ts +1 -2
- package/dist/note-tray-index/index.js +1 -1
- package/dist/page-loading/page-loading-overlay.d.ts +1 -2
- package/dist/page-loading/page-loading-overlay.js +3 -5
- package/dist/plugins/agent-export.d.ts +3 -0
- package/dist/plugins/agent-export.js +34 -0
- package/dist/plugins/internal/agent-export/chunk.d.ts +5 -0
- package/dist/plugins/internal/agent-export/chunk.js +90 -0
- package/dist/plugins/internal/agent-export/index.d.ts +24 -0
- package/dist/plugins/internal/agent-export/index.js +123 -0
- package/dist/plugins/internal/agent-export/normalize.d.ts +5 -0
- package/dist/plugins/internal/agent-export/normalize.js +73 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.d.ts +6 -0
- package/dist/plugins/internal/llms-txt/dev-middleware.js +8 -3
- package/dist/plugins/internal/llms-txt/emit.js +23 -6
- package/dist/plugins/internal/llms-txt/generate.d.ts +7 -1
- package/dist/plugins/internal/llms-txt/generate.js +9 -2
- package/dist/plugins/internal/llms-txt/load.d.ts +2 -0
- package/dist/plugins/internal/llms-txt/load.js +20 -4
- package/dist/plugins/internal/llms-txt/types.d.ts +10 -0
- package/dist/plugins/routes.js +4 -0
- package/dist/preset.d.ts +19 -9
- package/dist/preset.js +20 -1
- package/dist/route-context-payload/index.js +1 -1
- package/dist/routes/404.d.ts +2 -3
- package/dist/routes/404.js +1 -1
- package/dist/routes/_chrome.d.ts +5 -5
- package/dist/routes/_chrome.js +7 -2
- package/dist/routes/_context.d.ts +4 -4
- package/dist/routes/_design-token-panel-bootstrap.d.ts +1 -4
- package/dist/routes/_design-token-panel-bootstrap.js +9 -1
- package/dist/routes/docs-slug.d.ts +2 -3
- package/dist/routes/docs-tags-index.d.ts +2 -3
- package/dist/routes/docs-tags-index.js +1 -1
- package/dist/routes/docs-tags-tag.d.ts +2 -3
- package/dist/routes/docs-tags-tag.js +1 -1
- package/dist/routes/docs-versions.d.ts +2 -3
- package/dist/routes/docs-versions.js +1 -1
- package/dist/routes/files-path.d.ts +2 -3
- package/dist/routes/files-path.js +1 -1
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.js +1 -1
- package/dist/routes/locale-docs-slug.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.d.ts +2 -3
- package/dist/routes/locale-docs-tags-index.js +1 -1
- package/dist/routes/locale-docs-tags-tag.d.ts +2 -3
- package/dist/routes/locale-docs-tags-tag.js +1 -1
- package/dist/routes/locale-docs-versions.d.ts +2 -3
- package/dist/routes/locale-docs-versions.js +1 -1
- package/dist/routes/locale-files-path.d.ts +2 -3
- package/dist/routes/locale-files-path.js +1 -1
- package/dist/routes/locale-index.d.ts +2 -3
- package/dist/routes/locale-index.js +1 -1
- package/dist/routes/mcp.d.ts +5 -0
- package/dist/routes/mcp.js +25 -0
- package/dist/routes/v-docs-slug.d.ts +2 -3
- package/dist/routes/v-locale-docs-slug.d.ts +2 -3
- package/dist/search-widget/index.d.ts +1 -2
- package/dist/search-widget/index.js +4 -7
- package/dist/search-widget-script/generated-script.js +12 -5
- package/dist/settings-defaults.d.ts +2 -0
- package/dist/settings-defaults.js +93 -0
- package/dist/settings.d.ts +8 -2
- package/dist/sidebar/index.d.ts +1 -1
- package/dist/sidebar/sidebar.d.ts +12 -44
- package/dist/sidebar/sidebar.js +4 -3
- package/dist/sidebar/types.d.ts +14 -0
- package/dist/sidebar-prepaint/index.d.ts +1 -2
- package/dist/sidebar-prepaint/index.js +4 -6
- package/dist/sidebar-resizer/sidebar-resizer-init.d.ts +2 -3
- package/dist/sidebar-resizer/sidebar-resizer-init.js +3 -3
- package/dist/sidebar-toggle-island/index.d.ts +8 -11
- package/dist/sidebar-toggle-island/index.js +75 -62
- package/dist/sidebar-tree/build-tree.js +5 -6
- package/dist/sidebar-tree/types.d.ts +2 -0
- package/dist/sidebar-tree-island/index.d.ts +4 -19
- package/dist/sidebar-tree-island/index.js +782 -436
- package/dist/sidebar-tree-island/scope-state.d.ts +38 -0
- package/dist/sidebar-tree-island/scope-state.js +151 -0
- package/dist/sidebar-tree-island/sidebar-scroll-preserve.js +6 -2
- package/dist/sidebar-utils/index.d.ts +17 -19
- package/dist/sidebar-utils/index.js +100 -3
- package/dist/sidebar-utils/scope.d.ts +11 -0
- package/dist/sidebar-utils/scope.js +67 -0
- package/dist/sidebar-with-defaults/index.d.ts +1 -2
- package/dist/sidebar-with-defaults/index.js +19 -18
- package/dist/site-schema/nav-tree.js +15 -15
- package/dist/site-schema/types.d.ts +1 -0
- package/dist/site-tree-nav/index.d.ts +2 -3
- package/dist/site-tree-nav/index.js +11 -12
- package/dist/site-tree-nav/normalize-island-props.d.ts +16 -0
- package/dist/site-tree-nav/normalize-island-props.js +122 -0
- package/dist/site-tree-nav-island/index.d.ts +3 -3
- package/dist/site-tree-nav-island/index.js +243 -144
- package/dist/smart-break/index.d.ts +3 -4
- package/dist/smart-break/index.js +1 -1
- package/dist/tab-item/tab-item.d.ts +3 -4
- package/dist/tab-item/tab-item.js +1 -1
- package/dist/tag-pages/index.d.ts +3 -3
- package/dist/tag-pages/index.js +10 -10
- package/dist/theme/color-scheme-provider.d.ts +3 -3
- package/dist/theme/color-scheme-provider.js +3 -3
- package/dist/theme/theme-pack-provider.d.ts +1 -1
- package/dist/theme/theme-pack-provider.js +3 -3
- package/dist/theme/theme-toggle.d.ts +2 -3
- package/dist/theme/theme-toggle.js +1 -1
- package/dist/theme-pack-dialog/index.d.ts +1 -1
- package/dist/theme-pack-dialog/index.js +69 -75
- package/dist/theme-pack-dialog/theme-pack-card.d.ts +3 -4
- package/dist/theme-pack-dialog/theme-pack-card.js +19 -17
- package/dist/theme-pack-switcher/index.d.ts +4 -5
- package/dist/theme-pack-switcher/index.js +52 -49
- package/dist/theme-toggle/index.d.ts +1 -1
- package/dist/theme-toggle/index.js +154 -167
- package/dist/theme.css +47 -121
- package/dist/toc/mobile-toc.d.ts +3 -5
- package/dist/toc/mobile-toc.js +29 -27
- package/dist/toc/toc.d.ts +3 -4
- package/dist/toc/toc.js +18 -18
- package/dist/toc/use-active-heading.d.ts +5 -4
- package/dist/toc/use-active-heading.js +36 -30
- package/dist/toc-prepaint/index.d.ts +1 -2
- package/dist/toc-prepaint/index.js +4 -6
- package/dist/transitions/nested-island-props-refresh.d.ts +3 -16
- package/dist/transitions/nested-island-props-refresh.js +133 -151
- package/dist/transitions/page-events.d.ts +8 -13
- package/dist/tree-nav-shared/index.d.ts +4 -5
- package/dist/tree-nav-shared/index.js +6 -7
- package/dist/use-modal-dialog/index.d.ts +9 -63
- package/dist/use-modal-dialog/index.js +41 -59
- package/dist/versions-page/index.d.ts +3 -3
- package/dist/versions-page/index.js +5 -5
- package/dist/wind/index.d.ts +5 -0
- package/dist/wind/index.js +169 -0
- package/dist/wind.json +498 -0
- package/dist/z-index-defaults/index.d.ts +4 -4
- package/dist/zdtp-loader.d.ts +7 -0
- package/dist/zdtp-loader.js +8 -0
- package/eject/asset-components/asset-card.tsx +14 -16
- package/eject/asset-components/asset-code.tsx +10 -12
- package/eject/asset-components/shared.tsx +5 -7
- package/eject/breadcrumb/breadcrumb.tsx +15 -16
- package/eject/code-group/index.tsx +4 -10
- package/eject/content-admonition/index.tsx +5 -6
- package/eject/desktop-sidebar-toggle-island/index.ts +4 -0
- package/eject/desktop-sidebar-toggle-island/island.tsx +50 -0
- package/eject/desktop-sidebar-toggle-island/storage.ts +27 -0
- package/eject/details/details.tsx +3 -5
- package/eject/doc-history/index.tsx +193 -179
- package/eject/doc-pager/index.tsx +3 -4
- package/eject/footer/footer.tsx +7 -9
- package/eject/header/header.tsx +42 -54
- package/eject/header/nav-overflow-script.ts +1 -1
- package/eject/header/types.ts +12 -13
- package/eject/image-enlarge/index.tsx +84 -69
- package/eject/image-enlarge/public.ts +2 -0
- package/eject/image-enlarge/ssr-fallback.tsx +7 -0
- package/eject/page-loading/page-loading-overlay.tsx +8 -15
- package/eject/sidebar/index.ts +1 -0
- package/eject/sidebar/sidebar.tsx +16 -97
- package/eject/sidebar/types.ts +15 -0
- package/eject/sidebar-toggle-island/index.tsx +103 -102
- package/eject/sidebar-tree-island/index.tsx +827 -615
- package/eject/sidebar-tree-island/scope-state.ts +154 -0
- package/eject/sidebar-tree-island/sidebar-scroll-preserve.ts +8 -2
- package/eject/site-tree-nav-island/index.tsx +349 -222
- package/eject/tab-item/tab-item.tsx +2 -4
- package/eject/theme-toggle/hydration-pending.ts +6 -10
- package/eject/theme-toggle/index.tsx +133 -173
- package/eject/toc/mobile-toc.tsx +27 -31
- package/eject/toc/toc.tsx +21 -24
- package/eject/toc/use-active-heading.ts +43 -38
- package/package.json +40 -22
- package/routes-src/404.tsx +2 -3
- package/routes-src/_chrome.tsx +7 -2
- package/routes-src/_design-token-panel-bootstrap.tsx +1 -63
- package/routes-src/docs-slug.tsx +2 -3
- package/routes-src/docs-tags-index.tsx +2 -3
- package/routes-src/docs-tags-tag.tsx +2 -3
- package/routes-src/docs-versions.tsx +2 -3
- package/routes-src/files-path.tsx +2 -4
- package/routes-src/index.tsx +2 -3
- package/routes-src/locale-docs-slug.tsx +2 -3
- package/routes-src/locale-docs-tags-index.tsx +2 -3
- package/routes-src/locale-docs-tags-tag.tsx +2 -3
- package/routes-src/locale-docs-versions.tsx +2 -3
- package/routes-src/locale-files-path.tsx +2 -4
- package/routes-src/locale-index.tsx +2 -3
- package/routes-src/mcp.tsx +25 -0
- package/routes-src/v-docs-slug.tsx +2 -3
- package/routes-src/v-locale-docs-slug.tsx +2 -3
- package/tsconfig.base.json +1 -1
- package/dist/safelist.css +0 -2
- package/dist/theme-no-reset.css +0 -379
- package/eject/desktop-sidebar-toggle-island/index.tsx +0 -110
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,28 @@ The format is based on Keep a Changelog, and release notes are generated from th
|
|
|
8
8
|
|
|
9
9
|
No unreleased changes.
|
|
10
10
|
|
|
11
|
+
## [6.0.0] - 2026-10-11
|
|
12
|
+
|
|
13
|
+
### Breaking Changes
|
|
14
|
+
|
|
15
|
+
- Moves the framework to the zfb 4 engine family. `@takazudo/zfb`, `@takazudo/zfb-runtime` and `@takazudo/zfb-md-wasm` are now required at `^4.3.1`. Follow the [migration guide](https://zudo-doc.takazudomodular.com/docs/guides/migrating-to-zudo-doc-6/) to upgrade a 5.x project. (b9dd43b0d)
|
|
16
|
+
- Rendering uses zfb's owned zudo-react runtime instead of Preact, so Preact is no longer a peer of the core package. Extend `@takazudo/zudo-doc/tsconfig.base.json`, remove React→Preact compatibility paths, and port host or ejected components to zudo-react signals and `on:*` events. (b9dd43b0d)
|
|
17
|
+
- Styling uses the zudo-wind utility compiler instead of Tailwind. Remove Tailwind directives from your CSS entry and declare tokens as plain `:root` variables. The `./safelist.css` and `./theme-no-reset.css` exports are removed, and `./wind.json` is added and registered automatically by `zudoDoc()`. (b9dd43b0d)
|
|
18
|
+
- Public types move to zudo-react. Element descriptions use `Description`/`Child` and component callbacks use `Component`. Intrinsic-compatible components take `class` instead of `className`. `useModalDialog(...)` becomes `modalDialog(scope, options)`, and `ThemePackDialogProps.open` is a `ReadonlySignal<boolean>`. (b9dd43b0d)
|
|
19
|
+
- `DocHistory` and `DesignTokenPanelBootstrap` chrome-binding overrides are now server boundaries that own their Island mount. Use the exported `DocHistoryBoundary` for standard history. (84333fa7e)
|
|
20
|
+
- The optional `@takazudo/zudo-doc-history-server` peer now requires `^6.0.0`.
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- Adds an opt-in agent-readable documentation export (`agentExport`) and a read-only MCP server (`mcp`) with full-text search and fetch tools, plus agent discovery links. Both default to `false`. (4591145b0, 860eda41e, 578abf4ec)
|
|
25
|
+
- Adds Broader Tree sidebar controls: broaden the tree to its editorial parent, show only one branch, and restore the current page's local tree. Object-form sidebar configs with `items` and `initialPath` supply editorial parents outside a local view. (9c9826dcc)
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- Heading references and code-fence anchors now match zfb's native heading IDs. (3f35bff85)
|
|
30
|
+
- The agent export honors `copyPublicWithBase: false` when it places `agent/v1`. (db8e8495d)
|
|
31
|
+
- The search shortcut placeholder survives reconnects. (05c35801e, dab099db9)
|
|
32
|
+
|
|
11
33
|
## [5.28.2] - 2026-09-28
|
|
12
34
|
|
|
13
35
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -9,14 +9,14 @@ instead of editing the generated markdown directly.
|
|
|
9
9
|
This package provides the missing-by-design framework concerns:
|
|
10
10
|
|
|
11
11
|
- **Sidebar tree builder** (`./sidebar-tree`) — turns collection entries + `_category_.json` into breadcrumb/navigation nodes.
|
|
12
|
-
- **Theme controls** (`./theme`) — color scheme provider + design-token
|
|
12
|
+
- **Theme controls** (`./theme`) — color scheme provider + design-token panel bootstrap (the optional zdtp package owns its opaque Preact UI).
|
|
13
13
|
- **Theme toggle (bare)** (`./theme-toggle`) — the un-wrapped ThemeToggle component for call sites that compose their own `<Island>` (the `./theme` barrel exports an Island-wrapped variant of the same component).
|
|
14
|
-
- **TOC** (`./toc`) — desktop and mobile TOC
|
|
14
|
+
- **TOC** (`./toc`) — desktop and mobile TOC zudo-react islands fed by MDX `headings` export.
|
|
15
15
|
- **Breadcrumb** (`./breadcrumb`) — JSX breadcrumb fed by the sidebar tree.
|
|
16
16
|
- **DocLayout** (`./doclayout`) — composable layout shell with explicit `<Header>`, `<Sidebar>`, `<Main>`, `<Toc>`, `<Footer>` props; ships a `<DocLayoutWithDefaults>` wrapper that holds the 16 `create-zudo-doc` injection anchors.
|
|
17
17
|
- **View Transitions** (`./transitions`) — native View Transitions API shim (Chrome/Edge/Safari 18+); persistent regions via `view-transition-name`. No-op fallback in Firefox.
|
|
18
18
|
- **Head injection** (`./head`) — canonical, og:\*, twitter:\*, robots, preload hints, RSS link, sitemap link, and theme-color output.
|
|
19
|
-
- **SSR
|
|
19
|
+
- **SSR fallbacks** — fixed-target Island boundaries keep server fallback markup outside serialized client props; the image/mermaid fallback components remain public.
|
|
20
20
|
- **Site schema** (`./site-schema`) — browser-safe nav tree / breadcrumb / pager domain, with zero zfb engine or filesystem coupling. See below.
|
|
21
21
|
|
|
22
22
|
## `./site-schema` — the browser-safe site-shape domain
|
|
@@ -105,25 +105,58 @@ If your project renders **semi-trusted or user-submitted** HTML in a preview, ov
|
|
|
105
105
|
|
|
106
106
|
**Caveat:** removing `allow-same-origin` gives the iframe an opaque origin, which blocks the parent from reading `iframe.contentDocument`. That **disables auto-height** — always pair a stricter `sandbox` with a fixed `height`. Passing the empty string `""` is honored verbatim (only omitting the prop falls back to the computed default).
|
|
107
107
|
|
|
108
|
-
##
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
## 6.0 migration and peers
|
|
109
|
+
|
|
110
|
+
**6.0.0** is the coordinated major release of `@takazudo/zudo-doc`,
|
|
111
|
+
`@takazudo/zudo-doc-history-server` and `create-zudo-doc`. It targets the
|
|
112
|
+
published **zfb 4.3.1** family (peer floor **^4.3.1**).
|
|
113
|
+
[Upstream #4097](https://github.com/Takazudo/zudo-front-builder/issues/4097) is
|
|
114
|
+
resolved; its strict published 4.3.1 consumer control passed 3/3 with no skips or
|
|
115
|
+
retries in the [source-bound verification](../../docs/findings/zfb-4.3.1/verification.md).
|
|
116
|
+
That is Linux Chromium evidence; native macOS WebKit and the human/platform
|
|
117
|
+
limits retain their [recorded disposition](../../docs/findings/4430-zfb3-migration/2026-10-11-post-merge-status.md). See the
|
|
118
|
+
[5.x → 6.0 migration guide](../../src/content/docs/guides/migrating-to-zudo-doc-6.mdx)
|
|
119
|
+
for the full public API and host-boundary census.
|
|
120
|
+
|
|
121
|
+
Core rendering uses `@takazudo/zfb/zudo-react`, not Preact. Extend
|
|
122
|
+
`@takazudo/zudo-doc/tsconfig.base.json`, remove React→Preact compatibility paths,
|
|
123
|
+
and port host/ejected components to owned JSX/signals. zod remains required;
|
|
124
|
+
`katex`, `diff`, `@takazudo/zfb-md-wasm`, history-server, zdtp and MCP SDK peers
|
|
125
|
+
are feature-dependent. Package defaults for `agentExport`, `mcp`, and `llmsTxt`
|
|
126
|
+
are all `false`. The create-zudo-doc initializer enables `llmsTxt` by default;
|
|
127
|
+
agent export and MCP remain opt-in.
|
|
128
|
+
|
|
129
|
+
For the panel, the installed **zdtp 0.8.6** manifest carries **Preact ^10.29.1** as
|
|
130
|
+
its own dependency (it was a peer through 0.8.5) and exports `./styles.css` (also `./styles`) to `dist/zdtp.css`. Its internal
|
|
131
|
+
Tailwind browser dependency and Preact subtree are isolated from host JSX.
|
|
132
|
+
Install `@takazudo/zdtp` and import `@takazudo/zdtp/styles.css` when enabling it.
|
|
133
|
+
|
|
134
|
+
## Styling — Wind and public CSS
|
|
135
|
+
|
|
136
|
+
`zudoDoc()` registers the public `@takazudo/zudo-doc/wind.json` manifest and
|
|
137
|
+
var-backed Wind defaults automatically. No package-dist scanning or consumer
|
|
138
|
+
manifest import is needed. Remove the retired `safelist.css` and
|
|
139
|
+
`theme-no-reset.css` imports, Tailwind imports/directives and palette reset.
|
|
113
140
|
|
|
114
141
|
```css
|
|
115
|
-
@
|
|
116
|
-
@import "@takazudo/zudo-doc/
|
|
117
|
-
|
|
142
|
+
@layer zw-reset, zd-flow;
|
|
143
|
+
@import "@takazudo/zudo-doc/theme.css";
|
|
144
|
+
@import "@takazudo/zudo-doc/content.css";
|
|
145
|
+
@import "@takazudo/zudo-doc/page-loading.css";
|
|
146
|
+
@import "@takazudo/zudo-doc/features.css";
|
|
118
147
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
> **Don't `@source` into `node_modules`.** A glob like `@source "../node_modules/@takazudo/zudo-doc/dist/**"` looks plausible but is unreliable: pnpm surfaces packages via symlinks and Tailwind v4's file scanner does not reliably traverse them, so utilities get intermittently dropped across rebuilds (see zudolab/zudo-doc#1989). Import the package safelist instead.
|
|
148
|
+
:root { --spacing-hsp-md: 1rem; }
|
|
149
|
+
```
|
|
122
150
|
|
|
123
|
-
|
|
151
|
+
Override CSS variable values in `:root` after package imports, or utility token
|
|
152
|
+
mappings with `zudoDoc({ wind: { tokens: { colors: { accent: "var(--brand-accent)" } } } })`.
|
|
153
|
+
The top-level `wind` override deep-merges over package defaults; reset is
|
|
154
|
+
selected with `wind.reset` (default `"owned-v1"`), and `wind: false` disables it.
|
|
155
|
+
Public `compiled.css` remains the browser-ready embedding option when not using
|
|
156
|
+
zfb CSS generation. Do not use physical package `dist/*.css` import paths.
|
|
124
157
|
|
|
125
158
|
## Dev workflow (in this repo)
|
|
126
159
|
|
|
127
160
|
This package is published to npm as `@takazudo/zudo-doc` (since `0.2.0`, `latest` tracks the current line). Inside this repo the host site consumes it as a workspace package through its compiled `dist/` — `pnpm dev` at the repo root runs two watchers in parallel, `tsup --watch` for the JS and `tsc -p tsconfig.build.json --watch` for the `.d.ts`, so edits under `src/` rebuild both halves automatically; for a one-off rebuild use `pnpm --filter @takazudo/zudo-doc build`.
|
|
128
161
|
|
|
129
|
-
zfb itself comes from npm (versions pinned in the root `package.json`). To develop against a local zfb checkout, use the temporary `pnpm.overrides` link escape hatch documented in
|
|
162
|
+
zfb itself comes from npm (versions pinned in the root `package.json`). To develop against a local zfb checkout, use the temporary `pnpm.overrides` link escape hatch documented in root `CONTRIBUTING.md` — do not commit the override.
|
package/bin/gen-z-index.mjs
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
// - CSS: src/styles/global.css (override with --css <path>)
|
|
11
11
|
//
|
|
12
12
|
// Usage (after pnpm install, via scripts in package.json):
|
|
13
|
-
// gen-z-index # rewrite the
|
|
13
|
+
// gen-z-index # rewrite the :root block (conventional paths)
|
|
14
14
|
// gen-z-index --check # verify committed block is up to date (exit 1 on drift)
|
|
15
15
|
// gen-z-index --tokens <path> --css <path> # use non-conventional source/destination paths
|
|
16
|
-
// gen-z-index --no-theme-wrapper # emit bare --z-index-<name> declarations, no
|
|
16
|
+
// gen-z-index --no-theme-wrapper # emit bare --z-index-<name> declarations, no :root wrapper
|
|
17
17
|
// gen-z-index --md-table <path> # also generate/verify a Z_INDEX_TABLE region in a
|
|
18
18
|
// # markdown/MDX file (opt-in, no conventional default path)
|
|
19
19
|
//
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
// this repo's own b4push or CI; that integration was retired in
|
|
28
28
|
// zudolab/zudo-doc#2661.
|
|
29
29
|
//
|
|
30
|
-
// The block is
|
|
31
|
-
// tier
|
|
32
|
-
// `z-index: var(--z-index-<name>)`. `--no-theme-wrapper` drops the
|
|
30
|
+
// The block is an authored `:root { --z-index-<name>: <value>; }` for every
|
|
31
|
+
// tier. Matching wind tokens generate `z-<name>` utilities and raw CSS can reference
|
|
32
|
+
// `z-index: var(--z-index-<name>)`. `--no-theme-wrapper` drops the `:root`
|
|
33
33
|
// wrapper and emits bare `--z-index-<name>: <value>;` declarations instead,
|
|
34
|
-
// for projects that want to compose the block into their own
|
|
34
|
+
// for projects that want to compose the block into their own `:root` block.
|
|
35
35
|
//
|
|
36
36
|
// `--md-table <path>` additionally generates/verifies a second, independent
|
|
37
37
|
// `GENERATED:Z_INDEX_TABLE` region — a `| Token | Kind | Role |` table, one
|
|
@@ -660,7 +660,7 @@ function buildRerunCommand({ tokensPath, cssPath, themeWrapper, mdTablePath }) {
|
|
|
660
660
|
|
|
661
661
|
/**
|
|
662
662
|
* Build the full generated block (markers included). Two leading spaces of
|
|
663
|
-
* indentation match the surrounding
|
|
663
|
+
* indentation match the surrounding `:root` style in global.css.
|
|
664
664
|
*
|
|
665
665
|
* `options.tokensPath`/`options.cssPath` feed the "Source of truth:" and
|
|
666
666
|
* rerun-guidance lines in the header comment — pass the SAME path strings
|
|
@@ -670,9 +670,9 @@ function buildRerunCommand({ tokensPath, cssPath, themeWrapper, mdTablePath }) {
|
|
|
670
670
|
* its default, the header is byte-identical to the pre-flag generator.
|
|
671
671
|
*
|
|
672
672
|
* `options.themeWrapper` (default `true`) wraps the declarations in an
|
|
673
|
-
*
|
|
673
|
+
* `:root { ... }` block; `false` (the `--no-theme-wrapper` CLI flag) emits
|
|
674
674
|
* bare `--z-index-<name>: <value>;` declarations at 2-space indent instead,
|
|
675
|
-
* for projects composing the block into their own
|
|
675
|
+
* for projects composing the block into their own `:root` block.
|
|
676
676
|
*
|
|
677
677
|
* Deliberately does NOT accept `mdTablePath`: the CSS block's own content
|
|
678
678
|
* must depend only on the CSS-region flags (--tokens/--css/--no-theme-
|
|
@@ -696,12 +696,12 @@ export function buildBlock(tiers, options = {}) {
|
|
|
696
696
|
lines.push(
|
|
697
697
|
` * GENERATED:Z_INDEX — do not hand-edit; run ${buildRerunCommand({ tokensPath, cssPath, themeWrapper })}.`,
|
|
698
698
|
);
|
|
699
|
-
lines.push(` * Source of truth: ${tokensPath}.
|
|
699
|
+
lines.push(` * Source of truth: ${tokensPath}. zudo-wind reads the`);
|
|
700
700
|
lines.push(
|
|
701
|
-
` * --z-index-<name>
|
|
701
|
+
` * --z-index-<name> custom property and generates a z-<name> utility. */`,
|
|
702
702
|
);
|
|
703
703
|
if (themeWrapper) {
|
|
704
|
-
lines.push(`
|
|
704
|
+
lines.push(` :root {`);
|
|
705
705
|
for (const tier of tiers) {
|
|
706
706
|
lines.push(` --z-index-${tier.name}: ${tier.value};`);
|
|
707
707
|
}
|
|
@@ -867,7 +867,7 @@ export function scanMarkerLines(source, marker, options = {}) {
|
|
|
867
867
|
* error for each failure mode: missing (the block must be seeded once by
|
|
868
868
|
* hand), duplicated, or inverted markers.
|
|
869
869
|
*
|
|
870
|
-
* `beginMarker`/`endMarker` default to the CSS
|
|
870
|
+
* `beginMarker`/`endMarker` default to the CSS `:root` block's markers so
|
|
871
871
|
* existing call sites (the CSS region) are unaffected; the `--md-table`
|
|
872
872
|
* region passes `MD_TABLE_BEGIN_MARKER`/`MD_TABLE_END_MARKER` instead — same
|
|
873
873
|
* function, parameterized, mirroring how gen-component-tokens.mjs reuses one
|
|
@@ -1053,7 +1053,7 @@ function readNamedFile(absPath, asGivenPath, label) {
|
|
|
1053
1053
|
* message and into the generated header — never the resolved absolute path —
|
|
1054
1054
|
* so the committed CSS/md file never embeds a machine-specific path.
|
|
1055
1055
|
*
|
|
1056
|
-
* The CSS
|
|
1056
|
+
* The CSS `:root` region is always generated/verified. The `--md-table`
|
|
1057
1057
|
* region is entirely opt-in: when `--md-table <path>` isn't passed, no md
|
|
1058
1058
|
* file is read, built, or written, and `--check` only covers the CSS region
|
|
1059
1059
|
* (unchanged from pre-`--md-table` behavior). When it IS passed, `--check`
|
|
@@ -1114,19 +1114,19 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
console.log(
|
|
1116
1116
|
mdTablePath !== undefined
|
|
1117
|
-
? `OK — z-index
|
|
1118
|
-
: `OK — z-index
|
|
1117
|
+
? `OK — z-index :root block and md table are up to date (${tiers.length} tiers).`
|
|
1118
|
+
: `OK — z-index :root block is up to date (${tiers.length} tiers).`,
|
|
1119
1119
|
);
|
|
1120
1120
|
return 0;
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
1123
|
if (nextCss === css) {
|
|
1124
1124
|
console.log(
|
|
1125
|
-
`z-index
|
|
1125
|
+
`z-index :root block already up to date (${tiers.length} tiers); no change.`,
|
|
1126
1126
|
);
|
|
1127
1127
|
} else {
|
|
1128
1128
|
writeFileSync(cssAbsPath, nextCss);
|
|
1129
|
-
console.log(`Wrote z-index
|
|
1129
|
+
console.log(`Wrote z-index :root block to ${cssPath} (${tiers.length} tiers).`);
|
|
1130
1130
|
}
|
|
1131
1131
|
|
|
1132
1132
|
if (mdTablePath !== undefined) {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Stable filename-safe key for the actual locale and effective route slug. */
|
|
2
|
+
export declare function agentPageKey(locale: string, effectiveRouteSlug: string): string;
|
|
3
|
+
/** One-based part key. The exporter checks duplicate keys and validates part counts. */
|
|
4
|
+
export declare function agentItemKey(pageId: string, oneBasedPart: number): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const FNV_OFFSET = 14695981039346656037n;
|
|
2
|
+
const FNV_PRIME = 1099511628211n;
|
|
3
|
+
const FNV_MASK = (1n << 64n) - 1n;
|
|
4
|
+
function agentPageKey(locale, effectiveRouteSlug) {
|
|
5
|
+
const bytes = new TextEncoder().encode(JSON.stringify([locale, effectiveRouteSlug]));
|
|
6
|
+
let hash = FNV_OFFSET;
|
|
7
|
+
for (const byte of bytes) {
|
|
8
|
+
hash = (hash ^ BigInt(byte)) * FNV_PRIME & FNV_MASK;
|
|
9
|
+
}
|
|
10
|
+
return `p-${hash.toString(16).padStart(16, "0")}`;
|
|
11
|
+
}
|
|
12
|
+
function agentItemKey(pageId, oneBasedPart) {
|
|
13
|
+
if (!/^p-[0-9a-f]{16}$/.test(pageId)) {
|
|
14
|
+
throw new Error("Invalid agent page ID.");
|
|
15
|
+
}
|
|
16
|
+
if (!Number.isSafeInteger(oneBasedPart) || oneBasedPart < 1 || oneBasedPart > 999999) {
|
|
17
|
+
throw new Error("Agent item part must be between 1 and 999999.");
|
|
18
|
+
}
|
|
19
|
+
return `${pageId}-${String(oneBasedPart).padStart(6, "0")}`;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
agentItemKey,
|
|
23
|
+
agentPageKey
|
|
24
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const AGENT_SCHEMA_VERSION: 1;
|
|
2
|
+
export declare const AGENT_MAX_ITEM_TEXT_UNITS = 8000;
|
|
3
|
+
export declare const AGENT_MAX_TOOL_RESPONSE_BYTES = 131072;
|
|
4
|
+
export declare const AGENT_MAX_SEARCH_RESULTS = 10;
|
|
5
|
+
export declare const AGENT_MAX_QUERY_UNITS = 500;
|
|
6
|
+
export declare const AGENT_MAX_POST_BYTES = 65536;
|
|
7
|
+
export declare const AGENT_MAX_MANIFEST_BYTES: number;
|
|
8
|
+
export declare const AGENT_MAX_SEARCH_INDEX_BYTES: number;
|
|
9
|
+
export declare const AGENT_MAX_ITEMS = 10000;
|
|
10
|
+
export declare const AGENT_RETAINED_MEMORY_TARGET_BYTES: number;
|
|
11
|
+
export declare const AGENT_COLD_LOAD_TARGET_MS = 2000;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const AGENT_SCHEMA_VERSION = 1;
|
|
2
|
+
const AGENT_MAX_ITEM_TEXT_UNITS = 8e3;
|
|
3
|
+
const AGENT_MAX_TOOL_RESPONSE_BYTES = 131072;
|
|
4
|
+
const AGENT_MAX_SEARCH_RESULTS = 10;
|
|
5
|
+
const AGENT_MAX_QUERY_UNITS = 500;
|
|
6
|
+
const AGENT_MAX_POST_BYTES = 65536;
|
|
7
|
+
const AGENT_MAX_MANIFEST_BYTES = 8 * 1024 * 1024;
|
|
8
|
+
const AGENT_MAX_SEARCH_INDEX_BYTES = 16 * 1024 * 1024;
|
|
9
|
+
const AGENT_MAX_ITEMS = 1e4;
|
|
10
|
+
const AGENT_RETAINED_MEMORY_TARGET_BYTES = 64 * 1024 * 1024;
|
|
11
|
+
const AGENT_COLD_LOAD_TARGET_MS = 2e3;
|
|
12
|
+
export {
|
|
13
|
+
AGENT_COLD_LOAD_TARGET_MS,
|
|
14
|
+
AGENT_MAX_ITEMS,
|
|
15
|
+
AGENT_MAX_ITEM_TEXT_UNITS,
|
|
16
|
+
AGENT_MAX_MANIFEST_BYTES,
|
|
17
|
+
AGENT_MAX_POST_BYTES,
|
|
18
|
+
AGENT_MAX_QUERY_UNITS,
|
|
19
|
+
AGENT_MAX_SEARCH_INDEX_BYTES,
|
|
20
|
+
AGENT_MAX_SEARCH_RESULTS,
|
|
21
|
+
AGENT_MAX_TOOL_RESPONSE_BYTES,
|
|
22
|
+
AGENT_RETAINED_MEMORY_TARGET_BYTES,
|
|
23
|
+
AGENT_SCHEMA_VERSION
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentSearchIndex, AgentSearchResult, AgentItem } from "./types.js";
|
|
2
|
+
interface Posting {
|
|
3
|
+
item: number;
|
|
4
|
+
weight: number;
|
|
5
|
+
}
|
|
6
|
+
export interface BuiltAgentSearchIndex {
|
|
7
|
+
readonly items: readonly AgentItem[];
|
|
8
|
+
readonly postings: ReadonlyMap<string, readonly Posting[]>;
|
|
9
|
+
}
|
|
10
|
+
/** Build postings from complete item text, including content after UI-search truncation. */
|
|
11
|
+
export declare function buildAgentSearchIndex(source: AgentSearchIndex | readonly AgentItem[]): BuiltAgentSearchIndex;
|
|
12
|
+
/** Returns a validation result for bad queries and [] for valid queries with no matches. */
|
|
13
|
+
export declare function searchAgentIndex(index: BuiltAgentSearchIndex, query: string, topK?: number): AgentSearchResult;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AGENT_MAX_ITEMS, AGENT_MAX_QUERY_UNITS, AGENT_MAX_SEARCH_RESULTS } from "./limits.js";
|
|
2
|
+
import { tokenizeAgentText } from "./tokenize.js";
|
|
3
|
+
const HEADING = /^#{1,6}\s+(.+)$/gm;
|
|
4
|
+
function buildAgentSearchIndex(source) {
|
|
5
|
+
const artifact = Array.isArray(source) ? void 0 : source;
|
|
6
|
+
if (artifact && artifact.schemaVersion !== 1) {
|
|
7
|
+
throw new Error("Unsupported agent search index schema version.");
|
|
8
|
+
}
|
|
9
|
+
const items = artifact ? artifact.items : source;
|
|
10
|
+
if (items.length > AGENT_MAX_ITEMS) throw new Error(`Agent search index exceeds ${AGENT_MAX_ITEMS} items.`);
|
|
11
|
+
const postings = /* @__PURE__ */ new Map();
|
|
12
|
+
items.forEach((item, itemIndex) => {
|
|
13
|
+
const weights = /* @__PURE__ */ new Map();
|
|
14
|
+
const add = (text, weight) => {
|
|
15
|
+
for (const token of tokenizeAgentText(text)) {
|
|
16
|
+
weights.set(token, (weights.get(token) ?? 0) + weight);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
add(item.text, 1);
|
|
20
|
+
add(item.title, 12);
|
|
21
|
+
if (item.metadata.description) add(item.metadata.description, 5);
|
|
22
|
+
if (item.metadata.section) add(item.metadata.section, 7);
|
|
23
|
+
for (const match of item.text.matchAll(HEADING)) add(match[1], 6);
|
|
24
|
+
for (const [token, weight] of weights) {
|
|
25
|
+
const list = postings.get(token);
|
|
26
|
+
if (list) list.push({ item: itemIndex, weight });
|
|
27
|
+
else postings.set(token, [{ item: itemIndex, weight }]);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return { items, postings };
|
|
31
|
+
}
|
|
32
|
+
function displayTitle(item, duplicateTitle, duplicateQualifier) {
|
|
33
|
+
const { locale, section, part, partCount } = item.metadata;
|
|
34
|
+
const qualifiers = [locale];
|
|
35
|
+
if (section && section !== item.title) qualifiers.push(section);
|
|
36
|
+
if (partCount > 1) qualifiers.push(`part ${part}/${partCount}`);
|
|
37
|
+
if (duplicateQualifier) qualifiers.push(item.id);
|
|
38
|
+
return duplicateTitle || qualifiers.length > 1 ? `${item.title} (${qualifiers.join(" \xB7 ")})` : item.title;
|
|
39
|
+
}
|
|
40
|
+
function searchAgentIndex(index, query, topK = AGENT_MAX_SEARCH_RESULTS) {
|
|
41
|
+
if (query.length > AGENT_MAX_QUERY_UNITS) {
|
|
42
|
+
return { ok: false, error: `Query exceeds ${AGENT_MAX_QUERY_UNITS} UTF-16 code units.` };
|
|
43
|
+
}
|
|
44
|
+
if (!query.trim()) return { ok: false, error: "Query must not be empty." };
|
|
45
|
+
const tokens = tokenizeAgentText(query);
|
|
46
|
+
if (tokens.length === 0) return { ok: false, error: "Query has no searchable terms." };
|
|
47
|
+
const scores = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const token of tokens) {
|
|
49
|
+
const list = index.postings.get(token);
|
|
50
|
+
if (!list) continue;
|
|
51
|
+
const idf = 1 + Math.log((index.items.length + 1) / (list.length + 1));
|
|
52
|
+
const specificity = Array.from(token).length === 1 ? 0.25 : 1;
|
|
53
|
+
for (const { item, weight } of list) {
|
|
54
|
+
scores.set(item, (scores.get(item) ?? 0) + weight * idf * specificity);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const boundedK = Number.isFinite(topK) ? Math.max(0, Math.min(AGENT_MAX_SEARCH_RESULTS, Math.floor(topK))) : AGENT_MAX_SEARCH_RESULTS;
|
|
58
|
+
const ranked = [...scores.keys()].sort((a, b) => {
|
|
59
|
+
const difference = scores.get(b) - scores.get(a);
|
|
60
|
+
if (difference) return difference;
|
|
61
|
+
const first = index.items[a].id;
|
|
62
|
+
const second = index.items[b].id;
|
|
63
|
+
return first < second ? -1 : first > second ? 1 : 0;
|
|
64
|
+
}).slice(0, boundedK);
|
|
65
|
+
const titleCounts = /* @__PURE__ */ new Map();
|
|
66
|
+
for (const item of index.items) titleCounts.set(item.title, (titleCounts.get(item.title) ?? 0) + 1);
|
|
67
|
+
const qualifiedCounts = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const item of index.items) {
|
|
69
|
+
const title = displayTitle(item, (titleCounts.get(item.title) ?? 0) > 1, false);
|
|
70
|
+
qualifiedCounts.set(title, (qualifiedCounts.get(title) ?? 0) + 1);
|
|
71
|
+
}
|
|
72
|
+
const results = ranked.map((i) => {
|
|
73
|
+
const item = index.items[i];
|
|
74
|
+
const title = displayTitle(item, (titleCounts.get(item.title) ?? 0) > 1, false);
|
|
75
|
+
return { id: item.id, title: displayTitle(item, (titleCounts.get(item.title) ?? 0) > 1, (qualifiedCounts.get(title) ?? 0) > 1), url: item.url };
|
|
76
|
+
});
|
|
77
|
+
return { ok: true, results };
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
buildAgentSearchIndex,
|
|
81
|
+
searchAgentIndex
|
|
82
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const TOKEN_RUN = /[a-z0-9_]+|[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー]+/gu;
|
|
2
|
+
const IDENTIFIER = /^[a-z0-9_]+$/;
|
|
3
|
+
function tokenizeAgentText(input) {
|
|
4
|
+
const normalized = input.normalize("NFKC").toLowerCase();
|
|
5
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
6
|
+
for (const match of normalized.matchAll(TOKEN_RUN)) {
|
|
7
|
+
const run = match[0];
|
|
8
|
+
if (IDENTIFIER.test(run)) {
|
|
9
|
+
tokens.add(run);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
const points = Array.from(run);
|
|
13
|
+
for (let i = 0; i < points.length; i += 1) {
|
|
14
|
+
tokens.add(points[i]);
|
|
15
|
+
if (i + 1 < points.length) tokens.add(points[i] + points[i + 1]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return [...tokens].sort();
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
tokenizeAgentText
|
|
22
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** Version 1 of the published, read-only agent corpus. */
|
|
2
|
+
export interface AgentItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
text: string;
|
|
6
|
+
url: string;
|
|
7
|
+
metadata: {
|
|
8
|
+
locale: string;
|
|
9
|
+
pageId: string;
|
|
10
|
+
fingerprint: string;
|
|
11
|
+
part: number;
|
|
12
|
+
partCount: number;
|
|
13
|
+
description?: string;
|
|
14
|
+
section?: string;
|
|
15
|
+
unsupportedDynamicContent?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface AgentManifest {
|
|
19
|
+
schemaVersion: 1;
|
|
20
|
+
fingerprint: string;
|
|
21
|
+
site: {
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
base: string;
|
|
25
|
+
};
|
|
26
|
+
defaultLocale: string;
|
|
27
|
+
locales: string[];
|
|
28
|
+
searchIndex: {
|
|
29
|
+
url: string;
|
|
30
|
+
sha256: string;
|
|
31
|
+
};
|
|
32
|
+
documents: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
key: string;
|
|
35
|
+
locale: string;
|
|
36
|
+
title: string;
|
|
37
|
+
url: string;
|
|
38
|
+
markdownUrl: string;
|
|
39
|
+
itemIds: string[];
|
|
40
|
+
}>;
|
|
41
|
+
items: Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
key: string;
|
|
44
|
+
pageId: string;
|
|
45
|
+
url: string;
|
|
46
|
+
artifactUrl: string;
|
|
47
|
+
sha256: string;
|
|
48
|
+
part: number;
|
|
49
|
+
partCount: number;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentSearchIndex {
|
|
53
|
+
schemaVersion: 1;
|
|
54
|
+
fingerprint: string;
|
|
55
|
+
items: AgentItem[];
|
|
56
|
+
}
|
|
57
|
+
export interface AgentSearchResultItem {
|
|
58
|
+
id: string;
|
|
59
|
+
title: string;
|
|
60
|
+
url: string;
|
|
61
|
+
}
|
|
62
|
+
export type AgentSearchResult = {
|
|
63
|
+
ok: true;
|
|
64
|
+
results: AgentSearchResultItem[];
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
error: string;
|
|
68
|
+
};
|
|
File without changes
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
interface AiChatModalProps {
|
|
2
2
|
basePath: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function AiChatModal({ basePath }: AiChatModalProps): import("
|
|
5
|
-
export declare namespace AiChatModal {
|
|
6
|
-
var displayName: string;
|
|
7
|
-
}
|
|
4
|
+
export declare function AiChatModal({ basePath }: AiChatModalProps): import("@takazudo/zfb").Description;
|
|
8
5
|
export {};
|