@vite-hub/docs 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +5 -4
  2. package/dist/agent-copy-DTCo8cLy.js +48 -0
  3. package/dist/{content-C_WXjV3y.js → content-Chgcvz1q.js} +2 -2
  4. package/dist/index.d.ts +5 -5
  5. package/dist/{manifest-Bti_WxDZ.js → manifest-CQMreQZ5.js} +3 -3
  6. package/dist/{manifest-DJ2DyNue.d.ts → manifest-DmITPRKL.d.ts} +1 -1
  7. package/dist/{markdown-B97RuMXs.d.ts → markdown-Ul8Z9B5A.d.ts} +1 -1
  8. package/dist/navigation.d.ts +6 -1
  9. package/dist/navigation.js +21 -4
  10. package/dist/{nuxt-CYAIBEHE.d.ts → nuxt-B0kdfz6P.d.ts} +11 -3
  11. package/dist/nuxt.d.ts +1 -1
  12. package/dist/nuxt.js +41 -69
  13. package/dist/{page-B8_70-5D.d.ts → page-Cp7sifcg.d.ts} +2 -2
  14. package/dist/primitive-rail.d.ts +1 -1
  15. package/dist/primitive-rail.js +3 -2
  16. package/dist/{raw-CQukuLuj.js → raw-Dh38kL9g.js} +1 -0
  17. package/dist/runnable.d.ts +2 -2
  18. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +9 -5
  19. package/dist/runtime/app/components/AppHeader.vue +3 -9
  20. package/dist/runtime/app/components/AppSearch.vue +33 -10
  21. package/dist/runtime/app/components/DocsAsideLeftTop.vue +4 -10
  22. package/dist/runtime/app/components/DocsBuiltWith.vue +31 -0
  23. package/dist/runtime/app/components/DocsCatalogFooter.vue +4 -3
  24. package/dist/runtime/app/components/DocsLanding.vue +1 -3
  25. package/dist/runtime/app/components/DocsLearn.vue +9 -8
  26. package/dist/runtime/app/components/DocsLearnCodePre.vue +9 -20
  27. package/dist/runtime/app/components/DocsMarkdown.vue +17 -5
  28. package/dist/runtime/app/components/DocsPage.vue +26 -2
  29. package/dist/runtime/app/components/DocsPageHeaderLinks.vue +1 -3
  30. package/dist/runtime/app/components/DocsPlayground.vue +3 -3
  31. package/dist/runtime/app/components/DocsRail.vue +14 -30
  32. package/dist/runtime/app/components/DocsRailTooltip.vue +18 -0
  33. package/dist/runtime/app/components/DocsSidebarStrip.vue +3 -7
  34. package/dist/runtime/app/components/DocsSidebars.vue +2 -1
  35. package/dist/runtime/app/components/content/CopyPrompt.vue +72 -0
  36. package/dist/runtime/app/components/content/Example.vue +2 -1
  37. package/dist/runtime/app/composables/docs.ts +11 -24
  38. package/dist/runtime/app/layouts/docs.vue +7 -0
  39. package/dist/runtime/app/plugins/vitehub-ui.ts +22 -0
  40. package/dist/runtime/server/llms.js +1 -1
  41. package/dist/runtime/server/markdown.js +2 -2
  42. package/dist/runtime/server/mcp.js +1 -1
  43. package/dist/runtime/server/page.d.ts +1 -1
  44. package/dist/runtime/server/page.js +1 -1
  45. package/dist/runtime/server/raw.js +1 -1
  46. package/dist/runtime/server/search.d.ts +1 -1
  47. package/dist/runtime/server/search.js +3 -3
  48. package/dist/runtime/server/sitemap.js +1 -1
  49. package/dist/runtime/theme/design.css +15 -0
  50. package/dist/server.d.ts +3 -3
  51. package/dist/server.js +2 -2
  52. package/dist/{steps-C3tGwhNK.d.ts → steps-DzSu3r8K.d.ts} +1 -1
  53. package/dist/{theme-CxBzPBZ9.js → theme-DRktv19v.js} +1 -1
  54. package/dist/theme.js +1 -1
  55. package/dist/{types-B6YlHil4.d.ts → types-Dl6yjlwV.d.ts} +2 -0
  56. package/package.json +17 -14
  57. package/dist/agent-copy-CY9_RkHN.js +0 -32
package/README.md CHANGED
@@ -356,12 +356,13 @@ Most changes are options in `nuxt.config.ts`:
356
356
  | `start` | None | `{ section, links }`: the section that new readers open first, and site pages listed at its top. |
357
357
  | `socials` | `[]` | Community links at the foot of the docs sidebar and in the header of other pages, or in its menu on narrow screens. |
358
358
  | `footer` | `[]` | Site pages linked at the end of every docs page, such as About and Privacy. |
359
+ | `builtWith` | `true` | A "Built with ViteHub Docs" line at the end of every docs page. `false` removes it. |
359
360
  | `banner` | None | One line above every docs page. |
360
361
  | `github` | `false` | `{ repo, branch, dir }`. Adds a GitHub link beside the socials, with the star count when available. |
361
362
  | `icons` | Lucide fallbacks | Icon maps of the rail and the sidebar. |
362
363
  | `sitemap` | `[]` | More paths for `/sitemap.xml`. Every docs page is listed already. |
363
364
  | `mcp` | On | `{ name, guide }`, or `false` to turn off the MCP server. |
364
- | `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. |
365
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. |
366
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`. |
367
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). |
@@ -387,7 +388,7 @@ The shell is a set of Nuxt components. Create a component with the same name in
387
388
  | `DocsCatalogFooter` | The catalog at the end of an Overview. |
388
389
  | `DocsCodePanel`, `DocsCodePre` | The tutorial code panel and code blocks. |
389
390
 
390
- 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.
391
392
 
392
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.
393
394
 
@@ -483,7 +484,7 @@ Every page has a Markdown copy for coding agents. You get these routes with no s
483
484
 
484
485
  | Route | Content |
485
486
  | --- | --- |
486
- | `/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. |
487
488
  | `/llms.txt`, `/llms-full.txt` | An index of every page, and every page in one file without the section links. |
488
489
  | `/sitemap.md`, `/sitemap.xml` | Every page, for agents and for search engines. |
489
490
  | `/mcp` | An MCP server with the `list-pages` and `get-page` tools. |
@@ -498,7 +499,7 @@ Product landing components become plain Markdown, with the hero tagline, hosts,
498
499
 
499
500
  Every page gets its title, description, canonical link, Open Graph and Twitter tags, Schema.org (`WebSite`, `WebPage`, `TechArticle`, and a breadcrumb), and a share image, from its frontmatter and the `site` options. [Nuxt SEO](https://nuxtseo.com) does the work: `nuxt-site-config` takes `site`, `nuxt-schema-org` writes the graph, and `nuxt-og-image` renders each image while the build prerenders, so the server carries no renderer and a Worker stays small. The default image shows the site, the section, the page title, and the description. A page sets `seo.image` to share a file of its own. For another design, add `components/OgImage/Docs.takumi.vue` with the props `title`, `description`, `site`, `section`, `logo`, and `host`, and set `ogImage: { component: "Docs" }`. An app page, such as a playground, calls `useDocsSeo({ title, description })` to get the same tags and image.
500
501
 
501
- Search indexes every page by heading. `⌘K` opens it. Page titles rank first, then headings, then text, and a typo still finds the page. The index loads the first time the dialog opens, from `/api/_docs/search.json`. `::agent-only` content is not indexed.
502
+ Search indexes every page by heading. `⌘K` opens it. Page titles rank first, then headings, then text, and a typo still finds the page. A production page loads the index from `/api/_docs/search.json` once it is idle, so the dialog has results at the first key press. With Save-Data on, and in development, the index loads when the dialog first opens. `::agent-only` content is not indexed.
502
503
 
503
504
  ## Comments
504
505
 
@@ -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);
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-CYAIBEHE.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
  /**
@@ -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 { 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,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";
@@ -137,6 +137,8 @@ interface DocsModuleOptions {
137
137
  socials?: DocsLink[];
138
138
  /** Site pages linked at the end of every docs page, such as About and Privacy, so each one has a link to it. */
139
139
  footer?: DocsLink[];
140
+ /** A "Built with ViteHub Docs" line at the end of every docs page. `false` removes it. */
141
+ builtWith?: boolean;
140
142
  /** One line above every docs page, such as a release status. */
141
143
  banner?: string;
142
144
  /** More paths for `/sitemap.xml`, such as app pages outside the content folder. Every docs page is listed already. */
@@ -160,6 +162,8 @@ interface DocsModuleOptions {
160
162
  /**
161
163
  * More text for `/llms.txt`. `details` goes under the site description, such as rules for agents. `sections` adds
162
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.
163
167
  */
164
168
  llms?: DocsLlmsOptions;
165
169
  /**
@@ -233,6 +237,9 @@ interface DocsModuleOptions {
233
237
  interface DocsLlmsOptions {
234
238
  details?: string;
235
239
  sections?: ContentLlmsSection[];
240
+ report?: {
241
+ url: string;
242
+ } | false;
236
243
  }
237
244
  /** The site mark: `mask` fills `src` with the text color, else `src` shows as it is, and `dark` in dark mode. */
238
245
  interface DocsLogo {
@@ -264,6 +271,7 @@ interface DocsPublicConfig {
264
271
  };
265
272
  socials: DocsLink[];
266
273
  footer: DocsLink[];
274
+ builtWith: boolean;
267
275
  banner: string | null;
268
276
  sitemap: string[];
269
277
  /** `stars` is the repository's star count when the build could read it, else `null`. */
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-CYAIBEHE.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,11 @@
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 { 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-CQMreQZ5.js";
4
4
  import { docsAppPath, docsIndexedPages, docsManifestPages, docsPageIcon, docsPageIndexed, docsRailIcon, docsRawPath, docsSectionIcon, isDocsPath, isDocsWorkspaceLayout, normalizeDocsBase, normalizeDocsPath } from "./navigation.js";
5
5
  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";
6
+ import { a as docsReportUrl, i as docsReportDetails, r as docsContentSource } from "./agent-copy-DTCo8cLy.js";
7
7
  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-CxBzPBZ9.js";
8
+ import { i as docsThemeScope, n as docsThemeAdditions, r as docsUi, t as docsAppConfigUi } from "./theme-DRktv19v.js";
9
9
  import { createRequire } from "node:module";
10
10
  import { addComponent, addComponentsDir, addImportsDir, addPlugin, addRouteMiddleware, addServerHandler, addTemplate, addTypeTemplate, createResolver, defineNuxtModule, extendPages, updateTemplates, useLogger } from "@nuxt/kit";
11
11
  import { addRoute, createRouter, findAllRoutes, routeToRegExp } from "rou3";
@@ -13,7 +13,7 @@ import { defineDiagnostics, formatDiagnostic } from "nostics";
13
13
  import { createHash } from "node:crypto";
14
14
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
15
15
  import { copyFile, glob, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
16
- import { fileURLToPath, pathToFileURL } from "node:url";
16
+ import { fileURLToPath } from "node:url";
17
17
  import { basename, dirname, isAbsolute, join, matchesGlob, parse, posix, relative, resolve, sep } from "node:path";
18
18
  import { tmpdir } from "node:os";
19
19
  import { findContentEntry } from "@vite-hub/source/vite";
@@ -156,7 +156,7 @@ function findPackageDir(file) {
156
156
  function ownModule(importMetaUrl, modulePath) {
157
157
  return resolveRuntimeModule(findPackageDir(fileURLToPath(importMetaUrl)), modulePath);
158
158
  }
159
- // ../internal/dist/vite-D86Q14G4.js
159
+ // ../internal/dist/vite-Wl85zthG.js
160
160
  const projectRootDirectoryMarkers = [
161
161
  ["server", "agents"],
162
162
  ["server", "channels"],
@@ -358,44 +358,6 @@ function setupDocsAssistant(nuxt, config) {
358
358
  if (!(await viteHubModuleOptions(nuxt))?.agent) throw docsErrorDiagnostics.DOCS_ASSISTANT_AGENTS_MISSING({ agent: assistant.agent });
359
359
  });
360
360
  }
361
- // src/comark-blocks.ts
362
- /**
363
- * The source of a module whose default export is comark-ui's block components by tag, each one loaded on first use.
364
- * `comark-ui/vue` imports every block package, so a page that rendered with it downloaded all of them. Each tag imports
365
- * the package that defines its component. The tags that comark-ui defines itself, such as the Mermaid wrapper, import
366
- * `comark-ui/vue`. comark-ui 0.12.2 has `comark-ui/vue/lazy` (https://github.com/onmax/comark-ui/pull/434), but its block
367
- * packages change the spacing of callouts, so the switch waits for that decision.
368
- */
369
- async function comarkBlocksSource() {
370
- let ui;
371
- try {
372
- ui = createRequire(import.meta.url).resolve("comark-ui/package.json");
373
- } catch {
374
- return "export default {}\n";
375
- }
376
- const fromUi = createRequire(ui);
377
- const uiVue = fromUi.resolve("comark-ui/vue");
378
- const uiModule = await import(pathToFileURL(uiVue).href);
379
- const components = uiModule.components ?? uiModule.default().components;
380
- const files = /* @__PURE__ */ new Map();
381
- const dependencies = Object.keys(JSON.parse(readFileSync(ui, "utf8")).dependencies ?? {});
382
- for (const name of dependencies.filter((name) => name.startsWith("comark-"))) {
383
- let file;
384
- try {
385
- file = fromUi.resolve(`${name}/vue`);
386
- } catch {
387
- continue;
388
- }
389
- const plugin = await import(pathToFileURL(file).href);
390
- for (const component of Object.values(plugin.components ?? {})) files.set(component, file);
391
- }
392
- return `import { defineAsyncComponent } from "vue"\nexport default {\n${Object.entries(components).map(([tag, component]) => {
393
- const owner = files.get(component);
394
- const file = JSON.stringify(owner ?? uiVue);
395
- const map = owner ? "module.components" : "(module.components ?? module.default().components)";
396
- return ` ${JSON.stringify(tag)}: defineAsyncComponent(() => import(${file}).then(module => ${map}[${JSON.stringify(tag)}])),`;
397
- }).join("\n")}\n}\n`;
398
- }
399
361
  // src/comments-nuxt.ts
400
362
  /** Whether the app can import `name`, as `vite-hub` resolves its optional peers. */
401
363
  function installed(name, rootDir) {
@@ -1793,28 +1755,35 @@ const shadcnTokens = /* @__PURE__ */ new Set([
1793
1755
  /** The shared design system on docs pages inside an app, without changing the app's Tailwind font theme or primary. */
1794
1756
  function docsThemeCss(file) {
1795
1757
  const css = readTheme(file);
1758
+ css.walkAtRules("theme", (rule) => {
1759
+ rule.replaceWith(postcss.rule({
1760
+ selector: ":root",
1761
+ nodes: rule.nodes
1762
+ }));
1763
+ });
1796
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 = [];
1797
1767
  const values = /* @__PURE__ */ new Map();
1798
1768
  rule.each((node) => {
1799
1769
  if (node.type === "decl" && shadcnTokens.has(node.prop)) {
1800
1770
  values.set(node.prop, node.value);
1771
+ kitTokens.push(node);
1801
1772
  node.remove();
1802
1773
  }
1803
1774
  });
1804
1775
  rule.each((node) => {
1805
1776
  if (node.type === "decl") node.value = node.value.replace(/var\((--[\w-]+)\)/g, (match, name) => values.get(name) ?? match);
1806
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
+ }
1807
1785
  });
1808
- css.walkAtRules("theme", (rule) => {
1809
- rule.replaceWith(postcss.rule({
1810
- selector: ":root",
1811
- nodes: rule.nodes
1812
- }));
1813
- });
1814
- css.walkRules((rule) => {
1815
- rule.selectors = rule.selectors.map((selector) => /^(?:html|:root)\b/.test(selector) ? selector.replace(/^(html|:root)/, "$1:where(.vh-docs)") : `:where(.vh-docs) ${selector}`);
1816
- });
1817
- css.walkDecls("--ui-primary", (declaration) => {
1786
+ css.walkDecls(/^--ui-(primary|error)$/, (declaration) => {
1818
1787
  declaration.remove();
1819
1788
  });
1820
1789
  return css.toString();
@@ -2192,10 +2161,17 @@ const docsNuxtModule = defineNuxtModule({
2192
2161
  const agentFile = addTemplate({
2193
2162
  filename: "docs/agent.mjs",
2194
2163
  write: true,
2195
- getContents: () => `export default ${JSON.stringify({ llms: {
2196
- ...options.llms?.details ? { details: options.llms.details } : {},
2197
- ...options.llms?.sections ? { sections: options.llms.sections } : {}
2198
- } })}\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
+ }
2199
2175
  }).dst;
2200
2176
  const manifestSource = () => `export default JSON.parse(${JSON.stringify(JSON.stringify(manifest))})\n`;
2201
2177
  const manifestFile = addTemplate({
@@ -2283,16 +2259,6 @@ const docsNuxtModule = defineNuxtModule({
2283
2259
  write: true,
2284
2260
  getContents: () => `import type { Component } from "vue"\ndeclare const components: Record<string, Component>\nexport default components\n`
2285
2261
  });
2286
- nuxt.options.alias["#docs/blocks"] = addTemplate({
2287
- filename: "docs/blocks.mjs",
2288
- write: true,
2289
- getContents: () => comarkBlocksSource()
2290
- }).dst;
2291
- addTemplate({
2292
- filename: "docs/blocks.d.mts",
2293
- write: true,
2294
- getContents: () => `import type { Component } from "vue"\ndeclare const blocks: Record<string, Component>\nexport default blocks\n`
2295
- });
2296
2262
  addTypeTemplate({
2297
2263
  filename: "types/docs-page-meta.d.ts",
2298
2264
  getContents: () => `declare module "#app" {\n interface PageMeta {\n /** \`false\` hides the docs sidebar. \`"collapsed"\` shows a narrow strip with a button that opens it. */\n sidebar?: boolean | "collapsed"\n }\n}\nexport {}\n`
@@ -2464,9 +2430,10 @@ const docsNuxtModule = defineNuxtModule({
2464
2430
  filename: "docs/docs.css",
2465
2431
  write: true,
2466
2432
  getContents: () => [
2467
- `@layer theme, base, comark, components, utilities;`,
2433
+ `@layer theme, base, kit, comark, components, utilities;`,
2468
2434
  ...importsNuxtUi(nuxt.options.css, nuxt.options.alias, docsCss.dst) ? [] : [`@import "${stylesheet("tailwindcss")}";`, `@import "${stylesheet("@nuxt/ui")}";`],
2469
2435
  `@import "${scopedTheme?.dst ?? sharedTheme}";`,
2436
+ `@import "${dependency("@vite-hub/kit/styles/default.scoped.css")}" layer(kit);`,
2470
2437
  `@import "${join(runtime, "theme/design.css")}";`,
2471
2438
  ""
2472
2439
  ].join("\n")
@@ -2556,6 +2523,10 @@ const docsNuxtModule = defineNuxtModule({
2556
2523
  src: join(runtime, "app/plugins/icon-stroke.ts"),
2557
2524
  mode: "all"
2558
2525
  });
2526
+ addPlugin({
2527
+ src: join(runtime, "app/plugins/vitehub-ui.ts"),
2528
+ mode: "all"
2529
+ });
2559
2530
  addRouteMiddleware({
2560
2531
  name: "docs-layout",
2561
2532
  path: join(runtime, "app/middleware/docs-layout.ts"),
@@ -2990,6 +2961,7 @@ function publicConfig(options, base, appBase) {
2990
2961
  } : void 0,
2991
2962
  socials: options.socials ?? [],
2992
2963
  footer: options.footer ?? [],
2964
+ builtWith: options.builtWith !== false,
2993
2965
  banner: options.banner ?? null,
2994
2966
  sitemap: options.sitemap ?? [],
2995
2967
  github: options.github ? {
@@ -3028,7 +3000,7 @@ function publicConfig(options, base, appBase) {
3028
3000
  * so it can load before or after it.
3029
3001
  */
3030
3002
  function comarkStylesheet() {
3031
- const layers = "@layer theme, base, comark, components, utilities;";
3003
+ const layers = "@layer theme, base, kit, comark, components, utilities;";
3032
3004
  const require = createRequire(import.meta.url);
3033
3005
  let ui;
3034
3006
  try {
@@ -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