@polyxd/mcp 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/docs.d.ts +32 -0
- package/dist/docs.generated.d.ts +13 -0
- package/dist/docs.generated.js +219 -0
- package/dist/docs.generated.js.map +1 -0
- package/dist/docs.js +102 -0
- package/dist/docs.js.map +1 -0
- package/dist/output-schemas.d.ts +93 -0
- package/dist/output-schemas.js +48 -0
- package/dist/output-schemas.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +33 -3
- package/dist/server.js.map +1 -1
- package/dist/view.html +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ From a clone of this repository: `npm install && npm run build -w @polyxd/mcp`,
|
|
|
50
50
|
| `polyxd_show` | Validates, then returns the document for display. `pack` picks the design-system pack (default `material3`), `mode` picks light or dark (default: the host's theme). Shows nothing when there are errors. | `{ shown: true, document, pack, packName, mode?, specVersion }`, or `{ shown: false, issues }` with `isError` |
|
|
51
51
|
| `polyxd_packs` | The packs: published design systems and original templates. | `{ default, packs[{ name, displayName, template, package, description }] }` |
|
|
52
52
|
| `polyxd_components` | The components with a one-line summary each, or one component's full definition by `name`. | `{ components[{ name, category, summary, shell }] }`, or `{ component }` with the full definition |
|
|
53
|
+
| `polyxd_docs` | Searches the polyxd.com docs bundled into this version: the sections that best match `query`, one whole `page`, or the list of pages. | `{ sections[{ page, title, heading, url, text }] }`, `{ page }` or `{ pages[] }` |
|
|
53
54
|
|
|
54
55
|
Every tool is read-only. `data` can be passed to `polyxd_validate`, `polyxd_verify` and `polyxd_show` separately from the document; it replaces the document's own `data`.
|
|
55
56
|
|
package/dist/docs.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* polyxd_docs: the polyxd.com docs, bundled into the package (scripts/sync.ts writes
|
|
3
|
+
* docs.generated.ts), so answers match the released version and work offline.
|
|
4
|
+
*
|
|
5
|
+
* Search is plain keyword scoring over the docs' sections (each "## " heading and what follows),
|
|
6
|
+
* with a section's heading and its page's title counting more than its body. Small and
|
|
7
|
+
* predictable; the docs are a couple of hundred sections.
|
|
8
|
+
*/
|
|
9
|
+
import { DOCS, type DocPage } from "./docs.generated.ts";
|
|
10
|
+
export { DOCS, type DocPage };
|
|
11
|
+
export interface DocSection {
|
|
12
|
+
page: string;
|
|
13
|
+
title: string;
|
|
14
|
+
heading: string;
|
|
15
|
+
url: string;
|
|
16
|
+
text: string;
|
|
17
|
+
}
|
|
18
|
+
/** How much a search answer may carry, so one call stays a reasonable part of a context window. */
|
|
19
|
+
export declare const SEARCH_LIMIT_CHARS = 12000;
|
|
20
|
+
export declare const PAGE_LIMIT_CHARS = 40000;
|
|
21
|
+
/**
|
|
22
|
+
* A heading's anchor on polyxd.com. The site slugifies the heading as marked renders it
|
|
23
|
+
* (apps/site/scripts/build.ts), so this renders the inline Markdown the same way first: links to
|
|
24
|
+
* their text, code and emphasis marks dropped, and marked's escapes (an apostrophe is ').
|
|
25
|
+
*/
|
|
26
|
+
export declare const anchorFor: (heading: string) => string;
|
|
27
|
+
/** Every section of every page. A page's text before its first "## " is a section headed by the page's title. */
|
|
28
|
+
export declare function sections(): DocSection[];
|
|
29
|
+
/** The sections that best match the question, best first, within {@link SEARCH_LIMIT_CHARS}. */
|
|
30
|
+
export declare function searchDocs(query: string, limit?: number): DocSection[];
|
|
31
|
+
/** A page by its slug, title or URL: "quickstart", "Quickstart", "https://polyxd.com/docs/quickstart/". */
|
|
32
|
+
export declare function docPage(name: string): DocPage | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface DocPage {
|
|
2
|
+
/** The page's path under /docs/: "" for the docs home, "quickstart", … */
|
|
3
|
+
slug: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
section: string;
|
|
7
|
+
order: number;
|
|
8
|
+
/** The page on polyxd.com. */
|
|
9
|
+
url: string;
|
|
10
|
+
/** The page's Markdown, without its title, with site links made absolute. */
|
|
11
|
+
markdown: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DOCS: DocPage[];
|