@wix/mcp 1.0.25 → 1.0.26

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 (44) hide show
  1. package/build/bin-standalone.js +54 -11
  2. package/build/bin-standalone.js.map +3 -3
  3. package/build/cjs/index.cjs +298 -180
  4. package/build/cjs/index.cjs.map +4 -4
  5. package/build/dts/docs/docs.d.ts.map +1 -1
  6. package/build/dts/docs/docs.js +4 -2
  7. package/build/dts/docs/docs.js.map +1 -1
  8. package/build/dts/docs/normalize-menu-content.d.ts +13 -0
  9. package/build/dts/docs/normalize-menu-content.d.ts.map +1 -0
  10. package/build/dts/docs/normalize-menu-content.js +40 -0
  11. package/build/dts/docs/normalize-menu-content.js.map +1 -0
  12. package/build/dts/docs/semanticSearch.d.ts.map +1 -1
  13. package/build/dts/docs/semanticSearch.js +13 -10
  14. package/build/dts/docs/semanticSearch.js.map +1 -1
  15. package/build/dts/docs/semanticSearch.test.js +3 -2
  16. package/build/dts/docs/semanticSearch.test.js.map +1 -1
  17. package/build/dts/index.d.ts +1 -1
  18. package/build/dts/index.d.ts.map +1 -1
  19. package/build/dts/index.js.map +1 -1
  20. package/build/dts/site-widget-tools/index.d.ts +2 -2
  21. package/build/dts/site-widget-tools/index.d.ts.map +1 -1
  22. package/build/dts/site-widget-tools/index.js.map +1 -1
  23. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts +10 -1
  24. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +1 -1
  25. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js +22 -8
  26. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +1 -1
  27. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +10 -1
  28. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -1
  29. package/build/dts/site-widget-tools/site-builder-tool/index.js +25 -5
  30. package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -1
  31. package/build/dts/wixel/api.d.ts +10 -2
  32. package/build/dts/wixel/api.d.ts.map +1 -1
  33. package/build/dts/wixel/api.js +16 -5
  34. package/build/dts/wixel/api.js.map +1 -1
  35. package/build/dts/wixel/index.d.ts.map +1 -1
  36. package/build/dts/wixel/index.js +15 -4
  37. package/build/dts/wixel/index.js.map +1 -1
  38. package/build/dts/wixel/utils.d.ts +2 -0
  39. package/build/dts/wixel/utils.d.ts.map +1 -0
  40. package/build/dts/wixel/utils.js +5 -0
  41. package/build/dts/wixel/utils.js.map +1 -0
  42. package/build/esm/index.js +145 -46
  43. package/build/esm/index.js.map +4 -4
  44. package/package.json +2 -2
@@ -10309,23 +10309,32 @@ var runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank = f
10309
10309
  const url = new URL(
10310
10310
  `https://www.wixapis.com/mcp-docs-search/v1/search?maxResults=${maxResults}&rerank=${rerank}`
10311
10311
  );
10312
+ const kbNames = [];
10312
10313
  if (toolName === "SDK") {
10313
- url.searchParams.append("kbName", "SDK_SCHEMAS_KB_ID");
10314
- url.searchParams.append("kbName", "SDK_DOCS_KB_ID");
10314
+ kbNames.push(
10315
+ "API_REFERENCE_SDK_KB_ID",
10316
+ "FRONTEND_SDK_AND_EXTENSIONS_KB_ID",
10317
+ "REST_DOCS_KB_ID"
10318
+ );
10315
10319
  } else if (toolName === "REST" || toolName === "BUSINESS_SOLUTIONS") {
10316
10320
  if (toolName === "REST") {
10317
- url.searchParams.append("kbName", "REST_METHODS_KB_ID");
10321
+ kbNames.push("REST_METHODS_KB_ID");
10318
10322
  }
10319
- url.searchParams.append("kbName", "REST_DOCS_KB_ID");
10323
+ kbNames.push("REST_DOCS_KB_ID");
10320
10324
  } else if (toolName === "WDS") {
10321
- url.searchParams.append("kbName", "WDS_DOCS_KB_ID");
10325
+ kbNames.push("WDS_DOCS_KB_ID");
10322
10326
  } else if (toolName === "BUILD_APPS") {
10323
- url.searchParams.append("kbName", "BUILD_APPS_KB_ID");
10327
+ kbNames.push("BUILD_APPS_KB_ID");
10324
10328
  } else if (toolName === "WIX_HEADLESS") {
10325
- url.searchParams.append("kbName", "HEADLESS_KB_ID");
10329
+ kbNames.push("HEADLESS_KB_ID");
10326
10330
  } else if (toolName === "VELO") {
10327
- url.searchParams.append("kbName", "VELO_DOCS_KB_ID");
10328
- url.searchParams.append("kbName", "VELO_METHODS_KB_ID");
10331
+ kbNames.push("VELO_DOCS_KB_ID", "VELO_METHODS_KB_ID");
10332
+ }
10333
+ logger.log(
10334
+ `[SemanticSearch] Tool: ${toolName}, KBs: [${kbNames.join(", ")}], Query: "${toolParams.searchTerm}"`
10335
+ );
10336
+ for (const kbName of kbNames) {
10337
+ url.searchParams.append("kbName", kbName);
10329
10338
  }
10330
10339
  for (const [key, value] of Object.entries(toolParams)) {
10331
10340
  url.searchParams.append(key, value);
@@ -10517,6 +10526,39 @@ ${preview}${truncated}`);
10517
10526
  return content;
10518
10527
  }
10519
10528
 
10529
+ // src/docs/normalize-menu-content.ts
10530
+ var SCHEMA_HINT = "use ReadFullDocsMethodSchema to get the method full schema";
10531
+ var ARTICLE_HINT = "use ReadFullDocsArticle to see method code examples";
10532
+ var MENU_HINT = "use BrowseWixRESTDocsMenu to browse this category";
10533
+ function safeDecode(encoded) {
10534
+ try {
10535
+ return decodeURIComponent(encoded);
10536
+ } catch {
10537
+ return encoded;
10538
+ }
10539
+ }
10540
+ function normalizeMenuContent(content) {
10541
+ try {
10542
+ content = content.replace(
10543
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-article-content\?articleUrl=([^&)]+)[^)]*schema=true[^)]*\)/g,
10544
+ (_, title, encoded) => `[${title} (${SCHEMA_HINT})](${safeDecode(encoded)})`
10545
+ );
10546
+ content = content.replace(
10547
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-article-content\?articleUrl=([^&)]+)[^)]*\)/g,
10548
+ (_, title, encoded) => `[${title} (${ARTICLE_HINT})](${safeDecode(encoded)})`
10549
+ );
10550
+ content = content.replace(
10551
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-menu-content\?url=([^&)]+)[^)]*\)/g,
10552
+ (_, title, encoded) => `[${title} (${MENU_HINT})](${safeDecode(encoded)})`
10553
+ );
10554
+ } catch (error) {
10555
+ logger.error(
10556
+ `[BrowseWixRESTDocsMenu] Failed to normalize menu content: ${error}`
10557
+ );
10558
+ }
10559
+ return content;
10560
+ }
10561
+
10520
10562
  // ../../node_modules/dedent/dist/dedent.mjs
10521
10563
  function ownKeys(object, enumerableOnly) {
10522
10564
  var keys = Object.keys(object);
@@ -11401,7 +11443,8 @@ var addDocsTools = (server2, allowedTools = [
11401
11443
  type: "text",
11402
11444
  text: [
11403
11445
  result,
11404
- "you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method."
11446
+ "you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method.",
11447
+ "IMPORTANT: When sharing dev.wix.com/docs/rest or dev.wix.com/docs/api-reference links with the user, add ?apiView=SDK suffix to each link (or &apiView=SDK if the URL already has query params). for other prefix (dev.wix.com/docs/sdk) - no need to add the suffix."
11405
11448
  ].join("\n---\n")
11406
11449
  }
11407
11450
  ]
@@ -11729,7 +11772,7 @@ var addDocsTools = (server2, allowedTools = [
11729
11772
  content: [
11730
11773
  {
11731
11774
  type: "text",
11732
- text: content
11775
+ text: normalizeMenuContent(content)
11733
11776
  }
11734
11777
  ]
11735
11778
  };