@wix/mcp 1.0.80 → 1.0.82
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 -1
- package/build/bin-standalone.js +93 -31
- package/build/cjs/index.cjs +151 -380
- package/build/cjs/toolkit.cjs +97 -33
- package/build/dts/api-call/index.js +41 -3
- package/build/dts/code-mode/index.js +8 -2
- package/build/dts/config/api-request-rules.d.ts +11 -0
- package/build/dts/config/api-request-rules.js +11 -0
- package/build/dts/config/default-config.js +13 -3
- package/build/dts/config/param-descriptions.d.ts +1 -1
- package/build/dts/config/param-descriptions.js +5 -3
- package/build/dts/docs/docs.js +6 -6
- package/build/dts/import-claude-design-tool/index.js +2 -2
- package/build/dts/infra/tool-bi.d.ts +1 -1
- package/build/dts/infra/tool-bi.js +3 -2
- package/build/dts/site-widget-tools/constants.d.ts +12 -5
- package/build/dts/site-widget-tools/constants.js +20 -11
- package/build/dts/site-widget-tools/site-builder-tool/index.js +1 -1
- package/build/dts/site-widget-tools/site-creation-tool/index.js +3 -2
- package/build/dts/site-widget-tools/suggested-domain-tool/index.js +23 -5
- package/build/dts/toolkit-entry.d.cts +1 -1
- package/build/dts/toolkit-entry.d.ts +1 -1
- package/build/dts/toolkit.js +4 -1
- package/build/dts/wix-mcp-server.d.ts +4 -0
- package/build/dts/wix-mcp-server.js +9 -1
- package/build/dts/wixel/api.d.ts +0 -60
- package/build/dts/wixel/api.js +1 -50
- package/build/dts/wixel/constants.d.ts +0 -1
- package/build/dts/wixel/constants.js +0 -1
- package/build/dts/wixel/index.d.ts +0 -3
- package/build/dts/wixel/index.js +0 -9
- package/build/esm/index.js +151 -377
- package/build/esm/toolkit.js +97 -33
- package/package.json +3 -3
- package/build/dts/wixel/open-headless-wixel-project-tool.d.ts +0 -6
- package/build/dts/wixel/open-headless-wixel-project-tool.js +0 -84
- package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts +0 -6
- package/build/dts/wixel/pull-headless-wixel-job-tool.js +0 -61
- package/build/dts/wixel/update-headless-wixel-job-tool.d.ts +0 -6
- package/build/dts/wixel/update-headless-wixel-job-tool.js +0 -106
package/build/cjs/index.cjs
CHANGED
|
@@ -20911,8 +20911,6 @@ __export(index_exports, {
|
|
|
20911
20911
|
addImportClaudeDesignTool: () => addImportClaudeDesignTool,
|
|
20912
20912
|
addListWixelEventsTool: () => addListWixelEventsTool,
|
|
20913
20913
|
addMarkWixelJobAsFulfilledTool: () => addMarkWixelJobAsFulfilledTool,
|
|
20914
|
-
addOpenHeadlessWixelProjectTool: () => addOpenHeadlessWixelProjectTool,
|
|
20915
|
-
addPullHeadlessWixelJobTool: () => addPullHeadlessWixelJobTool,
|
|
20916
20914
|
addPullSiteJobTool: () => addPullSiteJobTool,
|
|
20917
20915
|
addSearchCodeModeTool: () => addSearchCodeModeTool,
|
|
20918
20916
|
addSearchSiteTemplatesTool: () => addSearchSiteTemplatesTool,
|
|
@@ -20920,7 +20918,6 @@ __export(index_exports, {
|
|
|
20920
20918
|
addSiteCreationWidgetTools: () => addSiteCreationWidgetTools,
|
|
20921
20919
|
addStartWixelSessionTool: () => addStartWixelSessionTool,
|
|
20922
20920
|
addSupportTool: () => addSupportTool,
|
|
20923
|
-
addUpdateHeadlessWixelJobTool: () => addUpdateHeadlessWixelJobTool,
|
|
20924
20921
|
addWixSiteCreationTool: () => addWixSiteCreationTool,
|
|
20925
20922
|
addWixelSessionTools: () => addWixelSessionTools,
|
|
20926
20923
|
addWixelTools: () => addWixelTools,
|
|
@@ -36019,7 +36016,7 @@ function extractText(result) {
|
|
|
36019
36016
|
return result.content.filter((content) => content.type === "text" && content.text != null).map((content) => content.text).join("\n");
|
|
36020
36017
|
}
|
|
36021
36018
|
var TOOL_RESULT_PREVIEW_MAX_CHARS = 4e3;
|
|
36022
|
-
function formatToolResultAdditionalFields(result) {
|
|
36019
|
+
function formatToolResultAdditionalFields(result, extras) {
|
|
36023
36020
|
const resultText = extractText(result);
|
|
36024
36021
|
const contentTypes = [
|
|
36025
36022
|
...new Set(
|
|
@@ -36035,7 +36032,8 @@ function formatToolResultAdditionalFields(result) {
|
|
|
36035
36032
|
resultPreview: resultText.slice(0, TOOL_RESULT_PREVIEW_MAX_CHARS),
|
|
36036
36033
|
resultTextLength: resultText.length,
|
|
36037
36034
|
resultPreviewTruncated: resultText.length > TOOL_RESULT_PREVIEW_MAX_CHARS,
|
|
36038
|
-
resultContentTypes: contentTypes
|
|
36035
|
+
resultContentTypes: contentTypes,
|
|
36036
|
+
...extras
|
|
36039
36037
|
});
|
|
36040
36038
|
}
|
|
36041
36039
|
function createToolBiEvent(params) {
|
|
@@ -36096,6 +36094,11 @@ var WixMcpServer = class extends McpServer {
|
|
|
36096
36094
|
isMcpAppsInMcpEnabled() {
|
|
36097
36095
|
return this.mcpAppsInMcpEnabled;
|
|
36098
36096
|
}
|
|
36097
|
+
/** Microsoft 365 Copilot ("sydney" at runtime) or Copilot Cowork ("copilot"). */
|
|
36098
|
+
isMicrosoftCopilotClient() {
|
|
36099
|
+
const clientName = this.getClientName?.()?.toLowerCase() ?? "";
|
|
36100
|
+
return clientName.includes("sydney") || clientName.includes("copilot");
|
|
36101
|
+
}
|
|
36099
36102
|
shouldRenderMcpApps() {
|
|
36100
36103
|
const clientName = this.getClientName?.()?.toLowerCase();
|
|
36101
36104
|
const isOpenAi = clientName?.includes("openai") ?? false;
|
|
@@ -36211,7 +36214,10 @@ var WixMcpServer = class extends McpServer {
|
|
|
36211
36214
|
if (!toolSucceeded) {
|
|
36212
36215
|
errorBody = extractText(cbResult);
|
|
36213
36216
|
} else {
|
|
36214
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
36217
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
36218
|
+
returnedRows: toolBiParams.returnedRows,
|
|
36219
|
+
originalLength: toolBiParams.originalLength
|
|
36220
|
+
});
|
|
36215
36221
|
}
|
|
36216
36222
|
if (toolSucceeded && !isDevEnvironment) {
|
|
36217
36223
|
panorama.transaction(toolName).finish({ toolInvocationId });
|
|
@@ -37118,6 +37124,9 @@ function rethrowIfUnauthorized(error2) {
|
|
|
37118
37124
|
}
|
|
37119
37125
|
}
|
|
37120
37126
|
|
|
37127
|
+
// src/config/api-request-rules.ts
|
|
37128
|
+
var ARRAY_QUERY_PARAMS_RULE = "Repeat array query params once per value: `?fieldsets=URL&fieldsets=RICH_CONTENT`. Do NOT comma-join values (`fieldsets=URL,RICH_CONTENT`), do NOT leave a trailing comma, and do NOT use a value the method schema does not list, even if a sibling method accepts it (draft posts have no `SEO` fieldset).";
|
|
37129
|
+
|
|
37121
37130
|
// src/config/default-config.ts
|
|
37122
37131
|
var AGENT_GOAL = dedent_default`
|
|
37123
37132
|
You are an agent that helps the user manage their Wix site.
|
|
@@ -37217,6 +37226,8 @@ var SITE_CREATION_COPY = {
|
|
|
37217
37226
|
var SITE_GUIDANCE = dedent_default`
|
|
37218
37227
|
A new-site request has two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.
|
|
37219
37228
|
|
|
37229
|
+
One case skips all of this: the user ALREADY HAS the finished site as files — hand-written HTML/CSS/JS, a zip, or the export of an AI builder. There is nothing to build, so don't offer AI or templates and don't call any site-creation tool. Send them to https://www.wix.com/headless/drop?utm_campaign=mcp — they drag the files in and get a live Wix-hosted site. Give that URL exactly as written, keeping the utm_campaign=mcp parameter.
|
|
37230
|
+
|
|
37220
37231
|
Settle what the site is for first: its purpose, topic, business type, audience, or main visitor action. Naming a method is not a description of the site, and neither is the business or industry on its own.
|
|
37221
37232
|
If you can't tell yet, ask the preferred question below and nothing else — one question, no creation-method question in the same reply, and no internal tool names.
|
|
37222
37233
|
Once the purpose is clear, unless the user already named a method, ${SITE_CREATION_COPY.unstatedMethod.nonWidget}. A method they named is settled — never re-open it. Never default to AI or to templates, and never ask the user to choose between Harmony and Wix Studio; infer that from their words.
|
|
@@ -37239,11 +37250,13 @@ var EXECUTE_WIX_API_INTRO = dedent_default`
|
|
|
37239
37250
|
CODE CONTRACT:
|
|
37240
37251
|
- Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
|
|
37241
37252
|
- Use only \`wix.request({ method, url, body })\` and in-memory JavaScript. Node.js modules, filesystem access, and downloadable-file creation are unavailable.
|
|
37253
|
+
- Do not minify the code. Put each object property on its own line, with spaces after colons and commas, and declare deep literals (request bodies, filters, patch lists) as a named \`const\` before use so each \`wix.request({ ... })\` argument stays short.
|
|
37242
37254
|
|
|
37243
37255
|
CONFIRM API CONTRACTS:
|
|
37244
37256
|
- Do not rely on memory for endpoints, methods, bodies, response paths, filters, enum values, or auth scope. Confirm every method from conversation-provided details, a complete matching docs example, or the schema/docs tools before executing.
|
|
37245
37257
|
- Prefer \`method.publicUrl\` from SearchWixAPISpec; never use \`method.servers[0]\`. Pass all supporting documentation URLs through \`sourceDocUrls\`.
|
|
37246
37258
|
- A response field is not automatically filterable or sortable. Use only capabilities declared for that exact query/search method. If an unsupported filter is unavoidable, fetch a bounded result set and filter it in code.
|
|
37259
|
+
- ${ARRAY_QUERY_PARAMS_RULE}
|
|
37247
37260
|
- Read-only probes may inspect state or resolve IDs. Never use speculative create/update/delete calls to discover request or response shapes, and never repeat a successful mutation merely to obtain more response data.
|
|
37248
37261
|
`;
|
|
37249
37262
|
var EXECUTE_WIX_API_OUTPUT_AND_ERRORS = dedent_default`
|
|
@@ -37259,6 +37272,7 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
37259
37272
|
SCOPE AND SITE TARGETING:
|
|
37260
37273
|
- Set \`scope: "site"\` for site-level APIs and \`scope: "account"\` for account-level APIs. Account-level acts on the account itself, or on sites as objects within it; anything that reads or writes inside a site is site-level.
|
|
37261
37274
|
- If \`scope\` is omitted it defaults to site when either the ExecuteWixAPI call or \`wix.request\` provides a \`siteId\`; otherwise it defaults to account.
|
|
37275
|
+
- Site-level calls need a site ID; there is no implicit current site. Before any \`scope: "site"\` call, pass the site's ID as the ExecuteWixAPI \`siteId\` parameter or per request. \`scope: "site"\` without a \`siteId\` fails.
|
|
37262
37276
|
- \`scope: "account"\` ignores any \`siteId\` you pass, so a site-level endpoint called that way fails.
|
|
37263
37277
|
- Authentication is injected automatically; never set Authorization, wix-site-id, or wix-account-id headers.
|
|
37264
37278
|
- For one named site, prefer GetSiteContext. If it is unavailable, resolve the exact site and perform the action in the same invocation.
|
|
@@ -37546,7 +37560,8 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
37546
37560
|
After calling, you MUST speak the message provided in the tool result to the user as your reply — do not stay silent and do not replace it with a one-line pointer to the widget. Write out ALL of it, word for word: its opening line (the "Ready to set up your … site?" question INCLUDING "Choose your path in the widget above:"), BOTH of its option bullets, and its "Next up:" line, each on its own line and in that order. Do not summarize, shorten, drop any line, invent your own opener, rename the options, or add an intro or outro.
|
|
37547
37561
|
`,
|
|
37548
37562
|
"import-claude-design-from-url": dedent_default`
|
|
37549
|
-
Import a design into Wix
|
|
37563
|
+
Import a design created in Claude's design tool into Wix. Takes the signed claudeusercontent.com URL Claude Design produces for its self-contained HTML bundle (all images, fonts, and styles inlined); any other host is rejected. Creates a live Wix-hosted site and returns its URL.
|
|
37564
|
+
NOT for site files the user provides themselves (their own HTML/CSS/JS, a zip, another builder's export) — for those, don't call this tool: send the user to https://www.wix.com/headless/drop?utm_campaign=mcp, where they upload the files and get a live hosted site. Give that URL exactly as written, keeping the utm_campaign=mcp parameter.
|
|
37550
37565
|
`,
|
|
37551
37566
|
RunWixCliCommand: dedent_default`
|
|
37552
37567
|
Executes Wix CLI commands for Wix app development and management.
|
|
@@ -37579,8 +37594,10 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
37579
37594
|
SearchBuildAppsDocumentation: dedent_default`
|
|
37580
37595
|
Searches the Wix Build Apps documentation.
|
|
37581
37596
|
`,
|
|
37582
|
-
|
|
37583
|
-
|
|
37597
|
+
SearchDevelopmentDocumentation: dedent_default`
|
|
37598
|
+
Broad Wix development documentation (platform concepts, developer guides, getting started). **Last resort — development tasks only.**
|
|
37599
|
+
Skip it entirely for general, business, support, or Wix-editor questions.
|
|
37600
|
+
Call it only after the specific search for your task returned nothing useful: \`SearchWixRESTDocumentation\` (REST), \`SearchWixSDKDocumentation\` (JS SDK), \`SearchWixCLIDocumentation\` (CLI), \`SearchBuildAppsDocumentation\` (apps), \`SearchWixHeadlessDocumentation\` (Headless), \`SearchWixWDSDocumentation\` (WDS). Never use it as a first search.
|
|
37584
37601
|
`,
|
|
37585
37602
|
SearchWixHeadlessDocumentation: dedent_default`
|
|
37586
37603
|
Searches the Wix Headless documentation.
|
|
@@ -37945,6 +37962,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
|
|
|
37945
37962
|
CreateWixBusinessGuide: dedent_default`
|
|
37946
37963
|
Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
|
|
37947
37964
|
Call this ONLY when the user explicitly asks for a headless site, a Wix Classic Editor site, or manual/advanced account/API-based site creation — these don't need the site's purpose first. For normal site-creation ${SITE_CREATION_COPY.normalCreationRoute.nonWidget}; for a specific template id, call \`CreateSiteFromTemplate\`.
|
|
37965
|
+
Exception, even when the user says "headless": if they ALREADY HAVE the finished site as files (their own HTML/CSS/JS, a zip, an AI-builder export) and want those files hosted, don't call this tool — send them to https://www.wix.com/headless/drop?utm_campaign=mcp to upload the files and get a live hosted site (give that URL exactly, keeping the utm_campaign=mcp parameter). This guide's CLI flow is for BUILDING a headless frontend, not for hosting ready-made files.
|
|
37948
37966
|
|
|
37949
37967
|
## What This Tool Contains
|
|
37950
37968
|
|
|
@@ -38232,14 +38250,20 @@ function renderApps(apps, knownApps) {
|
|
|
38232
38250
|
}
|
|
38233
38251
|
function renderProperties(props) {
|
|
38234
38252
|
const sections = [];
|
|
38235
|
-
const
|
|
38236
|
-
if (props.language)
|
|
38237
|
-
if (props.locale?.country)
|
|
38238
|
-
|
|
38239
|
-
if (props.
|
|
38240
|
-
if (
|
|
38241
|
-
|
|
38242
|
-
|
|
38253
|
+
const regionalFormat = [];
|
|
38254
|
+
if (props.language) regionalFormat.push(`- Language: **${props.language}**`);
|
|
38255
|
+
if (props.locale?.country)
|
|
38256
|
+
regionalFormat.push(`- Locale region: **${props.locale.country}**`);
|
|
38257
|
+
if (props.timeZone) regionalFormat.push(`- Timezone: **${props.timeZone}**`);
|
|
38258
|
+
if (props.paymentCurrency)
|
|
38259
|
+
regionalFormat.push(`- Currency: **${props.paymentCurrency}**`);
|
|
38260
|
+
if (regionalFormat.length) {
|
|
38261
|
+
sections.push(`**Regional Format**
|
|
38262
|
+
${regionalFormat.join("\n")}`);
|
|
38263
|
+
}
|
|
38264
|
+
if (props.address?.country) {
|
|
38265
|
+
sections.push(`**Location**
|
|
38266
|
+
- Country: **${props.address.country}**`);
|
|
38243
38267
|
}
|
|
38244
38268
|
const contact = [];
|
|
38245
38269
|
if (props.email) contact.push(`- Email: **${props.email}**`);
|
|
@@ -38386,6 +38410,7 @@ var known_apps_default = {
|
|
|
38386
38410
|
"225dd912-7dea-4738-8688-4b8c6955ffc2": "Wix Forms",
|
|
38387
38411
|
"d80111c5-a0f4-47a8-b63a-65b54d774a27": "Wix Gift Cards",
|
|
38388
38412
|
"148c2287-c669-d849-d153-463c7486a694": "Wix Groups",
|
|
38413
|
+
"14bca956-e09f-f4d6-14d7-466cb3f09103": "Wix Hotels",
|
|
38389
38414
|
"13ee94c1-b635-8505-3391-97919052c16f": "Wix Invoices",
|
|
38390
38415
|
"14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9": "Wix Members Area",
|
|
38391
38416
|
"14d84998-ae09-1abf-c6fc-3f3cace5bf19": "Wix Multilingual",
|
|
@@ -38403,7 +38428,16 @@ var known_apps_default = {
|
|
|
38403
38428
|
"1480c568-5cbd-9392-5604-1148f5faffa0": "Promote SEO",
|
|
38404
38429
|
"ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e": "Wix Rentals"
|
|
38405
38430
|
};
|
|
38406
|
-
var
|
|
38431
|
+
var DYNAMIC_CONTEXT_PATH = "/_api/dynamic-context/v1/dynamic-context";
|
|
38432
|
+
var DYNAMIC_CONTEXT_URL = `https://dev.wix.com${DYNAMIC_CONTEXT_PATH}`;
|
|
38433
|
+
var isWixHost = (hostname2) => hostname2 === "wix.com" || hostname2.endsWith(".wix.com");
|
|
38434
|
+
var dynamicContextUrl = () => {
|
|
38435
|
+
if (typeof window === "undefined") {
|
|
38436
|
+
return DYNAMIC_CONTEXT_URL;
|
|
38437
|
+
}
|
|
38438
|
+
const hostname2 = window.location?.hostname;
|
|
38439
|
+
return typeof hostname2 === "string" && isWixHost(hostname2) ? DYNAMIC_CONTEXT_PATH : DYNAMIC_CONTEXT_URL;
|
|
38440
|
+
};
|
|
38407
38441
|
var COUNT_SITES_URL = "https://www.wixapis.com/site-list/v2/sites/count";
|
|
38408
38442
|
var MAX_SITES_FOR_DYNAMIC_CONTEXT = 10;
|
|
38409
38443
|
var DYNAMIC_CONTEXT_PETRI_OVERRIDE = "shouldReturnDynamicContextInMCP#B";
|
|
@@ -38420,8 +38454,8 @@ async function getDynamicContext(auth, httpClient6, filter, options) {
|
|
|
38420
38454
|
partnerContextEnabled: options,
|
|
38421
38455
|
includeAccountContext: options
|
|
38422
38456
|
} : options;
|
|
38423
|
-
const includePartnerContext = contextOptions?.partnerContextEnabled ??
|
|
38424
|
-
const includeAccountContext = contextOptions?.includeAccountContext ??
|
|
38457
|
+
const includePartnerContext = contextOptions?.partnerContextEnabled ?? true;
|
|
38458
|
+
const includeAccountContext = contextOptions?.includeAccountContext ?? true;
|
|
38425
38459
|
try {
|
|
38426
38460
|
const accountHeaders = await auth.getAccountAuthHeaders();
|
|
38427
38461
|
const noFilter = !filter?.siteId && !filter?.siteName;
|
|
@@ -38455,7 +38489,7 @@ async function getDynamicContext(auth, httpClient6, filter, options) {
|
|
|
38455
38489
|
if (filter?.siteId) body.site_id = filter.siteId;
|
|
38456
38490
|
else if (filter?.siteName) body.site_name = filter.siteName;
|
|
38457
38491
|
const dynamicContextPromise = httpClient6.request({
|
|
38458
|
-
url:
|
|
38492
|
+
url: dynamicContextUrl(),
|
|
38459
38493
|
method: "POST",
|
|
38460
38494
|
headers: {
|
|
38461
38495
|
...accountHeaders,
|
|
@@ -38535,7 +38569,8 @@ var paramDescriptions = {
|
|
|
38535
38569
|
"The url of the api to call - ALWAYS get the API url from the Wix REST docs or from the conversation context, the URL MUST BE ABSOLUTE URL",
|
|
38536
38570
|
'NEVER guess the API url, ALWAYS get it from 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',
|
|
38537
38571
|
`Allowed API urls are: ${ALLOWED_HOSTNAMES.join(", ")}`,
|
|
38538
|
-
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool
|
|
38572
|
+
`Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`,
|
|
38573
|
+
ARRAY_QUERY_PARAMS_RULE
|
|
38539
38574
|
].join("\n"),
|
|
38540
38575
|
method: "The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)",
|
|
38541
38576
|
body: 'The request body as a JSON object or array with all the required fields and values, including nested objects. Pass the actual value (object or array), 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 "SearchWixAPISpec" 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.',
|
|
@@ -38608,8 +38643,8 @@ var paramDescriptions = {
|
|
|
38608
38643
|
searchTerm: "The search term to search for in the Build Apps Documentation",
|
|
38609
38644
|
maxResults: "The maximum number of results to return, default is 10, max is 15"
|
|
38610
38645
|
},
|
|
38611
|
-
|
|
38612
|
-
searchTerm: "The search term
|
|
38646
|
+
SearchDevelopmentDocumentation: {
|
|
38647
|
+
searchTerm: "The development-related search term. Use only after a more specific docs search (REST/SDK/CLI/Build Apps/Headless/WDS) came back empty.",
|
|
38613
38648
|
maxResults: "The maximum number of results to return, default is 10, max is 15"
|
|
38614
38649
|
},
|
|
38615
38650
|
SearchWixHeadlessDocumentation: {
|
|
@@ -39416,15 +39451,15 @@ var addDocsTools = (server, allowedTools = [
|
|
|
39416
39451
|
}
|
|
39417
39452
|
);
|
|
39418
39453
|
}
|
|
39419
|
-
if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("
|
|
39454
|
+
if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("SearchDevelopmentDocumentation")) {
|
|
39420
39455
|
server.tool(
|
|
39421
|
-
"
|
|
39456
|
+
"SearchDevelopmentDocumentation",
|
|
39422
39457
|
getDescription(
|
|
39423
|
-
"
|
|
39424
|
-
defaultToolDescriptions.
|
|
39458
|
+
"SearchDevelopmentDocumentation",
|
|
39459
|
+
defaultToolDescriptions.SearchDevelopmentDocumentation ?? ""
|
|
39425
39460
|
),
|
|
39426
39461
|
(() => {
|
|
39427
|
-
const d2 = desc("
|
|
39462
|
+
const d2 = desc("SearchDevelopmentDocumentation");
|
|
39428
39463
|
return {
|
|
39429
39464
|
searchTerm: external_exports.string().describe(d2.searchTerm),
|
|
39430
39465
|
maxResults: external_exports.number().describe(d2.maxResults).min(1).max(15).optional().default(15)
|
|
@@ -39454,8 +39489,8 @@ var addDocsTools = (server, allowedTools = [
|
|
|
39454
39489
|
panorama.errorMonitor().reportError(error2);
|
|
39455
39490
|
captureException(error2, {
|
|
39456
39491
|
tags: {
|
|
39457
|
-
componentId: "
|
|
39458
|
-
toolName: "
|
|
39492
|
+
componentId: "SearchDevelopmentDocumentation",
|
|
39493
|
+
toolName: "SearchDevelopmentDocumentation"
|
|
39459
39494
|
}
|
|
39460
39495
|
});
|
|
39461
39496
|
logger2.error(
|
|
@@ -40277,6 +40312,19 @@ var MAX_ALLOWED_RESPONSE_CHARS = 2e6;
|
|
|
40277
40312
|
|
|
40278
40313
|
// src/api-call/index.ts
|
|
40279
40314
|
var DEFAULT_MAX_RESPONSE_SIZE = 5e4;
|
|
40315
|
+
function extractReturnedRows(responseData) {
|
|
40316
|
+
if (responseData === null || typeof responseData !== "object") {
|
|
40317
|
+
return void 0;
|
|
40318
|
+
}
|
|
40319
|
+
const data = responseData;
|
|
40320
|
+
const block = data.pagingMetadata ?? data.cursorPagingMetadata ?? data.pagingOffsetMetadata ?? data.metaData ?? data.metadata;
|
|
40321
|
+
const raw = block?.count;
|
|
40322
|
+
if (typeof raw !== "number" && (typeof raw !== "string" || raw.trim() === "")) {
|
|
40323
|
+
return void 0;
|
|
40324
|
+
}
|
|
40325
|
+
const count = Number(raw);
|
|
40326
|
+
return Number.isFinite(count) ? count : void 0;
|
|
40327
|
+
}
|
|
40280
40328
|
function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_SIZE) {
|
|
40281
40329
|
if (typeof responseData === "string" && responseData.trim().startsWith("<!DOCTYPE")) {
|
|
40282
40330
|
return {
|
|
@@ -40284,13 +40332,15 @@ function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_
|
|
|
40284
40332
|
isError: true
|
|
40285
40333
|
};
|
|
40286
40334
|
}
|
|
40335
|
+
const returnedRows = extractReturnedRows(responseData);
|
|
40287
40336
|
let responseText = JSON.stringify(responseData);
|
|
40337
|
+
const originalLength = responseText.length;
|
|
40288
40338
|
const effectiveMax = Math.min(maxResponseSize, MAX_ALLOWED_RESPONSE_CHARS);
|
|
40289
40339
|
if (responseText.length > effectiveMax) {
|
|
40290
40340
|
responseText = responseText.slice(0, effectiveMax) + `
|
|
40291
40341
|
...[TRUNCATED - response was ${responseText.length} chars, showing first ${effectiveMax}]`;
|
|
40292
40342
|
}
|
|
40293
|
-
return { text: responseText, isError: false };
|
|
40343
|
+
return { text: responseText, isError: false, originalLength, returnedRows };
|
|
40294
40344
|
}
|
|
40295
40345
|
function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "ListWixSites", "ManageWixSite"], disableTools = [], enableTools = [], toolDescriptions, toolHints, maxResponseSize) {
|
|
40296
40346
|
const effectiveAllowedTools = [
|
|
@@ -40353,9 +40403,14 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
40353
40403
|
data: method === "GET" ? void 0 : body
|
|
40354
40404
|
});
|
|
40355
40405
|
const requestId = response.headers?.["x-wix-request-id"];
|
|
40356
|
-
setToolBiParams({ requestId, siteId });
|
|
40357
40406
|
const responseData = await handleWixAPIResponse(response);
|
|
40358
40407
|
const formatted = formatApiResponse(responseData, maxResponseSize);
|
|
40408
|
+
setToolBiParams({
|
|
40409
|
+
requestId,
|
|
40410
|
+
siteId,
|
|
40411
|
+
returnedRows: formatted.returnedRows,
|
|
40412
|
+
originalLength: formatted.originalLength
|
|
40413
|
+
});
|
|
40359
40414
|
if (formatted.isError) {
|
|
40360
40415
|
return {
|
|
40361
40416
|
content: [
|
|
@@ -40494,7 +40549,7 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
40494
40549
|
destructiveHint: true,
|
|
40495
40550
|
openWorldHint: false
|
|
40496
40551
|
}),
|
|
40497
|
-
async ({ url, body, method, reason }, { httpClient: httpClient6 }) => {
|
|
40552
|
+
async ({ url, body, method, reason }, { httpClient: httpClient6, setToolBiParams }) => {
|
|
40498
40553
|
logger2.log(
|
|
40499
40554
|
`Calling Wix Account level API: ${url}, reason="${reason}", body: ${JSON.stringify(body)}`
|
|
40500
40555
|
);
|
|
@@ -40523,6 +40578,10 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
|
|
|
40523
40578
|
});
|
|
40524
40579
|
const responseData = await handleWixAPIResponse(response);
|
|
40525
40580
|
const formatted = formatApiResponse(responseData, maxResponseSize);
|
|
40581
|
+
setToolBiParams({
|
|
40582
|
+
returnedRows: formatted.returnedRows,
|
|
40583
|
+
originalLength: formatted.originalLength
|
|
40584
|
+
});
|
|
40526
40585
|
if (formatted.isError) {
|
|
40527
40586
|
return {
|
|
40528
40587
|
content: [
|
|
@@ -40891,9 +40950,18 @@ var SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = `2\u20133 specific, high-value setup
|
|
|
40891
40950
|
* Events / Weddings / Real Estate: "add event schedules, display listings, and manage RSVP forms"
|
|
40892
40951
|
* General / Unspecified: "${SITE_CREATION_DEFAULT_ACTIONS}"
|
|
40893
40952
|
If none of these patterns fit the site, infer 2\u20133 actions that suit what that kind of business would manage on its site.`;
|
|
40894
|
-
function buildSiteCreationSelectorMessage(siteType, customActions) {
|
|
40953
|
+
function buildSiteCreationSelectorMessage(siteType, customActions, { plain = false } = {}) {
|
|
40895
40954
|
const type = (siteType ?? "").trim() || "new";
|
|
40896
40955
|
const actions = (customActions ?? "").trim() || SITE_CREATION_DEFAULT_ACTIONS;
|
|
40956
|
+
const body = `Ready to set up your ${type} site? Choose your path in the widget above:
|
|
40957
|
+
|
|
40958
|
+
* **Build with AI** for a custom, tailor-made layout
|
|
40959
|
+
* **Pick a template** to start with a pre-designed layout
|
|
40960
|
+
|
|
40961
|
+
**Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}\u2014right here in the chat!`;
|
|
40962
|
+
if (plain) {
|
|
40963
|
+
return body;
|
|
40964
|
+
}
|
|
40897
40965
|
return `You are the assistant replying to the user \u2014 say this message out loud in chat (do NOT stay silent, and do NOT just point at the widget). Your reply is only complete if it includes ALL of the following, word for word, each on its own line and in this order:
|
|
40898
40966
|
1. "Ready to set up your ${type} site? Choose your path in the widget above:" \u2014 keep the "Choose your path in the widget above:" part.
|
|
40899
40967
|
2. "* **Build with AI** for a custom, tailor-made layout"
|
|
@@ -40902,12 +40970,7 @@ function buildSiteCreationSelectorMessage(siteType, customActions) {
|
|
|
40902
40970
|
|
|
40903
40971
|
Copy those four lines as written; do not summarize, shorten, reorder, or reword any of them. Here is the full message to send:
|
|
40904
40972
|
|
|
40905
|
-
|
|
40906
|
-
|
|
40907
|
-
* **Build with AI** for a custom, tailor-made layout
|
|
40908
|
-
* **Pick a template** to start with a pre-designed layout
|
|
40909
|
-
|
|
40910
|
-
**Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}\u2014right here in the chat!`;
|
|
40973
|
+
${body}`;
|
|
40911
40974
|
}
|
|
40912
40975
|
var OPENAI_WIDGET_MIME_TYPE = "text/html+skybridge";
|
|
40913
40976
|
var SITE_WIDGET_MCP_CSP = {
|
|
@@ -47868,7 +47931,7 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
|
|
|
47868
47931
|
`The prompt to build the site. If not provided, the user will be asked to provide a prompt.`
|
|
47869
47932
|
),
|
|
47870
47933
|
suggestedSiteName: external_exports.string().optional().describe(
|
|
47871
|
-
"
|
|
47934
|
+
"You must provide this on every call, including updates to an existing job, in English. A short name for the site: the business name the user gave, or one you derive from the site prompt."
|
|
47872
47935
|
)
|
|
47873
47936
|
},
|
|
47874
47937
|
_meta: toolDefinitionMeta,
|
|
@@ -48025,6 +48088,10 @@ async function buildHarmonySite({
|
|
|
48025
48088
|
|
|
48026
48089
|
// src/site-widget-tools/suggested-domain-tool/index.ts
|
|
48027
48090
|
var WIX_APIS_BASE_URL3 = "https://www.wixapis.com";
|
|
48091
|
+
var DEFAULT_SITE_NAME = /^my site(\s+\d+)?$/i;
|
|
48092
|
+
function isDefaultSiteName(siteName) {
|
|
48093
|
+
return DEFAULT_SITE_NAME.test(siteName.trim());
|
|
48094
|
+
}
|
|
48028
48095
|
async function fetchSiteDisplayName(siteAuthorization, siteId) {
|
|
48029
48096
|
const response = await fetch(
|
|
48030
48097
|
`${WIX_APIS_BASE_URL3}/site-properties/v4/properties`,
|
|
@@ -48049,7 +48116,15 @@ function addSuggestedDomainTool(server, authStrategy) {
|
|
|
48049
48116
|
GET_SUGGESTED_DOMAINS_TOOL_NAME,
|
|
48050
48117
|
{
|
|
48051
48118
|
title: "Get Suggested Domains",
|
|
48052
|
-
description:
|
|
48119
|
+
description: dedent_default`
|
|
48120
|
+
Suggests available domain names for a business, brand, or Wix site.
|
|
48121
|
+
|
|
48122
|
+
Call this when the user asks for domain name ideas, wants to know which domains are available, or wants a domain for a new or existing site.
|
|
48123
|
+
|
|
48124
|
+
Provide either a free-text \`query\` (the user's own words, e.g. "pancakes business", "modern yoga studio") OR a \`siteId\` to base the suggestions on that site's name. At least one of them is required.
|
|
48125
|
+
|
|
48126
|
+
Present the returned domains to the user as a short list. This tool only suggests domains — it does not purchase or connect them.
|
|
48127
|
+
`,
|
|
48053
48128
|
inputSchema: {
|
|
48054
48129
|
query: zod_default.string().optional().describe(
|
|
48055
48130
|
"Free-text keywords, business idea, or brand concept to base suggestions on. Use the user's own words."
|
|
@@ -48069,10 +48144,11 @@ function addSuggestedDomainTool(server, authStrategy) {
|
|
|
48069
48144
|
},
|
|
48070
48145
|
_meta: {
|
|
48071
48146
|
securitySchemes: [{ type: "oauth2", scopes: ["offline_access"] }],
|
|
48072
|
-
|
|
48147
|
+
// Model-visible so hosts (e.g. Microsoft 365 Copilot) can call it directly and show it
|
|
48148
|
+
// in their debug info; 'app' keeps it callable from the site-builder widget.
|
|
48149
|
+
ui: { visibility: ["app", "model"] },
|
|
48073
48150
|
"openai/toolInvocation/invoking": "Fetching suggested domains",
|
|
48074
|
-
"openai/toolInvocation/invoked": "Suggested domains retrieved"
|
|
48075
|
-
"openai/visibility": "private"
|
|
48151
|
+
"openai/toolInvocation/invoked": "Suggested domains retrieved"
|
|
48076
48152
|
}
|
|
48077
48153
|
},
|
|
48078
48154
|
async (args, { panorama }) => {
|
|
@@ -48120,7 +48196,9 @@ function addSuggestedDomainTool(server, authStrategy) {
|
|
|
48120
48196
|
structuredContent: { domains: [] }
|
|
48121
48197
|
};
|
|
48122
48198
|
}
|
|
48123
|
-
resolvedQuery
|
|
48199
|
+
if (!isDefaultSiteName(siteName) || !resolvedQuery) {
|
|
48200
|
+
resolvedQuery = siteName;
|
|
48201
|
+
}
|
|
48124
48202
|
} catch (error2) {
|
|
48125
48203
|
panorama.logger().error(
|
|
48126
48204
|
`[getSuggestedDomains] Error fetching site name for siteId: ${siteId}`,
|
|
@@ -48578,7 +48656,8 @@ function addWixSiteCreationTool(server, _authStrategy, options) {
|
|
|
48578
48656
|
};
|
|
48579
48657
|
const message = buildSiteCreationSelectorMessage(
|
|
48580
48658
|
args.query,
|
|
48581
|
-
args.customActions
|
|
48659
|
+
args.customActions,
|
|
48660
|
+
{ plain: server.isMicrosoftCopilotClient() }
|
|
48582
48661
|
);
|
|
48583
48662
|
return withJsonContent({
|
|
48584
48663
|
content: [
|
|
@@ -49457,7 +49536,6 @@ function listAssetsByProjectId(payload) {
|
|
|
49457
49536
|
// src/wixel/constants.ts
|
|
49458
49537
|
var WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL = "https://manage.wix.com/";
|
|
49459
49538
|
var WWW_ASSET_V1_ASSET_API_BASE_URL = "https://manage.wix.com/";
|
|
49460
|
-
var HARMONY_SITE_BUILDER_API_BASE_URL = "https://manage.wix.com/";
|
|
49461
49539
|
var WIXEL_AGENT_EXTERNAL_API_BASE_URL = "https://manage.wix.com/";
|
|
49462
49540
|
var WIXEL_WIDGET_URI = "ui://widget/wixel-widget.html";
|
|
49463
49541
|
var WIXEL_ICON_PNG_URL = "https://wixmp-e9a92e1fa066d7bc836e4d31.wixmp.com/logos/wixel-icon-180.png";
|
|
@@ -49574,87 +49652,6 @@ async function queryAssets({
|
|
|
49574
49652
|
} = await httpClient6.request(listAssetsByProjectId({ projectId }));
|
|
49575
49653
|
return { assets };
|
|
49576
49654
|
}
|
|
49577
|
-
async function openHeadlessWixelProject({
|
|
49578
|
-
accountAuthHeaders,
|
|
49579
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
49580
|
-
url,
|
|
49581
|
-
userPrompt,
|
|
49582
|
-
jobId,
|
|
49583
|
-
siteId,
|
|
49584
|
-
projectId,
|
|
49585
|
-
conversationId,
|
|
49586
|
-
withScreenshots,
|
|
49587
|
-
useProvidedCookies,
|
|
49588
|
-
timeout,
|
|
49589
|
-
conductorOverride
|
|
49590
|
-
}) {
|
|
49591
|
-
const httpClient6 = (0, import_http_client13.createHttpClient)({
|
|
49592
|
-
headers: {
|
|
49593
|
-
...COMMON_HEADERS,
|
|
49594
|
-
...accountAuthHeaders,
|
|
49595
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
49596
|
-
"Content-Type": "application/json"
|
|
49597
|
-
},
|
|
49598
|
-
baseURL: apiBaseURL
|
|
49599
|
-
});
|
|
49600
|
-
const response = await httpClient6.post(
|
|
49601
|
-
"/_api/harmony-site-builder/open-wixel-project",
|
|
49602
|
-
{
|
|
49603
|
-
url,
|
|
49604
|
-
userPrompt,
|
|
49605
|
-
jobId,
|
|
49606
|
-
siteId,
|
|
49607
|
-
projectId,
|
|
49608
|
-
conversationId,
|
|
49609
|
-
withScreenshots,
|
|
49610
|
-
useProvidedCookies,
|
|
49611
|
-
timeout
|
|
49612
|
-
}
|
|
49613
|
-
);
|
|
49614
|
-
return response.data;
|
|
49615
|
-
}
|
|
49616
|
-
async function updateHeadlessWixelJob({
|
|
49617
|
-
accountAuthHeaders,
|
|
49618
|
-
job,
|
|
49619
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
49620
|
-
conductorOverride
|
|
49621
|
-
}) {
|
|
49622
|
-
const httpClient6 = (0, import_http_client13.createHttpClient)({
|
|
49623
|
-
headers: {
|
|
49624
|
-
...COMMON_HEADERS,
|
|
49625
|
-
...accountAuthHeaders,
|
|
49626
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
49627
|
-
"Content-Type": "application/json"
|
|
49628
|
-
},
|
|
49629
|
-
baseURL: apiBaseURL
|
|
49630
|
-
});
|
|
49631
|
-
const response = await httpClient6.post(
|
|
49632
|
-
"/_api/harmony-site-builder/update-wixel-job",
|
|
49633
|
-
{ job }
|
|
49634
|
-
);
|
|
49635
|
-
return response.data;
|
|
49636
|
-
}
|
|
49637
|
-
async function pullHeadlessWixelJob({
|
|
49638
|
-
accountAuthHeaders,
|
|
49639
|
-
apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
|
|
49640
|
-
jobId,
|
|
49641
|
-
conductorOverride
|
|
49642
|
-
}) {
|
|
49643
|
-
const httpClient6 = (0, import_http_client13.createHttpClient)({
|
|
49644
|
-
headers: {
|
|
49645
|
-
...COMMON_HEADERS,
|
|
49646
|
-
...accountAuthHeaders,
|
|
49647
|
-
...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
|
|
49648
|
-
"Content-Type": "application/json"
|
|
49649
|
-
},
|
|
49650
|
-
baseURL: apiBaseURL
|
|
49651
|
-
});
|
|
49652
|
-
const response = await httpClient6.post(
|
|
49653
|
-
"/_api/harmony-site-builder/pull-wixel-job",
|
|
49654
|
-
{ jobId }
|
|
49655
|
-
);
|
|
49656
|
-
return response.data;
|
|
49657
|
-
}
|
|
49658
49655
|
async function getStylePresetsByIds2({
|
|
49659
49656
|
siteAuthHeaders,
|
|
49660
49657
|
stylePresetIds,
|
|
@@ -49974,240 +49971,6 @@ function addGetWixelProjectAssetsTool(server, authStrategy, options = {}) {
|
|
|
49974
49971
|
);
|
|
49975
49972
|
}
|
|
49976
49973
|
|
|
49977
|
-
// src/wixel/update-headless-wixel-job-tool.ts
|
|
49978
|
-
var TOOL_NAME5 = "updateHeadlessWixelJob";
|
|
49979
|
-
var TOOL_TITLE5 = "Update Headless Wixel Job";
|
|
49980
|
-
var TOOL_DESCRIPTION5 = `Update the status and data of a headless Wixel job.`;
|
|
49981
|
-
var TOOL_META5 = {
|
|
49982
|
-
ui: { visibility: ["app"] }
|
|
49983
|
-
};
|
|
49984
|
-
var wixelJobStatusSchema = external_exports.enum([
|
|
49985
|
-
"STARTED",
|
|
49986
|
-
"IN_PROGRESS",
|
|
49987
|
-
"COMPLETED",
|
|
49988
|
-
"FAILED",
|
|
49989
|
-
"CANCELLED"
|
|
49990
|
-
]);
|
|
49991
|
-
function addUpdateHeadlessWixelJobTool(server, authStrategy, options = {}) {
|
|
49992
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
49993
|
-
vD(
|
|
49994
|
-
server,
|
|
49995
|
-
TOOL_NAME5,
|
|
49996
|
-
{
|
|
49997
|
-
title: TOOL_TITLE5,
|
|
49998
|
-
description: TOOL_DESCRIPTION5,
|
|
49999
|
-
inputSchema: {
|
|
50000
|
-
id: external_exports.string().describe("The job ID"),
|
|
50001
|
-
status: wixelJobStatusSchema.describe("The job status"),
|
|
50002
|
-
userPrompt: external_exports.string().optional().describe("The user prompt for the job"),
|
|
50003
|
-
shouldRefresh: external_exports.boolean().optional().describe("Whether the job should refresh"),
|
|
50004
|
-
errorMessage: external_exports.string().optional().describe("Error message if the job failed"),
|
|
50005
|
-
type: external_exports.string().optional().describe("The type of asset being created"),
|
|
50006
|
-
data: external_exports.object({
|
|
50007
|
-
siteId: external_exports.string().optional().describe("The site ID"),
|
|
50008
|
-
assetId: external_exports.string().optional().describe("The asset ID"),
|
|
50009
|
-
projectId: external_exports.string().optional().describe("The project ID"),
|
|
50010
|
-
conversationId: external_exports.string().optional().describe("The conversation ID")
|
|
50011
|
-
}).optional().describe("Additional job data"),
|
|
50012
|
-
userId: external_exports.string().optional().describe("The user ID"),
|
|
50013
|
-
accountId: external_exports.string().optional().describe("The account ID")
|
|
50014
|
-
},
|
|
50015
|
-
annotations: {
|
|
50016
|
-
readOnlyHint: false,
|
|
50017
|
-
destructiveHint: true,
|
|
50018
|
-
openWorldHint: false
|
|
50019
|
-
},
|
|
50020
|
-
_meta: TOOL_META5
|
|
50021
|
-
},
|
|
50022
|
-
async (args) => {
|
|
50023
|
-
try {
|
|
50024
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
50025
|
-
const result = await updateHeadlessWixelJob({
|
|
50026
|
-
accountAuthHeaders,
|
|
50027
|
-
conductorOverride: options.conductorOverride,
|
|
50028
|
-
job: {
|
|
50029
|
-
id: args.id,
|
|
50030
|
-
status: args.status,
|
|
50031
|
-
userPrompt: args.userPrompt,
|
|
50032
|
-
shouldRefresh: args.shouldRefresh,
|
|
50033
|
-
errorMessage: args.errorMessage,
|
|
50034
|
-
type: args.type,
|
|
50035
|
-
data: args.data,
|
|
50036
|
-
userId: args.userId,
|
|
50037
|
-
accountId: args.accountId
|
|
50038
|
-
}
|
|
50039
|
-
});
|
|
50040
|
-
return {
|
|
50041
|
-
isError: false,
|
|
50042
|
-
content: [
|
|
50043
|
-
{
|
|
50044
|
-
type: "text",
|
|
50045
|
-
text: `Headless Wixel job ${args.id} updated to status: ${args.status}`
|
|
50046
|
-
}
|
|
50047
|
-
],
|
|
50048
|
-
structuredContent: {
|
|
50049
|
-
jobId: args.id,
|
|
50050
|
-
status: args.status,
|
|
50051
|
-
...result
|
|
50052
|
-
}
|
|
50053
|
-
};
|
|
50054
|
-
} catch (error2) {
|
|
50055
|
-
console.error("\u274C Error updating headless Wixel job:", error2);
|
|
50056
|
-
const errorMessage = error2.message;
|
|
50057
|
-
return {
|
|
50058
|
-
isError: true,
|
|
50059
|
-
content: [{ type: "text", text: errorMessage }],
|
|
50060
|
-
structuredContent: {
|
|
50061
|
-
success: false,
|
|
50062
|
-
error: errorMessage
|
|
50063
|
-
}
|
|
50064
|
-
};
|
|
50065
|
-
}
|
|
50066
|
-
}
|
|
50067
|
-
);
|
|
50068
|
-
}
|
|
50069
|
-
|
|
50070
|
-
// src/wixel/pull-headless-wixel-job-tool.ts
|
|
50071
|
-
var TOOL_NAME6 = "pullHeadlessWixelJob";
|
|
50072
|
-
var TOOL_TITLE6 = "Pull Headless Wixel Job";
|
|
50073
|
-
var TOOL_DESCRIPTION6 = `Pull the next available headless Wixel job.`;
|
|
50074
|
-
var TOOL_META6 = {
|
|
50075
|
-
ui: { visibility: ["app"] }
|
|
50076
|
-
};
|
|
50077
|
-
function addPullHeadlessWixelJobTool(server, authStrategy, options = {}) {
|
|
50078
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
50079
|
-
vD(
|
|
50080
|
-
server,
|
|
50081
|
-
TOOL_NAME6,
|
|
50082
|
-
{
|
|
50083
|
-
title: TOOL_TITLE6,
|
|
50084
|
-
description: TOOL_DESCRIPTION6,
|
|
50085
|
-
inputSchema: {
|
|
50086
|
-
jobId: external_exports.string().describe("The job ID")
|
|
50087
|
-
},
|
|
50088
|
-
annotations: {
|
|
50089
|
-
readOnlyHint: false,
|
|
50090
|
-
destructiveHint: false,
|
|
50091
|
-
openWorldHint: false
|
|
50092
|
-
},
|
|
50093
|
-
_meta: TOOL_META6
|
|
50094
|
-
},
|
|
50095
|
-
async (args) => {
|
|
50096
|
-
try {
|
|
50097
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
50098
|
-
const result = await pullHeadlessWixelJob({
|
|
50099
|
-
accountAuthHeaders,
|
|
50100
|
-
jobId: args.jobId,
|
|
50101
|
-
conductorOverride: options.conductorOverride
|
|
50102
|
-
});
|
|
50103
|
-
return {
|
|
50104
|
-
isError: false,
|
|
50105
|
-
content: [
|
|
50106
|
-
{
|
|
50107
|
-
type: "text",
|
|
50108
|
-
text: result.job ? `Pulled headless Wixel job: ${result.job.id}` : "No headless Wixel job available"
|
|
50109
|
-
}
|
|
50110
|
-
],
|
|
50111
|
-
structuredContent: {
|
|
50112
|
-
...result
|
|
50113
|
-
}
|
|
50114
|
-
};
|
|
50115
|
-
} catch (error2) {
|
|
50116
|
-
console.error("\u274C Error pulling headless Wixel job:", error2);
|
|
50117
|
-
const errorMessage = error2.message;
|
|
50118
|
-
return {
|
|
50119
|
-
isError: true,
|
|
50120
|
-
content: [{ type: "text", text: errorMessage }],
|
|
50121
|
-
structuredContent: {
|
|
50122
|
-
success: false,
|
|
50123
|
-
error: errorMessage
|
|
50124
|
-
}
|
|
50125
|
-
};
|
|
50126
|
-
}
|
|
50127
|
-
}
|
|
50128
|
-
);
|
|
50129
|
-
}
|
|
50130
|
-
|
|
50131
|
-
// src/wixel/open-headless-wixel-project-tool.ts
|
|
50132
|
-
var TOOL_NAME7 = "openHeadlessWixelProject";
|
|
50133
|
-
var TOOL_TITLE7 = "Open Headless Wixel Project";
|
|
50134
|
-
var TOOL_DESCRIPTION7 = `Open a headless Wixel project for background asset generation.`;
|
|
50135
|
-
var TOOL_META7 = {
|
|
50136
|
-
ui: { visibility: ["app"] }
|
|
50137
|
-
};
|
|
50138
|
-
function addOpenHeadlessWixelProjectTool(server, authStrategy, options = {}) {
|
|
50139
|
-
const { getAccountAuthHeaders } = authStrategy;
|
|
50140
|
-
vD(
|
|
50141
|
-
server,
|
|
50142
|
-
TOOL_NAME7,
|
|
50143
|
-
{
|
|
50144
|
-
title: TOOL_TITLE7,
|
|
50145
|
-
description: TOOL_DESCRIPTION7,
|
|
50146
|
-
inputSchema: {
|
|
50147
|
-
url: external_exports.string().describe("The URL of the Wixel project"),
|
|
50148
|
-
userPrompt: external_exports.string().describe("The user prompt for the project"),
|
|
50149
|
-
jobId: external_exports.string().describe("The job ID"),
|
|
50150
|
-
siteId: external_exports.string().describe("The site ID"),
|
|
50151
|
-
projectId: external_exports.string().describe("The project ID"),
|
|
50152
|
-
conversationId: external_exports.string().describe("The conversation ID"),
|
|
50153
|
-
withScreenshots: external_exports.boolean().optional().describe("Whether to include screenshots"),
|
|
50154
|
-
useProvidedCookies: external_exports.boolean().optional().describe("Whether to use provided cookies"),
|
|
50155
|
-
timeout: external_exports.number().optional().describe("Timeout in milliseconds")
|
|
50156
|
-
},
|
|
50157
|
-
annotations: {
|
|
50158
|
-
readOnlyHint: false,
|
|
50159
|
-
destructiveHint: true,
|
|
50160
|
-
openWorldHint: false
|
|
50161
|
-
},
|
|
50162
|
-
_meta: TOOL_META7
|
|
50163
|
-
},
|
|
50164
|
-
async (args) => {
|
|
50165
|
-
try {
|
|
50166
|
-
const accountAuthHeaders = await getAccountAuthHeaders();
|
|
50167
|
-
const result = await openHeadlessWixelProject({
|
|
50168
|
-
accountAuthHeaders,
|
|
50169
|
-
url: args.url,
|
|
50170
|
-
userPrompt: args.userPrompt,
|
|
50171
|
-
jobId: args.jobId,
|
|
50172
|
-
siteId: args.siteId,
|
|
50173
|
-
projectId: args.projectId,
|
|
50174
|
-
conversationId: args.conversationId,
|
|
50175
|
-
withScreenshots: args.withScreenshots,
|
|
50176
|
-
useProvidedCookies: args.useProvidedCookies,
|
|
50177
|
-
timeout: args.timeout,
|
|
50178
|
-
conductorOverride: options.conductorOverride
|
|
50179
|
-
});
|
|
50180
|
-
return {
|
|
50181
|
-
isError: false,
|
|
50182
|
-
content: [
|
|
50183
|
-
{
|
|
50184
|
-
type: "text",
|
|
50185
|
-
text: `Headless Wixel project opened for job ${args.jobId}`
|
|
50186
|
-
}
|
|
50187
|
-
],
|
|
50188
|
-
structuredContent: {
|
|
50189
|
-
success: true,
|
|
50190
|
-
jobId: args.jobId,
|
|
50191
|
-
projectId: args.projectId,
|
|
50192
|
-
...result
|
|
50193
|
-
}
|
|
50194
|
-
};
|
|
50195
|
-
} catch (error2) {
|
|
50196
|
-
console.error("\u274C Error opening headless Wixel project:", error2);
|
|
50197
|
-
const errorMessage = error2.message;
|
|
50198
|
-
return {
|
|
50199
|
-
isError: true,
|
|
50200
|
-
content: [{ type: "text", text: errorMessage }],
|
|
50201
|
-
structuredContent: {
|
|
50202
|
-
success: false,
|
|
50203
|
-
error: errorMessage
|
|
50204
|
-
}
|
|
50205
|
-
};
|
|
50206
|
-
}
|
|
50207
|
-
}
|
|
50208
|
-
);
|
|
50209
|
-
}
|
|
50210
|
-
|
|
50211
49974
|
// src/wixel/external-agent-api.ts
|
|
50212
49975
|
var import_http_client14 = __toESM(require_index_node2(), 1);
|
|
50213
49976
|
|
|
@@ -50549,7 +50312,7 @@ async function getWixelPendingQuestion({
|
|
|
50549
50312
|
}
|
|
50550
50313
|
|
|
50551
50314
|
// src/wixel/wixel-session-tools.ts
|
|
50552
|
-
var
|
|
50315
|
+
var TOOL_META5 = {
|
|
50553
50316
|
ui: { visibility: ["app", "model"] }
|
|
50554
50317
|
};
|
|
50555
50318
|
function buildWixelEditorUrl(metaSiteId, projectId) {
|
|
@@ -50858,7 +50621,7 @@ Without arguments Wixel provisions a new project and session. Pass metaSiteId to
|
|
|
50858
50621
|
destructiveHint: false,
|
|
50859
50622
|
openWorldHint: false
|
|
50860
50623
|
},
|
|
50861
|
-
_meta:
|
|
50624
|
+
_meta: TOOL_META5
|
|
50862
50625
|
},
|
|
50863
50626
|
async (args, extra) => {
|
|
50864
50627
|
setWixelToolBi(extra, {
|
|
@@ -50952,7 +50715,7 @@ Send the user's request as THEY phrased it. Do NOT add creative direction they d
|
|
|
50952
50715
|
destructiveHint: true,
|
|
50953
50716
|
openWorldHint: false
|
|
50954
50717
|
},
|
|
50955
|
-
_meta:
|
|
50718
|
+
_meta: TOOL_META5
|
|
50956
50719
|
},
|
|
50957
50720
|
async (args, extra) => {
|
|
50958
50721
|
setWixelToolBi(extra, {
|
|
@@ -51053,7 +50816,7 @@ Event types: "reply" (the agent's answer), "failed" (the turn failed), and "user
|
|
|
51053
50816
|
destructiveHint: false,
|
|
51054
50817
|
openWorldHint: false
|
|
51055
50818
|
},
|
|
51056
|
-
_meta:
|
|
50819
|
+
_meta: TOOL_META5
|
|
51057
50820
|
},
|
|
51058
50821
|
async (args, extra) => {
|
|
51059
50822
|
setWixelToolBi(extra, {
|
|
@@ -51223,7 +50986,7 @@ function addGetWixelStylePresetsTool(server, authStrategy, options = {}) {
|
|
|
51223
50986
|
destructiveHint: false,
|
|
51224
50987
|
openWorldHint: false
|
|
51225
50988
|
},
|
|
51226
|
-
_meta:
|
|
50989
|
+
_meta: TOOL_META5
|
|
51227
50990
|
},
|
|
51228
50991
|
async (args, extra) => {
|
|
51229
50992
|
setWixelToolBi(extra, { siteId: args.metaSiteId });
|
|
@@ -51526,9 +51289,6 @@ function addWixelTools(server, authStrategy, options = {}) {
|
|
|
51526
51289
|
addMarkWixelJobAsFulfilledTool(server, authStrategy, options);
|
|
51527
51290
|
addGetWixelAssetTool(server, authStrategy, options);
|
|
51528
51291
|
addGetWixelProjectAssetsTool(server, authStrategy, options);
|
|
51529
|
-
addUpdateHeadlessWixelJobTool(server, authStrategy, options);
|
|
51530
|
-
addOpenHeadlessWixelProjectTool(server, authStrategy, options);
|
|
51531
|
-
addPullHeadlessWixelJobTool(server, authStrategy, options);
|
|
51532
51292
|
addWixelSessionTools(server, authStrategy, options);
|
|
51533
51293
|
}
|
|
51534
51294
|
|
|
@@ -51681,10 +51441,14 @@ function addImportClaudeDesignTool(server, authStrategy, options) {
|
|
|
51681
51441
|
try {
|
|
51682
51442
|
designUrl = new URL(args.url);
|
|
51683
51443
|
} catch {
|
|
51684
|
-
return errorResult(
|
|
51444
|
+
return errorResult(
|
|
51445
|
+
"Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For site files the user provided themselves, do not retry: send the user to https://www.wix.com/headless/drop?utm_campaign=mcp to upload them and get a live hosted site."
|
|
51446
|
+
);
|
|
51685
51447
|
}
|
|
51686
51448
|
if (designUrl.protocol !== "https:" || !designUrl.hostname.endsWith(CLAUDE_USER_CONTENT_HOST_SUFFIX)) {
|
|
51687
|
-
return errorResult(
|
|
51449
|
+
return errorResult(
|
|
51450
|
+
"Invalid design URL \u2014 this tool only accepts the claudeusercontent.com URL produced by Claude Design. For site files the user provided themselves, do not retry: send the user to https://www.wix.com/headless/drop?utm_campaign=mcp to upload them and get a live hosted site."
|
|
51451
|
+
);
|
|
51688
51452
|
}
|
|
51689
51453
|
const accountHeaders = await authStrategy.getAccountAuthHeaders();
|
|
51690
51454
|
const wixstroOptions = { baseUrl: wixstroBaseUrl, accountHeaders };
|
|
@@ -51968,10 +51732,13 @@ function executeTextResult(message) {
|
|
|
51968
51732
|
content: [{ type: "text", text: message }]
|
|
51969
51733
|
};
|
|
51970
51734
|
}
|
|
51971
|
-
function formatExecuteResult(data, maxResponseSize) {
|
|
51735
|
+
function formatExecuteResult(data, maxResponseSize, reportBi) {
|
|
51972
51736
|
if (data.error) {
|
|
51973
51737
|
return executeErrorResult(data.error);
|
|
51974
51738
|
}
|
|
51739
|
+
reportBi?.({
|
|
51740
|
+
originalLength: typeof data.result === "string" ? data.result.length : JSON.stringify(data.result)?.length
|
|
51741
|
+
});
|
|
51975
51742
|
return {
|
|
51976
51743
|
content: [
|
|
51977
51744
|
{ type: "text", text: truncateResponse(data.result, maxResponseSize) }
|
|
@@ -52081,7 +51848,11 @@ function addExecuteTool(server, options) {
|
|
|
52081
51848
|
status: data.authErrorStatus
|
|
52082
51849
|
});
|
|
52083
51850
|
}
|
|
52084
|
-
return formatExecuteResult(
|
|
51851
|
+
return formatExecuteResult(
|
|
51852
|
+
data,
|
|
51853
|
+
maxResponseSize,
|
|
51854
|
+
extra?.setToolBiParams
|
|
51855
|
+
);
|
|
52085
51856
|
} catch (err) {
|
|
52086
51857
|
const message = err instanceof Error ? err.message : String(err);
|
|
52087
51858
|
logger2.log(
|
|
@@ -52326,7 +52097,10 @@ function createWixToolkit(options) {
|
|
|
52326
52097
|
if (!toolSucceeded) {
|
|
52327
52098
|
errorBody = extractText(cbResult);
|
|
52328
52099
|
} else {
|
|
52329
|
-
additionalFields = formatToolResultAdditionalFields(cbResult
|
|
52100
|
+
additionalFields = formatToolResultAdditionalFields(cbResult, {
|
|
52101
|
+
returnedRows: toolBiParams.returnedRows,
|
|
52102
|
+
originalLength: toolBiParams.originalLength
|
|
52103
|
+
});
|
|
52330
52104
|
}
|
|
52331
52105
|
if (!isDevEnvironment) {
|
|
52332
52106
|
if (toolSucceeded) {
|
|
@@ -52485,8 +52259,6 @@ function createWixToolkit(options) {
|
|
|
52485
52259
|
addImportClaudeDesignTool,
|
|
52486
52260
|
addListWixelEventsTool,
|
|
52487
52261
|
addMarkWixelJobAsFulfilledTool,
|
|
52488
|
-
addOpenHeadlessWixelProjectTool,
|
|
52489
|
-
addPullHeadlessWixelJobTool,
|
|
52490
52262
|
addPullSiteJobTool,
|
|
52491
52263
|
addSearchCodeModeTool,
|
|
52492
52264
|
addSearchSiteTemplatesTool,
|
|
@@ -52494,7 +52266,6 @@ function createWixToolkit(options) {
|
|
|
52494
52266
|
addSiteCreationWidgetTools,
|
|
52495
52267
|
addStartWixelSessionTool,
|
|
52496
52268
|
addSupportTool,
|
|
52497
|
-
addUpdateHeadlessWixelJobTool,
|
|
52498
52269
|
addWixSiteCreationTool,
|
|
52499
52270
|
addWixelSessionTools,
|
|
52500
52271
|
addWixelTools,
|