@wix/mcp 1.0.12 → 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.
@@ -15206,7 +15206,6 @@ __export(index_exports, {
15206
15206
  addApiCallTool: () => addApiCallTool,
15207
15207
  addDocsResources: () => addDocsResources,
15208
15208
  addDocsTools: () => addDocsTools,
15209
- addGetToKnowTools: () => addGetToKnowTools,
15210
15209
  addSupportTool: () => addSupportTool,
15211
15210
  handleWixAPIResponse: () => handleWixAPIResponse
15212
15211
  });
@@ -23625,7 +23624,7 @@ var runSemanticSearchAndFormat = async ({
23625
23624
  };
23626
23625
 
23627
23626
  // src/docs/fetch-article.ts
23628
- async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
23627
+ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
23629
23628
  const url = new URL(`https://dev.wix.com/digor/api/get-article-content`);
23630
23629
  url.searchParams.set("articleUrl", articleUrl);
23631
23630
  const schema = mode === "methodSchema" ? "true" : "false";
@@ -23633,14 +23632,133 @@ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
23633
23632
  logger2.log(`Fetching resource from docs ${url.toString()}`);
23634
23633
  const { data } = await httpClient.get(url.toString());
23635
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
+ }
23636
23644
  return data.articleContent;
23637
23645
  }
23638
- async function fetchArticleContent(httpClient, articleUrl, mode) {
23646
+ async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = false) {
23639
23647
  if (mode === "raw") {
23640
23648
  const { data: doc } = await httpClient.get(articleUrl);
23641
23649
  return doc;
23642
23650
  }
23643
- return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
23651
+ return fetchArticleContentFromDigor(
23652
+ httpClient,
23653
+ articleUrl,
23654
+ mode,
23655
+ stripHeader
23656
+ );
23657
+ }
23658
+
23659
+ // src/docs/get-to-know.ts
23660
+ var docURLs = [
23661
+ {
23662
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions",
23663
+ action: "include"
23664
+ },
23665
+ {
23666
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts",
23667
+ action: "include"
23668
+ },
23669
+ {
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.`
23681
+ },
23682
+ {
23683
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes",
23684
+ action: "include"
23685
+ }
23686
+ ];
23687
+ var DESCRIPTION = `# Tool: WixREADME
23688
+
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**.
23690
+
23691
+ **Operational Protocol (Strictly Sequential):**
23692
+
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.";
23718
+ async function addGetToKnowTools(server) {
23719
+ server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
23720
+ try {
23721
+ const contents = await Promise.all(
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
+ };
23745
+ })
23746
+ );
23747
+ return {
23748
+ content: contents
23749
+ };
23750
+ } catch (error) {
23751
+ return {
23752
+ isError: true,
23753
+ content: [
23754
+ {
23755
+ type: "text",
23756
+ text: `Error fetching the document: ${error.message}`
23757
+ }
23758
+ ]
23759
+ };
23760
+ }
23761
+ });
23644
23762
  }
23645
23763
 
23646
23764
  // src/docs/docs.ts
@@ -23659,7 +23777,10 @@ var addDocsTools = (server, allowedTools = [
23659
23777
  "BUILD_APPS",
23660
23778
  "WIX_HEADLESS",
23661
23779
  "BUSINESS_SOLUTIONS"
23662
- ]) => {
23780
+ ], getToKnowWixEnabled = false) => {
23781
+ if (getToKnowWixEnabled) {
23782
+ addGetToKnowTools(server);
23783
+ }
23663
23784
  if (allowedTools.includes("WDS")) {
23664
23785
  server.tool(
23665
23786
  "SearchWixWDSDocumentation",
@@ -23667,7 +23788,8 @@ var addDocsTools = (server, allowedTools = [
23667
23788
  "Searches the Wix Design System Documentation for components and patterns.",
23668
23789
  "Use this tool when you need to understand or implement UI components and design patterns in a Wix project.",
23669
23790
  "Search for specific component names, patterns, or UI requirements.",
23670
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23791
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23792
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23671
23793
  ].join("\n"),
23672
23794
  {
23673
23795
  searchTerm: z.string().describe(
@@ -23721,7 +23843,8 @@ var addDocsTools = (server, allowedTools = [
23721
23843
  "Searches the official Wix REST API documentation.",
23722
23844
  "Use this tool whenever you need to to interact with the Wix platform via HTTP requests.",
23723
23845
  "Specify the API endpoint, resource, or action you need information about (e.g., 'get site details endpoint', 'create data collection', 'update product API', 'REST authentication').",
23724
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23846
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23847
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23725
23848
  ].join("\n"),
23726
23849
  {
23727
23850
  searchTerm: z.string().describe(
@@ -23773,7 +23896,7 @@ var addDocsTools = (server, allowedTools = [
23773
23896
  }
23774
23897
  );
23775
23898
  }
23776
- if (allowedTools.includes("BUSINESS_SOLUTIONS")) {
23899
+ if (allowedTools.includes("BUSINESS_SOLUTIONS") && !getToKnowWixEnabled) {
23777
23900
  server.tool(
23778
23901
  "WixBusinessFlowsDocumentation",
23779
23902
  [
@@ -23842,7 +23965,8 @@ var addDocsTools = (server, allowedTools = [
23842
23965
  "Searches the official Wix javascript SDK documentation.",
23843
23966
  "Use this tool whenever you need to write or modify Wix related SDK code.",
23844
23967
  "Specify the SDK module, function, or feature you need information about (e.g., 'how to query all items from a data collection?', 'how to use wix-stores-backend', 'authentication methods in the SDK').",
23845
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
23968
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
23969
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23846
23970
  ].join("\n"),
23847
23971
  {
23848
23972
  searchTerm: z.string().describe(
@@ -23903,7 +24027,8 @@ var addDocsTools = (server, allowedTools = [
23903
24027
  "Searches the official Build Apps documentation.",
23904
24028
  "Use this tool when you need to understand or implement Wix CLI applications related code.",
23905
24029
  "The search term should be a specific Wix CLI command or specific topic related to Wix CLI applications or its ecosystem (e.g. deployment, creating new extensions etc).",
23906
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
24030
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
24031
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23907
24032
  ].join("\n"),
23908
24033
  {
23909
24034
  searchTerm: z.string().describe(
@@ -23956,7 +24081,8 @@ var addDocsTools = (server, allowedTools = [
23956
24081
  "Searches the official Wix Headless Documentation.",
23957
24082
  "Use this tool when you need to understand or implement Headless related code.",
23958
24083
  "The search term should be a specific Wix Headless topic or feature you need information about.",
23959
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
24084
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
24085
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
23960
24086
  ].join("\n"),
23961
24087
  {
23962
24088
  searchTerm: z.string().describe(
@@ -24006,7 +24132,8 @@ var addDocsTools = (server, allowedTools = [
24006
24132
  "ReadFullDocsArticle",
24007
24133
  [
24008
24134
  "Fetches the full Wix docs article or method article.",
24009
- "Use this tool when you read a summary of a docs article or method article, you have the docs url and want to read the full article."
24135
+ "Use this tool when you read a summary of a docs article or method article, you have the docs url and want to read the full article.",
24136
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
24010
24137
  ].join("\n"),
24011
24138
  {
24012
24139
  articleUrl: z.string().describe(
@@ -24099,41 +24226,6 @@ var addDocsTools = (server, allowedTools = [
24099
24226
  );
24100
24227
  };
24101
24228
 
24102
- // src/docs/get-to-know.ts
24103
- var defaultDocUrl = "https://dev.wix.com/docs/picasso/wix-ai-docs/rules/get-to-know-wix-llm-instructions";
24104
- var DESCRIPTION = `**Tool Name:** WixREADME
24105
- **Description for LLM:**
24106
- "**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.
24107
-
24108
- **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.
24109
-
24110
- **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."`;
24111
- async function addGetToKnowTools(server, docUrl) {
24112
- server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
24113
- try {
24114
- const doc = docUrl ? await fetchArticleContent(httpClient, docUrl, "raw") : await fetchArticleContent(httpClient, defaultDocUrl, "article");
24115
- return {
24116
- content: [
24117
- {
24118
- type: "text",
24119
- text: doc
24120
- }
24121
- ]
24122
- };
24123
- } catch (error) {
24124
- return {
24125
- isError: true,
24126
- content: [
24127
- {
24128
- type: "text",
24129
- text: `Error fetching the document: ${error.message}`
24130
- }
24131
- ]
24132
- };
24133
- }
24134
- });
24135
- }
24136
-
24137
24229
  // src/tool-utils.ts
24138
24230
  var safeParseJSON = (text) => {
24139
24231
  try {
@@ -24420,7 +24512,6 @@ function addSupportTool(server) {
24420
24512
  addApiCallTool,
24421
24513
  addDocsResources,
24422
24514
  addDocsTools,
24423
- addGetToKnowTools,
24424
24515
  addSupportTool,
24425
24516
  handleWixAPIResponse
24426
24517
  });