@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.
- package/build/bin-standalone.js +140 -51
- package/build/bin-standalone.js.map +2 -2
- package/build/cjs/index.cjs +139 -48
- package/build/cjs/index.cjs.map +3 -3
- package/build/dts/bin.d.ts.map +1 -1
- package/build/dts/bin.js +1 -6
- package/build/dts/bin.js.map +1 -1
- package/build/dts/docs/docs.d.ts +1 -1
- package/build/dts/docs/docs.d.ts.map +1 -1
- package/build/dts/docs/docs.js +18 -8
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/fetch-article.d.ts +1 -1
- package/build/dts/docs/fetch-article.d.ts.map +1 -1
- package/build/dts/docs/fetch-article.js +10 -3
- package/build/dts/docs/fetch-article.js.map +1 -1
- package/build/dts/docs/get-to-know.d.ts +1 -1
- package/build/dts/docs/get-to-know.d.ts.map +1 -1
- package/build/dts/docs/get-to-know.js +71 -17
- package/build/dts/docs/get-to-know.js.map +1 -1
- package/build/dts/index.d.ts +0 -1
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/index.js +0 -1
- package/build/dts/index.js.map +1 -1
- package/build/esm/index.js +139 -47
- package/build/esm/index.js.map +3 -3
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -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,14 +18343,133 @@ 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(
|
|
18362
|
+
return fetchArticleContentFromDigor(
|
|
18363
|
+
httpClient,
|
|
18364
|
+
articleUrl,
|
|
18365
|
+
mode,
|
|
18366
|
+
stripHeader
|
|
18367
|
+
);
|
|
18368
|
+
}
|
|
18369
|
+
|
|
18370
|
+
// src/docs/get-to-know.ts
|
|
18371
|
+
var docURLs = [
|
|
18372
|
+
{
|
|
18373
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions",
|
|
18374
|
+
action: "include"
|
|
18375
|
+
},
|
|
18376
|
+
{
|
|
18377
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts",
|
|
18378
|
+
action: "include"
|
|
18379
|
+
},
|
|
18380
|
+
{
|
|
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.`
|
|
18392
|
+
},
|
|
18393
|
+
{
|
|
18394
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes",
|
|
18395
|
+
action: "include"
|
|
18396
|
+
}
|
|
18397
|
+
];
|
|
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**.
|
|
18401
|
+
|
|
18402
|
+
**Operational Protocol (Strictly Sequential):**
|
|
18403
|
+
|
|
18404
|
+
1. **Execute \`WixREADME\`:**
|
|
18405
|
+
* **Action:** Invoke \`WixREADME\`.
|
|
18406
|
+
* **Constraint:** MUST complete successfully. NO other Wix tool before this.
|
|
18407
|
+
|
|
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.";
|
|
18429
|
+
async function addGetToKnowTools(server) {
|
|
18430
|
+
server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
|
|
18431
|
+
try {
|
|
18432
|
+
const contents = await Promise.all(
|
|
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
|
+
};
|
|
18456
|
+
})
|
|
18457
|
+
);
|
|
18458
|
+
return {
|
|
18459
|
+
content: contents
|
|
18460
|
+
};
|
|
18461
|
+
} catch (error) {
|
|
18462
|
+
return {
|
|
18463
|
+
isError: true,
|
|
18464
|
+
content: [
|
|
18465
|
+
{
|
|
18466
|
+
type: "text",
|
|
18467
|
+
text: `Error fetching the document: ${error.message}`
|
|
18468
|
+
}
|
|
18469
|
+
]
|
|
18470
|
+
};
|
|
18471
|
+
}
|
|
18472
|
+
});
|
|
18354
18473
|
}
|
|
18355
18474
|
|
|
18356
18475
|
// src/docs/docs.ts
|
|
@@ -18369,7 +18488,10 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18369
18488
|
"BUILD_APPS",
|
|
18370
18489
|
"WIX_HEADLESS",
|
|
18371
18490
|
"BUSINESS_SOLUTIONS"
|
|
18372
|
-
]) => {
|
|
18491
|
+
], getToKnowWixEnabled = false) => {
|
|
18492
|
+
if (getToKnowWixEnabled) {
|
|
18493
|
+
addGetToKnowTools(server);
|
|
18494
|
+
}
|
|
18373
18495
|
if (allowedTools.includes("WDS")) {
|
|
18374
18496
|
server.tool(
|
|
18375
18497
|
"SearchWixWDSDocumentation",
|
|
@@ -18377,7 +18499,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18377
18499
|
"Searches the Wix Design System Documentation for components and patterns.",
|
|
18378
18500
|
"Use this tool when you need to understand or implement UI components and design patterns in a Wix project.",
|
|
18379
18501
|
"Search for specific component names, patterns, or UI requirements.",
|
|
18380
|
-
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
|
|
18502
|
+
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
18503
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18381
18504
|
].join("\n"),
|
|
18382
18505
|
{
|
|
18383
18506
|
searchTerm: z.string().describe(
|
|
@@ -18431,7 +18554,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18431
18554
|
"Searches the official Wix REST API documentation.",
|
|
18432
18555
|
"Use this tool whenever you need to to interact with the Wix platform via HTTP requests.",
|
|
18433
18556
|
"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').",
|
|
18434
|
-
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
|
|
18557
|
+
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
18558
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18435
18559
|
].join("\n"),
|
|
18436
18560
|
{
|
|
18437
18561
|
searchTerm: z.string().describe(
|
|
@@ -18483,7 +18607,7 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18483
18607
|
}
|
|
18484
18608
|
);
|
|
18485
18609
|
}
|
|
18486
|
-
if (allowedTools.includes("BUSINESS_SOLUTIONS")) {
|
|
18610
|
+
if (allowedTools.includes("BUSINESS_SOLUTIONS") && !getToKnowWixEnabled) {
|
|
18487
18611
|
server.tool(
|
|
18488
18612
|
"WixBusinessFlowsDocumentation",
|
|
18489
18613
|
[
|
|
@@ -18552,7 +18676,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18552
18676
|
"Searches the official Wix javascript SDK documentation.",
|
|
18553
18677
|
"Use this tool whenever you need to write or modify Wix related SDK code.",
|
|
18554
18678
|
"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').",
|
|
18555
|
-
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
|
|
18679
|
+
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
18680
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18556
18681
|
].join("\n"),
|
|
18557
18682
|
{
|
|
18558
18683
|
searchTerm: z.string().describe(
|
|
@@ -18613,7 +18738,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18613
18738
|
"Searches the official Build Apps documentation.",
|
|
18614
18739
|
"Use this tool when you need to understand or implement Wix CLI applications related code.",
|
|
18615
18740
|
"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).",
|
|
18616
|
-
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
|
|
18741
|
+
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
18742
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18617
18743
|
].join("\n"),
|
|
18618
18744
|
{
|
|
18619
18745
|
searchTerm: z.string().describe(
|
|
@@ -18666,7 +18792,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18666
18792
|
"Searches the official Wix Headless Documentation.",
|
|
18667
18793
|
"Use this tool when you need to understand or implement Headless related code.",
|
|
18668
18794
|
"The search term should be a specific Wix Headless topic or feature you need information about.",
|
|
18669
|
-
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value."
|
|
18795
|
+
"If you can't find what you need, try to rephrase your search term or use bigger maxResults value.",
|
|
18796
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18670
18797
|
].join("\n"),
|
|
18671
18798
|
{
|
|
18672
18799
|
searchTerm: z.string().describe(
|
|
@@ -18716,7 +18843,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18716
18843
|
"ReadFullDocsArticle",
|
|
18717
18844
|
[
|
|
18718
18845
|
"Fetches the full Wix docs article or method article.",
|
|
18719
|
-
"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."
|
|
18846
|
+
"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.",
|
|
18847
|
+
getToKnowWixEnabled ? WixREADME_DEPENDENT_DESCRIPTION : ""
|
|
18720
18848
|
].join("\n"),
|
|
18721
18849
|
{
|
|
18722
18850
|
articleUrl: z.string().describe(
|
|
@@ -18809,41 +18937,6 @@ var addDocsTools = (server, allowedTools = [
|
|
|
18809
18937
|
);
|
|
18810
18938
|
};
|
|
18811
18939
|
|
|
18812
|
-
// src/docs/get-to-know.ts
|
|
18813
|
-
var defaultDocUrl = "https://dev.wix.com/docs/picasso/wix-ai-docs/rules/get-to-know-wix-llm-instructions";
|
|
18814
|
-
var DESCRIPTION = `**Tool Name:** WixREADME
|
|
18815
|
-
**Description for LLM:**
|
|
18816
|
-
"**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.
|
|
18817
|
-
|
|
18818
|
-
**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.
|
|
18819
|
-
|
|
18820
|
-
**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."`;
|
|
18821
|
-
async function addGetToKnowTools(server, docUrl) {
|
|
18822
|
-
server.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
|
|
18823
|
-
try {
|
|
18824
|
-
const doc = docUrl ? await fetchArticleContent(httpClient, docUrl, "raw") : await fetchArticleContent(httpClient, defaultDocUrl, "article");
|
|
18825
|
-
return {
|
|
18826
|
-
content: [
|
|
18827
|
-
{
|
|
18828
|
-
type: "text",
|
|
18829
|
-
text: doc
|
|
18830
|
-
}
|
|
18831
|
-
]
|
|
18832
|
-
};
|
|
18833
|
-
} catch (error) {
|
|
18834
|
-
return {
|
|
18835
|
-
isError: true,
|
|
18836
|
-
content: [
|
|
18837
|
-
{
|
|
18838
|
-
type: "text",
|
|
18839
|
-
text: `Error fetching the document: ${error.message}`
|
|
18840
|
-
}
|
|
18841
|
-
]
|
|
18842
|
-
};
|
|
18843
|
-
}
|
|
18844
|
-
});
|
|
18845
|
-
}
|
|
18846
|
-
|
|
18847
18940
|
// src/tool-utils.ts
|
|
18848
18941
|
var safeParseJSON = (text) => {
|
|
18849
18942
|
try {
|
|
@@ -19129,7 +19222,6 @@ export {
|
|
|
19129
19222
|
addApiCallTool,
|
|
19130
19223
|
addDocsResources,
|
|
19131
19224
|
addDocsTools,
|
|
19132
|
-
addGetToKnowTools,
|
|
19133
19225
|
addSupportTool,
|
|
19134
19226
|
handleWixAPIResponse
|
|
19135
19227
|
};
|