@wix/mcp 1.0.28 → 1.0.30
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/README.md +1 -0
- package/build/bin-standalone.js +214 -5
- package/build/bin-standalone.js.map +2 -2
- package/build/cjs/index.cjs +388 -16
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/bin.d.ts +1 -1
- package/build/dts/bin.d.ts.map +1 -1
- package/build/dts/code-mode/index.d.ts +10 -0
- package/build/dts/code-mode/index.d.ts.map +1 -0
- package/build/dts/code-mode/index.js +150 -0
- package/build/dts/code-mode/index.js.map +1 -0
- package/build/dts/config/default-config.d.ts +1 -0
- package/build/dts/config/default-config.d.ts.map +1 -1
- package/build/dts/config/default-config.js +147 -2
- package/build/dts/config/default-config.js.map +1 -1
- package/build/dts/config/param-descriptions.d.ts +5 -0
- package/build/dts/config/param-descriptions.d.ts.map +1 -1
- package/build/dts/config/param-descriptions.js +7 -2
- package/build/dts/config/param-descriptions.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 +56 -2
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/semanticSearch.d.ts.map +1 -1
- package/build/dts/docs/semanticSearch.js +3 -0
- package/build/dts/docs/semanticSearch.js.map +1 -1
- package/build/dts/docs/semanticSearch.test.js +33 -0
- package/build/dts/docs/semanticSearch.test.js.map +1 -1
- package/build/dts/index.d.ts +1 -0
- package/build/dts/index.d.ts.map +1 -1
- package/build/dts/index.js +2 -0
- package/build/dts/index.js.map +1 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +0 -7
- package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -1
- package/build/dts/site-widget-tools/site-builder-tool/index.js +6 -10
- package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -1
- package/build/esm/index.js +387 -16
- package/build/esm/index.js.map +4 -4
- package/package.json +2 -2
package/build/dts/bin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './infra/sentry.js';
|
|
2
|
-
declare const PUBLIC_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "VELO", "BUSINESS_SOLUTIONS"];
|
|
2
|
+
declare const PUBLIC_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "VELO", "BUSINESS_SOLUTIONS", "CLI"];
|
|
3
3
|
declare const EXPERIMENTAL_TOOLS: readonly ["WIX_API", "CLI_COMMAND", "GET_TO_KNOW_WIX", "CREATE_WIX_BUSINESS_GUIDE", "VELO_README", "WIX_API_THROUGH_FS"];
|
|
4
4
|
type Tool = (typeof PUBLIC_TOOLS)[number] | (typeof EXPERIMENTAL_TOOLS)[number];
|
|
5
5
|
export declare const DEFAULT_TOOLS: Tool[];
|
package/build/dts/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAmB3B,QAAA,MAAM,YAAY,oGAAiC,CAAC;AAEpD,QAAA,MAAM,kBAAkB,0HAOd,CAAC;AAEX,KAAK,IAAI,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,aAAa,EAAE,IAAI,EAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
|
+
import type { McpAuthenticationStrategy } from '../auth/index.js';
|
|
3
|
+
export interface CodeModeOptions {
|
|
4
|
+
codeModeBaseUrl: string;
|
|
5
|
+
authStrategy?: McpAuthenticationStrategy;
|
|
6
|
+
disableTools?: string[];
|
|
7
|
+
toolDescriptions?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function addCodeModeTools(server: WixMcpServer, options: CodeModeOptions): void;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/code-mode/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAKD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,eAAe,QAsBzB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { logger } from '../infra/logger.js';
|
|
3
|
+
import { defaultToolDescriptions } from '../config/default-config.js';
|
|
4
|
+
const SEARCH_TOOL_NAME = 'SearchWixAPISpec';
|
|
5
|
+
const EXECUTE_TOOL_NAME = 'ExecuteWixAPI';
|
|
6
|
+
export function addCodeModeTools(server, options) {
|
|
7
|
+
const { codeModeBaseUrl, authStrategy, disableTools = [], toolDescriptions } = options;
|
|
8
|
+
if (!disableTools.includes(SEARCH_TOOL_NAME)) {
|
|
9
|
+
addSearchTool(server, codeModeBaseUrl, disableTools, toolDescriptions);
|
|
10
|
+
}
|
|
11
|
+
if (!disableTools.includes(EXECUTE_TOOL_NAME) && authStrategy) {
|
|
12
|
+
addExecuteTool(server, codeModeBaseUrl, authStrategy, disableTools, toolDescriptions);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function addSearchTool(server, codeModeBaseUrl, disableTools, toolDescriptions) {
|
|
16
|
+
const searchUrl = `${codeModeBaseUrl}/api/code-mode/search`;
|
|
17
|
+
server.tool(SEARCH_TOOL_NAME, toolDescriptions?.[SEARCH_TOOL_NAME] ??
|
|
18
|
+
defaultToolDescriptions.SearchWixAPISpec, {
|
|
19
|
+
code: z
|
|
20
|
+
.string()
|
|
21
|
+
.describe('JavaScript async function() expression to search the Wix API index. Has access to `lightIndex` (array of resources) and `getResourceSchema(resourceId)` (returns full schema).')
|
|
22
|
+
}, { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ code }) => {
|
|
23
|
+
logger.log(`[SearchWixAPISpec] Executing search (${code.length} chars)`);
|
|
24
|
+
try {
|
|
25
|
+
const resp = await fetch(searchUrl, {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: { 'Content-Type': 'application/json' },
|
|
28
|
+
body: JSON.stringify({ code })
|
|
29
|
+
});
|
|
30
|
+
if (!resp.ok) {
|
|
31
|
+
const errorBody = await resp.text();
|
|
32
|
+
logger.log(`[SearchWixAPISpec] HTTP ${resp.status}: ${errorBody}`);
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
text: `Search error (${resp.status}): ${errorBody}`,
|
|
38
|
+
isError: true
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
const data = (await resp.json());
|
|
44
|
+
if (data.error) {
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: `Search error: ${data.error}`,
|
|
50
|
+
isError: true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const text = typeof data.result === 'string'
|
|
56
|
+
? data.result
|
|
57
|
+
: JSON.stringify(data.result, null, 2);
|
|
58
|
+
return {
|
|
59
|
+
content: [{ type: 'text', text }]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
64
|
+
logger.log(`[SearchWixAPISpec] Error: ${message}`);
|
|
65
|
+
return {
|
|
66
|
+
content: [
|
|
67
|
+
{ type: 'text', text: `Search error: ${message}`, isError: true }
|
|
68
|
+
]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function addExecuteTool(server, codeModeBaseUrl, authStrategy, disableTools, toolDescriptions) {
|
|
74
|
+
const executeUrl = `${codeModeBaseUrl}/api/code-mode/execute`;
|
|
75
|
+
server.tool(EXECUTE_TOOL_NAME, toolDescriptions?.[EXECUTE_TOOL_NAME] ??
|
|
76
|
+
defaultToolDescriptions.ExecuteWixAPI, {
|
|
77
|
+
code: z
|
|
78
|
+
.string()
|
|
79
|
+
.describe('JavaScript async function() expression to execute against the Wix REST API. Has access to `wix.request({ method, url, body, headers })` and `siteId`.'),
|
|
80
|
+
siteId: z
|
|
81
|
+
.string()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('Wix site ID to execute against. You can find site IDs using the ListWixSites tool or by querying the Wix API.')
|
|
84
|
+
}, { readOnlyHint: false, destructiveHint: true, openWorldHint: false }, async ({ code, siteId }) => {
|
|
85
|
+
if (!siteId) {
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: 'text',
|
|
90
|
+
text: 'Error: siteId is required. You can list available sites using the ListWixSites tool or by querying the Wix Sites API.',
|
|
91
|
+
isError: true
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
logger.log(`[ExecuteWixAPI] Executing code (${code.length} chars), siteId=${siteId}`);
|
|
97
|
+
try {
|
|
98
|
+
const authHeaders = await authStrategy.getSiteAuthHeaders(siteId);
|
|
99
|
+
const resp = await fetch(executeUrl, {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
...authHeaders
|
|
104
|
+
},
|
|
105
|
+
body: JSON.stringify({ code, siteId })
|
|
106
|
+
});
|
|
107
|
+
if (!resp.ok) {
|
|
108
|
+
const errorBody = await resp.text();
|
|
109
|
+
logger.log(`[ExecuteWixAPI] HTTP ${resp.status}: ${errorBody}`);
|
|
110
|
+
return {
|
|
111
|
+
content: [
|
|
112
|
+
{
|
|
113
|
+
type: 'text',
|
|
114
|
+
text: `Execute error (${resp.status}): ${errorBody}`,
|
|
115
|
+
isError: true
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const data = (await resp.json());
|
|
121
|
+
if (data.error) {
|
|
122
|
+
return {
|
|
123
|
+
content: [
|
|
124
|
+
{
|
|
125
|
+
type: 'text',
|
|
126
|
+
text: `Execute error: ${data.error}`,
|
|
127
|
+
isError: true
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const text = typeof data.result === 'string'
|
|
133
|
+
? data.result
|
|
134
|
+
: JSON.stringify(data.result, null, 2);
|
|
135
|
+
return {
|
|
136
|
+
content: [{ type: 'text', text }]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
141
|
+
logger.log(`[ExecuteWixAPI] Error: ${message}`);
|
|
142
|
+
return {
|
|
143
|
+
content: [
|
|
144
|
+
{ type: 'text', text: `Execute error: ${message}`, isError: true }
|
|
145
|
+
]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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O,CAAC;
|
|
1
|
+
{"version":3,"file":"default-config.d.ts","sourceRoot":"","sources":["../../../src/config/default-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAE5C,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IAExC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAUD;;GAEG;AACH,eAAO,MAAM,eAAe,QAyB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsR1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAoE9C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACpC,iBAAiB,CAkBnB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,iBAQ3B,CAAC"}
|
|
@@ -62,7 +62,8 @@ export const defaultToolDescriptions = {
|
|
|
62
62
|
${SYSTEM_REMINDER}
|
|
63
63
|
`,
|
|
64
64
|
CallWixSiteAPI: dedent `
|
|
65
|
-
Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site
|
|
65
|
+
Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site.
|
|
66
|
+
For POST/PATCH/PUT requests, pass the request body as a JSON object in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}}).
|
|
66
67
|
The API endpoint url param MUST ALWAYS be taken from the conversation context.
|
|
67
68
|
By conversation context we mean the endpoint url was given in the user prompt OR got into the conversation context by the "WixREADME" tool OR by the "SearchWixRESTDocumentation" tool OR by the "BrowseWixRESTDocsMenu" tool OR by the "ReadFullDocsArticle" tool.
|
|
68
69
|
Error Handling:
|
|
@@ -79,6 +80,7 @@ export const defaultToolDescriptions = {
|
|
|
79
80
|
`,
|
|
80
81
|
ManageWixSite: dedent `
|
|
81
82
|
Use account level API in order to create a site, update a site and publish site.
|
|
83
|
+
For POST/PATCH/PUT requests, pass the request body as a JSON object in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}}).
|
|
82
84
|
The API endpoint url param MUST ALWAYS be taken from the conversation context.
|
|
83
85
|
By conversation context we mean the endpoint url was given in the user prompt or got into the conversation context by the "WixREADME" tool or by the "SearchWixRESTDocumentation" tool or by the "BrowseWixRESTDocsMenu" tool or by the "ReadFullDocsArticle" tool.
|
|
84
86
|
${SYSTEM_REMINDER}
|
|
@@ -156,6 +158,148 @@ export const defaultToolDescriptions = {
|
|
|
156
158
|
`,
|
|
157
159
|
VeloREADME: dedent `
|
|
158
160
|
This tool is set for providing Velo context in order to be used by the agent for executing Velo-related tasks.
|
|
161
|
+
`,
|
|
162
|
+
SearchWixCLIDocumentation: dedent `
|
|
163
|
+
Searches the Wix CLI documentation for website development and CLI commands.
|
|
164
|
+
Use this tool when you need information about Wix CLI commands, local development workflows, or CLI-based website development.
|
|
165
|
+
Specify what you need information about (e.g., 'wix dev command', 'local development setup', 'CLI authentication', 'wix deploy').
|
|
166
|
+
If you can't find what you need, try to rephrase your search term or use bigger maxResults value.
|
|
167
|
+
${SYSTEM_REMINDER}
|
|
168
|
+
`,
|
|
169
|
+
SearchWixAPISpec: dedent `
|
|
170
|
+
Search the Wix REST API documentation by writing JavaScript code that runs in a sandboxed environment.
|
|
171
|
+
Your code has access to two globals:
|
|
172
|
+
|
|
173
|
+
**lightIndex** — Array of all Wix REST API resources (~330):
|
|
174
|
+
\`\`\`typescript
|
|
175
|
+
interface LightResource {
|
|
176
|
+
name: string; // e.g. "Products V3", "Contact V4"
|
|
177
|
+
resourceId: string;
|
|
178
|
+
menuPath: string[]; // e.g. ["business-solutions", "stores", "catalog-v3", "products-v3"]
|
|
179
|
+
methods: Array<{
|
|
180
|
+
operationId: string; // e.g. "wix.stores.catalog.v3.CatalogApi.CreateProduct"
|
|
181
|
+
summary: string; // e.g. "Create Product"
|
|
182
|
+
httpMethod: string; // "get" | "post" | "patch" | "delete"
|
|
183
|
+
path: string; // e.g. "/v3/products"
|
|
184
|
+
description: string; // truncated to 200 chars
|
|
185
|
+
}>;
|
|
186
|
+
}
|
|
187
|
+
\`\`\`
|
|
188
|
+
|
|
189
|
+
**getResourceSchema(resourceId)** — Async function returning the full schema for a resource:
|
|
190
|
+
\`\`\`typescript
|
|
191
|
+
interface FullSchema {
|
|
192
|
+
title: string;
|
|
193
|
+
description: string;
|
|
194
|
+
fqdn: string;
|
|
195
|
+
methods: Array<{
|
|
196
|
+
summary: string;
|
|
197
|
+
description: string;
|
|
198
|
+
operationId: string;
|
|
199
|
+
httpMethod: string;
|
|
200
|
+
path: string;
|
|
201
|
+
servers: Array<{ url: string }>; // Base URLs (e.g. "https://www.wixapis.com/...")
|
|
202
|
+
requestBody: object | null;
|
|
203
|
+
responses: object;
|
|
204
|
+
parameters: Array<object>;
|
|
205
|
+
permissions: string[];
|
|
206
|
+
legacyExamples: Array<{ // Curl examples
|
|
207
|
+
content: { title: string; request: string; response: string };
|
|
208
|
+
}>;
|
|
209
|
+
sdkData: { // JS SDK examples
|
|
210
|
+
packageName: string;
|
|
211
|
+
namespace: string;
|
|
212
|
+
methodExamples: Array<{ title: string; content: string }>;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
components: { schemas: object };
|
|
216
|
+
}
|
|
217
|
+
\`\`\`
|
|
218
|
+
|
|
219
|
+
Your code MUST be an \`async function()\` expression that returns a value.
|
|
220
|
+
|
|
221
|
+
Top-level verticals: business-solutions (stores, e-commerce, bookings, events, restaurants, pricing-plans, coupons), crm (contacts, members, loyalty-program, forms, community), business-management (payments, invoices, automations), assets (media, files), app-management (oauth, billing), account-level, site.
|
|
222
|
+
|
|
223
|
+
Examples:
|
|
224
|
+
|
|
225
|
+
Find APIs by keyword:
|
|
226
|
+
\`\`\`javascript
|
|
227
|
+
async function() {
|
|
228
|
+
return lightIndex.filter(r => r.methods.some(m => m.summary.toLowerCase().includes("query products")))
|
|
229
|
+
.map(r => ({ name: r.name, methods: r.methods.map(m => m.summary + " (" + m.httpMethod.toUpperCase() + " " + m.path + ")") }));
|
|
230
|
+
}
|
|
231
|
+
\`\`\`
|
|
232
|
+
|
|
233
|
+
Get full schema with base URL, curl examples, and permissions:
|
|
234
|
+
\`\`\`javascript
|
|
235
|
+
async function() {
|
|
236
|
+
const resource = lightIndex.find(r => r.name === "Contact V4");
|
|
237
|
+
const schema = await getResourceSchema(resource.resourceId);
|
|
238
|
+
const method = schema.methods.find(m => m.summary === "Query Contacts");
|
|
239
|
+
return {
|
|
240
|
+
baseUrl: method.servers?.find(s => s.url.includes("wixapis.com"))?.url,
|
|
241
|
+
path: method.path,
|
|
242
|
+
httpMethod: method.httpMethod,
|
|
243
|
+
permissions: method.permissions,
|
|
244
|
+
requestBody: method.requestBody,
|
|
245
|
+
curlExample: method.legacyExamples?.[0]?.content,
|
|
246
|
+
sdkExample: method.sdkData?.methodExamples?.[0]?.content
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
\`\`\`
|
|
250
|
+
|
|
251
|
+
Browse a vertical:
|
|
252
|
+
\`\`\`javascript
|
|
253
|
+
async function() {
|
|
254
|
+
return lightIndex.filter(r => r.menuPath[0] === "crm")
|
|
255
|
+
.map(r => ({ name: r.name, path: r.menuPath.join(" > "), methods: r.methods.length }));
|
|
256
|
+
}
|
|
257
|
+
\`\`\`
|
|
258
|
+
`,
|
|
259
|
+
ExecuteWixAPI: dedent `
|
|
260
|
+
Execute JavaScript code against the Wix REST API. First use the 'SearchWixAPISpec' tool to find the right endpoints, base URLs, and request/response schemas. Then write code using the wix.request() function. Auth is handled automatically — do not set Authorization headers.
|
|
261
|
+
|
|
262
|
+
Available in your code:
|
|
263
|
+
\`\`\`typescript
|
|
264
|
+
interface WixRequestOptions {
|
|
265
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
266
|
+
url: string; // Full URL from schema servers field, e.g. "https://www.wixapis.com/contacts/v4/contacts"
|
|
267
|
+
body?: unknown;
|
|
268
|
+
headers?: Record<string, string>; // Do NOT set Authorization — it is injected automatically
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
interface WixResponse<T = unknown> {
|
|
272
|
+
status: number;
|
|
273
|
+
data: T;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
declare const wix: {
|
|
277
|
+
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
declare const siteId: string | undefined;
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
Your code MUST be an \`async function()\` expression that returns the result.
|
|
284
|
+
|
|
285
|
+
Example — query products then update one:
|
|
286
|
+
\`\`\`javascript
|
|
287
|
+
async function() {
|
|
288
|
+
const list = await wix.request({
|
|
289
|
+
method: "POST",
|
|
290
|
+
url: "https://www.wixapis.com/stores/v1/products/query",
|
|
291
|
+
body: { query: { paging: { limit: 5 } } }
|
|
292
|
+
});
|
|
293
|
+
const product = list.data.products[0];
|
|
294
|
+
if (!product) return { error: "No products found" };
|
|
295
|
+
const updated = await wix.request({
|
|
296
|
+
method: "PATCH",
|
|
297
|
+
url: \`https://www.wixapis.com/stores/v1/products/\${product.id}\`,
|
|
298
|
+
body: { product: { name: "Updated Name" } }
|
|
299
|
+
});
|
|
300
|
+
return updated.data;
|
|
301
|
+
}
|
|
302
|
+
\`\`\`
|
|
159
303
|
`
|
|
160
304
|
};
|
|
161
305
|
/**
|
|
@@ -249,7 +393,8 @@ export function mergeConfig(base, overrides) {
|
|
|
249
393
|
docsTools: overrides.docsTools ?? base.docsTools,
|
|
250
394
|
getToKnowWixEnabled: overrides.getToKnowWixEnabled ?? base.getToKnowWixEnabled,
|
|
251
395
|
createWixBusinessGuideEnabled: overrides.createWixBusinessGuideEnabled ??
|
|
252
|
-
base.createWixBusinessGuideEnabled
|
|
396
|
+
base.createWixBusinessGuideEnabled,
|
|
397
|
+
codeModeEnabled: overrides.codeModeEnabled ?? base.codeModeEnabled
|
|
253
398
|
};
|
|
254
399
|
}
|
|
255
400
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-config.js","sourceRoot":"","sources":["../../../src/config/default-config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"default-config.js","sourceRoot":"","sources":["../../../src/config/default-config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAsB5B;;GAEG;AACH,MAAM,UAAU,GAAG,MAAM,CAAA;;;CAGxB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAA;;;;;IAKjC,UAAU;;;;;;;;;;;;;;;;;;;;CAoBb,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA2B;IAC7D,SAAS,EAAE,MAAM,CAAA;;;MAGb,eAAe;GAClB;IAED,0BAA0B,EAAE,MAAM,CAAA;;;;;MAK9B,e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W,EAAE,MAAM,CAAA;;;;;;;;;KASlB;KACF;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,IAAuB,EACvB,SAAqC;IAErC,OAAO;QACL,gBAAgB,EAAE;YAChB,GAAG,IAAI,CAAC,gBAAgB;YACxB,GAAG,SAAS,CAAC,gBAAgB;SAC9B;QACD,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QACvE,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QACpE,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;QACnD,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE;QACxD,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS;QAChD,mBAAmB,EACjB,SAAS,CAAC,mBAAmB,IAAI,IAAI,CAAC,mBAAmB;QAC3D,6BAA6B,EAC3B,SAAS,CAAC,6BAA6B;YACvC,IAAI,CAAC,6BAA6B;QACpC,eAAe,EAAE,SAAS,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe;KACnE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,gBAAgB,EAAE,uBAAuB;IACzC,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,iBAAiB;IAC7B,mEAAmE;IACnE,mBAAmB,EAAE,IAAI;IACzB,6BAA6B,EAAE,IAAI;CACpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"param-descriptions.d.ts","sourceRoot":"","sources":["../../../src/config/param-descriptions.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"param-descriptions.d.ts","sourceRoot":"","sources":["../../../src/config/param-descriptions.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,MAAM,OAAO,iBAAiB,EAC3D,UAAU,CAAC,KACV,CAAC,OAAO,iBAAiB,EAAE,CAAC,CAAgC,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const paramDescriptions = {
|
|
|
13
13
|
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`
|
|
14
14
|
].join('\n'),
|
|
15
15
|
method: 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)',
|
|
16
|
-
body: 'The request body object. YOU MUST NEVER MAKE UP A BODY - the body should be based on the conversation context, i.e from the user prompt OR got into the conversation context by the "ReadFullDocsArticle" tool OR by the "ReadFullDocsMethodSchema" tool - i.e based on the API docs, a relevant recipe you read (preferably), a code example you found in the docs, a schema you read etc.. YOU MUST NEVER ASSUME YOU KNOW WHAT THE BODY SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT. Prefer reading relevant recipes if you have them in context for understand the body schema for API calls.',
|
|
16
|
+
body: 'The request body as a JSON object with all the required fields and values, including nested objects. Pass the actual object, NOT a JSON string. YOU MUST NEVER MAKE UP A BODY - the body should be based on the conversation context, i.e from the user prompt OR got into the conversation context by the "ReadFullDocsArticle" tool OR by the "ReadFullDocsMethodSchema" tool - i.e based on the API docs, a relevant recipe you read (preferably), a code example you found in the docs, a schema you read etc.. YOU MUST NEVER ASSUME YOU KNOW WHAT THE BODY SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT. Prefer reading relevant recipes if you have them in context for understand the body schema for API calls.',
|
|
17
17
|
reason: 'One sentence explaining the original user request and why you are calling this API to complete it.',
|
|
18
18
|
sourceDocUrl: [
|
|
19
19
|
'The URL of the documentation or recipe where you found this API endpoint.',
|
|
@@ -31,7 +31,7 @@ export const paramDescriptions = {
|
|
|
31
31
|
ManageWixSite: {
|
|
32
32
|
url: 'The url of the api to call - ALWAYS get the information from the Wix REST docs DONT GUESS IT, the URL MUST BE ABSOLUTE URL',
|
|
33
33
|
method: 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)',
|
|
34
|
-
body: 'The request body object. YOU MUST NEVER MAKE UP A BODY - this should be based on the conversation context, i.e from the user prompt or from the "WixREADME" tool or from the "SearchWixRESTDocumentation" tool or from the "BrowseWixRESTDocsMenu" tool or from the "ReadFullDocsArticle" tool or from the "ReadFullDocsMethodSchema" tool - i.e based on the API docs. YOU MUST NEVER ASSUME YOU KNOW WHAT THE SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT.'
|
|
34
|
+
body: 'The request body as a JSON object with all the required fields and values, including nested objects. Pass the actual object, NOT a JSON string. YOU MUST NEVER MAKE UP A BODY - this should be based on the conversation context, i.e from the user prompt or from the "WixREADME" tool or from the "SearchWixRESTDocumentation" tool or from the "BrowseWixRESTDocsMenu" tool or from the "ReadFullDocsArticle" tool or from the "ReadFullDocsMethodSchema" tool - i.e based on the API docs. YOU MUST NEVER ASSUME YOU KNOW WHAT THE SCHEMA IS WITHOUT CONCRETE EXAMPLES OR SCHEMA DEFINITIONS FROM THE CONVERSATION CONTEXT.'
|
|
35
35
|
},
|
|
36
36
|
SearchWixWDSDocumentation: {
|
|
37
37
|
searchTerm: 'The search term to search for in the Wix Design System Documentation',
|
|
@@ -62,6 +62,11 @@ export const paramDescriptions = {
|
|
|
62
62
|
searchTerm: 'The search term to search for in the Velo Documentation',
|
|
63
63
|
maxResults: 'The maximum number of results to return, default is 5, max is 15'
|
|
64
64
|
},
|
|
65
|
+
SearchWixCLIDocumentation: {
|
|
66
|
+
searchTerm: 'The search term to search for in the Wix CLI Documentation',
|
|
67
|
+
maxResults: 'The maximum number of results to return, default is 5, max is 15',
|
|
68
|
+
reason: 'One sentence describing the original user request and the task you are trying to accomplish with this search.'
|
|
69
|
+
},
|
|
65
70
|
ReadFullDocsArticle: {
|
|
66
71
|
articleUrl: 'The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../.../...'
|
|
67
72
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"param-descriptions.js","sourceRoot":"","sources":["../../../src/config/param-descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,uDAAuD;QAC/D,GAAG,EAAE;YACH,2IAA2I;YAC3I,2PAA2P;YAC3P,yBAAyB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACvD,gIAAgI;SACjI,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,MAAM,EACJ,uEAAuE;QACzE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"param-descriptions.js","sourceRoot":"","sources":["../../../src/config/param-descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,uDAAuD;QAC/D,GAAG,EAAE;YACH,2IAA2I;YAC3I,2PAA2P;YAC3P,yBAAyB,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACvD,gIAAgI;SACjI,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,MAAM,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EAAiE;YACjE,6DAA6D;YAC7D,2HAA2H;SAC5H,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,MAAM,EACJ,wGAAwG;KAC3G;IAED,oBAAoB,EAAE;QACpB,MAAM,EAAE,qCAAqC;QAC7C,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EACT,mGAAmG;KACtG;IAED,gBAAgB,EAAE;QAChB,OAAO,EAAE,yDAAyD;QAClE,aAAa,EACX,iGAAiG;QACnG,aAAa,EACX,6HAA6H;QAC/H,YAAY,EACV,0FAA0F;QAC5F,OAAO,EACL,qNAAqN;KACxN;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,QAAW,EACoB,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC"}
|
package/build/dts/docs/docs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
2
|
import { McpAuthenticationStrategy } from '../auth/index.js';
|
|
3
|
-
export declare const VALID_DOCS_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "VELO", "BUSINESS_SOLUTIONS"];
|
|
3
|
+
export declare const VALID_DOCS_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "VELO", "BUSINESS_SOLUTIONS", "CLI"];
|
|
4
4
|
export type DocsTool = (typeof VALID_DOCS_TOOLS)[number];
|
|
5
5
|
/**
|
|
6
6
|
* Configuration for a README doc entry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../src/docs/docs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAWzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"docs.d.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dts/docs/docs.js
CHANGED
|
@@ -15,7 +15,8 @@ export const VALID_DOCS_TOOLS = [
|
|
|
15
15
|
'BUILD_APPS',
|
|
16
16
|
'WIX_HEADLESS',
|
|
17
17
|
'VELO',
|
|
18
|
-
'BUSINESS_SOLUTIONS'
|
|
18
|
+
'BUSINESS_SOLUTIONS',
|
|
19
|
+
'CLI'
|
|
19
20
|
];
|
|
20
21
|
export const addDocsTools = (server, allowedTools = [
|
|
21
22
|
'WDS',
|
|
@@ -23,7 +24,8 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
23
24
|
'SDK',
|
|
24
25
|
'BUILD_APPS',
|
|
25
26
|
'WIX_HEADLESS',
|
|
26
|
-
'BUSINESS_SOLUTIONS'
|
|
27
|
+
'BUSINESS_SOLUTIONS',
|
|
28
|
+
'CLI'
|
|
27
29
|
], options = {}) => {
|
|
28
30
|
const { getToKnowWixEnabled = false, createWixBusinessGuideEnabled = true, disableTools, toolDescriptions, readmeDocs, authStrategy, picassoPortalUrl } = options;
|
|
29
31
|
// Helper to get description (custom or default)
|
|
@@ -410,6 +412,58 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
410
412
|
}
|
|
411
413
|
});
|
|
412
414
|
}
|
|
415
|
+
// CLI Documentation
|
|
416
|
+
if (allowedTools.includes('CLI') &&
|
|
417
|
+
!disableTools?.includes('SearchWixCLIDocumentation')) {
|
|
418
|
+
server.tool('SearchWixCLIDocumentation', getDescription('SearchWixCLIDocumentation', defaultToolDescriptions.SearchWixCLIDocumentation ?? ''), (() => {
|
|
419
|
+
const d = desc('SearchWixCLIDocumentation');
|
|
420
|
+
return {
|
|
421
|
+
searchTerm: z.string().describe(d.searchTerm),
|
|
422
|
+
maxResults: z
|
|
423
|
+
.number()
|
|
424
|
+
.describe(d.maxResults)
|
|
425
|
+
.min(1)
|
|
426
|
+
.max(15)
|
|
427
|
+
.optional()
|
|
428
|
+
.default(10),
|
|
429
|
+
reason: z.string().describe(d.reason)
|
|
430
|
+
};
|
|
431
|
+
})(), { readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ searchTerm, maxResults, reason }, { panorama }) => {
|
|
432
|
+
try {
|
|
433
|
+
logger.log(`[SearchWixCLIDocumentation] searchTerm="${searchTerm}", reason="${reason}"`);
|
|
434
|
+
const result = await runSemanticSearchAndFormat({
|
|
435
|
+
toolName: 'CLI',
|
|
436
|
+
toolParams: {
|
|
437
|
+
searchTerm: searchTerm
|
|
438
|
+
},
|
|
439
|
+
maxResults: Math.max(1, Math.min(maxResults ?? 5, 15)),
|
|
440
|
+
linesInEachResult: 15
|
|
441
|
+
});
|
|
442
|
+
return {
|
|
443
|
+
content: [
|
|
444
|
+
{
|
|
445
|
+
type: 'text',
|
|
446
|
+
text: result
|
|
447
|
+
}
|
|
448
|
+
]
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
panorama.errorMonitor().reportError(error);
|
|
453
|
+
captureException(error, {
|
|
454
|
+
tags: {
|
|
455
|
+
componentId: 'SearchWixCLIDocumentation',
|
|
456
|
+
toolName: 'SearchWixCLIDocumentation'
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
logger.error(`Error searching for ${searchTerm} in Wix CLI: ${error}`);
|
|
460
|
+
return {
|
|
461
|
+
isError: true,
|
|
462
|
+
content: [{ type: 'text', text: 'Error: ' + error.message }]
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}
|
|
413
467
|
if (!disableTools?.includes('ReadFullDocsArticle')) {
|
|
414
468
|
server.tool('ReadFullDocsArticle', getDescription('ReadFullDocsArticle', defaultToolDescriptions.ReadFullDocsArticle), (() => {
|
|
415
469
|
const d = desc('ReadFullDocsArticle');
|