@sebgroup/green-core 2.21.0-rc.20260113143213999 → 2.21.0-rc.20260113151650310

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.
@@ -4,12 +4,12 @@ import {
4
4
  ReadResourceRequestSchema
5
5
  } from "@modelcontextprotocol/sdk/types.js";
6
6
  import {
7
+ buildResourceUri,
7
8
  loadComponentsIndex,
8
- loadIconsIndex,
9
9
  loadGlobalIndex,
10
- readMcpFile,
11
- buildResourceUri,
12
- parseResourceUri
10
+ loadIconsIndex,
11
+ parseResourceUri,
12
+ readMcpFile
13
13
  } from "./utils.js";
14
14
  function setupResourceHandlers(server) {
15
15
  server.setRequestHandler(ListResourcesRequestSchema, async () => {
@@ -222,8 +222,10 @@ async function handleSearchComponents(input) {
222
222
  const matches2 = regexPattern.test(tagName) || regexPattern.test(name) || regexPattern.test(className) || regexPattern.test(description);
223
223
  if (matches2) {
224
224
  if (regexPattern.test(tagName)) {
225
- if (tagName === query.toLowerCase()) return { matches: true, tier: 1, matchedTerms: 1 };
226
- if (tagName.startsWith(query.toLowerCase())) return { matches: true, tier: 2, matchedTerms: 1 };
225
+ if (tagName === query.toLowerCase())
226
+ return { matches: true, tier: 1, matchedTerms: 1 };
227
+ if (tagName.startsWith(query.toLowerCase()))
228
+ return { matches: true, tier: 2, matchedTerms: 1 };
227
229
  return { matches: true, tier: 3, matchedTerms: 1 };
228
230
  }
229
231
  return { matches: true, tier: 4, matchedTerms: 1 };
@@ -293,7 +295,11 @@ async function handleSearchComponents(input) {
293
295
  const shortName = icon.tagName.replace(/^gds-/, "");
294
296
  const resourceUris = {};
295
297
  for (const docType of icon.files) {
296
- resourceUris[docType] = buildResourceUri("icons", shortName, docType);
298
+ resourceUris[docType] = buildResourceUri(
299
+ "icons",
300
+ shortName,
301
+ docType
302
+ );
297
303
  }
298
304
  results.push({
299
305
  name: icon.name,
@@ -395,6 +401,22 @@ async function handleGetComponentDocs(input) {
395
401
  sections.push("");
396
402
  }
397
403
  }
404
+ if ((framework === "angular" || framework === "react") && found.files.includes("api")) {
405
+ const apiContent = await readMcpFile(`${shortName}/api.md`);
406
+ if (apiContent) {
407
+ sections.push("---");
408
+ sections.push("");
409
+ sections.push("## Component API Reference");
410
+ sections.push("");
411
+ sections.push(
412
+ "The following properties, events, slots, and methods are available:"
413
+ );
414
+ sections.push("");
415
+ const apiWithoutHeader = apiContent.replace(/^#\s+.*?\n/, "").replace(/\*\*Class\*\*:.*?\n/, "").replace(/\*\*Tag\*\*:.*?\n/, "").trim();
416
+ sections.push(apiWithoutHeader);
417
+ sections.push("");
418
+ }
419
+ }
398
420
  if (includeGuidelines && found.files.includes("guidelines")) {
399
421
  const guidelines = await readMcpFile(`${shortName}/guidelines.md`);
400
422
  if (guidelines) {