@wix/mcp 1.0.12 → 1.0.13

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.
@@ -15083,6 +15083,61 @@ async function fetchArticleContent(httpClient, articleUrl, mode) {
15083
15083
  return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
15084
15084
  }
15085
15085
 
15086
+ // src/docs/get-to-know.ts
15087
+ var docURLs = [
15088
+ {
15089
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions"
15090
+ },
15091
+ {
15092
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts"
15093
+ },
15094
+ {
15095
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions"
15096
+ },
15097
+ {
15098
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes"
15099
+ }
15100
+ ];
15101
+ var DESCRIPTION = `**Tool Name:** WixREADME
15102
+ **Description for LLM:**
15103
+ "**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.
15104
+
15105
+ **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.
15106
+
15107
+ **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."
15108
+
15109
+ **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.
15110
+ `;
15111
+ var WixREADME_DEPENDENT_DESCRIPTION = `**Dependency:** Must be used after 'WixREADME' has successfully run.`;
15112
+ async function addGetToKnowTools(server2) {
15113
+ server2.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
15114
+ try {
15115
+ const contents = await Promise.all(
15116
+ docURLs.map(async ({ url }) => {
15117
+ const content = await fetchArticleContent(httpClient, url, "article");
15118
+ return content;
15119
+ })
15120
+ );
15121
+ return {
15122
+ content: contents.map((content) => ({
15123
+ type: "text",
15124
+ text: content
15125
+ }))
15126
+ };
15127
+ } catch (error) {
15128
+ return {
15129
+ isError: true,
15130
+ content: [
15131
+ {
15132
+ type: "text",
15133
+ text: `Error fetching the document: ${error.message}`
15134
+ }
15135
+ ]
15136
+ };
15137
+ }
15138
+ });
15139
+ }
15140
+
15086
15141
  // src/docs/docs.ts
15087
15142
  var VALID_DOCS_TOOLS = [
15088
15143
  "WDS",
@@ -15099,7 +15154,10 @@ var addDocsTools = (server2, allowedTools = [
15099
15154
  "BUILD_APPS",
15100
15155
  "WIX_HEADLESS",
15101
15156
  "BUSINESS_SOLUTIONS"
15102
- ]) => {
15157
+ ], getToKnowWixEnabled = false) => {
15158
+ if (getToKnowWixEnabled) {
15159
+ addGetToKnowTools(server2);
15160
+ }
15103
15161
  if (allowedTools.includes("WDS")) {
15104
15162
  server2.tool(
15105
15163
  "SearchWixWDSDocumentation",
@@ -15107,7 +15165,8 @@ var addDocsTools = (server2, allowedTools = [
15107
15165
  "Searches the Wix Design System Documentation for components and patterns.",
15108
15166
  "Use this tool when you need to understand or implement UI components and design patterns in a Wix project.",
15109
15167
  "Search for specific component names, patterns, or UI requirements.",
15110
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
15168
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
15169
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15111
15170
  ].join("\n"),
15112
15171
  {
15113
15172
  searchTerm: z.string().describe(
@@ -15161,7 +15220,8 @@ var addDocsTools = (server2, allowedTools = [
15161
15220
  "Searches the official Wix REST API documentation.",
15162
15221
  "Use this tool whenever you need to to interact with the Wix platform via HTTP requests.",
15163
15222
  "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').",
15164
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
15223
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
15224
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15165
15225
  ].join("\n"),
15166
15226
  {
15167
15227
  searchTerm: z.string().describe(
@@ -15213,7 +15273,7 @@ var addDocsTools = (server2, allowedTools = [
15213
15273
  }
15214
15274
  );
15215
15275
  }
15216
- if (allowedTools.includes("BUSINESS_SOLUTIONS")) {
15276
+ if (allowedTools.includes("BUSINESS_SOLUTIONS") && !getToKnowWixEnabled) {
15217
15277
  server2.tool(
15218
15278
  "WixBusinessFlowsDocumentation",
15219
15279
  [
@@ -15282,7 +15342,8 @@ var addDocsTools = (server2, allowedTools = [
15282
15342
  "Searches the official Wix javascript SDK documentation.",
15283
15343
  "Use this tool whenever you need to write or modify Wix related SDK code.",
15284
15344
  "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').",
15285
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
15345
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
15346
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15286
15347
  ].join("\n"),
15287
15348
  {
15288
15349
  searchTerm: z.string().describe(
@@ -15343,7 +15404,8 @@ var addDocsTools = (server2, allowedTools = [
15343
15404
  "Searches the official Build Apps documentation.",
15344
15405
  "Use this tool when you need to understand or implement Wix CLI applications related code.",
15345
15406
  "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).",
15346
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
15407
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
15408
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15347
15409
  ].join("\n"),
15348
15410
  {
15349
15411
  searchTerm: z.string().describe(
@@ -15396,7 +15458,8 @@ var addDocsTools = (server2, allowedTools = [
15396
15458
  "Searches the official Wix Headless Documentation.",
15397
15459
  "Use this tool when you need to understand or implement Headless related code.",
15398
15460
  "The search term should be a specific Wix Headless topic or feature you need information about.",
15399
- "If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
15461
+ "If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
15462
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15400
15463
  ].join("\n"),
15401
15464
  {
15402
15465
  searchTerm: z.string().describe(
@@ -15446,7 +15509,8 @@ var addDocsTools = (server2, allowedTools = [
15446
15509
  "ReadFullDocsArticle",
15447
15510
  [
15448
15511
  "Fetches the full Wix docs article or method article.",
15449
- "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."
15512
+ "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.",
15513
+ getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
15450
15514
  ].join("\n"),
15451
15515
  {
15452
15516
  articleUrl: z.string().describe(
@@ -15539,41 +15603,6 @@ var addDocsTools = (server2, allowedTools = [
15539
15603
  );
15540
15604
  };
15541
15605
 
15542
- // src/docs/get-to-know.ts
15543
- var defaultDocUrl = "https://dev.wix.com/docs/picasso/wix-ai-docs/rules/get-to-know-wix-llm-instructions";
15544
- var DESCRIPTION = `**Tool Name:** WixREADME
15545
- **Description for LLM:**
15546
- "**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.
15547
-
15548
- **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.
15549
-
15550
- **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."`;
15551
- async function addGetToKnowTools(server2, docUrl) {
15552
- server2.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
15553
- try {
15554
- const doc = docUrl ? await fetchArticleContent(httpClient, docUrl, "raw") : await fetchArticleContent(httpClient, defaultDocUrl, "article");
15555
- return {
15556
- content: [
15557
- {
15558
- type: "text",
15559
- text: doc
15560
- }
15561
- ]
15562
- };
15563
- } catch (error) {
15564
- return {
15565
- isError: true,
15566
- content: [
15567
- {
15568
- type: "text",
15569
- text: `Error fetching the document: ${error.message}`
15570
- }
15571
- ]
15572
- };
15573
- }
15574
- });
15575
- }
15576
-
15577
15606
  // src/cli-tools/cli.ts
15578
15607
  import { z as z2 } from "zod";
15579
15608
 
@@ -16473,7 +16502,7 @@ var docsTools = activeTools.filter(
16473
16502
  );
16474
16503
  if (docsTools.length > 0) {
16475
16504
  logger.log("Adding docs tools:", docsTools);
16476
- addDocsTools(server, docsTools);
16505
+ addDocsTools(server, docsTools, activeTools.includes("GET_TO_KNOW_WIX"));
16477
16506
  }
16478
16507
  var isWixOne = parsedArgs["cli"] === "wix-one";
16479
16508
  var cliTools = activeTools.filter(
@@ -16483,10 +16512,6 @@ if (cliTools.length > 0) {
16483
16512
  logger.log("Adding cli tools:", cliTools, "isWixOne:", isWixOne);
16484
16513
  addCliTools(server, cliTools, isWixOne);
16485
16514
  }
16486
- if (activeTools.includes("GET_TO_KNOW_WIX")) {
16487
- const docUrl = parsedArgs["get-to-know-wix-url"];
16488
- await addGetToKnowTools(server, docUrl);
16489
- }
16490
16515
  try {
16491
16516
  const portals = parsedArgs["portals"]?.split(",") || [];
16492
16517
  if (portals.length > 0) {