@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.
- package/build/bin-standalone.js +86 -22
- package/build/bin-standalone.js.map +2 -2
- package/build/cjs/index.cjs +86 -22
- package/build/cjs/index.cjs.map +2 -2
- 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.map +1 -1
- package/build/dts/docs/get-to-know.js +58 -19
- package/build/dts/docs/get-to-know.js.map +1 -1
- package/build/esm/index.js +86 -22
- package/build/esm/index.js.map +2 -2
- package/package.json +2 -2
package/build/bin-standalone.js
CHANGED
|
@@ -15065,7 +15065,7 @@ var runSemanticSearchAndFormat = async ({
|
|
|
15065
15065
|
import { captureException } from "@sentry/node";
|
|
15066
15066
|
|
|
15067
15067
|
// src/docs/fetch-article.ts
|
|
15068
|
-
async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
|
|
15068
|
+
async function fetchArticleContentFromDigor(httpClient, articleUrl, mode, stripHeader = false) {
|
|
15069
15069
|
const url = new URL(`https://dev.wix.com/digor/api/get-article-content`);
|
|
15070
15070
|
url.searchParams.set("articleUrl", articleUrl);
|
|
15071
15071
|
const schema = mode === "methodSchema" ? "true" : "false";
|
|
@@ -15073,56 +15073,120 @@ async function fetchArticleContentFromDigor(httpClient, articleUrl, mode) {
|
|
|
15073
15073
|
logger.log(`Fetching resource from docs ${url.toString()}`);
|
|
15074
15074
|
const { data } = await httpClient.get(url.toString());
|
|
15075
15075
|
logger.log(`Fetched resource from docs: ${data.articleContent}`);
|
|
15076
|
+
const headerDivider = "## Article Content:";
|
|
15077
|
+
if (stripHeader) {
|
|
15078
|
+
const headerIndex = data.articleContent.indexOf(headerDivider);
|
|
15079
|
+
if (headerIndex !== -1) {
|
|
15080
|
+
return data.articleContent.substring(
|
|
15081
|
+
headerIndex + headerDivider.length
|
|
15082
|
+
);
|
|
15083
|
+
}
|
|
15084
|
+
}
|
|
15076
15085
|
return data.articleContent;
|
|
15077
15086
|
}
|
|
15078
|
-
async function fetchArticleContent(httpClient, articleUrl, mode) {
|
|
15087
|
+
async function fetchArticleContent(httpClient, articleUrl, mode, stripHeader = false) {
|
|
15079
15088
|
if (mode === "raw") {
|
|
15080
15089
|
const { data: doc } = await httpClient.get(articleUrl);
|
|
15081
15090
|
return doc;
|
|
15082
15091
|
}
|
|
15083
|
-
return fetchArticleContentFromDigor(
|
|
15092
|
+
return fetchArticleContentFromDigor(
|
|
15093
|
+
httpClient,
|
|
15094
|
+
articleUrl,
|
|
15095
|
+
mode,
|
|
15096
|
+
stripHeader
|
|
15097
|
+
);
|
|
15084
15098
|
}
|
|
15085
15099
|
|
|
15086
15100
|
// src/docs/get-to-know.ts
|
|
15087
15101
|
var docURLs = [
|
|
15088
15102
|
{
|
|
15089
|
-
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions"
|
|
15103
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/get-to-know-wix-llm-instructions",
|
|
15104
|
+
action: "include"
|
|
15090
15105
|
},
|
|
15091
15106
|
{
|
|
15092
|
-
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts"
|
|
15107
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-concepts",
|
|
15108
|
+
action: "include"
|
|
15093
15109
|
},
|
|
15094
15110
|
{
|
|
15095
|
-
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions"
|
|
15111
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions",
|
|
15112
|
+
action: "index",
|
|
15113
|
+
title: "Wix Business Solutions",
|
|
15114
|
+
description: `This document provides an overview of the all business solutions available in Wix.
|
|
15115
|
+
|
|
15116
|
+
Use this document under the following scenarios:
|
|
15117
|
+
1. The user asks general questions about Wix business solutions.
|
|
15118
|
+
2. The user asks about a specific business solution, and you want to provide a high-level overview of it.
|
|
15119
|
+
3. The user looks for a specific business solution, and you want to provide a list of all available solutions.
|
|
15120
|
+
|
|
15121
|
+
Please note that this is a large document. Only use it for the scenarios mentioned above.`
|
|
15096
15122
|
},
|
|
15097
15123
|
{
|
|
15098
|
-
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes"
|
|
15124
|
+
url: "https://dev.wix.com/docs/picasso/wix-ai-docs/index/wix-business-solutions-recipes",
|
|
15125
|
+
action: "include"
|
|
15099
15126
|
}
|
|
15100
15127
|
];
|
|
15101
|
-
var DESCRIPTION =
|
|
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.
|
|
15128
|
+
var DESCRIPTION = `# Tool: WixREADME
|
|
15104
15129
|
|
|
15105
|
-
**
|
|
15130
|
+
**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**.
|
|
15106
15131
|
|
|
15107
|
-
**
|
|
15132
|
+
**Operational Protocol (Strictly Sequential):**
|
|
15108
15133
|
|
|
15109
|
-
**
|
|
15110
|
-
|
|
15111
|
-
|
|
15134
|
+
1. **Execute \`WixREADME\`:**
|
|
15135
|
+
* **Action:** Invoke \`WixREADME\`.
|
|
15136
|
+
* **Constraint:** MUST complete successfully. NO other Wix tool before this.
|
|
15137
|
+
|
|
15138
|
+
2. **Process \`WixREADME\` Output (Link Identification & Relevance Assessment):**
|
|
15139
|
+
* **A. Identify Candidate Links:** Scan \`WixREADME\` output. Extract *only* URLs found within \`<urls>{urls}</urls>\` tags. Ignore all other URLs.
|
|
15140
|
+
* **B. Assess Relevance:** For EACH candidate URL from (A), assess its relevance to the **current user's specific prompt/task**.
|
|
15141
|
+
* **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.
|
|
15142
|
+
|
|
15143
|
+
3. **Fetch Relevant Documents (via \`ReadFullDocsArticle\`):**
|
|
15144
|
+
* **Condition:** ONLY if Step 2B identified one or more *relevant* URLs.
|
|
15145
|
+
* **Action:** For EACH *relevant* URL, invoke \`ReadFullDocsArticle\` to fetch its full content.
|
|
15146
|
+
* **Constraint:** All *relevant* documents MUST be fetched before Step 4.
|
|
15147
|
+
|
|
15148
|
+
4. **Proceed with Other Wix Tools:**
|
|
15149
|
+
* **Condition:** ONLY after completing Steps 1, 2, and 3 (if Step 3 was applicable).
|
|
15150
|
+
* **Action:** Use other Wix tools as needed, utilizing the full context from \`WixREADME\` and fetched relevant documents.
|
|
15151
|
+
|
|
15152
|
+
**Summary of Critical Rules:**
|
|
15153
|
+
* \`WixREADME\` is **ALWAYS FIRST**.
|
|
15154
|
+
* Analyze \`WixREADME\` output: Extract links *only* from \`<urls>{urls}</urls>\` tags.
|
|
15155
|
+
* Assess relevance of *each* extracted link against the user's current task.
|
|
15156
|
+
* Fetch **ONLY RELEVANT** linked documents using \`ReadFullDocsArticle\` before any other Wix tool.
|
|
15157
|
+
* **FAILURE TO FOLLOW THIS EXACT SEQUENCE WILL LEAD TO ERRORS.** Strict adherence is mandatory.`;
|
|
15158
|
+
var WixREADME_DEPENDENT_DESCRIPTION = "**Dependency:** Must be used after 'WixREADME' has successfully run.";
|
|
15112
15159
|
async function addGetToKnowTools(server2) {
|
|
15113
15160
|
server2.tool("WixREADME", DESCRIPTION, async ({ httpClient }) => {
|
|
15114
15161
|
try {
|
|
15115
15162
|
const contents = await Promise.all(
|
|
15116
|
-
docURLs.map(async ({ url }) => {
|
|
15117
|
-
|
|
15118
|
-
|
|
15163
|
+
docURLs.map(async ({ url, action, description, title }) => {
|
|
15164
|
+
if (action === "index") {
|
|
15165
|
+
return {
|
|
15166
|
+
type: "text",
|
|
15167
|
+
text: `## ${title}
|
|
15168
|
+
|
|
15169
|
+
<urls>
|
|
15170
|
+
${url}
|
|
15171
|
+
</urls>
|
|
15172
|
+
|
|
15173
|
+
${description}`
|
|
15174
|
+
};
|
|
15175
|
+
}
|
|
15176
|
+
const content = await fetchArticleContent(
|
|
15177
|
+
httpClient,
|
|
15178
|
+
url,
|
|
15179
|
+
"article",
|
|
15180
|
+
true
|
|
15181
|
+
);
|
|
15182
|
+
return {
|
|
15183
|
+
type: "text",
|
|
15184
|
+
text: content
|
|
15185
|
+
};
|
|
15119
15186
|
})
|
|
15120
15187
|
);
|
|
15121
15188
|
return {
|
|
15122
|
-
content: contents
|
|
15123
|
-
type: "text",
|
|
15124
|
-
text: content
|
|
15125
|
-
}))
|
|
15189
|
+
content: contents
|
|
15126
15190
|
};
|
|
15127
15191
|
} catch (error) {
|
|
15128
15192
|
return {
|