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