@wix/mcp 1.0.13 → 1.0.14

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.
@@ -23624,7 +23624,7 @@ var runSemanticSearchAndFormat = async ({
23624
23624
  };
23625
23625
 
23626
23626
  // src/docs/fetch-article.ts
23627
- async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
23627
+ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
23628
23628
  const url = new URL(`https://dev.wix.com/digor/api/get-article-content`);
23629
23629
  url.searchParams.set("articleUrl", articleUrl);
23630
23630
  const schema = mode === "methodSchema" ? "true" : "false";
@@ -23632,56 +23632,120 @@ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
23632
23632
  logger2.log(`Fetching resource from docs ${url.toString()}`);
23633
23633
  const { data } = await httpClient.get(url.toString());
23634
23634
  logger2.log(`Fetched resource from docs: ${data.articleContent}`);
23635
+ const headerDivider = "## Article Content:";
23636
+ if (stripHeader) {
23637
+ const headerIndex = data.articleContent.indexOf(headerDivider);
23638
+ if (headerIndex !== -1) {
23639
+ return data.articleContent.substring(
23640
+ headerIndex + headerDivider.length
23641
+ );
23642
+ }
23643
+ }
23635
23644
  return data.articleContent;
23636
23645
  }
23637
- async function fetchArticleContent(httpClient, articleUrl, mode) {
23646
+ async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = false) {
23638
23647
  if (mode === "raw") {
23639
23648
  const { data: doc } = await httpClient.get(articleUrl);
23640
23649
  return doc;
23641
23650
  }
23642
- return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
23651
+ return fetchArticleContentFromDigor(
23652
+ httpClient,
23653
+ articleUrl,
23654
+ mode,
23655
+ stripHeader
23656
+ );
23643
23657
  }
23644
23658
 
23645
23659
  // src/docs/get-to-know.ts
23646
23660
  var docURLs = [
23647
23661
  {
23648
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions"
23662
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions",
23663
+ action: "include"
23649
23664
  },
23650
23665
  {
23651
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts"
23666
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts",
23667
+ action: "include"
23652
23668
  },
23653
23669
  {
23654
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions"
23670
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions",
23671
+ action: "index",
23672
+ title: "Wix Business Solutions",
23673
+ description: `This document provides an overview of the all business solutions available in Wix.
23674
+
23675
+ Use this document under the following scenarios:
23676
+ 1. The user asks general questions about Wix business solutions.
23677
+ 2. The user asks about a specific business solution, and you want to provide a high-level overview of it.
23678
+ 3. The user looks for a specific business solution, and you want to provide a list of all available solutions.
23679
+
23680
+ Please note that this is a large document. Only use it for the scenarios mentioned above.`
23655
23681
  },
23656
23682
  {
23657
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes"
23683
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes",
23684
+ action: "include"
23658
23685
  }
23659
23686
  ];
23660
- var DESCRIPTION = `**Tool Name:** WixREADME
23661
- **Description for LLM:**
23662
- "**Mandatory First Action for Wix Tasks.** This tool, 'WixREADME', MUST be executed at the very beginning of any process involving Wix functionalities. It provides the indispensable foundational Wix ecosystem context, global setup details, and current best practices.
23687
+ var DESCRIPTION = `# Tool: WixREADME
23663
23688
 
23664
- **Operational Rule:** Your processing protocol for any Wix-related task dictates that 'WixREADME' is successfully invoked and its output comprehensively analyzed BEFORE any other Wix-specific tool (such as 'ReadFullDocsArticle' or 'SearchX..') is considered or used. This is a non-negotiable prerequisite.
23689
+ **Directive:** \`WixREADME\` is the **MANDATORY FIRST STEP** for all Wix-related tasks. Its output (including relevant linked documents) provides foundational context for all other Wix tools. Adherence to this protocol is **NON-NEGOTIABLE**.
23665
23690
 
23666
- **Function:** Acts as the sole authoritative source for Wix global operational standards and session initialization. Its output is essential for the correct and safe execution of all subsequent Wix-related actions. All other Wix tools are designed to rely on the information it provides."
23691
+ **Operational Protocol (Strictly Sequential):**
23667
23692
 
23668
- **Next Steps:** After executing 'WixREADME', relevant information from the README may include links to other documents. You MUST use the 'ReadFullDocsArticle' tool to fetch the full content of these documents. This is a critical step to ensure you have all necessary information before proceeding with any other Wix tools.
23669
- `;
23670
- var WixREADME_DEPENDENT_DESCRIPTION = `**Dependency:** Must be used after 'WixREADME' has successfully run.`;
23693
+ 1. **Execute \`WixREADME\`:**
23694
+ * **Action:** Invoke \`WixREADME\`.
23695
+ * **Constraint:** MUST complete successfully. NO other Wix tool before this.
23696
+
23697
+ 2. **Process \`WixREADME\` Output (Link Identification & Relevance Assessment):**
23698
+ * **A. Identify Candidate Links:** Scan \`WixREADME\` output. Extract *only* URLs found within \`<urls>{urls}</urls>\` tags. Ignore all other URLs.
23699
+ * **B. Assess Relevance:** For EACH candidate URL from (A), assess its relevance to the **current user's specific prompt/task**.
23700
+ * **Outcome:** A list of *relevant* document URLs. If no links are found in \`<urls>\` tags or none are deemed relevant, note this and proceed to Step 4.
23701
+
23702
+ 3. **Fetch Relevant Documents (via \`ReadFullDocsArticle\`):**
23703
+ * **Condition:** ONLY if Step 2B identified one or more *relevant* URLs.
23704
+ * **Action:** For EACH *relevant* URL, invoke \`ReadFullDocsArticle\` to fetch its full content.
23705
+ * **Constraint:** All *relevant* documents MUST be fetched before Step 4.
23706
+
23707
+ 4. **Proceed with Other Wix Tools:**
23708
+ * **Condition:** ONLY after completing Steps 1, 2, and 3 (if Step 3 was applicable).
23709
+ * **Action:** Use other Wix tools as needed, utilizing the full context from \`WixREADME\` and fetched relevant documents.
23710
+
23711
+ **Summary of Critical Rules:**
23712
+ * \`WixREADME\` is **ALWAYS FIRST**.
23713
+ * Analyze \`WixREADME\` output: Extract links *only* from \`<urls>{urls}</urls>\` tags.
23714
+ * Assess relevance of *each* extracted link against the user's current task.
23715
+ * Fetch **ONLY RELEVANT** linked documents using \`ReadFullDocsArticle\` before any other Wix tool.
23716
+ * **FAILURE TO FOLLOW THIS EXACT SEQUENCE WILL LEAD TO ERRORS.** Strict adherence is mandatory.`;
23717
+ var WixREADME_DEPENDENT_DESCRIPTION = "**Dependency:** Must be used after 'WixREADME' has successfully run.";
23671
23718
  async function addGetToKnowTools(server) {
23672
23719
  server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
23673
23720
  try {
23674
23721
  const contents = await Promise.all(
23675
- docURLs.map(async ({ url }) => {
23676
- const content = await fetchArticleContent(httpClient, url, "article");
23677
- return content;
23722
+ docURLs.map(async ({ url, action, description, title }) => {
23723
+ if (action === "index") {
23724
+ return {
23725
+ type: "text",
23726
+ text: `## ${title}
23727
+
23728
+ <urls>
23729
+ ${url}
23730
+ </urls>
23731
+
23732
+ ${description}`
23733
+ };
23734
+ }
23735
+ const content = await fetchArticleContent(
23736
+ httpClient,
23737
+ url,
23738
+ "article",
23739
+ true
23740
+ );
23741
+ return {
23742
+ type: "text",
23743
+ text: content
23744
+ };
23678
23745
  })
23679
23746
  );
23680
23747
  return {
23681
- content: contents.map((content) => ({
23682
- type: "text",
23683
- text: content
23684
- }))
23748
+ content: contents
23685
23749
  };
23686
23750
  } catch (error) {
23687
23751
  return {