@wix/mcp 1.0.87 → 1.0.88
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 +25 -0
- package/build/cjs/index.cjs +36 -2
- package/build/cjs/toolkit.cjs +36 -2
- package/build/dts/code-mode/index.js +12 -2
- package/build/dts/config/default-config.js +25 -0
- package/build/esm/index.js +36 -2
- package/build/esm/toolkit.js +36 -2
- package/package.json +2 -2
package/build/bin-standalone.js
CHANGED
|
@@ -71735,8 +71735,33 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
71735
71735
|
}
|
|
71736
71736
|
declare const wix: {
|
|
71737
71737
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
71738
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
71739
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
71740
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
71741
|
+
multipart(
|
|
71742
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
71743
|
+
options?: { fieldName?: string }
|
|
71744
|
+
): { body: string; contentType: string };
|
|
71738
71745
|
};
|
|
71739
71746
|
declare const siteId: string | undefined;
|
|
71747
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
71748
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
71749
|
+
\`\`\`
|
|
71750
|
+
|
|
71751
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
71752
|
+
\`\`\`javascript
|
|
71753
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
71754
|
+
async () => {
|
|
71755
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
71756
|
+
const res = await wix.request({
|
|
71757
|
+
scope: "account",
|
|
71758
|
+
method: "POST",
|
|
71759
|
+
url: "https://www.wixapis.com/.../upload",
|
|
71760
|
+
headers: { "Content-Type": mp.contentType },
|
|
71761
|
+
body: mp.body
|
|
71762
|
+
});
|
|
71763
|
+
return res.data;
|
|
71764
|
+
}
|
|
71740
71765
|
\`\`\`
|
|
71741
71766
|
`;
|
|
71742
71767
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
package/build/cjs/index.cjs
CHANGED
|
@@ -37351,8 +37351,33 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
37351
37351
|
}
|
|
37352
37352
|
declare const wix: {
|
|
37353
37353
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
37354
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
37355
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
37356
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
37357
|
+
multipart(
|
|
37358
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
37359
|
+
options?: { fieldName?: string }
|
|
37360
|
+
): { body: string; contentType: string };
|
|
37354
37361
|
};
|
|
37355
37362
|
declare const siteId: string | undefined;
|
|
37363
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
37364
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
37365
|
+
\`\`\`
|
|
37366
|
+
|
|
37367
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
37368
|
+
\`\`\`javascript
|
|
37369
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
37370
|
+
async () => {
|
|
37371
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
37372
|
+
const res = await wix.request({
|
|
37373
|
+
scope: "account",
|
|
37374
|
+
method: "POST",
|
|
37375
|
+
url: "https://www.wixapis.com/.../upload",
|
|
37376
|
+
headers: { "Content-Type": mp.contentType },
|
|
37377
|
+
body: mp.body
|
|
37378
|
+
});
|
|
37379
|
+
return res.data;
|
|
37380
|
+
}
|
|
37356
37381
|
\`\`\`
|
|
37357
37382
|
`;
|
|
37358
37383
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
@@ -53156,6 +53181,14 @@ function addExecuteTool(server, options) {
|
|
|
53156
53181
|
visitor ? "Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor\u2019s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false." : "Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false."
|
|
53157
53182
|
),
|
|
53158
53183
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d2.sourceDocUrls),
|
|
53184
|
+
files: external_exports.string().optional().describe(
|
|
53185
|
+
[
|
|
53186
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
53187
|
+
"Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
|
|
53188
|
+
'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload \u2014 e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
53189
|
+
"Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported."
|
|
53190
|
+
].join(" ")
|
|
53191
|
+
),
|
|
53159
53192
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
53160
53193
|
// mode lets the agent pick the site.
|
|
53161
53194
|
...visitor ? {
|
|
@@ -53170,7 +53203,7 @@ function addExecuteTool(server, options) {
|
|
|
53170
53203
|
},
|
|
53171
53204
|
{ readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
53172
53205
|
async (rawArgs, extra) => {
|
|
53173
|
-
const { code, reason, hasMutations, sourceDocUrls, visitorToken } = rawArgs;
|
|
53206
|
+
const { code, reason, hasMutations, sourceDocUrls, visitorToken, files } = rawArgs;
|
|
53174
53207
|
const siteId = visitor ? visitor.siteId : rawArgs.siteId;
|
|
53175
53208
|
logger2.log(
|
|
53176
53209
|
`[ExecuteWixAPI]${visitor ? " (visitor)" : ""} Executing code (${code.length} chars), siteId=${siteId ?? "none"}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason="${reason}"`
|
|
@@ -53215,7 +53248,8 @@ function addExecuteTool(server, options) {
|
|
|
53215
53248
|
siteToken: visitor ? visitorToken : siteHeaders?.Authorization,
|
|
53216
53249
|
accountToken: visitor ? visitorToken : accountHeaders?.Authorization,
|
|
53217
53250
|
accountId: accountHeaders?.["wix-account-id"],
|
|
53218
|
-
siteAuthContext
|
|
53251
|
+
siteAuthContext,
|
|
53252
|
+
...files ? { files } : {}
|
|
53219
53253
|
},
|
|
53220
53254
|
visitor ? visitorToken : accountHeaders?.Authorization ?? siteHeaders?.Authorization,
|
|
53221
53255
|
codeModeFetch
|
package/build/cjs/toolkit.cjs
CHANGED
|
@@ -17838,8 +17838,33 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
17838
17838
|
}
|
|
17839
17839
|
declare const wix: {
|
|
17840
17840
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
17841
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
17842
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
17843
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
17844
|
+
multipart(
|
|
17845
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
17846
|
+
options?: { fieldName?: string }
|
|
17847
|
+
): { body: string; contentType: string };
|
|
17841
17848
|
};
|
|
17842
17849
|
declare const siteId: string | undefined;
|
|
17850
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
17851
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
17852
|
+
\`\`\`
|
|
17853
|
+
|
|
17854
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
17855
|
+
\`\`\`javascript
|
|
17856
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
17857
|
+
async () => {
|
|
17858
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
17859
|
+
const res = await wix.request({
|
|
17860
|
+
scope: "account",
|
|
17861
|
+
method: "POST",
|
|
17862
|
+
url: "https://www.wixapis.com/.../upload",
|
|
17863
|
+
headers: { "Content-Type": mp.contentType },
|
|
17864
|
+
body: mp.body
|
|
17865
|
+
});
|
|
17866
|
+
return res.data;
|
|
17867
|
+
}
|
|
17843
17868
|
\`\`\`
|
|
17844
17869
|
`;
|
|
17845
17870
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
@@ -22299,6 +22324,14 @@ function addExecuteTool(server, options) {
|
|
|
22299
22324
|
visitor ? "Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor\u2019s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false." : "Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false."
|
|
22300
22325
|
),
|
|
22301
22326
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d.sourceDocUrls),
|
|
22327
|
+
files: external_exports.string().optional().describe(
|
|
22328
|
+
[
|
|
22329
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
22330
|
+
"Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
|
|
22331
|
+
'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload \u2014 e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
22332
|
+
"Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported."
|
|
22333
|
+
].join(" ")
|
|
22334
|
+
),
|
|
22302
22335
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
22303
22336
|
// mode lets the agent pick the site.
|
|
22304
22337
|
...visitor ? {
|
|
@@ -22313,7 +22346,7 @@ function addExecuteTool(server, options) {
|
|
|
22313
22346
|
},
|
|
22314
22347
|
{ readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
22315
22348
|
async (rawArgs, extra) => {
|
|
22316
|
-
const { code, reason, hasMutations, sourceDocUrls, visitorToken } = rawArgs;
|
|
22349
|
+
const { code, reason, hasMutations, sourceDocUrls, visitorToken, files } = rawArgs;
|
|
22317
22350
|
const siteId = visitor ? visitor.siteId : rawArgs.siteId;
|
|
22318
22351
|
logger.log(
|
|
22319
22352
|
`[ExecuteWixAPI]${visitor ? " (visitor)" : ""} Executing code (${code.length} chars), siteId=${siteId ?? "none"}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason="${reason}"`
|
|
@@ -22358,7 +22391,8 @@ function addExecuteTool(server, options) {
|
|
|
22358
22391
|
siteToken: visitor ? visitorToken : siteHeaders?.Authorization,
|
|
22359
22392
|
accountToken: visitor ? visitorToken : accountHeaders?.Authorization,
|
|
22360
22393
|
accountId: accountHeaders?.["wix-account-id"],
|
|
22361
|
-
siteAuthContext
|
|
22394
|
+
siteAuthContext,
|
|
22395
|
+
...files ? { files } : {}
|
|
22362
22396
|
},
|
|
22363
22397
|
visitor ? visitorToken : accountHeaders?.Authorization ?? siteHeaders?.Authorization,
|
|
22364
22398
|
codeModeFetch
|
|
@@ -236,6 +236,15 @@ function addExecuteTool(server, options) {
|
|
|
236
236
|
? 'Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor’s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false.'
|
|
237
237
|
: 'Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false.'),
|
|
238
238
|
sourceDocUrls: z.array(z.string()).describe(d.sourceDocUrls),
|
|
239
|
+
files: z
|
|
240
|
+
.string()
|
|
241
|
+
.optional()
|
|
242
|
+
.describe([
|
|
243
|
+
'Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).',
|
|
244
|
+
"Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
|
|
245
|
+
'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload — e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
246
|
+
'Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported.'
|
|
247
|
+
].join(' ')),
|
|
239
248
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
240
249
|
// mode lets the agent pick the site.
|
|
241
250
|
...(visitor
|
|
@@ -254,7 +263,7 @@ function addExecuteTool(server, options) {
|
|
|
254
263
|
// Partial: duck-typed servers (the toolkit's capturing server, test
|
|
255
264
|
// doubles) build their own extra and may not supply every field.
|
|
256
265
|
extra) => {
|
|
257
|
-
const { code, reason, hasMutations, sourceDocUrls, visitorToken } = rawArgs;
|
|
266
|
+
const { code, reason, hasMutations, sourceDocUrls, visitorToken, files } = rawArgs;
|
|
258
267
|
// In visitor mode the site is pinned; otherwise it comes from the param.
|
|
259
268
|
const siteId = visitor ? visitor.siteId : rawArgs.siteId;
|
|
260
269
|
logger.log(`[ExecuteWixAPI]${visitor ? ' (visitor)' : ''} Executing code (${code.length} chars), siteId=${siteId ?? 'none'}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason="${reason}"`);
|
|
@@ -318,7 +327,8 @@ function addExecuteTool(server, options) {
|
|
|
318
327
|
? visitorToken
|
|
319
328
|
: accountHeaders?.Authorization,
|
|
320
329
|
accountId: accountHeaders?.['wix-account-id'],
|
|
321
|
-
siteAuthContext
|
|
330
|
+
siteAuthContext,
|
|
331
|
+
...(files ? { files } : {})
|
|
322
332
|
}, visitor
|
|
323
333
|
? visitorToken
|
|
324
334
|
: (accountHeaders?.Authorization ?? siteHeaders?.Authorization), codeModeFetch);
|
|
@@ -165,8 +165,33 @@ const ACCOUNT_SITE_EXECUTE_SCOPE = dedent `
|
|
|
165
165
|
}
|
|
166
166
|
declare const wix: {
|
|
167
167
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
168
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
169
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
170
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
171
|
+
multipart(
|
|
172
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
173
|
+
options?: { fieldName?: string }
|
|
174
|
+
): { body: string; contentType: string };
|
|
168
175
|
};
|
|
169
176
|
declare const siteId: string | undefined;
|
|
177
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
178
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
179
|
+
\`\`\`
|
|
180
|
+
|
|
181
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
182
|
+
\`\`\`javascript
|
|
183
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
184
|
+
async () => {
|
|
185
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
186
|
+
const res = await wix.request({
|
|
187
|
+
scope: "account",
|
|
188
|
+
method: "POST",
|
|
189
|
+
url: "https://www.wixapis.com/.../upload",
|
|
190
|
+
headers: { "Content-Type": mp.contentType },
|
|
191
|
+
body: mp.body
|
|
192
|
+
});
|
|
193
|
+
return res.data;
|
|
194
|
+
}
|
|
170
195
|
\`\`\`
|
|
171
196
|
`;
|
|
172
197
|
const EXECUTE_WIX_API_WQL = dedent `
|
package/build/esm/index.js
CHANGED
|
@@ -31064,8 +31064,33 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
31064
31064
|
}
|
|
31065
31065
|
declare const wix: {
|
|
31066
31066
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
31067
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
31068
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
31069
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
31070
|
+
multipart(
|
|
31071
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
31072
|
+
options?: { fieldName?: string }
|
|
31073
|
+
): { body: string; contentType: string };
|
|
31067
31074
|
};
|
|
31068
31075
|
declare const siteId: string | undefined;
|
|
31076
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
31077
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
31078
|
+
\`\`\`
|
|
31079
|
+
|
|
31080
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
31081
|
+
\`\`\`javascript
|
|
31082
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
31083
|
+
async () => {
|
|
31084
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
31085
|
+
const res = await wix.request({
|
|
31086
|
+
scope: "account",
|
|
31087
|
+
method: "POST",
|
|
31088
|
+
url: "https://www.wixapis.com/.../upload",
|
|
31089
|
+
headers: { "Content-Type": mp.contentType },
|
|
31090
|
+
body: mp.body
|
|
31091
|
+
});
|
|
31092
|
+
return res.data;
|
|
31093
|
+
}
|
|
31069
31094
|
\`\`\`
|
|
31070
31095
|
`;
|
|
31071
31096
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
@@ -46920,6 +46945,14 @@ function addExecuteTool(server, options) {
|
|
|
46920
46945
|
visitor ? "Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor\u2019s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false." : "Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false."
|
|
46921
46946
|
),
|
|
46922
46947
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d2.sourceDocUrls),
|
|
46948
|
+
files: external_exports.string().optional().describe(
|
|
46949
|
+
[
|
|
46950
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
46951
|
+
"Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
|
|
46952
|
+
'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload \u2014 e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
46953
|
+
"Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported."
|
|
46954
|
+
].join(" ")
|
|
46955
|
+
),
|
|
46923
46956
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
46924
46957
|
// mode lets the agent pick the site.
|
|
46925
46958
|
...visitor ? {
|
|
@@ -46934,7 +46967,7 @@ function addExecuteTool(server, options) {
|
|
|
46934
46967
|
},
|
|
46935
46968
|
{ readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
46936
46969
|
async (rawArgs, extra) => {
|
|
46937
|
-
const { code, reason, hasMutations, sourceDocUrls, visitorToken } = rawArgs;
|
|
46970
|
+
const { code, reason, hasMutations, sourceDocUrls, visitorToken, files } = rawArgs;
|
|
46938
46971
|
const siteId = visitor ? visitor.siteId : rawArgs.siteId;
|
|
46939
46972
|
logger2.log(
|
|
46940
46973
|
`[ExecuteWixAPI]${visitor ? " (visitor)" : ""} Executing code (${code.length} chars), siteId=${siteId ?? "none"}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason="${reason}"`
|
|
@@ -46979,7 +47012,8 @@ function addExecuteTool(server, options) {
|
|
|
46979
47012
|
siteToken: visitor ? visitorToken : siteHeaders?.Authorization,
|
|
46980
47013
|
accountToken: visitor ? visitorToken : accountHeaders?.Authorization,
|
|
46981
47014
|
accountId: accountHeaders?.["wix-account-id"],
|
|
46982
|
-
siteAuthContext
|
|
47015
|
+
siteAuthContext,
|
|
47016
|
+
...files ? { files } : {}
|
|
46983
47017
|
},
|
|
46984
47018
|
visitor ? visitorToken : accountHeaders?.Authorization ?? siteHeaders?.Authorization,
|
|
46985
47019
|
codeModeFetch
|
package/build/esm/toolkit.js
CHANGED
|
@@ -12260,8 +12260,33 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
12260
12260
|
}
|
|
12261
12261
|
declare const wix: {
|
|
12262
12262
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
12263
|
+
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
12264
|
+
// global). Each file becomes a part named fieldName (default "files") with
|
|
12265
|
+
// its path as the filename. Pass body + contentType to wix.request.
|
|
12266
|
+
multipart(
|
|
12267
|
+
files?: Array<{ path: string; content: string; contentType?: string }>,
|
|
12268
|
+
options?: { fieldName?: string }
|
|
12269
|
+
): { body: string; contentType: string };
|
|
12263
12270
|
};
|
|
12264
12271
|
declare const siteId: string | undefined;
|
|
12272
|
+
// Files from the ExecuteWixAPI \`files\` param (raw content, no escaping).
|
|
12273
|
+
declare const files: Array<{ path: string; content: string }>;
|
|
12274
|
+
\`\`\`
|
|
12275
|
+
|
|
12276
|
+
FILE UPLOADS: pass file bodies via the \`files\` param (not inside \`code\` — no escaping), then build the multipart body with \`wix.multipart()\`:
|
|
12277
|
+
\`\`\`javascript
|
|
12278
|
+
// files param: "=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: app.js ===\\nconsole.log(1)"
|
|
12279
|
+
async () => {
|
|
12280
|
+
const mp = wix.multipart(); // parts named "files", filename = each path
|
|
12281
|
+
const res = await wix.request({
|
|
12282
|
+
scope: "account",
|
|
12283
|
+
method: "POST",
|
|
12284
|
+
url: "https://www.wixapis.com/.../upload",
|
|
12285
|
+
headers: { "Content-Type": mp.contentType },
|
|
12286
|
+
body: mp.body
|
|
12287
|
+
});
|
|
12288
|
+
return res.data;
|
|
12289
|
+
}
|
|
12265
12290
|
\`\`\`
|
|
12266
12291
|
`;
|
|
12267
12292
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
@@ -16718,6 +16743,14 @@ function addExecuteTool(server, options) {
|
|
|
16718
16743
|
visitor ? "Whether this code creates, updates, deletes, publishes, imports, uploads, or otherwise mutates site data on the visitor\u2019s behalf. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false." : "Whether this code creates, updates, deletes, publishes, installs, imports, uploads, or otherwise mutates Wix data or site/account state. Set this to true for create/update/delete/bulk create/import/upload calls even if the reason is inspection, verification, or response-shape discovery. Read-only GET/query/list/search calls can use false."
|
|
16719
16744
|
),
|
|
16720
16745
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d.sourceDocUrls),
|
|
16746
|
+
files: external_exports.string().optional().describe(
|
|
16747
|
+
[
|
|
16748
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
16749
|
+
"Format: one or more sections, each a line `=== FILE: <path> ===` on its own, followed by that file's raw text content; `<path>` is the path relative to the site root (e.g. `index.html`, `assets/app.js`). Example: `=== FILE: index.html ===\\n<!doctype html>...\\n=== FILE: assets/app.js ===\\nconsole.log(1)`.",
|
|
16750
|
+
'In `code`, the parsed files are the `files` global (array of `{ path, content }`), and `wix.multipart(files)` returns `{ body, contentType }` for a `multipart/form-data` upload \u2014 e.g. `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
16751
|
+
"Text files only; for binary assets pass bytes as a base64 request body instead. A file whose content itself contains a line exactly like the delimiter is not supported."
|
|
16752
|
+
].join(" ")
|
|
16753
|
+
),
|
|
16721
16754
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
16722
16755
|
// mode lets the agent pick the site.
|
|
16723
16756
|
...visitor ? {
|
|
@@ -16732,7 +16765,7 @@ function addExecuteTool(server, options) {
|
|
|
16732
16765
|
},
|
|
16733
16766
|
{ readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
16734
16767
|
async (rawArgs, extra) => {
|
|
16735
|
-
const { code, reason, hasMutations, sourceDocUrls, visitorToken } = rawArgs;
|
|
16768
|
+
const { code, reason, hasMutations, sourceDocUrls, visitorToken, files } = rawArgs;
|
|
16736
16769
|
const siteId = visitor ? visitor.siteId : rawArgs.siteId;
|
|
16737
16770
|
logger.log(
|
|
16738
16771
|
`[ExecuteWixAPI]${visitor ? " (visitor)" : ""} Executing code (${code.length} chars), siteId=${siteId ?? "none"}, hasMutations=${hasMutations}, sourceDocUrls=${JSON.stringify(sourceDocUrls)}, reason="${reason}"`
|
|
@@ -16777,7 +16810,8 @@ function addExecuteTool(server, options) {
|
|
|
16777
16810
|
siteToken: visitor ? visitorToken : siteHeaders?.Authorization,
|
|
16778
16811
|
accountToken: visitor ? visitorToken : accountHeaders?.Authorization,
|
|
16779
16812
|
accountId: accountHeaders?.["wix-account-id"],
|
|
16780
|
-
siteAuthContext
|
|
16813
|
+
siteAuthContext,
|
|
16814
|
+
...files ? { files } : {}
|
|
16781
16815
|
},
|
|
16782
16816
|
visitor ? visitorToken : accountHeaders?.Authorization ?? siteHeaders?.Authorization,
|
|
16783
16817
|
codeModeFetch
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.88",
|
|
4
4
|
"description": "A Model Context Protocol server for Wix AI tools",
|
|
5
5
|
"bin": "./build/bin-standalone.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
]
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
-
"falconPackageHash": "
|
|
136
|
+
"falconPackageHash": "ca9fecd4d1efd1afea0d159f209aea15cf9475c2edec6f5a172bd92f"
|
|
137
137
|
}
|