@wix/ditto-codegen-public 1.0.212 → 1.0.213

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/out.js +27 -8
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -84552,7 +84552,7 @@ var require_fetchApiDocs = __commonJS({
84552
84552
  "use strict";
84553
84553
  Object.defineProperty(exports2, "__esModule", { value: true });
84554
84554
  exports2.fetchApiDocsByName = fetchApiDocsByName;
84555
- exports2.extractUrlFromSearchResult = extractUrlFromSearchResult;
84555
+ exports2.extractMatchingUrlFromSearchResult = extractMatchingUrlFromSearchResult;
84556
84556
  exports2.formatApiDocumentation = formatApiDocumentation;
84557
84557
  var WixMCPClient_1 = require_WixMCPClient();
84558
84558
  async function fetchApiDocsByName(apis) {
@@ -84564,8 +84564,8 @@ var require_fetchApiDocs = __commonJS({
84564
84564
  await mcpClient.connect();
84565
84565
  const results = await Promise.all(apis.map(async (api) => {
84566
84566
  try {
84567
- const searchResult = await mcpClient.searchSDKDocumentation(api.name, 3);
84568
- const docsUrl = extractUrlFromSearchResult(searchResult.content);
84567
+ const searchResult = await mcpClient.searchSDKDocumentation(api.name, 5);
84568
+ const docsUrl = extractMatchingUrlFromSearchResult(searchResult.content, api.name);
84569
84569
  if (!docsUrl) {
84570
84570
  console.warn(`Could not find docsUrl for API: ${api.name}`);
84571
84571
  return { name: api.name, purpose: api.purpose };
@@ -84594,13 +84594,32 @@ var require_fetchApiDocs = __commonJS({
84594
84594
  }
84595
84595
  }
84596
84596
  var WIX_SDK_DOCS_URL_PATTERN = /https:\/\/dev\.wix\.com\/docs\/sdk\/[^\s"']+/;
84597
- function extractUrlFromSearchResult(content) {
84598
- for (const text of content) {
84599
- const match = text.match(WIX_SDK_DOCS_URL_PATTERN);
84600
- if (match) {
84601
- return match[0];
84597
+ function parseSearchResults(content) {
84598
+ const results = [];
84599
+ const fullContent = content.join("\n");
84600
+ const blocks = fullContent.split("---");
84601
+ for (const block of blocks) {
84602
+ const methodNameMatch = block.match(/# Method name:\s*\n?\s*([^\n(]+)/);
84603
+ const urlMatch = block.match(WIX_SDK_DOCS_URL_PATTERN);
84604
+ if (methodNameMatch && urlMatch) {
84605
+ results.push({
84606
+ methodName: methodNameMatch[1].trim(),
84607
+ url: urlMatch[0]
84608
+ });
84602
84609
  }
84603
84610
  }
84611
+ return results;
84612
+ }
84613
+ function extractMatchingUrlFromSearchResult(content, apiName) {
84614
+ const results = parseSearchResults(content);
84615
+ if (results.length === 0) {
84616
+ return void 0;
84617
+ }
84618
+ const exactMatch = results.find((r) => r.methodName.toLowerCase().startsWith(apiName.toLowerCase()));
84619
+ if (exactMatch) {
84620
+ return exactMatch.url;
84621
+ }
84622
+ console.warn(`No exact match found for API "${apiName}", available methods: ${results.map((r) => r.methodName).join(", ")}`);
84604
84623
  return void 0;
84605
84624
  }
84606
84625
  function formatApiDocumentation(apis) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.212",
3
+ "version": "1.0.213",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.27.2"
26
26
  },
27
- "falconPackageHash": "4b29d603670b4ca40b83ad4b69df9d465476c03c3986d97d212663be"
27
+ "falconPackageHash": "47600d341c19ba7c336cc524f1cc2038e1cef8953542639ed4ecd624"
28
28
  }