@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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/build/bin-standalone.js +93 -31
  3. package/build/cjs/index.cjs +151 -380
  4. package/build/cjs/toolkit.cjs +97 -33
  5. package/build/dts/api-call/index.js +41 -3
  6. package/build/dts/code-mode/index.js +8 -2
  7. package/build/dts/config/api-request-rules.d.ts +11 -0
  8. package/build/dts/config/api-request-rules.js +11 -0
  9. package/build/dts/config/default-config.js +13 -3
  10. package/build/dts/config/param-descriptions.d.ts +1 -1
  11. package/build/dts/config/param-descriptions.js +5 -3
  12. package/build/dts/docs/docs.js +6 -6
  13. package/build/dts/import-claude-design-tool/index.js +2 -2
  14. package/build/dts/infra/tool-bi.d.ts +1 -1
  15. package/build/dts/infra/tool-bi.js +3 -2
  16. package/build/dts/site-widget-tools/constants.d.ts +12 -5
  17. package/build/dts/site-widget-tools/constants.js +20 -11
  18. package/build/dts/site-widget-tools/site-builder-tool/index.js +1 -1
  19. package/build/dts/site-widget-tools/site-creation-tool/index.js +3 -2
  20. package/build/dts/site-widget-tools/suggested-domain-tool/index.js +23 -5
  21. package/build/dts/toolkit-entry.d.cts +1 -1
  22. package/build/dts/toolkit-entry.d.ts +1 -1
  23. package/build/dts/toolkit.js +4 -1
  24. package/build/dts/wix-mcp-server.d.ts +4 -0
  25. package/build/dts/wix-mcp-server.js +9 -1
  26. package/build/dts/wixel/api.d.ts +0 -60
  27. package/build/dts/wixel/api.js +1 -50
  28. package/build/dts/wixel/constants.d.ts +0 -1
  29. package/build/dts/wixel/constants.js +0 -1
  30. package/build/dts/wixel/index.d.ts +0 -3
  31. package/build/dts/wixel/index.js +0 -9
  32. package/build/esm/index.js +151 -377
  33. package/build/esm/toolkit.js +97 -33
  34. package/package.json +3 -3
  35. package/build/dts/wixel/open-headless-wixel-project-tool.d.ts +0 -6
  36. package/build/dts/wixel/open-headless-wixel-project-tool.js +0 -84
  37. package/build/dts/wixel/pull-headless-wixel-job-tool.d.ts +0 -6
  38. package/build/dts/wixel/pull-headless-wixel-job-tool.js +0 -61
  39. package/build/dts/wixel/update-headless-wixel-job-tool.d.ts +0 -6
  40. package/build/dts/wixel/update-headless-wixel-job-tool.js +0 -106
@@ -29740,7 +29740,7 @@ function extractText(result) {
29740
29740
  return result.content.filter((content) => content.type === "text" && content.text != null).map((content) => content.text).join("\n");
29741
29741
  }
29742
29742
  var TOOL_RESULT_PREVIEW_MAX_CHARS = 4e3;
29743
- function formatToolResultAdditionalFields(result) {
29743
+ function formatToolResultAdditionalFields(result, extras) {
29744
29744
  const resultText = extractText(result);
29745
29745
  const contentTypes = [
29746
29746
  ...new Set(
@@ -29756,7 +29756,8 @@ function formatToolResultAdditionalFields(result) {
29756
29756
  resultPreview: resultText.slice(0, TOOL_RESULT_PREVIEW_MAX_CHARS),
29757
29757
  resultTextLength: resultText.length,
29758
29758
  resultPreviewTruncated: resultText.length > TOOL_RESULT_PREVIEW_MAX_CHARS,
29759
- resultContentTypes: contentTypes
29759
+ resultContentTypes: contentTypes,
29760
+ ...extras
29760
29761
  });
29761
29762
  }
29762
29763
  function createToolBiEvent(params) {
@@ -29817,6 +29818,11 @@ var WixMcpServer = class extends McpServer {
29817
29818
  isMcpAppsInMcpEnabled() {
29818
29819
  return this.mcpAppsInMcpEnabled;
29819
29820
  }
29821
+ /** Microsoft 365 Copilot ("sydney" at runtime) or Copilot Cowork ("copilot"). */
29822
+ isMicrosoftCopilotClient() {
29823
+ const clientName = this.getClientName?.()?.toLowerCase() ?? "";
29824
+ return clientName.includes("sydney") || clientName.includes("copilot");
29825
+ }
29820
29826
  shouldRenderMcpApps() {
29821
29827
  const clientName = this.getClientName?.()?.toLowerCase();
29822
29828
  const isOpenAi = clientName?.includes("openai") ?? false;
@@ -29932,7 +29938,10 @@ var WixMcpServer = class extends McpServer {
29932
29938
  if (!toolSucceeded) {
29933
29939
  errorBody = extractText(cbResult);
29934
29940
  } else {
29935
- additionalFields = formatToolResultAdditionalFields(cbResult);
29941
+ additionalFields = formatToolResultAdditionalFields(cbResult, {
29942
+ returnedRows: toolBiParams.returnedRows,
29943
+ originalLength: toolBiParams.originalLength
29944
+ });
29936
29945
  }
29937
29946
  if (toolSucceeded && !isDevEnvironment) {
29938
29947
  panorama.transaction(toolName).finish({ toolInvocationId });
@@ -30836,6 +30845,9 @@ function rethrowIfUnauthorized(error2) {
30836
30845
  }
30837
30846
  }
30838
30847
 
30848
+ // src/config/api-request-rules.ts
30849
+ 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).";
30850
+
30839
30851
  // src/config/default-config.ts
30840
30852
  var AGENT_GOAL = dedent_default`
30841
30853
  You are an agent that helps the user manage their Wix site.
@@ -30935,6 +30947,8 @@ var SITE_CREATION_COPY = {
30935
30947
  var SITE_GUIDANCE = dedent_default`
30936
30948
  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.
30937
30949
 
30950
+ 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.
30951
+
30938
30952
  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.
30939
30953
  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.
30940
30954
  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.
@@ -30957,11 +30971,13 @@ var EXECUTE_WIX_API_INTRO = dedent_default`
30957
30971
  CODE CONTRACT:
30958
30972
  - Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
30959
30973
  - Use only \`wix.request({ method, url, body })\` and in-memory JavaScript. Node.js modules, filesystem access, and downloadable-file creation are unavailable.
30974
+ - 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.
30960
30975
 
30961
30976
  CONFIRM API CONTRACTS:
30962
30977
  - 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.
30963
30978
  - Prefer \`method.publicUrl\` from SearchWixAPISpec; never use \`method.servers[0]\`. Pass all supporting documentation URLs through \`sourceDocUrls\`.
30964
30979
  - 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.
30980
+ - ${ARRAY_QUERY_PARAMS_RULE}
30965
30981
  - 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.
30966
30982
  `;
30967
30983
  var EXECUTE_WIX_API_OUTPUT_AND_ERRORS = dedent_default`
@@ -30977,6 +30993,7 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
30977
30993
  SCOPE AND SITE TARGETING:
30978
30994
  - 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.
30979
30995
  - If \`scope\` is omitted it defaults to site when either the ExecuteWixAPI call or \`wix.request\` provides a \`siteId\`; otherwise it defaults to account.
30996
+ - 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.
30980
30997
  - \`scope: "account"\` ignores any \`siteId\` you pass, so a site-level endpoint called that way fails.
30981
30998
  - Authentication is injected automatically; never set Authorization, wix-site-id, or wix-account-id headers.
30982
30999
  - For one named site, prefer GetSiteContext. If it is unavailable, resolve the exact site and perform the action in the same invocation.
@@ -31264,7 +31281,8 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31264
31281
  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.
31265
31282
  `,
31266
31283
  "import-claude-design-from-url": dedent_default`
31267
- Import a design into Wix from a publicly fetchable URL. The file is a self-contained HTML bundle with all images, fonts, and styles inlined. Creates a live Wix-hosted site and returns its URL.
31284
+ 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.
31285
+ 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.
31268
31286
  `,
31269
31287
  RunWixCliCommand: dedent_default`
31270
31288
  Executes Wix CLI commands for Wix app development and management.
@@ -31297,8 +31315,10 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31297
31315
  SearchBuildAppsDocumentation: dedent_default`
31298
31316
  Searches the Wix Build Apps documentation.
31299
31317
  `,
31300
- SearchOverviewDocumentation: dedent_default`
31301
- Searches high-level Wix platform and business overview documentation.
31318
+ SearchDevelopmentDocumentation: dedent_default`
31319
+ Broad Wix development documentation (platform concepts, developer guides, getting started). **Last resort — development tasks only.**
31320
+ Skip it entirely for general, business, support, or Wix-editor questions.
31321
+ 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.
31302
31322
  `,
31303
31323
  SearchWixHeadlessDocumentation: dedent_default`
31304
31324
  Searches the Wix Headless documentation.
@@ -31663,6 +31683,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
31663
31683
  CreateWixBusinessGuide: dedent_default`
31664
31684
  Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
31665
31685
  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\`.
31686
+ 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.
31666
31687
 
31667
31688
  ## What This Tool Contains
31668
31689
 
@@ -31950,14 +31971,20 @@ function renderApps(apps, knownApps) {
31950
31971
  }
31951
31972
  function renderProperties(props) {
31952
31973
  const sections = [];
31953
- const locale = [];
31954
- if (props.language) locale.push(`- Language: **${props.language}**`);
31955
- if (props.locale?.country) locale.push(`- Country: **${props.locale.country}**`);
31956
- if (props.timeZone) locale.push(`- Timezone: **${props.timeZone}**`);
31957
- if (props.paymentCurrency) locale.push(`- Currency: **${props.paymentCurrency}**`);
31958
- if (locale.length) {
31959
- sections.push(`**Locale & Region**
31960
- ${locale.join("\n")}`);
31974
+ const regionalFormat = [];
31975
+ if (props.language) regionalFormat.push(`- Language: **${props.language}**`);
31976
+ if (props.locale?.country)
31977
+ regionalFormat.push(`- Locale region: **${props.locale.country}**`);
31978
+ if (props.timeZone) regionalFormat.push(`- Timezone: **${props.timeZone}**`);
31979
+ if (props.paymentCurrency)
31980
+ regionalFormat.push(`- Currency: **${props.paymentCurrency}**`);
31981
+ if (regionalFormat.length) {
31982
+ sections.push(`**Regional Format**
31983
+ ${regionalFormat.join("\n")}`);
31984
+ }
31985
+ if (props.address?.country) {
31986
+ sections.push(`**Location**
31987
+ - Country: **${props.address.country}**`);
31961
31988
  }
31962
31989
  const contact = [];
31963
31990
  if (props.email) contact.push(`- Email: **${props.email}**`);
@@ -32104,6 +32131,7 @@ var known_apps_default = {
32104
32131
  "225dd912-7dea-4738-8688-4b8c6955ffc2": "Wix Forms",
32105
32132
  "d80111c5-a0f4-47a8-b63a-65b54d774a27": "Wix Gift Cards",
32106
32133
  "148c2287-c669-d849-d153-463c7486a694": "Wix Groups",
32134
+ "14bca956-e09f-f4d6-14d7-466cb3f09103": "Wix Hotels",
32107
32135
  "13ee94c1-b635-8505-3391-97919052c16f": "Wix Invoices",
32108
32136
  "14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9": "Wix Members Area",
32109
32137
  "14d84998-ae09-1abf-c6fc-3f3cace5bf19": "Wix Multilingual",
@@ -32121,7 +32149,16 @@ var known_apps_default = {
32121
32149
  "1480c568-5cbd-9392-5604-1148f5faffa0": "Promote SEO",
32122
32150
  "ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e": "Wix Rentals"
32123
32151
  };
32124
- var DYNAMIC_CONTEXT_URL = "https://dev.wix.com/_api/dynamic-context/v1/dynamic-context";
32152
+ var DYNAMIC_CONTEXT_PATH = "/_api/dynamic-context/v1/dynamic-context";
32153
+ var DYNAMIC_CONTEXT_URL = `https://dev.wix.com${DYNAMIC_CONTEXT_PATH}`;
32154
+ var isWixHost = (hostname2) => hostname2 === "wix.com" || hostname2.endsWith(".wix.com");
32155
+ var dynamicContextUrl = () => {
32156
+ if (typeof window === "undefined") {
32157
+ return DYNAMIC_CONTEXT_URL;
32158
+ }
32159
+ const hostname2 = window.location?.hostname;
32160
+ return typeof hostname2 === "string" && isWixHost(hostname2) ? DYNAMIC_CONTEXT_PATH : DYNAMIC_CONTEXT_URL;
32161
+ };
32125
32162
  var COUNT_SITES_URL = "https://www.wixapis.com/site-list/v2/sites/count";
32126
32163
  var MAX_SITES_FOR_DYNAMIC_CONTEXT = 10;
32127
32164
  var DYNAMIC_CONTEXT_PETRI_OVERRIDE = "shouldReturnDynamicContextInMCP#B";
@@ -32138,8 +32175,8 @@ async function getDynamicContext(auth, httpClient6, filter, options) {
32138
32175
  partnerContextEnabled: options,
32139
32176
  includeAccountContext: options
32140
32177
  } : options;
32141
- const includePartnerContext = contextOptions?.partnerContextEnabled ?? false;
32142
- const includeAccountContext = contextOptions?.includeAccountContext ?? false;
32178
+ const includePartnerContext = contextOptions?.partnerContextEnabled ?? true;
32179
+ const includeAccountContext = contextOptions?.includeAccountContext ?? true;
32143
32180
  try {
32144
32181
  const accountHeaders = await auth.getAccountAuthHeaders();
32145
32182
  const noFilter = !filter?.siteId && !filter?.siteName;
@@ -32173,7 +32210,7 @@ async function getDynamicContext(auth, httpClient6, filter, options) {
32173
32210
  if (filter?.siteId) body.site_id = filter.siteId;
32174
32211
  else if (filter?.siteName) body.site_name = filter.siteName;
32175
32212
  const dynamicContextPromise = httpClient6.request({
32176
- url: DYNAMIC_CONTEXT_URL,
32213
+ url: dynamicContextUrl(),
32177
32214
  method: "POST",
32178
32215
  headers: {
32179
32216
  ...accountHeaders,
@@ -32253,7 +32290,8 @@ var paramDescriptions = {
32253
32290
  "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",
32254
32291
  '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',
32255
32292
  `Allowed API urls are: ${ALLOWED_HOSTNAMES.join(", ")}`,
32256
- `Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`
32293
+ `Docs urls like https://dev.wix.com/docs/... are not API urls, if you want to read the docs, use the "ReadFullDocsArticle" tool`,
32294
+ ARRAY_QUERY_PARAMS_RULE
32257
32295
  ].join("\n"),
32258
32296
  method: "The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)",
32259
32297
  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.',
@@ -32326,8 +32364,8 @@ var paramDescriptions = {
32326
32364
  searchTerm: "The search term to search for in the Build Apps Documentation",
32327
32365
  maxResults: "The maximum number of results to return, default is 10, max is 15"
32328
32366
  },
32329
- SearchOverviewDocumentation: {
32330
- searchTerm: "The search term to search for in the Wix Overview Documentation",
32367
+ SearchDevelopmentDocumentation: {
32368
+ searchTerm: "The development-related search term. Use only after a more specific docs search (REST/SDK/CLI/Build Apps/Headless/WDS) came back empty.",
32331
32369
  maxResults: "The maximum number of results to return, default is 10, max is 15"
32332
32370
  },
32333
32371
  SearchWixHeadlessDocumentation: {
@@ -33134,15 +33172,15 @@ var addDocsTools = (server, allowedTools = [
33134
33172
  }
33135
33173
  );
33136
33174
  }
33137
- if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("SearchOverviewDocumentation")) {
33175
+ if (allowedTools.includes("OVERVIEW") && !disableTools?.includes("SearchDevelopmentDocumentation")) {
33138
33176
  server.tool(
33139
- "SearchOverviewDocumentation",
33177
+ "SearchDevelopmentDocumentation",
33140
33178
  getDescription(
33141
- "SearchOverviewDocumentation",
33142
- defaultToolDescriptions.SearchOverviewDocumentation ?? ""
33179
+ "SearchDevelopmentDocumentation",
33180
+ defaultToolDescriptions.SearchDevelopmentDocumentation ?? ""
33143
33181
  ),
33144
33182
  (() => {
33145
- const d2 = desc("SearchOverviewDocumentation");
33183
+ const d2 = desc("SearchDevelopmentDocumentation");
33146
33184
  return {
33147
33185
  searchTerm: external_exports.string().describe(d2.searchTerm),
33148
33186
  maxResults: external_exports.number().describe(d2.maxResults).min(1).max(15).optional().default(15)
@@ -33172,8 +33210,8 @@ var addDocsTools = (server, allowedTools = [
33172
33210
  panorama.errorMonitor().reportError(error2);
33173
33211
  captureException(error2, {
33174
33212
  tags: {
33175
- componentId: "SearchOverviewDocumentation",
33176
- toolName: "SearchOverviewDocumentation"
33213
+ componentId: "SearchDevelopmentDocumentation",
33214
+ toolName: "SearchDevelopmentDocumentation"
33177
33215
  }
33178
33216
  });
33179
33217
  logger2.error(
@@ -33992,6 +34030,19 @@ var MAX_ALLOWED_RESPONSE_CHARS = 2e6;
33992
34030
 
33993
34031
  // src/api-call/index.ts
33994
34032
  var DEFAULT_MAX_RESPONSE_SIZE = 5e4;
34033
+ function extractReturnedRows(responseData) {
34034
+ if (responseData === null || typeof responseData !== "object") {
34035
+ return void 0;
34036
+ }
34037
+ const data = responseData;
34038
+ const block = data.pagingMetadata ?? data.cursorPagingMetadata ?? data.pagingOffsetMetadata ?? data.metaData ?? data.metadata;
34039
+ const raw = block?.count;
34040
+ if (typeof raw !== "number" && (typeof raw !== "string" || raw.trim() === "")) {
34041
+ return void 0;
34042
+ }
34043
+ const count = Number(raw);
34044
+ return Number.isFinite(count) ? count : void 0;
34045
+ }
33995
34046
  function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_SIZE) {
33996
34047
  if (typeof responseData === "string" && responseData.trim().startsWith("<!DOCTYPE")) {
33997
34048
  return {
@@ -33999,13 +34050,15 @@ function formatApiResponse(responseData, maxResponseSize = DEFAULT_MAX_RESPONSE_
33999
34050
  isError: true
34000
34051
  };
34001
34052
  }
34053
+ const returnedRows = extractReturnedRows(responseData);
34002
34054
  let responseText = JSON.stringify(responseData);
34055
+ const originalLength = responseText.length;
34003
34056
  const effectiveMax = Math.min(maxResponseSize, MAX_ALLOWED_RESPONSE_CHARS);
34004
34057
  if (responseText.length > effectiveMax) {
34005
34058
  responseText = responseText.slice(0, effectiveMax) + `
34006
34059
  ...[TRUNCATED - response was ${responseText.length} chars, showing first ${effectiveMax}]`;
34007
34060
  }
34008
- return { text: responseText, isError: false };
34061
+ return { text: responseText, isError: false, originalLength, returnedRows };
34009
34062
  }
34010
34063
  function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "ListWixSites", "ManageWixSite"], disableTools = [], enableTools = [], toolDescriptions, toolHints, maxResponseSize) {
34011
34064
  const effectiveAllowedTools = [
@@ -34068,9 +34121,14 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
34068
34121
  data: method === "GET" ? void 0 : body
34069
34122
  });
34070
34123
  const requestId = response.headers?.["x-wix-request-id"];
34071
- setToolBiParams({ requestId, siteId });
34072
34124
  const responseData = await handleWixAPIResponse(response);
34073
34125
  const formatted = formatApiResponse(responseData, maxResponseSize);
34126
+ setToolBiParams({
34127
+ requestId,
34128
+ siteId,
34129
+ returnedRows: formatted.returnedRows,
34130
+ originalLength: formatted.originalLength
34131
+ });
34074
34132
  if (formatted.isError) {
34075
34133
  return {
34076
34134
  content: [
@@ -34209,7 +34267,7 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
34209
34267
  destructiveHint: true,
34210
34268
  openWorldHint: false
34211
34269
  }),
34212
- async ({ url, body, method, reason }, { httpClient: httpClient6 }) => {
34270
+ async ({ url, body, method, reason }, { httpClient: httpClient6, setToolBiParams }) => {
34213
34271
  logger2.log(
34214
34272
  `Calling Wix Account level API: ${url}, reason="${reason}", body: ${JSON.stringify(body)}`
34215
34273
  );
@@ -34238,6 +34296,10 @@ function addApiCallTool(server, strategy, allowedTools = ["CallWixSiteAPI", "Lis
34238
34296
  });
34239
34297
  const responseData = await handleWixAPIResponse(response);
34240
34298
  const formatted = formatApiResponse(responseData, maxResponseSize);
34299
+ setToolBiParams({
34300
+ returnedRows: formatted.returnedRows,
34301
+ originalLength: formatted.originalLength
34302
+ });
34241
34303
  if (formatted.isError) {
34242
34304
  return {
34243
34305
  content: [
@@ -34599,9 +34661,18 @@ var SITE_CREATION_CUSTOM_ACTIONS_GUIDANCE = `2\u20133 specific, high-value setup
34599
34661
  * Events / Weddings / Real Estate: "add event schedules, display listings, and manage RSVP forms"
34600
34662
  * General / Unspecified: "${SITE_CREATION_DEFAULT_ACTIONS}"
34601
34663
  If none of these patterns fit the site, infer 2\u20133 actions that suit what that kind of business would manage on its site.`;
34602
- function buildSiteCreationSelectorMessage(siteType, customActions) {
34664
+ function buildSiteCreationSelectorMessage(siteType, customActions, { plain = false } = {}) {
34603
34665
  const type = (siteType ?? "").trim() || "new";
34604
34666
  const actions = (customActions ?? "").trim() || SITE_CREATION_DEFAULT_ACTIONS;
34667
+ const body = `Ready to set up your ${type} site? Choose your path in the widget above:
34668
+
34669
+ * **Build with AI** for a custom, tailor-made layout
34670
+ * **Pick a template** to start with a pre-designed layout
34671
+
34672
+ **Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}\u2014right here in the chat!`;
34673
+ if (plain) {
34674
+ return body;
34675
+ }
34605
34676
  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:
34606
34677
  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.
34607
34678
  2. "* **Build with AI** for a custom, tailor-made layout"
@@ -34610,12 +34681,7 @@ function buildSiteCreationSelectorMessage(siteType, customActions) {
34610
34681
 
34611
34682
  Copy those four lines as written; do not summarize, shorten, reorder, or reword any of them. Here is the full message to send:
34612
34683
 
34613
- Ready to set up your ${type} site? Choose your path in the widget above:
34614
-
34615
- * **Build with AI** for a custom, tailor-made layout
34616
- * **Pick a template** to start with a pre-designed layout
34617
-
34618
- **Next up:** Once your site is created, you can customize it in Wix or ask me to ${actions}\u2014right here in the chat!`;
34684
+ ${body}`;
34619
34685
  }
34620
34686
  var OPENAI_WIDGET_MIME_TYPE = "text/html+skybridge";
34621
34687
  var SITE_WIDGET_MCP_CSP = {
@@ -41570,7 +41636,7 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
41570
41636
  `The prompt to build the site. If not provided, the user will be asked to provide a prompt.`
41571
41637
  ),
41572
41638
  suggestedSiteName: external_exports.string().optional().describe(
41573
- "Suggested site name to use for the site based on the site prompt."
41639
+ "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."
41574
41640
  )
41575
41641
  },
41576
41642
  _meta: toolDefinitionMeta,
@@ -41727,6 +41793,10 @@ async function buildHarmonySite({
41727
41793
 
41728
41794
  // src/site-widget-tools/suggested-domain-tool/index.ts
41729
41795
  var WIX_APIS_BASE_URL3 = "https://www.wixapis.com";
41796
+ var DEFAULT_SITE_NAME = /^my site(\s+\d+)?$/i;
41797
+ function isDefaultSiteName(siteName) {
41798
+ return DEFAULT_SITE_NAME.test(siteName.trim());
41799
+ }
41730
41800
  async function fetchSiteDisplayName(siteAuthorization, siteId) {
41731
41801
  const response = await fetch(
41732
41802
  `${WIX_APIS_BASE_URL3}/site-properties/v4/properties`,
@@ -41751,7 +41821,15 @@ function addSuggestedDomainTool(server, authStrategy) {
41751
41821
  GET_SUGGESTED_DOMAINS_TOOL_NAME,
41752
41822
  {
41753
41823
  title: "Get Suggested Domains",
41754
- description: 'Suggest available domain names. Provide either a free-text query (e.g. "pancakes business", "modern yoga studio") OR a siteId to auto-suggest based on the site name. At least one of query or siteId is required.',
41824
+ description: dedent_default`
41825
+ Suggests available domain names for a business, brand, or Wix site.
41826
+
41827
+ 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.
41828
+
41829
+ 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.
41830
+
41831
+ Present the returned domains to the user as a short list. This tool only suggests domains — it does not purchase or connect them.
41832
+ `,
41755
41833
  inputSchema: {
41756
41834
  query: zod_default.string().optional().describe(
41757
41835
  "Free-text keywords, business idea, or brand concept to base suggestions on. Use the user's own words."
@@ -41771,10 +41849,11 @@ function addSuggestedDomainTool(server, authStrategy) {
41771
41849
  },
41772
41850
  _meta: {
41773
41851
  securitySchemes: [{ type: "oauth2", scopes: ["offline_access"] }],
41774
- ui: { visibility: ["app"] },
41852
+ // Model-visible so hosts (e.g. Microsoft 365 Copilot) can call it directly and show it
41853
+ // in their debug info; 'app' keeps it callable from the site-builder widget.
41854
+ ui: { visibility: ["app", "model"] },
41775
41855
  "openai/toolInvocation/invoking": "Fetching suggested domains",
41776
- "openai/toolInvocation/invoked": "Suggested domains retrieved",
41777
- "openai/visibility": "private"
41856
+ "openai/toolInvocation/invoked": "Suggested domains retrieved"
41778
41857
  }
41779
41858
  },
41780
41859
  async (args, { panorama }) => {
@@ -41822,7 +41901,9 @@ function addSuggestedDomainTool(server, authStrategy) {
41822
41901
  structuredContent: { domains: [] }
41823
41902
  };
41824
41903
  }
41825
- resolvedQuery = siteName;
41904
+ if (!isDefaultSiteName(siteName) || !resolvedQuery) {
41905
+ resolvedQuery = siteName;
41906
+ }
41826
41907
  } catch (error2) {
41827
41908
  panorama.logger().error(
41828
41909
  `[getSuggestedDomains] Error fetching site name for siteId: ${siteId}`,
@@ -42278,7 +42359,8 @@ function addWixSiteCreationTool(server, _authStrategy, options) {
42278
42359
  };
42279
42360
  const message = buildSiteCreationSelectorMessage(
42280
42361
  args.query,
42281
- args.customActions
42362
+ args.customActions,
42363
+ { plain: server.isMicrosoftCopilotClient() }
42282
42364
  );
42283
42365
  return withJsonContent({
42284
42366
  content: [
@@ -43232,7 +43314,6 @@ function listAssetsByProjectId(payload) {
43232
43314
  // src/wixel/constants.ts
43233
43315
  var WIXEL_ASSISTANT_V1_NO_ENTITY_API_BASE_URL = "https://manage.wix.com/";
43234
43316
  var WWW_ASSET_V1_ASSET_API_BASE_URL = "https://manage.wix.com/";
43235
- var HARMONY_SITE_BUILDER_API_BASE_URL = "https://manage.wix.com/";
43236
43317
  var WIXEL_AGENT_EXTERNAL_API_BASE_URL = "https://manage.wix.com/";
43237
43318
  var WIXEL_WIDGET_URI = "ui://widget/wixel-widget.html";
43238
43319
  var WIXEL_ICON_PNG_URL = "https://wixmp-e9a92e1fa066d7bc836e4d31.wixmp.com/logos/wixel-icon-180.png";
@@ -43349,87 +43430,6 @@ async function queryAssets({
43349
43430
  } = await httpClient6.request(listAssetsByProjectId({ projectId }));
43350
43431
  return { assets };
43351
43432
  }
43352
- async function openHeadlessWixelProject({
43353
- accountAuthHeaders,
43354
- apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
43355
- url,
43356
- userPrompt,
43357
- jobId,
43358
- siteId,
43359
- projectId,
43360
- conversationId,
43361
- withScreenshots,
43362
- useProvidedCookies,
43363
- timeout,
43364
- conductorOverride
43365
- }) {
43366
- const httpClient6 = createHttpClient2({
43367
- headers: {
43368
- ...COMMON_HEADERS,
43369
- ...accountAuthHeaders,
43370
- ...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
43371
- "Content-Type": "application/json"
43372
- },
43373
- baseURL: apiBaseURL
43374
- });
43375
- const response = await httpClient6.post(
43376
- "/_api/harmony-site-builder/open-wixel-project",
43377
- {
43378
- url,
43379
- userPrompt,
43380
- jobId,
43381
- siteId,
43382
- projectId,
43383
- conversationId,
43384
- withScreenshots,
43385
- useProvidedCookies,
43386
- timeout
43387
- }
43388
- );
43389
- return response.data;
43390
- }
43391
- async function updateHeadlessWixelJob({
43392
- accountAuthHeaders,
43393
- job,
43394
- apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
43395
- conductorOverride
43396
- }) {
43397
- const httpClient6 = createHttpClient2({
43398
- headers: {
43399
- ...COMMON_HEADERS,
43400
- ...accountAuthHeaders,
43401
- ...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
43402
- "Content-Type": "application/json"
43403
- },
43404
- baseURL: apiBaseURL
43405
- });
43406
- const response = await httpClient6.post(
43407
- "/_api/harmony-site-builder/update-wixel-job",
43408
- { job }
43409
- );
43410
- return response.data;
43411
- }
43412
- async function pullHeadlessWixelJob({
43413
- accountAuthHeaders,
43414
- apiBaseURL = HARMONY_SITE_BUILDER_API_BASE_URL,
43415
- jobId,
43416
- conductorOverride
43417
- }) {
43418
- const httpClient6 = createHttpClient2({
43419
- headers: {
43420
- ...COMMON_HEADERS,
43421
- ...accountAuthHeaders,
43422
- ...conductorOverride ? { ...CONDUCTOR_OVERRIDE_HEADERS } : {},
43423
- "Content-Type": "application/json"
43424
- },
43425
- baseURL: apiBaseURL
43426
- });
43427
- const response = await httpClient6.post(
43428
- "/_api/harmony-site-builder/pull-wixel-job",
43429
- { jobId }
43430
- );
43431
- return response.data;
43432
- }
43433
43433
  async function getStylePresetsByIds2({
43434
43434
  siteAuthHeaders,
43435
43435
  stylePresetIds,
@@ -43749,240 +43749,6 @@ function addGetWixelProjectAssetsTool(server, authStrategy, options = {}) {
43749
43749
  );
43750
43750
  }
43751
43751
 
43752
- // src/wixel/update-headless-wixel-job-tool.ts
43753
- var TOOL_NAME5 = "updateHeadlessWixelJob";
43754
- var TOOL_TITLE5 = "Update Headless Wixel Job";
43755
- var TOOL_DESCRIPTION5 = `Update the status and data of a headless Wixel job.`;
43756
- var TOOL_META5 = {
43757
- ui: { visibility: ["app"] }
43758
- };
43759
- var wixelJobStatusSchema = external_exports.enum([
43760
- "STARTED",
43761
- "IN_PROGRESS",
43762
- "COMPLETED",
43763
- "FAILED",
43764
- "CANCELLED"
43765
- ]);
43766
- function addUpdateHeadlessWixelJobTool(server, authStrategy, options = {}) {
43767
- const { getAccountAuthHeaders } = authStrategy;
43768
- vD(
43769
- server,
43770
- TOOL_NAME5,
43771
- {
43772
- title: TOOL_TITLE5,
43773
- description: TOOL_DESCRIPTION5,
43774
- inputSchema: {
43775
- id: external_exports.string().describe("The job ID"),
43776
- status: wixelJobStatusSchema.describe("The job status"),
43777
- userPrompt: external_exports.string().optional().describe("The user prompt for the job"),
43778
- shouldRefresh: external_exports.boolean().optional().describe("Whether the job should refresh"),
43779
- errorMessage: external_exports.string().optional().describe("Error message if the job failed"),
43780
- type: external_exports.string().optional().describe("The type of asset being created"),
43781
- data: external_exports.object({
43782
- siteId: external_exports.string().optional().describe("The site ID"),
43783
- assetId: external_exports.string().optional().describe("The asset ID"),
43784
- projectId: external_exports.string().optional().describe("The project ID"),
43785
- conversationId: external_exports.string().optional().describe("The conversation ID")
43786
- }).optional().describe("Additional job data"),
43787
- userId: external_exports.string().optional().describe("The user ID"),
43788
- accountId: external_exports.string().optional().describe("The account ID")
43789
- },
43790
- annotations: {
43791
- readOnlyHint: false,
43792
- destructiveHint: true,
43793
- openWorldHint: false
43794
- },
43795
- _meta: TOOL_META5
43796
- },
43797
- async (args) => {
43798
- try {
43799
- const accountAuthHeaders = await getAccountAuthHeaders();
43800
- const result = await updateHeadlessWixelJob({
43801
- accountAuthHeaders,
43802
- conductorOverride: options.conductorOverride,
43803
- job: {
43804
- id: args.id,
43805
- status: args.status,
43806
- userPrompt: args.userPrompt,
43807
- shouldRefresh: args.shouldRefresh,
43808
- errorMessage: args.errorMessage,
43809
- type: args.type,
43810
- data: args.data,
43811
- userId: args.userId,
43812
- accountId: args.accountId
43813
- }
43814
- });
43815
- return {
43816
- isError: false,
43817
- content: [
43818
- {
43819
- type: "text",
43820
- text: `Headless Wixel job ${args.id} updated to status: ${args.status}`
43821
- }
43822
- ],
43823
- structuredContent: {
43824
- jobId: args.id,
43825
- status: args.status,
43826
- ...result
43827
- }
43828
- };
43829
- } catch (error2) {
43830
- console.error("\u274C Error updating headless Wixel job:", error2);
43831
- const errorMessage = error2.message;
43832
- return {
43833
- isError: true,
43834
- content: [{ type: "text", text: errorMessage }],
43835
- structuredContent: {
43836
- success: false,
43837
- error: errorMessage
43838
- }
43839
- };
43840
- }
43841
- }
43842
- );
43843
- }
43844
-
43845
- // src/wixel/pull-headless-wixel-job-tool.ts
43846
- var TOOL_NAME6 = "pullHeadlessWixelJob";
43847
- var TOOL_TITLE6 = "Pull Headless Wixel Job";
43848
- var TOOL_DESCRIPTION6 = `Pull the next available headless Wixel job.`;
43849
- var TOOL_META6 = {
43850
- ui: { visibility: ["app"] }
43851
- };
43852
- function addPullHeadlessWixelJobTool(server, authStrategy, options = {}) {
43853
- const { getAccountAuthHeaders } = authStrategy;
43854
- vD(
43855
- server,
43856
- TOOL_NAME6,
43857
- {
43858
- title: TOOL_TITLE6,
43859
- description: TOOL_DESCRIPTION6,
43860
- inputSchema: {
43861
- jobId: external_exports.string().describe("The job ID")
43862
- },
43863
- annotations: {
43864
- readOnlyHint: false,
43865
- destructiveHint: false,
43866
- openWorldHint: false
43867
- },
43868
- _meta: TOOL_META6
43869
- },
43870
- async (args) => {
43871
- try {
43872
- const accountAuthHeaders = await getAccountAuthHeaders();
43873
- const result = await pullHeadlessWixelJob({
43874
- accountAuthHeaders,
43875
- jobId: args.jobId,
43876
- conductorOverride: options.conductorOverride
43877
- });
43878
- return {
43879
- isError: false,
43880
- content: [
43881
- {
43882
- type: "text",
43883
- text: result.job ? `Pulled headless Wixel job: ${result.job.id}` : "No headless Wixel job available"
43884
- }
43885
- ],
43886
- structuredContent: {
43887
- ...result
43888
- }
43889
- };
43890
- } catch (error2) {
43891
- console.error("\u274C Error pulling headless Wixel job:", error2);
43892
- const errorMessage = error2.message;
43893
- return {
43894
- isError: true,
43895
- content: [{ type: "text", text: errorMessage }],
43896
- structuredContent: {
43897
- success: false,
43898
- error: errorMessage
43899
- }
43900
- };
43901
- }
43902
- }
43903
- );
43904
- }
43905
-
43906
- // src/wixel/open-headless-wixel-project-tool.ts
43907
- var TOOL_NAME7 = "openHeadlessWixelProject";
43908
- var TOOL_TITLE7 = "Open Headless Wixel Project";
43909
- var TOOL_DESCRIPTION7 = `Open a headless Wixel project for background asset generation.`;
43910
- var TOOL_META7 = {
43911
- ui: { visibility: ["app"] }
43912
- };
43913
- function addOpenHeadlessWixelProjectTool(server, authStrategy, options = {}) {
43914
- const { getAccountAuthHeaders } = authStrategy;
43915
- vD(
43916
- server,
43917
- TOOL_NAME7,
43918
- {
43919
- title: TOOL_TITLE7,
43920
- description: TOOL_DESCRIPTION7,
43921
- inputSchema: {
43922
- url: external_exports.string().describe("The URL of the Wixel project"),
43923
- userPrompt: external_exports.string().describe("The user prompt for the project"),
43924
- jobId: external_exports.string().describe("The job ID"),
43925
- siteId: external_exports.string().describe("The site ID"),
43926
- projectId: external_exports.string().describe("The project ID"),
43927
- conversationId: external_exports.string().describe("The conversation ID"),
43928
- withScreenshots: external_exports.boolean().optional().describe("Whether to include screenshots"),
43929
- useProvidedCookies: external_exports.boolean().optional().describe("Whether to use provided cookies"),
43930
- timeout: external_exports.number().optional().describe("Timeout in milliseconds")
43931
- },
43932
- annotations: {
43933
- readOnlyHint: false,
43934
- destructiveHint: true,
43935
- openWorldHint: false
43936
- },
43937
- _meta: TOOL_META7
43938
- },
43939
- async (args) => {
43940
- try {
43941
- const accountAuthHeaders = await getAccountAuthHeaders();
43942
- const result = await openHeadlessWixelProject({
43943
- accountAuthHeaders,
43944
- url: args.url,
43945
- userPrompt: args.userPrompt,
43946
- jobId: args.jobId,
43947
- siteId: args.siteId,
43948
- projectId: args.projectId,
43949
- conversationId: args.conversationId,
43950
- withScreenshots: args.withScreenshots,
43951
- useProvidedCookies: args.useProvidedCookies,
43952
- timeout: args.timeout,
43953
- conductorOverride: options.conductorOverride
43954
- });
43955
- return {
43956
- isError: false,
43957
- content: [
43958
- {
43959
- type: "text",
43960
- text: `Headless Wixel project opened for job ${args.jobId}`
43961
- }
43962
- ],
43963
- structuredContent: {
43964
- success: true,
43965
- jobId: args.jobId,
43966
- projectId: args.projectId,
43967
- ...result
43968
- }
43969
- };
43970
- } catch (error2) {
43971
- console.error("\u274C Error opening headless Wixel project:", error2);
43972
- const errorMessage = error2.message;
43973
- return {
43974
- isError: true,
43975
- content: [{ type: "text", text: errorMessage }],
43976
- structuredContent: {
43977
- success: false,
43978
- error: errorMessage
43979
- }
43980
- };
43981
- }
43982
- }
43983
- );
43984
- }
43985
-
43986
43752
  // ../../node_modules/@wix/ambassador-www-wixel-agent-v1-external-agent/es/build/http.impl.js
43987
43753
  init_ambassador_index();
43988
43754
  init_build();
@@ -44321,7 +44087,7 @@ async function getWixelPendingQuestion({
44321
44087
  }
44322
44088
 
44323
44089
  // src/wixel/wixel-session-tools.ts
44324
- var TOOL_META8 = {
44090
+ var TOOL_META5 = {
44325
44091
  ui: { visibility: ["app", "model"] }
44326
44092
  };
44327
44093
  function buildWixelEditorUrl(metaSiteId, projectId) {
@@ -44630,7 +44396,7 @@ Without arguments Wixel provisions a new project and session. Pass metaSiteId to
44630
44396
  destructiveHint: false,
44631
44397
  openWorldHint: false
44632
44398
  },
44633
- _meta: TOOL_META8
44399
+ _meta: TOOL_META5
44634
44400
  },
44635
44401
  async (args, extra) => {
44636
44402
  setWixelToolBi(extra, {
@@ -44724,7 +44490,7 @@ Send the user's request as THEY phrased it. Do NOT add creative direction they d
44724
44490
  destructiveHint: true,
44725
44491
  openWorldHint: false
44726
44492
  },
44727
- _meta: TOOL_META8
44493
+ _meta: TOOL_META5
44728
44494
  },
44729
44495
  async (args, extra) => {
44730
44496
  setWixelToolBi(extra, {
@@ -44825,7 +44591,7 @@ Event types: "reply" (the agent's answer), "failed" (the turn failed), and "user
44825
44591
  destructiveHint: false,
44826
44592
  openWorldHint: false
44827
44593
  },
44828
- _meta: TOOL_META8
44594
+ _meta: TOOL_META5
44829
44595
  },
44830
44596
  async (args, extra) => {
44831
44597
  setWixelToolBi(extra, {
@@ -44995,7 +44761,7 @@ function addGetWixelStylePresetsTool(server, authStrategy, options = {}) {
44995
44761
  destructiveHint: false,
44996
44762
  openWorldHint: false
44997
44763
  },
44998
- _meta: TOOL_META8
44764
+ _meta: TOOL_META5
44999
44765
  },
45000
44766
  async (args, extra) => {
45001
44767
  setWixelToolBi(extra, { siteId: args.metaSiteId });
@@ -45298,9 +45064,6 @@ function addWixelTools(server, authStrategy, options = {}) {
45298
45064
  addMarkWixelJobAsFulfilledTool(server, authStrategy, options);
45299
45065
  addGetWixelAssetTool(server, authStrategy, options);
45300
45066
  addGetWixelProjectAssetsTool(server, authStrategy, options);
45301
- addUpdateHeadlessWixelJobTool(server, authStrategy, options);
45302
- addOpenHeadlessWixelProjectTool(server, authStrategy, options);
45303
- addPullHeadlessWixelJobTool(server, authStrategy, options);
45304
45067
  addWixelSessionTools(server, authStrategy, options);
45305
45068
  }
45306
45069
 
@@ -45453,10 +45216,14 @@ function addImportClaudeDesignTool(server, authStrategy, options) {
45453
45216
  try {
45454
45217
  designUrl = new URL(args.url);
45455
45218
  } catch {
45456
- return errorResult("Invalid design URL.");
45219
+ return errorResult(
45220
+ "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."
45221
+ );
45457
45222
  }
45458
45223
  if (designUrl.protocol !== "https:" || !designUrl.hostname.endsWith(CLAUDE_USER_CONTENT_HOST_SUFFIX)) {
45459
- return errorResult("Invalid design URL.");
45224
+ return errorResult(
45225
+ "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."
45226
+ );
45460
45227
  }
45461
45228
  const accountHeaders = await authStrategy.getAccountAuthHeaders();
45462
45229
  const wixstroOptions = { baseUrl: wixstroBaseUrl, accountHeaders };
@@ -45737,10 +45504,13 @@ function executeTextResult(message) {
45737
45504
  content: [{ type: "text", text: message }]
45738
45505
  };
45739
45506
  }
45740
- function formatExecuteResult(data, maxResponseSize) {
45507
+ function formatExecuteResult(data, maxResponseSize, reportBi) {
45741
45508
  if (data.error) {
45742
45509
  return executeErrorResult(data.error);
45743
45510
  }
45511
+ reportBi?.({
45512
+ originalLength: typeof data.result === "string" ? data.result.length : JSON.stringify(data.result)?.length
45513
+ });
45744
45514
  return {
45745
45515
  content: [
45746
45516
  { type: "text", text: truncateResponse(data.result, maxResponseSize) }
@@ -45850,7 +45620,11 @@ function addExecuteTool(server, options) {
45850
45620
  status: data.authErrorStatus
45851
45621
  });
45852
45622
  }
45853
- return formatExecuteResult(data, maxResponseSize);
45623
+ return formatExecuteResult(
45624
+ data,
45625
+ maxResponseSize,
45626
+ extra?.setToolBiParams
45627
+ );
45854
45628
  } catch (err) {
45855
45629
  const message = err instanceof Error ? err.message : String(err);
45856
45630
  logger2.log(
@@ -46095,7 +45869,10 @@ function createWixToolkit(options) {
46095
45869
  if (!toolSucceeded) {
46096
45870
  errorBody = extractText(cbResult);
46097
45871
  } else {
46098
- additionalFields = formatToolResultAdditionalFields(cbResult);
45872
+ additionalFields = formatToolResultAdditionalFields(cbResult, {
45873
+ returnedRows: toolBiParams.returnedRows,
45874
+ originalLength: toolBiParams.originalLength
45875
+ });
46099
45876
  }
46100
45877
  if (!isDevEnvironment) {
46101
45878
  if (toolSucceeded) {
@@ -46253,8 +46030,6 @@ export {
46253
46030
  addImportClaudeDesignTool,
46254
46031
  addListWixelEventsTool,
46255
46032
  addMarkWixelJobAsFulfilledTool,
46256
- addOpenHeadlessWixelProjectTool,
46257
- addPullHeadlessWixelJobTool,
46258
46033
  addPullSiteJobTool,
46259
46034
  addSearchCodeModeTool,
46260
46035
  addSearchSiteTemplatesTool,
@@ -46262,7 +46037,6 @@ export {
46262
46037
  addSiteCreationWidgetTools,
46263
46038
  addStartWixelSessionTool,
46264
46039
  addSupportTool,
46265
- addUpdateHeadlessWixelJobTool,
46266
46040
  addWixSiteCreationTool,
46267
46041
  addWixelSessionTools,
46268
46042
  addWixelTools,