@polyxd/mcp 0.4.1 → 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/NOTICE +3 -1
- package/README.md +3 -6
- 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 +6 -4
- package/package.json +5 -5
package/NOTICE
CHANGED
|
@@ -2,7 +2,9 @@ Polyxd
|
|
|
2
2
|
Copyright 2026 the Polyxd authors
|
|
3
3
|
|
|
4
4
|
This product includes software developed at Polyxd, licensed under the Apache
|
|
5
|
-
License, Version 2.0 (see LICENSE)
|
|
5
|
+
License, Version 2.0 (see LICENSE), except Polyxd Studio (apps/studio), which is
|
|
6
|
+
licensed under the Functional Source License, Version 1.1, ALv2 Future License
|
|
7
|
+
(see apps/studio/LICENSE).
|
|
6
8
|
|
|
7
9
|
It also includes material from the projects below. Each is used under its own
|
|
8
10
|
licence, and each licence is included in full beside the material it covers.
|
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
|
|
|
@@ -132,13 +133,9 @@ mcp-publisher publish # from packages/mcp
|
|
|
132
133
|
|
|
133
134
|
This needs OpenSSL 3 (macOS's LibreSSL has no Ed25519). Keep `key.pem` private and out of the repository. The TXT record goes on the apex, `polyxd.com`. HTTP proof works instead: serve the same `v=MCPv1; k=ed25519; p=...` line at `https://polyxd.com/.well-known/mcp-registry-auth` and use `mcp-publisher login http`. It has to be `polyxd.com`, not `mcp.polyxd.com`, whose proof would only cover names under `com.polyxd.mcp`.
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
The release workflow publishes `server.json` to the registry on each version tag, once npm has the version, signing in with the private key in the `MCP_REGISTRY_KEY` Actions secret (the hex string the `--private-key` command above prints). Without the secret, or when the registry already has the version, the step is skipped with a notice.
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
"packages": [{ "registryType": "npm", "identifier": "@polyxd/mcp", "version": "0.3.0", "transport": { "type": "stdio" } }]
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Keep `version` in `server.json` in step with `package.json`; a test checks it.
|
|
138
|
+
`server.json` lists both the hosted server (`remotes`) and the npm package (`packages`), so hosts can offer either. The registry checks the package's `mcpName` in `package.json`. Keep both `version` fields in `server.json` in step with `package.json`; a test checks it.
|
|
142
139
|
|
|
143
140
|
## Build and test
|
|
144
141
|
|
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[];
|