@jsswift/knowledge-mcp 0.1.2 → 0.1.4

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 (2) hide show
  1. package/dist/server.mjs +10 -2
  2. package/package.json +1 -1
package/dist/server.mjs CHANGED
@@ -85,7 +85,15 @@ async function loadKnowledge(root = defaultRoot) {
85
85
  }
86
86
  }
87
87
  }
88
- const files = (await readdir(path.join(docsRoot, "components"))).filter((name) => name.endsWith(".md") && name !== "README.md");
88
+ const aliases = map.documentAliases ?? {};
89
+ for (const [alias, target] of Object.entries(aliases)) {
90
+ if (!alias.endsWith(".md") || !map.components.some((component) => component.path === target)) {
91
+ throw new Error("Invalid documentation alias");
92
+ }
93
+ await safePath(alias);
94
+ await safePath(target);
95
+ }
96
+ const files = (await readdir(path.join(docsRoot, "components"))).filter((name) => name.endsWith(".md") && name !== "README.md" && !Object.hasOwn(aliases, `components/${name}`));
89
97
  const indexed = new Set(map.components.map((component) => component.path));
90
98
  if (files.length !== indexed.size || files.some((name) => !indexed.has(`components/${name}`))) {
91
99
  throw new Error("Component map coverage mismatch; run npm run knowledge:refresh");
@@ -154,7 +162,7 @@ var options = parseArgs(process.argv.slice(2));
154
162
  var context = options.docs ? { project: options.project, version: "development", docsRoot: options.docs } : await resolveProject(options.project);
155
163
  var knowledge = await loadKnowledge(context.docsRoot);
156
164
  var server = new McpServer({ name: "jsswift-knowledge", version: "0.1.2" }, {
157
- instructions: `Serving JSswift ${context.version} from project ${context.project}. Prefer _.Button for buttons. Use _.Component and _.signal, _.effect, _.computed, _.untracked, _.batch. Start with guide:AI for a basic page and its supported examples. Search and read component contracts only for additional APIs; read guide:ui/common-props once when styling. JSswift includes component CSS; read application-rules and prefer documented styling props and theme variables before custom overrides. Fonts and the Tabler catalog are optional; read getting-started for imports. This server covers application development only.`
165
+ instructions: `Serving JSswift ${context.version} from project ${context.project}. Prefer _.Button for buttons. Use _.Component; prefer _.rod for bidirectional field models and _.useForm for structured forms. Signals remain supported for getter/setter state. Start with guide:AI for a basic page and its supported examples. Search and read component contracts only for additional APIs; read guide:ui/common-props once when styling. JSswift includes component CSS; read application-rules and prefer documented styling props and theme variables before custom overrides. Fonts and the Tabler catalog are optional; read getting-started for imports. This server covers application development only.`
158
166
  });
159
167
  var annotations = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
160
168
  var jsonResult = (value) => ({ content: [{ type: "text", text: JSON.stringify(value) }], structuredContent: value });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsswift/knowledge-mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Read-only MCP for the installed JSswift version's documentation",
5
5
  "type": "module",
6
6
  "engines": {