@vite-hub/docs 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +3 -3
  2. package/dist/agent-copy-DTCo8cLy.js +48 -0
  3. package/dist/{content-C_WXjV3y.js → content-Chgcvz1q.js} +2 -2
  4. package/dist/{draft-rOGhtXch.js → draft-BKQg2PLU.js} +1 -1
  5. package/dist/index.d.ts +5 -5
  6. package/dist/index.js +1 -1
  7. package/dist/{manifest-DJ2DyNue.d.ts → manifest-DmITPRKL.d.ts} +1 -1
  8. package/dist/{manifest-Bti_WxDZ.js → manifest-E4mohC7O.js} +4 -4
  9. package/dist/{markdown-B97RuMXs.d.ts → markdown-Ul8Z9B5A.d.ts} +1 -1
  10. package/dist/navigation.d.ts +6 -1
  11. package/dist/navigation.js +21 -4
  12. package/dist/{nuxt-CPt71DeE.d.ts → nuxt-B0kdfz6P.d.ts} +8 -3
  13. package/dist/nuxt.d.ts +1 -1
  14. package/dist/nuxt.js +40 -21
  15. package/dist/object-ycNFay7F.js +6 -0
  16. package/dist/{page-B8_70-5D.d.ts → page-Cp7sifcg.d.ts} +2 -2
  17. package/dist/primitive-rail.d.ts +1 -1
  18. package/dist/primitive-rail.js +3 -2
  19. package/dist/{raw-CQukuLuj.js → raw-Dh38kL9g.js} +1 -0
  20. package/dist/runnable.d.ts +2 -2
  21. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +9 -5
  22. package/dist/runtime/app/components/AppHeader.vue +3 -9
  23. package/dist/runtime/app/components/DocsAsideLeftTop.vue +4 -10
  24. package/dist/runtime/app/components/DocsLearn.vue +9 -8
  25. package/dist/runtime/app/components/DocsLearnCodePre.vue +9 -20
  26. package/dist/runtime/app/components/DocsPageHeaderLinks.vue +1 -3
  27. package/dist/runtime/app/components/DocsPlayground.vue +3 -3
  28. package/dist/runtime/app/components/DocsRail.vue +14 -30
  29. package/dist/runtime/app/components/DocsRailTooltip.vue +18 -0
  30. package/dist/runtime/app/components/DocsSidebarStrip.vue +3 -7
  31. package/dist/runtime/app/components/DocsSidebars.vue +2 -1
  32. package/dist/runtime/app/components/content/CopyPrompt.vue +72 -0
  33. package/dist/runtime/app/components/content/Example.vue +2 -1
  34. package/dist/runtime/app/composables/docs.ts +11 -24
  35. package/dist/runtime/app/layouts/docs.vue +7 -0
  36. package/dist/runtime/app/plugins/vitehub-ui.ts +22 -0
  37. package/dist/runtime/server/llms.js +1 -1
  38. package/dist/runtime/server/markdown.js +2 -2
  39. package/dist/runtime/server/mcp.js +1 -1
  40. package/dist/runtime/server/page.d.ts +1 -1
  41. package/dist/runtime/server/page.js +2 -2
  42. package/dist/runtime/server/raw.js +1 -1
  43. package/dist/runtime/server/search.d.ts +1 -1
  44. package/dist/runtime/server/search.js +3 -3
  45. package/dist/runtime/server/sitemap.js +1 -1
  46. package/dist/runtime/theme/design.css +15 -0
  47. package/dist/{schema-CmSiwC4t.js → schema-fumnVoRZ.js} +1 -3
  48. package/dist/server.d.ts +3 -3
  49. package/dist/server.js +2 -2
  50. package/dist/{steps-C3tGwhNK.d.ts → steps-DzSu3r8K.d.ts} +1 -1
  51. package/dist/{theme-DRktv19v.js → theme-Bju84I9x.js} +7 -9
  52. package/dist/theme.js +1 -1
  53. package/dist/{types-B6YlHil4.d.ts → types-Dl6yjlwV.d.ts} +2 -0
  54. package/package.json +14 -11
  55. package/dist/agent-copy-CY9_RkHN.js +0 -32
package/README.md CHANGED
@@ -362,7 +362,7 @@ Most changes are options in `nuxt.config.ts`:
362
362
  | `icons` | Lucide fallbacks | Icon maps of the rail and the sidebar. |
363
363
  | `sitemap` | `[]` | More paths for `/sitemap.xml`. Every docs page is listed already. |
364
364
  | `mcp` | On | `{ name, guide }`, or `false` to turn off the MCP server. |
365
- | `llms` | None | `{ details, sections }`. Text under the description of `/llms.txt`, and sections of links before the page sections. |
365
+ | `llms` | None | `{ details, sections, report }`. Text under the description of `/llms.txt`, and sections of links before the page sections. `report` is on when `github` is set: agents that find a problem draft an issue for the user at the issues of the repository. `{ url }` names another tracker, `false` turns it off. |
366
366
  | `linkChecker` | On | `false` turns off the link checks. The build first runs `vitehub content check` on the Markdown of every page, also the pages it does not prerender, and stops with `DOCS_LINKS_BROKEN` on a link to a missing page, named by file and line. Then `nuxt-link-checker` fails the build on detected link errors in prerendered pages, such as links in the navigation and app pages. Fragments on other pages are checked against the final built HTML. Remote URLs are not fetched. A link to an exact `redirect` route rule passes, and the build checks that the rule leads to a docs page instead. Set the app's own `linkChecker` options to change it. |
367
367
  | `seoAudit` | `"warn"` | The search check of prerendered pages. `"warn"` reports one hint for each kind of problem, such as `DOCS_SEO_TITLE_INVALID`, in the build output and in `.vitehub/hints.json`. `"error"` or `true` stops the build with `DOCS_SEO_FAILED`, and `false` turns it off. The audit checks the rendered title and description, including duplicates across indexed pages. When the rendered title or description has the same problem in `vitehub content check`, the audit includes the frontmatter file and line. It also checks sitemap URLs, `h1` and heading order, word count, inbound links, Open Graph tags, HTML over 2 MB, and links to redirects or `/mcp`. A page without a share image (`seo.image: false`, or `ogImage: false`) needs no `og:image`, and a site without `site.url` needs no `og:url`. |
368
368
  | `ogImage` | On | Share images. `{ component }` renders the app's own template from `components/OgImage/`, or `false` turns them off. See [Search and share](#search-and-share). |
@@ -388,7 +388,7 @@ The shell is a set of Nuxt components. Create a component with the same name in
388
388
  | `DocsCatalogFooter` | The catalog at the end of an Overview. |
389
389
  | `DocsCodePanel`, `DocsCodePre` | The tutorial code panel and code blocks. |
390
390
 
391
- Markdown blocks are components in `components/content/`. The package has `::tutorial-step`, `::product-features` with `:::product-feature-item`, `::example` and `::examples`, `::correct` and `::incorrect`, `::code-tree`, `::page-list`, `::mcp-install` with `:::mcp-client`, and `::agent-only`. Add your own in `app/components/content/`, for example `ProductHero.vue` for `::product-hero`. An app `app.vue`, `error.vue`, `layouts/docs.vue`, or `layouts/default.vue` also replaces the package one. In an app with its own `app.vue`, the plain articles outside the sections use the `docs-article` layout, so the app's `default` layout stays on its own pages. A catch-all page replaces the docs page only at the docs prefix: `pages/[...slug].vue` for docs at `/`, and `pages/docs/[...slug].vue` for docs at `/docs`. One at another prefix, such as `pages/blog/[...slug].vue`, does not.
391
+ Markdown blocks are components in `components/content/`. The package has `::tutorial-step`, `::product-features` with `:::product-feature-item`, `::example` and `::examples`, `::correct` and `::incorrect`, `::code-tree`, `::page-list`, `::mcp-install` with `:::mcp-client`, `::copy-prompt`, and `::agent-only`. `::copy-prompt` shows its text with a Copy prompt button for a coding agent, and raw Markdown keeps the text as a plain paragraph. Add your own in `app/components/content/`, for example `ProductHero.vue` for `::product-hero`. An app `app.vue`, `error.vue`, `layouts/docs.vue`, or `layouts/default.vue` also replaces the package one. In an app with its own `app.vue`, the plain articles outside the sections use the `docs-article` layout, so the app's `default` layout stays on its own pages. A catch-all page replaces the docs page only at the docs prefix: `pages/[...slug].vue` for docs at `/`, and `pages/docs/[...slug].vue` for docs at `/docs`. One at another prefix, such as `pages/blog/[...slug].vue`, does not.
392
392
 
393
393
  A replacement docs layout or sidebar keeps the site header. Render `<DocsSidebars panel head />` to supply the sidebar controls and hide the desktop header. A replacement `DocsSidebars` can opt in with `data-docs-sidebar-head` on its root after it supplies the brand, badge tooltip, search, and `<DocsAsideFooter />`. The header owns one `DocsHeaderActions` instance and moves it into the mounted footer on wide screens.
394
394
 
@@ -484,7 +484,7 @@ Every page has a Markdown copy for coding agents. You get these routes with no s
484
484
 
485
485
  | Route | Content |
486
486
  | --- | --- |
487
- | `/raw/<page>.md` | The page as Markdown, with absolute links. `::agent-only` blocks stay in it. It ends with the pages of its section, the next page, and a link to `/llms.txt`. |
487
+ | `/raw/<page>.md` | The page as Markdown, with absolute links. `::agent-only` blocks stay in it. It ends with the pages of its section, the next page, a link to `/llms.txt`, and, with `llms.report`, where to report a problem. |
488
488
  | `/llms.txt`, `/llms-full.txt` | An index of every page, and every page in one file without the section links. |
489
489
  | `/sitemap.md`, `/sitemap.xml` | Every page, for agents and for search engines. |
490
490
  | `/mcp` | An MCP server with the `list-pages` and `get-page` tools. |
@@ -0,0 +1,48 @@
1
+ import { docsManifestPages, docsRawSectionLinks } from "./navigation.js";
2
+ import { t as toRawMarkdown } from "./raw-Dh38kL9g.js";
3
+ // src/agent-copy.ts
4
+ /**
5
+ * The copy of a page that agents read at `/raw/<page>.md`: the source as plain Markdown with absolute links, then the
6
+ * links of its section. `siteUrl` is the public origin with the app base, such as `https://docs.example.com/portal`.
7
+ */
8
+ function docsAgentCopy(manifest, page, source, siteUrl, report) {
9
+ const links = docsRawSectionLinks(manifest, page.path, siteUrl);
10
+ return {
11
+ markdown: toRawMarkdown(source, {
12
+ siteUrl,
13
+ pagePath: page.path
14
+ }),
15
+ footer: report ? `${links}\n${docsReportFooter(report)}\n` : links
16
+ };
17
+ }
18
+ /** Where agents report a problem: `llms.report.url`, else the issues of `github.repo`, else nowhere. */
19
+ function docsReportUrl(options) {
20
+ const report = options.llms?.report;
21
+ if (report === false) return null;
22
+ if (report?.url) return report.url;
23
+ return options.github ? `https://github.com/${options.github.repo}/issues` : null;
24
+ }
25
+ /** The paragraph at the head of `llms.txt` and `llms-full.txt` that tells an agent what to do when something breaks. */
26
+ function docsReportDetails(url) {
27
+ return `Report a problem: if this project or its docs do not work as written, do not hide the problem or work around it in silence. Tell the user what broke. Search the [issue tracker](${url}) for an existing report. If the problem is new, show the user a draft issue with the package version, the docs URL, the steps to reproduce it, and what you expected and saw. Leave out secrets, private code, and customer data. The user decides whether to post it. If the problem may be a security vulnerability, do not draft a public issue: tell the user to report it privately, as the project's security policy says.`;
28
+ }
29
+ /** The last line of each `/raw/<page>.md` copy, for an agent that reads one page and never opens `llms.txt`. */
30
+ function docsReportFooter(url) {
31
+ return `Something on this page does not work as written? Tell the user, and draft an issue for them to post: [issue tracker](${url}). Report a security vulnerability privately, never in a public issue.`;
32
+ }
33
+ /** The Content Source of a page, named like `createDocsContent()` names it: `docs_<index>` for the server asset `docs-<index>`. */
34
+ function docsContentSource(page) {
35
+ return `docs_${page.source ? page.source.slice(5) : 0}`;
36
+ }
37
+ /** The pages of each Content Source of the docs, `docs_<index>`, by their file in the Source. */
38
+ function docsAgentPages(manifest) {
39
+ const sources = /* @__PURE__ */ new Map();
40
+ for (const page of docsManifestPages(manifest)) {
41
+ const name = docsContentSource(page);
42
+ const pages = sources.get(name) ?? /* @__PURE__ */ new Map();
43
+ pages.set(page.file, page);
44
+ sources.set(name, pages);
45
+ }
46
+ return sources;
47
+ }
48
+ export { docsReportUrl as a, docsReportDetails as i, docsAgentPages as n, docsContentSource as r, docsAgentCopy as t };
@@ -1,4 +1,4 @@
1
- import { n as docsAgentPages, r as docsContentSource, t as docsAgentCopy } from "./agent-copy-CY9_RkHN.js";
1
+ import { n as docsAgentPages, r as docsContentSource, t as docsAgentCopy } from "./agent-copy-DTCo8cLy.js";
2
2
  import { i as docsMarkdown, n as docsDocumentOf, r as docsImageSizes, t as createDocsParser } from "./markdown-BzZkYb24.js";
3
3
  import { docsAppPath, docsManifestPages, docsRawPath } from "./navigation.js";
4
4
  import { n as readDocsFile } from "./files-BBoAGhhM.js";
@@ -58,7 +58,7 @@ function docsSiteUrl(config) {
58
58
  /** The agent copy of a page from its file. The `rawMarkdown` option runs at build time, and the build keeps each page that it changed. */
59
59
  async function docsPageCopy(page, text, siteUrl) {
60
60
  const rewritten = await readDocsFile("docs-agent", `${docsContentSource(page)}/${page.file}`);
61
- return docsAgentCopy(manifest, page, rewritten === null ? text : String(rewritten), siteUrl);
61
+ return docsAgentCopy(manifest, page, rewritten === null ? text : String(rewritten), siteUrl, agent.report);
62
62
  }
63
63
  async function readDocsPageCopy(page) {
64
64
  const text = await readDocsFile(page.source ?? "docs", page.file);
@@ -1,6 +1,6 @@
1
1
  import { docsSectionForPath, findDocsPage, normalizeDocsPath } from "./navigation.js";
2
2
  import { i as docsPageResponse, n as docsPageOf } from "./page-DWsretqk.js";
3
- import { i as docsPageSchema, t as docsFrontmatter } from "./schema-CmSiwC4t.js";
3
+ import { i as docsPageSchema, t as docsFrontmatter } from "./schema-fumnVoRZ.js";
4
4
  // src/draft.ts
5
5
  /**
6
6
  * The draft of the page at `path`, parsed like a published page, or null when the request shows the published file.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as docsPageFields, a as DocsSearchSection, b as expandDottedKeys, d as DocsPageFrontmatter, f as DocsPageNavigation, g as docsLayouts, h as DocsSectionFile, i as DocsPageWorkspace, l as DocsLayout, m as DocsPlaygroundTab, n as DocsManifest, o as DocsSection, p as DocsPlaygroundExample, r as DocsPage, s as DocsTocLink, t as DocsAppPage, u as DocsPageFile, v as docsPageSchema, y as docsSectionSchema } from "./types-B6YlHil4.js";
2
- import { t as DocsDocument } from "./markdown-B97RuMXs.js";
3
- import { n as DocsPageResponse, t as DocsPageLink } from "./page-B8_70-5D.js";
4
- import { a as DocsPublicConfig, d as DocsRunnableOptions, l as DocsRunnableExample, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, u as DocsRunnableLesson } from "./nuxt-CPt71DeE.js";
1
+ import { _ as docsPageFields, a as DocsSearchSection, b as expandDottedKeys, d as DocsPageFrontmatter, f as DocsPageNavigation, g as docsLayouts, h as DocsSectionFile, i as DocsPageWorkspace, l as DocsLayout, m as DocsPlaygroundTab, n as DocsManifest, o as DocsSection, p as DocsPlaygroundExample, r as DocsPage, s as DocsTocLink, t as DocsAppPage, u as DocsPageFile, v as docsPageSchema, y as docsSectionSchema } from "./types-Dl6yjlwV.js";
2
+ import { t as DocsDocument } from "./markdown-Ul8Z9B5A.js";
3
+ import { n as DocsPageResponse, t as DocsPageLink } from "./page-Cp7sifcg.js";
4
+ import { a as DocsPublicConfig, d as DocsRunnableOptions, l as DocsRunnableExample, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, u as DocsRunnableLesson } from "./nuxt-B0kdfz6P.js";
5
5
  import { DocsCatalogGroup, DocsGroup, DocsIcons, DocsLink, DocsMarkdownLinks, DocsPanelLoaders, DocsRailEntry, DocsSidebarGroup, DocsSidebarSection, DocsSidebarSectionBlock, docsCatalog, docsManifestPages, docsMarkdownLinks, docsMcpInstallLinks, docsPageIcon, docsRailEntries, docsRailEntry, docsRailGroups, docsRailIcon, docsRawPath, docsRelatedSections, docsSectionForPath, docsSectionGroup, docsSectionIcon, docsSidebarCollapses, docsSidebarGroups, docsSidebarSections, docsTutorialNavigationCookie, findDocsPage, isDocsWorkspaceLayout, normalizeDocsBase, normalizeDocsPath } from "./navigation.js";
6
- import { i as DocsSourceInput, r as DocsSource, t as DocsContentSource } from "./manifest-DJ2DyNue.js";
6
+ import { i as DocsSourceInput, r as DocsSource, t as DocsContentSource } from "./manifest-DmITPRKL.js";
7
7
  import { ContentLabel, DocumentsDefinition } from "@vite-hub/content";
8
8
  interface DocsCollectionOptions {
9
9
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as docsSectionSchema, i as docsPageSchema, n as docsLayouts, o as expandDottedKeys, r as docsPageFields } from "./schema-CmSiwC4t.js";
1
+ import { a as docsSectionSchema, i as docsPageSchema, n as docsLayouts, o as expandDottedKeys, r as docsPageFields } from "./schema-fumnVoRZ.js";
2
2
  import { r as docsPagePath } from "./page-DWsretqk.js";
3
3
  import { docsCatalog, docsManifestPages, docsMarkdownLinks, docsMcpInstallLinks, docsPageIcon, docsRailEntries, docsRailEntry, docsRailGroups, docsRailIcon, docsRawPath, docsRelatedSections, docsSectionForPath, docsSectionGroup, docsSectionIcon, docsSidebarCollapses, docsSidebarGroups, docsSidebarSections, docsTutorialNavigationCookie, findDocsPage, isDocsWorkspaceLayout, normalizeDocsBase, normalizeDocsPath } from "./navigation.js";
4
4
  import { documents } from "@vite-hub/content/collections";
@@ -1,4 +1,4 @@
1
- import { h as DocsSectionFile, n as DocsManifest } from "./types-B6YlHil4.js";
1
+ import { h as DocsSectionFile, n as DocsManifest } from "./types-Dl6yjlwV.js";
2
2
  import "nostics";
3
3
  import { ContentCheckOptions, ContentRuntime } from "@vite-hub/content";
4
4
  import { Source } from "@vite-hub/source";
@@ -1,5 +1,5 @@
1
1
  import { docsManifestPages, normalizeDocsBase } from "./navigation.js";
2
- import { a as docsSectionSchema, i as docsPageSchema, t as docsFrontmatter } from "./schema-CmSiwC4t.js";
2
+ import { a as docsSectionSchema, i as docsPageSchema, t as docsFrontmatter } from "./schema-fumnVoRZ.js";
3
3
  import { n as docsPageOf, r as docsPagePath } from "./page-DWsretqk.js";
4
4
  import { t as docsErrorDiagnostics } from "./error-diagnostics-Daz9oBJS.js";
5
5
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -206,9 +206,9 @@ function createDocsContent(sources, rootDir = process.cwd(), options = {}) {
206
206
  });
207
207
  }
208
208
  /**
209
- * The pages and `.navigation.yml` files of each docs source, from `content.list()`. Content keys a document by its
210
- * URL, so it lists one of two files with the same URL, such as `guide.md` and `guide/index.md`, and no empty file.
211
- * Those are read from the Source, so the manifest still names both files or the empty one in a `DOCS_CONTENT_INVALID` error.
209
+ * The pages and `.navigation.yml` files of each docs source, from `content.list()`. Content rejects two files of one
210
+ * Source with the same URL, such as `guide.md` and `guide/index.md`, with `CONTENT_R0003`, and lists no empty file.
211
+ * Empty files are read from the Source, so the manifest still names them in a `DOCS_CONTENT_INVALID` error.
212
212
  */
213
213
  async function listDocsContent(content, sources) {
214
214
  const files = [];
@@ -1,4 +1,4 @@
1
- import { a as DocsSearchSection, s as DocsTocLink } from "./types-B6YlHil4.js";
1
+ import { a as DocsSearchSection, s as DocsTocLink } from "./types-Dl6yjlwV.js";
2
2
  import { PresetOptions } from "comark-ui/vue";
3
3
  import { Node, ParserOptions } from "comark";
4
4
  /** A page parsed on the server. The client renders `nodes` and never parses Markdown itself. */
@@ -1,4 +1,4 @@
1
- import { a as DocsSearchSection, l as DocsLayout, n as DocsManifest, o as DocsSection, r as DocsPage, t as DocsAppPage } from "./types-B6YlHil4.js";
1
+ import { a as DocsSearchSection, l as DocsLayout, n as DocsManifest, o as DocsSection, r as DocsPage, t as DocsAppPage } from "./types-Dl6yjlwV.js";
2
2
  /** A link that the site options add to the shell, such as a tutorials page or a community chat. */
3
3
  export interface DocsLink {
4
4
  label: string;
@@ -217,6 +217,11 @@ export declare function docsIndexedPages(manifest: DocsManifest): DocsPage[];
217
217
  * ranks as a heading under its section, so a long tail of generated pages, such as error codes, stays below the real pages.
218
218
  */
219
219
  export declare function docsUnindexedSearchSections(manifest: DocsManifest): DocsSearchSection[];
220
+ /**
221
+ * Marks the records of a panel's Overview and of the pages inside the panel, such as `/docs/kv/diagnostics` and its
222
+ * error code pages. Search lists them after the section's own pages, unless the title is the query, such as `KV_DISABLED`.
223
+ */
224
+ export declare function docsPanelSearchSections(manifest: DocsManifest, records: readonly DocsSearchSection[]): DocsSearchSection[];
220
225
  /** Sections listed under Related, in the order that `.navigation.yml` declares them. */
221
226
  export declare function docsRelatedSections<Page extends DocsAppPage = DocsPage>(manifest: DocsManifest<Page>, section: DocsSection<Page>): DocsSection<Page>[];
222
227
  /** Sidebar icon of a page. */
@@ -322,6 +322,21 @@ function docsUnindexedSearchSections(manifest) {
322
322
  });
323
323
  return [...manifest.sections.flatMap((section) => section.pages.filter((page) => !docsPageIndexed(page)).map((page) => record(page, [section.title]))), ...[...manifest.root ? [manifest.root] : [], ...manifest.pages].filter((page) => !docsPageIndexed(page)).map((page) => record(page, []))];
324
324
  }
325
+ /**
326
+ * Marks the records of a panel's Overview and of the pages inside the panel, such as `/docs/kv/diagnostics` and its
327
+ * error code pages. Search lists them after the section's own pages, unless the title is the query, such as `KV_DISABLED`.
328
+ */
329
+ function docsPanelSearchSections(manifest, records) {
330
+ const panels = manifest.sections.flatMap((section) => section.pages.filter((page) => page.panel).map((page) => normalizeDocsPath(page.path)));
331
+ if (!panels.length) return [...records];
332
+ return records.map((record) => {
333
+ const path = normalizeDocsPath(record.id.split("#")[0] ?? record.id);
334
+ return panels.some((panel) => path === panel || path.startsWith(`${panel}/`)) ? {
335
+ ...record,
336
+ panel: true
337
+ } : record;
338
+ });
339
+ }
325
340
  /** Sections listed under Related, in the order that `.navigation.yml` declares them. */
326
341
  function docsRelatedSections(manifest, section) {
327
342
  return section.related.map((id) => manifest.sections.find((candidate) => candidate.id === id)).filter((candidate) => candidate !== void 0 && candidate.id !== section.id);
@@ -518,15 +533,17 @@ function createDocsSearch(records) {
518
533
  score += best;
519
534
  }
520
535
  if (missed) continue;
521
- if (entry.title.join(" ") === words.join(" ")) score += titleWeight / 2;
536
+ const exact = entry.title.join(" ") === words.join(" ");
537
+ if (exact) score += titleWeight / 2;
522
538
  hits.push({
523
539
  entry,
524
540
  inTitles,
525
- score
541
+ score,
542
+ nested: entry.record.panel === true && !exact
526
543
  });
527
544
  }
528
- hits.sort((left, right) => right.inTitles - left.inTitles || Number(left.entry.record.indexed === false) - Number(right.entry.record.indexed === false) || right.score - left.score || left.entry.title.length - right.entry.title.length || left.entry.order - right.entry.order);
545
+ hits.sort((left, right) => right.inTitles - left.inTitles || Number(left.entry.record.indexed === false) - Number(right.entry.record.indexed === false) || Number(left.nested) - Number(right.nested) || right.score - left.score || left.entry.title.length - right.entry.title.length || left.entry.order - right.entry.order);
529
546
  return hits.slice(0, limit).map((hit) => hit.entry.record);
530
547
  };
531
548
  }
532
- export { createDocsSearch, docsAppPath, docsCanonicalUrl, docsCatalog, docsHasRail, docsHomePath, docsIconStroke, docsIndexedPages, docsManifestPages, docsMarkdownLinks, docsMcpInstallLinks, docsPageIcon, docsPageIndexed, docsPanelGroupWindow, docsPanelOf, docsPanelPages, docsPanelSidebarGroups, docsPanelWindow, docsRailEntries, docsRailEntry, docsRailGroups, docsRailIcon, docsRailTarget, docsRawFile, docsRawPath, docsRawSectionLinks, docsRawSectionLinksMarker, docsRelatedSections, docsSectionForPath, docsSectionGroup, docsSectionHome, docsSectionIcon, docsSectionPanels, docsSidebarCollapses, docsSidebarGroup, docsSidebarGroups, docsSidebarSections, docsStartPage, docsTutorialNavigationCookie, docsUnindexedSearchSections, findDocsPage, isDocsPath, isDocsWorkspaceLayout, loadDocsPanels, normalizeDocsBase, normalizeDocsPath };
549
+ export { createDocsSearch, docsAppPath, docsCanonicalUrl, docsCatalog, docsHasRail, docsHomePath, docsIconStroke, docsIndexedPages, docsManifestPages, docsMarkdownLinks, docsMcpInstallLinks, docsPageIcon, docsPageIndexed, docsPanelGroupWindow, docsPanelOf, docsPanelPages, docsPanelSearchSections, docsPanelSidebarGroups, docsPanelWindow, docsRailEntries, docsRailEntry, docsRailGroups, docsRailIcon, docsRailTarget, docsRawFile, docsRawPath, docsRawSectionLinks, docsRawSectionLinksMarker, docsRelatedSections, docsSectionForPath, docsSectionGroup, docsSectionHome, docsSectionIcon, docsSectionPanels, docsSidebarCollapses, docsSidebarGroup, docsSidebarGroups, docsSidebarSections, docsStartPage, docsTutorialNavigationCookie, docsUnindexedSearchSections, findDocsPage, isDocsPath, isDocsWorkspaceLayout, loadDocsPanels, normalizeDocsBase, normalizeDocsPath };
@@ -1,6 +1,6 @@
1
- import "./steps-C3tGwhNK.js";
2
- import { h as DocsSectionFile, r as DocsPage } from "./types-B6YlHil4.js";
3
- import { i as DocsSourceInput, s as DocsLinkCheckOptions } from "./manifest-DJ2DyNue.js";
1
+ import "./steps-DzSu3r8K.js";
2
+ import { h as DocsSectionFile, r as DocsPage } from "./types-Dl6yjlwV.js";
3
+ import { i as DocsSourceInput, s as DocsLinkCheckOptions } from "./manifest-DmITPRKL.js";
4
4
  import { DocsGroup, DocsIcons, DocsLink } from "./navigation.js";
5
5
  import { ContentLlmsSection } from "@vite-hub/content";
6
6
  import { PublicRuntimeConfig } from "nuxt/schema";
@@ -162,6 +162,8 @@ interface DocsModuleOptions {
162
162
  /**
163
163
  * More text for `/llms.txt`. `details` goes under the site description, such as rules for agents. `sections` adds
164
164
  * sections of links, `[{ title, description?, links: [{ title, href, description? }] }]`, before the sections of pages.
165
+ * `report` tells agents to draft an issue for the user when something does not work as written. It is on when `github`
166
+ * is set and points at its issues. `{ url }` names another tracker, and `false` turns it off.
165
167
  */
166
168
  llms?: DocsLlmsOptions;
167
169
  /**
@@ -235,6 +237,9 @@ interface DocsModuleOptions {
235
237
  interface DocsLlmsOptions {
236
238
  details?: string;
237
239
  sections?: ContentLlmsSection[];
240
+ report?: {
241
+ url: string;
242
+ } | false;
238
243
  }
239
244
  /** The site mark: `mask` fills `src` with the text color, else `src` shows as it is, and `dark` in dark mode. */
240
245
  interface DocsLogo {
package/dist/nuxt.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as DocsPublicConfig, c as docsNuxtModule, d as DocsRunnableOptions, f as DocsCommentsOptions, i as DocsNuxtModule, l as DocsRunnableExample, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, t as DocsLlmsOptions, u as DocsRunnableLesson } from "./nuxt-CPt71DeE.js";
1
+ import { a as DocsPublicConfig, c as docsNuxtModule, d as DocsRunnableOptions, f as DocsCommentsOptions, i as DocsNuxtModule, l as DocsRunnableExample, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, t as DocsLlmsOptions, u as DocsRunnableLesson } from "./nuxt-B0kdfz6P.js";
2
2
  import { a as DocsThemeScope } from "./theme-CgJRnVdT.js";
3
3
  export { type DocsCommentsOptions, DocsLlmsOptions, DocsLogo, DocsModuleOptions, DocsNuxtModule, DocsPublicConfig, type DocsRunnableExample, type DocsRunnableLesson, type DocsRunnableOptions, DocsSiteOptions, DocsStartOptions, type DocsThemeScope, docsNuxtModule as default };
package/dist/nuxt.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { t as docsErrorDiagnostics } from "./error-diagnostics-Daz9oBJS.js";
2
2
  import { t as dependencyKey } from "./steps-muDP1nYT.js";
3
- import { a as docsAppManifestSource, c as resolveDocsSources, d as docsLinkExclusion, f as docsOutputFile, i as docsAppManifest, l as checkDocsLinks, n as createDocsContent, o as docsAppPanelSource, s as readDocsContent, t as contentName, u as docsLinkError } from "./manifest-Bti_WxDZ.js";
3
+ import { t as isRecord } from "./object-ycNFay7F.js";
4
+ import { a as docsAppManifestSource, c as resolveDocsSources, d as docsLinkExclusion, f as docsOutputFile, i as docsAppManifest, l as checkDocsLinks, n as createDocsContent, o as docsAppPanelSource, s as readDocsContent, t as contentName, u as docsLinkError } from "./manifest-E4mohC7O.js";
4
5
  import { docsAppPath, docsIndexedPages, docsManifestPages, docsPageIcon, docsPageIndexed, docsRailIcon, docsRawPath, docsSectionIcon, isDocsPath, isDocsWorkspaceLayout, normalizeDocsBase, normalizeDocsPath } from "./navigation.js";
5
6
  import { a as replacesDocsPage, o as routePaths, t as docsMount } from "./page-DWsretqk.js";
6
- import { r as docsContentSource } from "./agent-copy-CY9_RkHN.js";
7
+ import { a as docsReportUrl, i as docsReportDetails, r as docsContentSource } from "./agent-copy-DTCo8cLy.js";
7
8
  import { i as docsServerRoutes, n as docsRedirectProblems, r as docsRedirects, t as docsRedirectError } from "./redirects-BEFu4KLR.js";
8
- import { i as docsThemeScope, n as docsThemeAdditions, r as docsUi, t as docsAppConfigUi } from "./theme-DRktv19v.js";
9
+ import { i as docsThemeScope, n as docsThemeAdditions, r as docsUi, t as docsAppConfigUi } from "./theme-Bju84I9x.js";
9
10
  import { createRequire } from "node:module";
10
11
  import { addComponent, addComponentsDir, addImportsDir, addPlugin, addRouteMiddleware, addServerHandler, addTemplate, addTypeTemplate, createResolver, defineNuxtModule, extendPages, updateTemplates, useLogger } from "@nuxt/kit";
11
12
  import { addRoute, createRouter, findAllRoutes, routeToRegExp } from "rou3";
@@ -156,7 +157,7 @@ function findPackageDir(file) {
156
157
  function ownModule(importMetaUrl, modulePath) {
157
158
  return resolveRuntimeModule(findPackageDir(fileURLToPath(importMetaUrl)), modulePath);
158
159
  }
159
- // ../internal/dist/vite-D86Q14G4.js
160
+ // ../internal/dist/vite-DyksG6Kl.js
160
161
  const projectRootDirectoryMarkers = [
161
162
  ["server", "agents"],
162
163
  ["server", "channels"],
@@ -941,7 +942,6 @@ function runSnapshotWorker(args) {
941
942
  function tutorialLockfile(fixturesDir, fixture) {
942
943
  return resolve(fixturesDir, `${fixture}.package-lock.json`);
943
944
  }
944
- const isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
945
945
  const stringRecord = (value) => isRecord(value) ? Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[1] === "string")) : {};
946
946
  /** The fields of a `package.json` that a snapshot reads. Other values, and invalid JSON, read as empty. */
947
947
  function readManifest(source) {
@@ -1755,28 +1755,35 @@ const shadcnTokens = /* @__PURE__ */ new Set([
1755
1755
  /** The shared design system on docs pages inside an app, without changing the app's Tailwind font theme or primary. */
1756
1756
  function docsThemeCss(file) {
1757
1757
  const css = readTheme(file);
1758
+ css.walkAtRules("theme", (rule) => {
1759
+ rule.replaceWith(postcss.rule({
1760
+ selector: ":root",
1761
+ nodes: rule.nodes
1762
+ }));
1763
+ });
1758
1764
  css.walkRules((rule) => {
1765
+ rule.selectors = rule.selectors.map((selector) => /^(?:html|:root)\b/.test(selector) ? selector.replace(/^(html|:root)/, "$1:where(.vh-docs)") : `:where(.vh-docs) ${selector}`);
1766
+ const kitTokens = [];
1759
1767
  const values = /* @__PURE__ */ new Map();
1760
1768
  rule.each((node) => {
1761
1769
  if (node.type === "decl" && shadcnTokens.has(node.prop)) {
1762
1770
  values.set(node.prop, node.value);
1771
+ kitTokens.push(node);
1763
1772
  node.remove();
1764
1773
  }
1765
1774
  });
1766
1775
  rule.each((node) => {
1767
1776
  if (node.type === "decl") node.value = node.value.replace(/var\((--[\w-]+)\)/g, (match, name) => values.get(name) ?? match);
1768
1777
  });
1778
+ if (kitTokens.length) {
1779
+ const selector = rule.selectors.map((root) => `${root} :where(.vh-docs-workspace, .vh-example-live).ui-sdk`).join(", ");
1780
+ rule.before(postcss.rule({
1781
+ selector,
1782
+ nodes: kitTokens
1783
+ }));
1784
+ }
1769
1785
  });
1770
- css.walkAtRules("theme", (rule) => {
1771
- rule.replaceWith(postcss.rule({
1772
- selector: ":root",
1773
- nodes: rule.nodes
1774
- }));
1775
- });
1776
- css.walkRules((rule) => {
1777
- rule.selectors = rule.selectors.map((selector) => /^(?:html|:root)\b/.test(selector) ? selector.replace(/^(html|:root)/, "$1:where(.vh-docs)") : `:where(.vh-docs) ${selector}`);
1778
- });
1779
- css.walkDecls("--ui-primary", (declaration) => {
1786
+ css.walkDecls(/^--ui-(primary|error)$/, (declaration) => {
1780
1787
  declaration.remove();
1781
1788
  });
1782
1789
  return css.toString();
@@ -2154,10 +2161,17 @@ const docsNuxtModule = defineNuxtModule({
2154
2161
  const agentFile = addTemplate({
2155
2162
  filename: "docs/agent.mjs",
2156
2163
  write: true,
2157
- getContents: () => `export default ${JSON.stringify({ llms: {
2158
- ...options.llms?.details ? { details: options.llms.details } : {},
2159
- ...options.llms?.sections ? { sections: options.llms.sections } : {}
2160
- } })}\n`
2164
+ getContents: () => {
2165
+ const report = docsReportUrl(options);
2166
+ const details = [options.llms?.details?.trim(), report ? docsReportDetails(report) : void 0].filter(Boolean).join("\n\n");
2167
+ return `export default ${JSON.stringify({
2168
+ llms: {
2169
+ ...details ? { details } : {},
2170
+ ...options.llms?.sections ? { sections: options.llms.sections } : {}
2171
+ },
2172
+ report
2173
+ })}\n`;
2174
+ }
2161
2175
  }).dst;
2162
2176
  const manifestSource = () => `export default JSON.parse(${JSON.stringify(JSON.stringify(manifest))})\n`;
2163
2177
  const manifestFile = addTemplate({
@@ -2416,9 +2430,10 @@ const docsNuxtModule = defineNuxtModule({
2416
2430
  filename: "docs/docs.css",
2417
2431
  write: true,
2418
2432
  getContents: () => [
2419
- `@layer theme, base, comark, components, utilities;`,
2433
+ `@layer theme, base, kit, comark, components, utilities;`,
2420
2434
  ...importsNuxtUi(nuxt.options.css, nuxt.options.alias, docsCss.dst) ? [] : [`@import "${stylesheet("tailwindcss")}";`, `@import "${stylesheet("@nuxt/ui")}";`],
2421
2435
  `@import "${scopedTheme?.dst ?? sharedTheme}";`,
2436
+ `@import "${dependency("@vite-hub/kit/styles/default.scoped.css")}" layer(kit);`,
2422
2437
  `@import "${join(runtime, "theme/design.css")}";`,
2423
2438
  ""
2424
2439
  ].join("\n")
@@ -2508,6 +2523,10 @@ const docsNuxtModule = defineNuxtModule({
2508
2523
  src: join(runtime, "app/plugins/icon-stroke.ts"),
2509
2524
  mode: "all"
2510
2525
  });
2526
+ addPlugin({
2527
+ src: join(runtime, "app/plugins/vitehub-ui.ts"),
2528
+ mode: "all"
2529
+ });
2511
2530
  addRouteMiddleware({
2512
2531
  name: "docs-layout",
2513
2532
  path: join(runtime, "app/middleware/docs-layout.ts"),
@@ -2981,7 +3000,7 @@ function publicConfig(options, base, appBase) {
2981
3000
  * so it can load before or after it.
2982
3001
  */
2983
3002
  function comarkStylesheet() {
2984
- const layers = "@layer theme, base, comark, components, utilities;";
3003
+ const layers = "@layer theme, base, kit, comark, components, utilities;";
2985
3004
  const require = createRequire(import.meta.url);
2986
3005
  let ui;
2987
3006
  try {
@@ -0,0 +1,6 @@
1
+ // ../internal/dist/object.js
2
+ /** A non-null object that is not an array. Functions do not pass. */
3
+ function isRecord(value) {
4
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5
+ }
6
+ export { isRecord as t };
@@ -1,5 +1,5 @@
1
- import { t as DocsDocument } from "./markdown-B97RuMXs.js";
2
- import { n as DocsManifest, o as DocsSection, r as DocsPage } from "./types-B6YlHil4.js";
1
+ import { t as DocsDocument } from "./markdown-Ul8Z9B5A.js";
2
+ import { n as DocsManifest, o as DocsSection, r as DocsPage } from "./types-Dl6yjlwV.js";
3
3
  interface DocsPageLink {
4
4
  path: string;
5
5
  title: string;
@@ -1,6 +1,6 @@
1
1
  import { Component, PropType, SlotsType, VNode } from "vue";
2
2
  /** Name of an icon in the ViteHub set, such as `kv` for `i-vitehub-kv`. */
3
- type ViteHubIconName = "agent" | "auth" | "blob" | "browser" | "bundle" | "cache" | "channels" | "choices" | "cli" | "cms" | "codemods" | "comments" | "compare" | "connections" | "console" | "content" | "database" | "development" | "device" | "docs" | "email" | "env" | "forge" | "forms" | "gateways" | "guides" | "hosts" | "i18n" | "kv" | "logs" | "markdown-template" | "mcp" | "presets" | "queue" | "rate-limit" | "realtime" | "reference" | "runtime" | "sandbox" | "schedule" | "shell" | "skills" | "source" | "start" | "sync" | "ui" | "usage" | "web-container" | "webhooks" | "workflow" | "workspace";
3
+ type ViteHubIconName = "agent" | "auth" | "blob" | "browser" | "bundle" | "cache" | "channels" | "choices" | "cli" | "cms" | "codemods" | "comments" | "compare" | "connections" | "console" | "content" | "database" | "development" | "device" | "docs" | "email" | "env" | "forge" | "forms" | "gateways" | "guides" | "hosts" | "i18n" | "kv" | "logs" | "markdown-template" | "mcp" | "presets" | "queue" | "rate-limit" | "realtime" | "reference" | "runtime" | "sandbox" | "schedule" | "shell" | "site" | "skills" | "source" | "start" | "sync" | "ui" | "usage" | "web-container" | "webhooks" | "workflow" | "workspace";
4
4
  /** Name of an icon in the `@vite-hub/icons` set: one for each Server Primitive, Console area, and docs area. */
5
5
  type PrimitiveIconName = ViteHubIconName;
6
6
  export declare function isPrimitiveIconName(value: unknown): value is PrimitiveIconName;
@@ -4,7 +4,7 @@ const icons = {
4
4
  "prefix": "vitehub",
5
5
  "info": {
6
6
  "name": "ViteHub",
7
- "total": 51,
7
+ "total": 52,
8
8
  "author": {
9
9
  "name": "ViteHub",
10
10
  "url": "https://github.com/vite-hub/vitehub/tree/main/packages/icons"
@@ -60,6 +60,7 @@ const icons = {
60
60
  "sandbox": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3\"/><g data-motion=\"\"><rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1.5\"/></g></g>" },
61
61
  "schedule": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"5\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 10h18M8 3v4M16 3v4\"/><g data-motion=\"\"><rect x=\"7\" y=\"13.5\" width=\"3.5\" height=\"3.5\" rx=\"1\"/></g></g>" },
62
62
  "shell": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"m7 9.5 3 2.5-3 2.5\"/><g data-motion=\"\"><path d=\"M12.5 15h4.5\"/></g></g>" },
63
+ "site": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M11 5a8 8 0 1 0 8 8M3 13h16M11 5a12 12 0 0 0 0 16 12 12 0 0 0 0-16\"/><rect x=\"15.5\" y=\"6\" width=\"5.5\" height=\"4.5\" rx=\"1\"/><g data-motion=\"\"><path d=\"M17 6V4.75a1.25 1.25 0 0 1 2.5 0V6\"/></g></g>" },
63
64
  "skills": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 19V5a2 2 0 0 1 2-2h12v14H7a2 2 0 0 0 0 4h12\"/><g data-motion=\"\"><path d=\"M10 3v6.5l2-1.5 2 1.5V3\"/></g></g>" },
64
65
  "source": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 14v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5\"/><g data-motion=\"\"><path d=\"M12 3v11.5M8 10.5l4 4 4-4\"/></g></g>" },
65
66
  "start": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 21V3.5\"/><g data-motion=\"\"><path d=\"M5 4h13l-3 4.5 3 4.5H5\"/></g></g>" },
@@ -67,7 +68,7 @@ const icons = {
67
68
  "ui": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"3.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"13.5\" y=\"3.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><rect x=\"3.5\" y=\"13.5\" width=\"7\" height=\"7\" rx=\"1.5\"/><g data-motion=\"\"><rect x=\"13.5\" y=\"13.5\" width=\"7\" height=\"7\" rx=\"1.5\"/></g></g>" },
68
69
  "usage": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 20.5h18\"/><g data-motion=\"\"><rect x=\"5\" y=\"11\" width=\"3\" height=\"6\" rx=\"0.5\"/><rect x=\"10.5\" y=\"5\" width=\"3\" height=\"12\" rx=\"0.5\"/><rect x=\"16\" y=\"8\" width=\"3\" height=\"9\" rx=\"0.5\"/></g></g>" },
69
70
  "web-container": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><path d=\"M3 8.5h18\"/><g data-motion=\"\"><path d=\"m12 11 3.5 2v3.5L12 18.5l-3.5-2V13zM8.5 13l3.5 2 3.5-2M12 15v3.5\"/></g></g>" },
70
- "webhooks": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M11 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6\"/><g data-motion=\"\"><path d=\"M15 3h6v6M21 3l-9 9\"/></g></g>" },
71
+ "webhooks": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M17.4 16.48h-5.39c-.99 0-1.76.85-2.23 1.71A3.6 3.6 0 0 1 3 16.5c.01-.63.18-1.26.51-1.8\"/><path d=\"M6.6 16.5l2.82-5.2c.48-.87.09-1.96-.45-2.79a3.6 3.6 0 1 1 6.2-3.65\"/><g data-motion=\"\"><path d=\"M12 6.6l2.82 5.16C15.29 12.63 16.41 12.9 17.4 12.9a3.6 3.6 0 0 1 0 7.2\"/></g></g>" },
71
72
  "workflow": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3\" y=\"3\" width=\"6\" height=\"6\" rx=\"1.5\"/><rect x=\"3\" y=\"15\" width=\"6\" height=\"6\" rx=\"1.5\"/><path d=\"M9 6h2.5a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H9M12.5 12H15\"/><g data-motion=\"\"><rect x=\"15\" y=\"9\" width=\"6\" height=\"6\" rx=\"1.5\"/></g></g>" },
72
73
  "workspace": { "body": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/><g data-motion=\"\"><path d=\"M3 11h18\"/></g></g>" }
73
74
  },
@@ -667,6 +667,7 @@ const presentationDirectives = /* @__PURE__ */ new Set([
667
667
  "collapsible",
668
668
  "code-tree",
669
669
  "component-preview",
670
+ "copy-prompt",
670
671
  "correct",
671
672
  "example",
672
673
  "examples",
@@ -1,5 +1,5 @@
1
- import { a as DocsWorkspaceData, c as RunnableTutorialData, d as dependencyKey, f as restartsDevServer, i as DocsRenderFunction, l as RunnableTutorialStep, m as tutorialWorkspaceFiles, n as DocsPlaygroundData, o as DocsWorkspaceTab, p as tutorialStepFiles, r as DocsPlaygroundExampleData, s as PlaygroundTemplate, t as DocsLearnData, u as TutorialFiles } from "./steps-C3tGwhNK.js";
2
- import { t as DocsDocument } from "./markdown-B97RuMXs.js";
1
+ import { a as DocsWorkspaceData, c as RunnableTutorialData, d as dependencyKey, f as restartsDevServer, i as DocsRenderFunction, l as RunnableTutorialStep, m as tutorialWorkspaceFiles, n as DocsPlaygroundData, o as DocsWorkspaceTab, p as tutorialStepFiles, r as DocsPlaygroundExampleData, s as PlaygroundTemplate, t as DocsLearnData, u as TutorialFiles } from "./steps-DzSu3r8K.js";
2
+ import { t as DocsDocument } from "./markdown-Ul8Z9B5A.js";
3
3
  type DocsNode = DocsDocument["nodes"][number];
4
4
  /**
5
5
  * The nodes as a reader of one framework sees them: each `::tabs{sync="framework"}` block becomes the content of that
@@ -3,7 +3,7 @@ import { createReusableTemplate, useEventListener, usePreferredReducedMotion } f
3
3
  import { CopyButton } from "@vite-hub/ui"
4
4
  import { computed, nextTick, onScopeDispose, ref, useId, watch, watchEffect } from "vue"
5
5
 
6
- import { useAgent, useChat } from "vite-hub/agent/vue"
6
+ import { useChat } from "vite-hub/agent/vue"
7
7
 
8
8
  import { useCookie, useRoute } from "#imports"
9
9
 
@@ -18,7 +18,7 @@ const props = defineProps<{ agent: string }>()
18
18
  const { open, toggle } = useDocsAssistant()
19
19
  const { appBase } = useDocsConfig()
20
20
  const route = useRoute()
21
- const chat = useChat(useAgent(props.agent))
21
+ const chat = useChat({ name: props.agent })
22
22
  const draft = ref("")
23
23
  const problem = computed(() => chat.error.value ? docsAssistantProblem(chat.error.value, window.location.origin) : undefined)
24
24
  // The server reads the page path from the request body and adds it to the Agent instructions.
@@ -215,12 +215,16 @@ async function restart() {
215
215
  v-model="draft"
216
216
  class="shrink-0 border-t border-default p-2"
217
217
  placeholder="Ask a question"
218
- :attachments="false"
219
218
  :status="chat.status.value"
220
219
  @submit="submit"
221
220
  @stop="chat.stop()"
222
- @reload="chat.regenerate(requestBody())"
223
- />
221
+ @retry="chat.regenerate(requestBody())"
222
+ >
223
+ <PromptInputTextarea />
224
+ <PromptInputToolbar>
225
+ <PromptInputSubmit />
226
+ </PromptInputToolbar>
227
+ </PromptInput>
224
228
  </div>
225
229
  </DefineBody>
226
230
 
@@ -6,9 +6,7 @@ import { useDocsHeaderActionsTarget } from "../composables/headerActions"
6
6
  const route = useRoute()
7
7
  const { base, github, site, socials, start } = useDocsConfig()
8
8
  const docsHome = docsHomePath(useDocsManifest(), start)
9
- // Docs routes and the start links use the docs shell. There the brand opens the docs home, like a docs site logo,
10
- // and the menu shows the docs sidebar. Elsewhere the brand opens the home page.
11
- // The header is the same on every page: the brand, search in the middle, and the site's links and controls.
9
+ const brandLink = useDocsBrandLink()
12
10
  const shell = useDocsShell()
13
11
  const error = useError()
14
12
  const isDocsRoute = computed(() => shell.value && !error.value)
@@ -16,10 +14,8 @@ const menuOpen = ref(false)
16
14
  const wide = useMediaQuery("(min-width: 64rem)", { ssrWidth: 0 })
17
15
  const actionsTargetId = useDocsHeaderActionsTarget()
18
16
  const actionsTarget = computed(() => wide.value && actionsTargetId.value ? document.getElementById(actionsTargetId.value) : null)
19
- // Nuxt turns a `null` in runtime config into "", so only a number counts.
20
17
  const stars = github && typeof github.stars === "number" ? new Intl.NumberFormat("en", { notation: "compact" }).format(github.stars) : null
21
18
 
22
- // A site without docs pages has no "Docs" link. A start link that "Docs" already opens would repeat it.
23
19
  const navLinks = [
24
20
  ...docsHome ? [{ label: "Docs", to: docsHome }] : [],
25
21
  ...(start?.links ?? []).filter(link => link.to !== base && normalizeDocsPath(link.to) !== docsHome).map(link => ({ label: link.label, to: link.to })),
@@ -30,14 +26,12 @@ const mobileLinks = [
30
26
  ...navLinks,
31
27
  ]
32
28
 
33
- // The docs drawer already lists the docs pages.
34
29
  const docsMobileLinks = mobileLinks.filter(link => !isDocsPath(link.to, base))
35
30
 
36
31
  function isActiveLink(to: string) {
37
32
  return route.path === to || route.path.startsWith(`${to}/`)
38
33
  }
39
34
 
40
- // Touch screens get 44px header icon buttons. Below 360px they are 40px wide, so the brand and four buttons fit a 320px row.
41
35
  const touchIconButton = "pointer-coarse:size-11 max-[22.5rem]:pointer-coarse:w-10 pointer-coarse:justify-center"
42
36
  </script>
43
37
 
@@ -61,7 +55,7 @@ const touchIconButton = "pointer-coarse:size-11 max-[22.5rem]:pointer-coarse:w-1
61
55
  ignore-non-keyboard-focus
62
56
  :ui="{ content: 'h-auto max-w-64 whitespace-normal px-3 py-2 text-left leading-5' }"
63
57
  >
64
- <ULink :to="isDocsRoute && docsHome ? docsHome : '/'" class="vh-brand" :aria-label="site.badge ? `${site.name} ${site.badge.label}` : site.name">
58
+ <ULink v-bind="brandLink" class="vh-brand" :aria-label="site.badge ? `${site.name} ${site.badge.label}` : site.name">
65
59
  <DocsBrandMark class="vh-brand-mark" />
66
60
  <span class="vh-brand-name">
67
61
  <span>{{ site.name }}</span>
@@ -139,7 +133,7 @@ const touchIconButton = "pointer-coarse:size-11 max-[22.5rem]:pointer-coarse:w-1
139
133
  </template>
140
134
 
141
135
  <template #body>
142
- <div v-if="isDocsRoute" class="vh-docs-menu -mx-4 -my-2">
136
+ <div v-if="isDocsRoute" class="vh-docs-menu -mx-4 -my-2" data-motion-press="none">
143
137
  <nav class="flex shrink-0 flex-wrap items-center gap-1 border-b border-default px-2 py-1.5" aria-label="Site">
144
138
  <UButton
145
139
  v-for="link in docsMobileLinks"