@wix/mcp 1.0.31 → 1.0.33

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 (41) hide show
  1. package/build/bin-standalone.js +308 -19
  2. package/build/bin-standalone.js.map +4 -4
  3. package/build/cjs/index.cjs +353 -27
  4. package/build/cjs/index.cjs.map +4 -4
  5. package/build/dts/bin.js +3 -1
  6. package/build/dts/bin.js.map +1 -1
  7. package/build/dts/config/default-config.d.ts +1 -0
  8. package/build/dts/config/default-config.d.ts.map +1 -1
  9. package/build/dts/config/default-config.js +27 -4
  10. package/build/dts/config/default-config.js.map +1 -1
  11. package/build/dts/docs/docs.d.ts +2 -0
  12. package/build/dts/docs/docs.d.ts.map +1 -1
  13. package/build/dts/docs/docs.js +10 -2
  14. package/build/dts/docs/docs.js.map +1 -1
  15. package/build/dts/docs/get-to-know.d.ts +12 -1
  16. package/build/dts/docs/get-to-know.d.ts.map +1 -1
  17. package/build/dts/docs/get-to-know.js +20 -8
  18. package/build/dts/docs/get-to-know.js.map +1 -1
  19. package/build/dts/docs/get-to-know.test.d.ts +2 -0
  20. package/build/dts/docs/get-to-know.test.d.ts.map +1 -0
  21. package/build/dts/docs/get-to-know.test.js +89 -0
  22. package/build/dts/docs/get-to-know.test.js.map +1 -0
  23. package/build/dts/site-widget-tools/edit-site-tool/index.d.ts.map +1 -1
  24. package/build/dts/site-widget-tools/edit-site-tool/index.js +4 -2
  25. package/build/dts/site-widget-tools/edit-site-tool/index.js.map +1 -1
  26. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +4 -0
  27. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -1
  28. package/build/dts/site-widget-tools/site-builder-tool/index.js +26 -3
  29. package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -1
  30. package/build/dts/toolkit.d.ts +5 -1
  31. package/build/dts/toolkit.d.ts.map +1 -1
  32. package/build/dts/toolkit.js +13 -1
  33. package/build/dts/toolkit.js.map +1 -1
  34. package/build/dts/toolkit.test.js +41 -0
  35. package/build/dts/toolkit.test.js.map +1 -1
  36. package/build/dts/wixel/index.d.ts.map +1 -1
  37. package/build/dts/wixel/index.js +4 -2
  38. package/build/dts/wixel/index.js.map +1 -1
  39. package/build/esm/index.js +349 -23
  40. package/build/esm/index.js.map +4 -4
  41. package/package.json +3 -2
@@ -15697,9 +15697,9 @@ var require_dist4 = __commonJS({
15697
15697
  }
15698
15698
  });
15699
15699
 
15700
- // ../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/parse-proxy-response.js
15700
+ // ../../node_modules/https-proxy-agent/dist/parse-proxy-response.js
15701
15701
  var require_parse_proxy_response = __commonJS({
15702
- "../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
15702
+ "../../node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
15703
15703
  "use strict";
15704
15704
  var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
15705
15705
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -15793,9 +15793,9 @@ var require_parse_proxy_response = __commonJS({
15793
15793
  }
15794
15794
  });
15795
15795
 
15796
- // ../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js
15796
+ // ../../node_modules/https-proxy-agent/dist/index.js
15797
15797
  var require_dist5 = __commonJS({
15798
- "../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js"(exports2) {
15798
+ "../../node_modules/https-proxy-agent/dist/index.js"(exports2) {
15799
15799
  "use strict";
15800
15800
  var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
15801
15801
  if (k2 === void 0) k2 = k;
@@ -34564,6 +34564,8 @@ var SYSTEM_REMINDER = dedent_default`
34564
34564
  </goal>
34565
34565
  <guidelines>
34566
34566
  if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.
34567
+ **Exception:** If the user asks to create, build, or generate a new Wix site/website, skip WixREADME and call WixSiteBuilder directly if it is available.
34568
+ **Exception:** If the user asks to list, show, or find their Wix sites, skip WixREADME and call ListWixSites directly.
34567
34569
  If the WixREADME tool is not available to you, you should use the other flows as described without using the WixREADME tool until the task is completed.
34568
34570
  If the user prompt / task is an instruction to do something in Wix, You should not tell the user what Docs to read or what API to call, your task is to do the work and complete the task in minimal steps and time with minimal back and forth with the user, unless absolutely necessary.
34569
34571
  </guidelines>
@@ -34606,6 +34608,7 @@ var defaultToolDescriptions = {
34606
34608
  `,
34607
34609
  CallWixSiteAPI: dedent_default`
34608
34610
  Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site.
34611
+ **Prefer using the "ListWixSites" tool when the user asks to list or show their sites.** Only use this tool for site listing if the user needs advanced filtering or specific site details beyond what ListWixSites provides.
34609
34612
  For POST/PATCH/PUT requests, pass the request body as a JSON object in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}}).
34610
34613
  The API endpoint url param MUST ALWAYS be taken from the conversation context.
34611
34614
  By conversation context we mean the endpoint url was given in the user prompt OR got into the conversation context by the "WixREADME" tool OR by the "SearchWixRESTDocumentation" tool OR by the "BrowseWixRESTDocsMenu" tool OR by the "ReadFullDocsArticle" tool.
@@ -34618,7 +34621,11 @@ var defaultToolDescriptions = {
34618
34621
  ${SYSTEM_REMINDER}
34619
34622
  `,
34620
34623
  ListWixSites: dedent_default`
34621
- List Wix sites for the current user, by default it will return all sites, but you can filter by name
34624
+ **Use this tool whenever the user asks to list, show, get, or find their Wix sites.** This is the dedicated tool for listing Wix sites for the current user. By default it returns all sites, but you can filter by name.
34625
+
34626
+ **Do NOT use WixREADME before this tool.** When the user asks to list their sites, call this tool directly — no need to read documentation first.
34627
+
34628
+ **Prefer this tool over CallWixSiteAPI for listing sites.** Call this tool directly — it already knows the correct API and handles everything needed. Only fall back to CallWixSiteAPI if the user needs advanced filtering or specific site details beyond what this tool provides.
34622
34629
  ${SYSTEM_REMINDER}
34623
34630
  `,
34624
34631
  ManageWixSite: dedent_default`
@@ -34660,6 +34667,15 @@ var defaultToolDescriptions = {
34660
34667
  - Site Properties: "https://dev.wix.com/docs/api-reference/business-management/site-properties"
34661
34668
  ${SYSTEM_REMINDER}
34662
34669
  `,
34670
+ WixSiteBuilder: dedent_default`
34671
+ **PRIMARY tool for creating/building/generating a Wix site or website.** This is the preferred and recommended way to create a new Wix site. Use this tool whenever the user asks to build, create, or generate a site/website/application. Do NOT use CreateWixBusinessGuide for site creation — use this tool instead.
34672
+
34673
+ **Do NOT use WixREADME or SearchWixRESTDocumentation before this tool.** When the user asks to build, create, or generate a site, call this tool directly. It handles everything needed for site creation.
34674
+
34675
+ **IMPORTANT: You MUST call this tool to build the site.** Do NOT suggest HTML code, prompt templates, or alternative approaches instead of actually building the site. When a user asks to create a site, your job is to call this tool and build it — not to describe how to build it or suggest alternatives.
34676
+
34677
+ **IMPORTANT: The sitePrompt must be under 6000 characters.** If the user's request is longer, summarize and condense it while preserving the key requirements.
34678
+ `,
34663
34679
  CreateWixBusinessGuide: dedent_default`
34664
34680
  Provides comprehensive documentation for creating a new Wix Business (i.e site, app, etc.)
34665
34681
 
@@ -34955,7 +34971,12 @@ var defaultReadmeDocs = [
34955
34971
 
34956
34972
  <flow-description>
34957
34973
  Wix MCP Site Management Flows:
34958
-
34974
+
34975
+ Site Creation flow (highest priority for site creation requests):
34976
+ 1. User asks to create, build, or generate a Wix site/website,
34977
+ 2. Call the "WixSiteBuilder" tool directly with the user's prompt. Do NOT call WixREADME first.
34978
+ 3. Do NOT suggest HTML code or alternative approaches — actually build the site.
34979
+
34959
34980
  "Recipe" based flow (The most preferred flow):
34960
34981
  1. User asks you to do something,
34961
34982
  2. You use the "WixREADME" tool to get the context, it will return a list of "recipes" which are essentially Wix docs articles that describe how to do something in Wix.
@@ -35024,7 +35045,8 @@ function mergeConfig(base, overrides) {
35024
35045
  getToKnowWixEnabled: overrides.getToKnowWixEnabled ?? base.getToKnowWixEnabled,
35025
35046
  createWixBusinessGuideEnabled: overrides.createWixBusinessGuideEnabled ?? base.createWixBusinessGuideEnabled,
35026
35047
  codeModeEnabled: overrides.codeModeEnabled ?? base.codeModeEnabled,
35027
- maxResponseSize: overrides.maxResponseSize ?? base.maxResponseSize
35048
+ maxResponseSize: overrides.maxResponseSize ?? base.maxResponseSize,
35049
+ dynamicContextEnabled: overrides.dynamicContextEnabled ?? base.dynamicContextEnabled
35028
35050
  };
35029
35051
  }
35030
35052
  var defaultConfig = {
@@ -35034,11 +35056,264 @@ var defaultConfig = {
35034
35056
  readmeDocs: defaultReadmeDocs,
35035
35057
  // docsTools not set - defaults to all docs tools in addDocsTools()
35036
35058
  getToKnowWixEnabled: true,
35037
- createWixBusinessGuideEnabled: true
35059
+ createWixBusinessGuideEnabled: true,
35060
+ dynamicContextEnabled: true
35038
35061
  };
35039
35062
 
35063
+ // ../dynamic-context-enricher/build/index.mjs
35064
+ var __defProp2 = Object.defineProperty;
35065
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
35066
+ var __esm2 = (fn, res) => function __init() {
35067
+ return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
35068
+ };
35069
+ var __export2 = (target, all) => {
35070
+ for (var name in all)
35071
+ __defProp2(target, name, { get: all[name], enumerable: true });
35072
+ };
35073
+ var enrich_exports = {};
35074
+ __export2(enrich_exports, {
35075
+ enrichDynamicContext: () => enrichDynamicContext
35076
+ });
35077
+ function snakeToCamel(obj) {
35078
+ if (Array.isArray(obj)) return obj.map(snakeToCamel);
35079
+ if (obj !== null && typeof obj === "object") {
35080
+ const result = {};
35081
+ for (const [key, value] of Object.entries(obj)) {
35082
+ const camelKey = key.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
35083
+ result[camelKey] = snakeToCamel(value);
35084
+ }
35085
+ return result;
35086
+ }
35087
+ return obj;
35088
+ }
35089
+ function formatTimestamp(value) {
35090
+ if (!value) return "";
35091
+ try {
35092
+ const date3 = new Date(value);
35093
+ return date3.toLocaleDateString("en-US", {
35094
+ month: "short",
35095
+ day: "2-digit",
35096
+ year: "numeric",
35097
+ hour: "2-digit",
35098
+ minute: "2-digit",
35099
+ hour12: false,
35100
+ timeZone: "UTC"
35101
+ });
35102
+ } catch {
35103
+ return value;
35104
+ }
35105
+ }
35106
+ function capitalize(s) {
35107
+ if (!s) return s;
35108
+ return s.charAt(0).toUpperCase() + s.slice(1);
35109
+ }
35110
+ function renderAccountHeader(account) {
35111
+ const lines = [];
35112
+ if (account.displayName) {
35113
+ lines.push(`**Account**: ${account.displayName}`);
35114
+ }
35115
+ if (account.id) {
35116
+ lines.push(`**Account ID**: \`${account.id}\``);
35117
+ }
35118
+ const meta = [];
35119
+ if (account.status) meta.push(`Status: **${account.status}**`);
35120
+ if (account.coBranding && account.coBranding !== "None" && account.coBranding !== "CO_BRANDING_UNSPECIFIED") {
35121
+ meta.push("Co-branded");
35122
+ }
35123
+ if (meta.length) lines.push(meta.join(" \xB7 "));
35124
+ if (account.createdDate) {
35125
+ let dateLine = `**Created**: ${formatTimestamp(account.createdDate)}`;
35126
+ if (account.updatedDate) {
35127
+ dateLine += ` \xB7 **Updated**: ${formatTimestamp(account.updatedDate)}`;
35128
+ }
35129
+ lines.push(dateLine);
35130
+ }
35131
+ return lines.length ? lines.join("\n") : "";
35132
+ }
35133
+ function renderStatusBadges(site) {
35134
+ const tags = [];
35135
+ tags.push(site.published ? "Published" : "Draft");
35136
+ if (site.premium) tags.push("Premium");
35137
+ if (site.domainConnected) tags.push("Custom Domain");
35138
+ if (site.editorType && site.editorType !== "EDITOR_TYPE_UNSPECIFIED" && site.editorType !== "UNKNOWN") {
35139
+ tags.push(capitalize(site.editorType.replace(/_/g, " ").toLowerCase()));
35140
+ }
35141
+ return tags.join(" \xB7 ");
35142
+ }
35143
+ function renderApps(apps) {
35144
+ const relevant = apps.filter((a) => a.appId && KNOWN_APPS[a.appId]).sort(
35145
+ (a, b) => (KNOWN_APPS[a.appId] ?? "").localeCompare(KNOWN_APPS[b.appId] ?? "")
35146
+ );
35147
+ if (!relevant.length) return "";
35148
+ const lines = [];
35149
+ for (const app of relevant) {
35150
+ let line = `- **${KNOWN_APPS[app.appId]}** (ID: \`${app.appId}\`)`;
35151
+ if (app.catalogVersion) {
35152
+ line += ` \u2014 Catalog app version: **${app.catalogVersion}**`;
35153
+ }
35154
+ lines.push(line);
35155
+ }
35156
+ return lines.join("\n");
35157
+ }
35158
+ function renderProperties(props) {
35159
+ const sections = [];
35160
+ const locale = [];
35161
+ if (props.language) locale.push(`- Language: **${props.language}**`);
35162
+ if (props.locale?.country) locale.push(`- Country: **${props.locale.country}**`);
35163
+ if (props.timeZone) locale.push(`- Timezone: **${props.timeZone}**`);
35164
+ if (props.paymentCurrency) locale.push(`- Currency: **${props.paymentCurrency}**`);
35165
+ if (locale.length) {
35166
+ sections.push(`**Locale & Region**
35167
+ ${locale.join("\n")}`);
35168
+ }
35169
+ const contact = [];
35170
+ if (props.email) contact.push(`- Email: **${props.email}**`);
35171
+ if (props.phone) contact.push(`- Phone: **${props.phone}**`);
35172
+ if (contact.length) {
35173
+ sections.push(`**Contact**
35174
+ ${contact.join("\n")}`);
35175
+ }
35176
+ return sections.join("\n\n");
35177
+ }
35178
+ function renderSite(site, index) {
35179
+ const lines = [];
35180
+ const heading = site.displayName ?? `Site ${index}`;
35181
+ lines.push(`## ${index}. ${heading}`);
35182
+ lines.push("");
35183
+ if (site.id) lines.push(`**ID**: \`${site.id}\``);
35184
+ if (site.url) lines.push(`**URL**: [${site.url}](${site.url})`);
35185
+ lines.push(`**Status**: ${renderStatusBadges(site)}`);
35186
+ if (site.createdDate) {
35187
+ let dateLine = `**Created**: ${formatTimestamp(site.createdDate)}`;
35188
+ if (site.updatedDate) {
35189
+ dateLine += ` \xB7 **Updated**: ${formatTimestamp(site.updatedDate)}`;
35190
+ }
35191
+ lines.push(dateLine);
35192
+ }
35193
+ if (site.veloEnabled !== void 0 && site.veloEnabled !== null) {
35194
+ lines.push(`**Velo**: ${site.veloEnabled ? "Enabled" : "Disabled"}`);
35195
+ }
35196
+ if (site.properties) {
35197
+ const propsContent = renderProperties(site.properties);
35198
+ if (propsContent) {
35199
+ lines.push("");
35200
+ lines.push("### Properties");
35201
+ lines.push("");
35202
+ lines.push(propsContent);
35203
+ }
35204
+ }
35205
+ const appsContent = renderApps(site.installedApps ?? []);
35206
+ if (appsContent) {
35207
+ lines.push("");
35208
+ lines.push("### Apps");
35209
+ lines.push("");
35210
+ lines.push(appsContent);
35211
+ }
35212
+ lines.push("");
35213
+ lines.push("---");
35214
+ lines.push("");
35215
+ return lines.join("\n");
35216
+ }
35217
+ function enrichDynamicContext(data) {
35218
+ let parsed = data;
35219
+ if (typeof data === "string") {
35220
+ try {
35221
+ parsed = JSON.parse(data);
35222
+ } catch {
35223
+ return data;
35224
+ }
35225
+ }
35226
+ if (parsed === null || parsed === void 0) return "";
35227
+ if (typeof parsed !== "object") return "";
35228
+ const response = snakeToCamel(parsed);
35229
+ const sections = [];
35230
+ sections.push("# My Wix Sites Context");
35231
+ sections.push("");
35232
+ if (response.account) {
35233
+ const accountSection = renderAccountHeader(response.account);
35234
+ if (accountSection) {
35235
+ sections.push(accountSection);
35236
+ }
35237
+ }
35238
+ const siteCount = response.sites?.length ?? 0;
35239
+ const hasNext = Boolean(response.pagingMetadata?.cursors?.next);
35240
+ let countLine = `_Showing ${siteCount} sites`;
35241
+ if (hasNext) countLine += " (more available)";
35242
+ countLine += "_";
35243
+ sections.push(countLine);
35244
+ sections.push("");
35245
+ sections.push("---");
35246
+ sections.push("");
35247
+ const hasCatalogVersion = response.sites?.some(
35248
+ (site) => site.installedApps?.some(
35249
+ (app) => app.appId && KNOWN_APPS[app.appId] && app.catalogVersion
35250
+ )
35251
+ );
35252
+ if (hasCatalogVersion) {
35253
+ sections.push(
35254
+ "> **Catalog Version**: When a site shows a Catalog app version (V1/V3), always use the APIs matching that version."
35255
+ );
35256
+ sections.push("");
35257
+ }
35258
+ if (response.sites?.length) {
35259
+ for (let i = 0; i < response.sites.length; i++) {
35260
+ sections.push(renderSite(response.sites[i], i + 1));
35261
+ }
35262
+ }
35263
+ if (!response.account && !siteCount) return "";
35264
+ return sections.join("\n");
35265
+ }
35266
+ var KNOWN_APPS;
35267
+ var init_enrich = __esm2({
35268
+ "src/enrich.ts"() {
35269
+ "use strict";
35270
+ KNOWN_APPS = {
35271
+ "14bcded7-0066-7c35-14d7-466cb3f09103": "Wix Bookings",
35272
+ "215238eb-22a5-4c36-9e7b-e7c08025e04e": "Wix Stores",
35273
+ "9a5d83fd-8570-482e-81ab-cfa88942ee60": "Wix Restaurants (Orders)",
35274
+ "b278a256-2757-4f19-9313-c05c783bec92": "Wix Restaurants (Menus)"
35275
+ };
35276
+ }
35277
+ });
35278
+ init_enrich();
35279
+ var DYNAMIC_CONTEXT_URL = "https://dev.wix.com/_api/dynamic-context/v1/dynamic-context";
35280
+ async function getDynamicContext(auth, httpClient6, filter) {
35281
+ const { enrichDynamicContext: enrichDynamicContext2 } = await Promise.resolve().then(() => (init_enrich(), enrich_exports));
35282
+ try {
35283
+ const accountHeaders = await auth.getAccountAuthHeaders();
35284
+ const body = {};
35285
+ if (filter?.siteId) body.site_id = filter.siteId;
35286
+ else if (filter?.siteName) body.site_name = filter.siteName;
35287
+ const response = await httpClient6.request({
35288
+ url: DYNAMIC_CONTEXT_URL,
35289
+ method: "POST",
35290
+ headers: {
35291
+ ...accountHeaders,
35292
+ "Content-Type": "application/json",
35293
+ "Petri_ovr": "shouldReturnDynamicContextInMCP#B",
35294
+ "X-Wix-Office": "1"
35295
+ },
35296
+ data: body
35297
+ });
35298
+ return enrichDynamicContext2(response.data);
35299
+ } catch (error2) {
35300
+ console.error(
35301
+ `[dynamic-context-enricher] Fetch failed: ${error2.message}`
35302
+ );
35303
+ return "";
35304
+ }
35305
+ }
35306
+
35040
35307
  // src/docs/get-to-know.ts
35041
- async function addGetToKnowTools(server, disableTools = [], toolDescriptions, readmeDocs, authStrategy, picassoPortalUrl) {
35308
+ async function addGetToKnowTools({
35309
+ server,
35310
+ disableTools = [],
35311
+ toolDescriptions,
35312
+ readmeDocs,
35313
+ authStrategy,
35314
+ picassoPortalUrl,
35315
+ dynamicContextEnabled
35316
+ }) {
35042
35317
  if (disableTools.includes("WixREADME")) {
35043
35318
  return;
35044
35319
  }
@@ -35049,6 +35324,7 @@ async function addGetToKnowTools(server, disableTools = [], toolDescriptions, re
35049
35324
  {},
35050
35325
  { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
35051
35326
  async (_, { httpClient: httpClient6 }) => {
35327
+ const { siteId, siteName } = _;
35052
35328
  const contents = await Promise.all(
35053
35329
  docsToUse.map(
35054
35330
  async ({
@@ -35145,12 +35421,23 @@ Failed to fetch content: ${errorMsg}`
35145
35421
  }
35146
35422
  )
35147
35423
  );
35148
- const filteredContents = contents.filter(
35149
- (item) => item !== null
35150
- );
35151
- const concatenatedText = filteredContents.map((item) => item.text).join("\n\n");
35424
+ const filter = {};
35425
+ if (siteId) filter.siteId = siteId;
35426
+ if (siteName) filter.siteName = siteName;
35427
+ const dynamicContext = dynamicContextEnabled && authStrategy ? await getDynamicContext(
35428
+ authStrategy,
35429
+ httpClient6,
35430
+ Object.keys(filter).length ? filter : void 0
35431
+ ) : "";
35432
+ const parts = [
35433
+ ...contents.filter(
35434
+ (item) => item !== null
35435
+ ).map((item) => item.text),
35436
+ ...dynamicContext ? [dynamicContext] : []
35437
+ ];
35438
+ const text = parts.join("\n\n");
35152
35439
  return {
35153
- content: [{ type: "text", text: concatenatedText }]
35440
+ content: [{ type: "text", text }]
35154
35441
  };
35155
35442
  }
35156
35443
  );
@@ -35370,18 +35657,20 @@ var addDocsTools = (server, allowedTools = [
35370
35657
  toolDescriptions,
35371
35658
  readmeDocs,
35372
35659
  authStrategy,
35373
- picassoPortalUrl
35660
+ picassoPortalUrl,
35661
+ dynamicContextEnabled
35374
35662
  } = options;
35375
35663
  const getDescription = (toolName, defaultDesc) => toolDescriptions?.[toolName] ?? defaultDesc;
35376
35664
  if (getToKnowWixEnabled && !disableTools?.includes("WixREADME")) {
35377
- addGetToKnowTools(
35665
+ addGetToKnowTools({
35378
35666
  server,
35379
- disableTools || [],
35667
+ disableTools: disableTools || [],
35380
35668
  toolDescriptions,
35381
35669
  readmeDocs,
35382
35670
  authStrategy,
35383
- picassoPortalUrl
35384
- );
35671
+ picassoPortalUrl,
35672
+ dynamicContextEnabled
35673
+ });
35385
35674
  }
35386
35675
  if (createWixBusinessGuideEnabled && !disableTools?.includes("CreateWixBusinessGuide")) {
35387
35676
  addCreateWixBusinessGuideTools(
@@ -36636,6 +36925,7 @@ var CLAIM_SITE_TOOL_NAME = "ClaimAnonymousSite";
36636
36925
  // src/site-widget-tools/site-builder-tool/index.ts
36637
36926
  var httpClient = (0, import_http_client4.createHttpClient)();
36638
36927
  var CREATE_SITE_WIDGET_URI = "ui://widget/site-builder.html";
36928
+ var MAX_SITE_PROMPT_CHARS = 6e3;
36639
36929
  function addCreateSiteWidgetTool(server, authStrategy, options) {
36640
36930
  const { getAccountAuthHeaders } = authStrategy;
36641
36931
  const isAnonymous = authStrategy.isAnonymous?.() ?? false;
@@ -36655,13 +36945,15 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
36655
36945
  "https://*.wix.com",
36656
36946
  "https://*.wixsite.com",
36657
36947
  "https://static.parastorage.com",
36658
- "https://cdn.openai.com"
36948
+ "https://cdn.openai.com",
36949
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36659
36950
  ],
36660
36951
  resource_domains: [
36661
36952
  "https://*.wix.com",
36662
36953
  "https://*.wixsite.com",
36663
36954
  "https://static.parastorage.com",
36664
- "https://cdn.openai.com"
36955
+ "https://cdn.openai.com",
36956
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36665
36957
  ],
36666
36958
  frame_domains: ["https://*.wix.com", "https://*.wixsite.com"],
36667
36959
  redirect_domains: ["https://*.wix.com", "https://*.wixsite.com"]
@@ -36691,7 +36983,7 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
36691
36983
  SITE_BUILDER_TOOL_NAME,
36692
36984
  {
36693
36985
  title: "Wix Site Builder",
36694
- description: `**PRIMARY tool for creating/building/generating a Wix site or website.** This is the preferred and recommended way to create a new Wix site. Use this tool whenever the user asks to build, create, or generate a site/website/application. Do NOT use CreateWixBusinessGuide for site creation \u2014 use this tool instead.`,
36986
+ description: options?.toolDescriptions?.[SITE_BUILDER_TOOL_NAME] ?? defaultToolDescriptions[SITE_BUILDER_TOOL_NAME],
36695
36987
  inputSchema: {
36696
36988
  jobId: external_exports.string().optional().describe(
36697
36989
  "The job ID of the site build. If not provided, a new job will be created."
@@ -36712,6 +37004,26 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
36712
37004
  `[${SITE_BUILDER_TOOL_NAME}] \u{1F680} Start Building Your Site tool invoked!`,
36713
37005
  { prompt: args.sitePrompt, jobId: args.jobId }
36714
37006
  );
37007
+ const charCount = args.sitePrompt.length;
37008
+ if (charCount > MAX_SITE_PROMPT_CHARS) {
37009
+ console.log(
37010
+ `[${SITE_BUILDER_TOOL_NAME}] The site prompt is too long (${charCount} characters). Please shorten it to under ${MAX_SITE_PROMPT_CHARS} characters and try again.`
37011
+ );
37012
+ return {
37013
+ isError: true,
37014
+ content: [
37015
+ {
37016
+ type: "text",
37017
+ text: `The site prompt is too long (${charCount} characters). Please shorten it to under ${MAX_SITE_PROMPT_CHARS} characters and try again.`
37018
+ }
37019
+ ],
37020
+ structuredContent: {
37021
+ success: false,
37022
+ status: `Prompt exceeds maximum length of ${MAX_SITE_PROMPT_CHARS} characters`,
37023
+ jobId: null
37024
+ }
37025
+ };
37026
+ }
36715
37027
  let jobId;
36716
37028
  if (args.jobId) {
36717
37029
  console.log(
@@ -36871,13 +37183,15 @@ function addEditSiteWidgetTool(server, authStrategy) {
36871
37183
  "https://*.wix.com",
36872
37184
  "https://*.wixsite.com",
36873
37185
  "https://static.parastorage.com",
36874
- "https://cdn.openai.com"
37186
+ "https://cdn.openai.com",
37187
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36875
37188
  ],
36876
37189
  resource_domains: [
36877
37190
  "https://*.wix.com",
36878
37191
  "https://*.wixsite.com",
36879
37192
  "https://static.parastorage.com",
36880
- "https://cdn.openai.com"
37193
+ "https://cdn.openai.com",
37194
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36881
37195
  ],
36882
37196
  frame_domains: ["https://*.wix.com", "https://*.wixsite.com"],
36883
37197
  redirect_domains: ["https://*.wix.com", "https://*.wixsite.com"]
@@ -38540,7 +38854,8 @@ function addSendMessageToWixelTool(server, authStrategy) {
38540
38854
  "https://cdn.jsdelivr.net",
38541
38855
  "https://unpkg.com",
38542
38856
  "https://*.oaiusercontent.com",
38543
- "https://threejs.org"
38857
+ "https://threejs.org",
38858
+ "https://*.widgetrenderer.usercontent.microsoft.com"
38544
38859
  ],
38545
38860
  resource_domains: [
38546
38861
  "https://wix.to",
@@ -38553,7 +38868,8 @@ function addSendMessageToWixelTool(server, authStrategy) {
38553
38868
  "https://cdn.jsdelivr.net",
38554
38869
  "https://unpkg.com",
38555
38870
  "https://*.oaiusercontent.com",
38556
- "https://threejs.org"
38871
+ "https://threejs.org",
38872
+ "https://*.widgetrenderer.usercontent.microsoft.com"
38557
38873
  ],
38558
38874
  frame_domains: [
38559
38875
  "https://*.wix.com",
@@ -39020,7 +39336,9 @@ function createWixToolkit(options) {
39020
39336
  authStrategy
39021
39337
  });
39022
39338
  } else {
39023
- addDocsTools(server, void 0, { authStrategy });
39339
+ addDocsTools(server, void 0, {
39340
+ authStrategy
39341
+ });
39024
39342
  }
39025
39343
  if (api) {
39026
39344
  const {
@@ -39183,6 +39501,14 @@ function createWixToolkit(options) {
39183
39501
  } catch {
39184
39502
  return null;
39185
39503
  }
39504
+ },
39505
+ preloadDynamicContext: async () => {
39506
+ try {
39507
+ const httpClient6 = new import_http_client10.HttpClient();
39508
+ return await getDynamicContext(authStrategy, httpClient6, defaults) || null;
39509
+ } catch {
39510
+ return null;
39511
+ }
39186
39512
  }
39187
39513
  };
39188
39514
  }