@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.
@@ -1,3 +1,3 @@
1
1
  import { HttpClient } from '@wix/http-client';
2
- export declare function fetchArticleContent(httpClient: HttpClient, articleUrl: string, mode: 'article' | 'methodSchema' | 'raw'): Promise<string>;
2
+ export declare function fetchArticleContent(httpClient: HttpClient, articleUrl: string, mode: 'article' | 'methodSchema' | 'raw', stripHeader?: boolean): Promise<string>;
3
3
  //# sourceMappingURL=fetch-article.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-article.d.ts","sourceRoot":"","sources":["../../../src/docs/fetch-article.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAuB9C,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,KAAK,mBAQzC"}
1
+ {"version":3,"file":"fetch-article.d.ts","sourceRoot":"","sources":["../../../src/docs/fetch-article.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAmC9C,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,KAAK,EACxC,WAAW,GAAE,OAAe,mBAa7B"}
@@ -1,5 +1,5 @@
1
1
  import { logger } from '../infra/logger.js';
2
- async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
2
+ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
3
3
  // https://dev.wix.com/digor/api/get-article-content?articleUrl=https://dev.wix.com/docs/rest/business-solutions/blog/draft-posts/create-draft-post&schema=true
4
4
  const url = new URL(`https://dev.wix.com/digor/api/get-article-content`);
5
5
  url.searchParams.set('articleUrl', articleUrl);
@@ -8,13 +8,20 @@ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
8
8
  logger.log(`Fetching resource from docs ${url.toString()}`);
9
9
  const { data } = await httpClient.get(url.toString());
10
10
  logger.log(`Fetched resource from docs: ${data.articleContent}`);
11
+ const headerDivider = '## Article Content:'; // after the header, the content starts
12
+ if (stripHeader) {
13
+ const headerIndex = data.articleContent.indexOf(headerDivider);
14
+ if (headerIndex !== -1) {
15
+ return data.articleContent.substring(headerIndex + headerDivider.length);
16
+ }
17
+ }
11
18
  return data.articleContent;
12
19
  }
13
- export async function fetchArticleContent(httpClient, articleUrl, mode) {
20
+ export async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = false) {
14
21
  if (mode === 'raw') {
15
22
  const { data: doc } = await httpClient.get(articleUrl);
16
23
  return doc;
17
24
  }
18
- return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
25
+ return fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader);
19
26
  }
20
27
  //# sourceMappingURL=fetch-article.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-article.js","sourceRoot":"","sources":["../../../src/docs/fetch-article.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,KAAK,UAAU,4BAA4B,CACzC,UAAsB,EACtB,UAAkB,EAClB,IAAgC;IAEhC,+JAA+J;IAC/J,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACzE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEvC,MAAM,CAAC,GAAG,CAAC,+BAA+B,GAAG,CAAC,QAAQ,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,EAAE,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEtD,MAAM,CAAC,GAAG,CAAC,+BAA+B,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;IAEjE,MAAM,aAAa,GAAG,qBAAqB,CAAC,CAAC,uCAAuC;IAEpF,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC/D,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAClC,WAAW,GAAG,aAAa,CAAC,MAAM,CACzB,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,cAAwB,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAsB,EACtB,UAAkB,EAClB,IAAwC,EACxC,cAAuB,KAAK;IAE5B,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvD,OAAO,GAAa,CAAC;IACvB,CAAC;IAED,OAAO,4BAA4B,CACjC,UAAU,EACV,UAAU,EACV,IAAI,EACJ,WAAW,CACZ,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-to-know.d.ts","sourceRoot":"","sources":["../../../src/docs/get-to-know.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6BpD,eAAO,MAAM,+BAA+B,yEAAyE,CAAC;AAEtH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,iBA4B3D"}
1
+ {"version":3,"file":"get-to-know.d.ts","sourceRoot":"","sources":["../../../src/docs/get-to-know.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA8DpD,eAAO,MAAM,+BAA+B,yEAC4B,CAAC;AAEzE,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,iBAwC3D"}
@@ -1,41 +1,80 @@
1
1
  import { fetchArticleContent } from './fetch-article.js';
2
2
  const docURLs = [
3
3
  {
4
- url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions'
4
+ url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions',
5
+ action: 'include'
5
6
  },
6
7
  {
7
- url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts'
8
+ url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts',
9
+ action: 'include'
8
10
  },
9
11
  {
10
- url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions'
12
+ url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions',
13
+ action: 'index',
14
+ title: 'Wix Business Solutions',
15
+ description: `This document provides an overview of the all business solutions available in Wix.
16
+
17
+ Use this document under the following scenarios:
18
+ 1. The user asks general questions about Wix business solutions.
19
+ 2. The user asks about a specific business solution, and you want to provide a high-level overview of it.
20
+ 3. The user looks for a specific business solution, and you want to provide a list of all available solutions.
21
+
22
+ Please note that this is a large document. Only use it for the scenarios mentioned above.`
11
23
  },
12
24
  {
13
- url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes'
25
+ url: 'https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes',
26
+ action: 'include'
14
27
  }
15
28
  ];
16
- const DESCRIPTION = `**Tool Name:** WixREADME
17
- **Description for LLM:**
18
- "**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.
29
+ const DESCRIPTION = `# Tool: WixREADME
30
+
31
+ **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**.
32
+
33
+ **Operational Protocol (Strictly Sequential):**
34
+
35
+ 1. **Execute \`WixREADME\`:**
36
+ * **Action:** Invoke \`WixREADME\`.
37
+ * **Constraint:** MUST complete successfully. NO other Wix tool before this.
38
+
39
+ 2. **Process \`WixREADME\` Output (Link Identification & Relevance Assessment):**
40
+ * **A. Identify Candidate Links:** Scan \`WixREADME\` output. Extract *only* URLs found within \`<urls>{urls}</urls>\` tags. Ignore all other URLs.
41
+ * **B. Assess Relevance:** For EACH candidate URL from (A), assess its relevance to the **current user's specific prompt/task**.
42
+ * **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.
19
43
 
20
- **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.
44
+ 3. **Fetch Relevant Documents (via \`ReadFullDocsArticle\`):**
45
+ * **Condition:** ONLY if Step 2B identified one or more *relevant* URLs.
46
+ * **Action:** For EACH *relevant* URL, invoke \`ReadFullDocsArticle\` to fetch its full content.
47
+ * **Constraint:** All *relevant* documents MUST be fetched before Step 4.
21
48
 
22
- **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."
49
+ 4. **Proceed with Other Wix Tools:**
50
+ * **Condition:** ONLY after completing Steps 1, 2, and 3 (if Step 3 was applicable).
51
+ * **Action:** Use other Wix tools as needed, utilizing the full context from \`WixREADME\` and fetched relevant documents.
23
52
 
24
- **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.
25
- `;
26
- export const WixREADME_DEPENDENT_DESCRIPTION = `**Dependency:** Must be used after 'WixREADME' has successfully run.`;
53
+ **Summary of Critical Rules:**
54
+ * \`WixREADME\` is **ALWAYS FIRST**.
55
+ * Analyze \`WixREADME\` output: Extract links *only* from \`<urls>{urls}</urls>\` tags.
56
+ * Assess relevance of *each* extracted link against the user's current task.
57
+ * Fetch **ONLY RELEVANT** linked documents using \`ReadFullDocsArticle\` before any other Wix tool.
58
+ * **FAILURE TO FOLLOW THIS EXACT SEQUENCE WILL LEAD TO ERRORS.** Strict adherence is mandatory.`;
59
+ export const WixREADME_DEPENDENT_DESCRIPTION = "**Dependency:** Must be used after 'WixREADME' has successfully run.";
27
60
  export async function addGetToKnowTools(server) {
28
61
  server.tool('WixREADME', DESCRIPTION, async ({ httpClient }) => {
29
62
  try {
30
- const contents = await Promise.all(docURLs.map(async ({ url }) => {
31
- const content = await fetchArticleContent(httpClient, url, 'article');
32
- return content;
33
- }));
34
- return {
35
- content: contents.map((content) => ({
63
+ const contents = await Promise.all(docURLs.map(async ({ url, action, description, title }) => {
64
+ if (action === 'index') {
65
+ return {
66
+ type: 'text',
67
+ text: `## ${title}\n\n<urls>\n${url}\n</urls>\n\n${description}`
68
+ };
69
+ }
70
+ const content = await fetchArticleContent(httpClient, url, 'article', true);
71
+ return {
36
72
  type: 'text',
37
73
  text: content
38
- }))
74
+ };
75
+ }));
76
+ return {
77
+ content: contents
39
78
  };
40
79
  }
41
80
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"get-to-know.js","sourceRoot":"","sources":["../../../src/docs/get-to-know.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,OAAO,GAAG;IACd;QACE,GAAG,EAAE,qFAAqF;KAC3F;IACD;QACE,GAAG,EAAE,iEAAiE;KACvE;IACD;QACE,GAAG,EAAE,2EAA2E;KACjF;IAC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Z,IAAI,EAAE,gCAAiC,KAAe,CAAC,OAAO,EAAE;qBACjE;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -18335,7 +18335,7 @@ var runSemanticSearchAndFormat = async ({
18335
18335
  };
18336
18336
 
18337
18337
  // src/docs/fetch-article.ts
18338
- async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
18338
+ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
18339
18339
  const url = new URL(`https://dev.wix.com/digor/api/get-article-content`);
18340
18340
  url.searchParams.set("articleUrl", articleUrl);
18341
18341
  const schema = mode === "methodSchema" ? "true" : "false";
@@ -18343,56 +18343,120 @@ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
18343
18343
  logger2.log(`Fetching resource from docs ${url.toString()}`);
18344
18344
  const { data } = await httpClient.get(url.toString());
18345
18345
  logger2.log(`Fetched resource from docs: ${data.articleContent}`);
18346
+ const headerDivider = "## Article Content:";
18347
+ if (stripHeader) {
18348
+ const headerIndex = data.articleContent.indexOf(headerDivider);
18349
+ if (headerIndex !== -1) {
18350
+ return data.articleContent.substring(
18351
+ headerIndex + headerDivider.length
18352
+ );
18353
+ }
18354
+ }
18346
18355
  return data.articleContent;
18347
18356
  }
18348
- async function fetchArticleContent(httpClient, articleUrl, mode) {
18357
+ async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = false) {
18349
18358
  if (mode === "raw") {
18350
18359
  const { data: doc } = await httpClient.get(articleUrl);
18351
18360
  return doc;
18352
18361
  }
18353
- return fetchArticleContentFromDigor(httpClient, articleUrl, mode);
18362
+ return fetchArticleContentFromDigor(
18363
+ httpClient,
18364
+ articleUrl,
18365
+ mode,
18366
+ stripHeader
18367
+ );
18354
18368
  }
18355
18369
 
18356
18370
  // src/docs/get-to-know.ts
18357
18371
  var docURLs = [
18358
18372
  {
18359
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions"
18373
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions",
18374
+ action: "include"
18360
18375
  },
18361
18376
  {
18362
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts"
18377
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts",
18378
+ action: "include"
18363
18379
  },
18364
18380
  {
18365
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions"
18381
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions",
18382
+ action: "index",
18383
+ title: "Wix Business Solutions",
18384
+ description: `This document provides an overview of the all business solutions available in Wix.
18385
+
18386
+ Use this document under the following scenarios:
18387
+ 1. The user asks general questions about Wix business solutions.
18388
+ 2. The user asks about a specific business solution, and you want to provide a high-level overview of it.
18389
+ 3. The user looks for a specific business solution, and you want to provide a list of all available solutions.
18390
+
18391
+ Please note that this is a large document. Only use it for the scenarios mentioned above.`
18366
18392
  },
18367
18393
  {
18368
- url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes"
18394
+ url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes",
18395
+ action: "include"
18369
18396
  }
18370
18397
  ];
18371
- var DESCRIPTION = `**Tool Name:** WixREADME
18372
- **Description for LLM:**
18373
- "**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.
18398
+ var DESCRIPTION = `# Tool: WixREADME
18399
+
18400
+ **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**.
18374
18401
 
18375
- **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.
18402
+ **Operational Protocol (Strictly Sequential):**
18376
18403
 
18377
- **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."
18404
+ 1. **Execute \`WixREADME\`:**
18405
+ * **Action:** Invoke \`WixREADME\`.
18406
+ * **Constraint:** MUST complete successfully. NO other Wix tool before this.
18378
18407
 
18379
- **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.
18380
- `;
18381
- var WixREADME_DEPENDENT_DESCRIPTION = `**Dependency:** Must be used after 'WixREADME' has successfully run.`;
18408
+ 2. **Process \`WixREADME\` Output (Link Identification & Relevance Assessment):**
18409
+ * **A. Identify Candidate Links:** Scan \`WixREADME\` output. Extract *only* URLs found within \`<urls>{urls}</urls>\` tags. Ignore all other URLs.
18410
+ * **B. Assess Relevance:** For EACH candidate URL from (A), assess its relevance to the **current user's specific prompt/task**.
18411
+ * **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.
18412
+
18413
+ 3. **Fetch Relevant Documents (via \`ReadFullDocsArticle\`):**
18414
+ * **Condition:** ONLY if Step 2B identified one or more *relevant* URLs.
18415
+ * **Action:** For EACH *relevant* URL, invoke \`ReadFullDocsArticle\` to fetch its full content.
18416
+ * **Constraint:** All *relevant* documents MUST be fetched before Step 4.
18417
+
18418
+ 4. **Proceed with Other Wix Tools:**
18419
+ * **Condition:** ONLY after completing Steps 1, 2, and 3 (if Step 3 was applicable).
18420
+ * **Action:** Use other Wix tools as needed, utilizing the full context from \`WixREADME\` and fetched relevant documents.
18421
+
18422
+ **Summary of Critical Rules:**
18423
+ * \`WixREADME\` is **ALWAYS FIRST**.
18424
+ * Analyze \`WixREADME\` output: Extract links *only* from \`<urls>{urls}</urls>\` tags.
18425
+ * Assess relevance of *each* extracted link against the user's current task.
18426
+ * Fetch **ONLY RELEVANT** linked documents using \`ReadFullDocsArticle\` before any other Wix tool.
18427
+ * **FAILURE TO FOLLOW THIS EXACT SEQUENCE WILL LEAD TO ERRORS.** Strict adherence is mandatory.`;
18428
+ var WixREADME_DEPENDENT_DESCRIPTION = "**Dependency:** Must be used after 'WixREADME' has successfully run.";
18382
18429
  async function addGetToKnowTools(server) {
18383
18430
  server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
18384
18431
  try {
18385
18432
  const contents = await Promise.all(
18386
- docURLs.map(async ({ url }) => {
18387
- const content = await fetchArticleContent(httpClient, url, "article");
18388
- return content;
18433
+ docURLs.map(async ({ url, action, description, title }) => {
18434
+ if (action === "index") {
18435
+ return {
18436
+ type: "text",
18437
+ text: `## ${title}
18438
+
18439
+ <urls>
18440
+ ${url}
18441
+ </urls>
18442
+
18443
+ ${description}`
18444
+ };
18445
+ }
18446
+ const content = await fetchArticleContent(
18447
+ httpClient,
18448
+ url,
18449
+ "article",
18450
+ true
18451
+ );
18452
+ return {
18453
+ type: "text",
18454
+ text: content
18455
+ };
18389
18456
  })
18390
18457
  );
18391
18458
  return {
18392
- content: contents.map((content) => ({
18393
- type: "text",
18394
- text: content
18395
- }))
18459
+ content: contents
18396
18460
  };
18397
18461
  } catch (error) {
18398
18462
  return {