@wix/mcp 1.0.32 → 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.
@@ -35147,47 +35147,33 @@ function renderApps(apps) {
35147
35147
  if (!relevant.length) return "";
35148
35148
  const lines = [];
35149
35149
  for (const app of relevant) {
35150
- let line = `- **${KNOWN_APPS[app.appId]}**`;
35150
+ let line = `- **${KNOWN_APPS[app.appId]}** (ID: \`${app.appId}\`)`;
35151
35151
  if (app.catalogVersion) {
35152
- line += ` \u2014 catalog: **${app.catalogVersion}**`;
35152
+ line += ` \u2014 Catalog app version: **${app.catalogVersion}**`;
35153
35153
  }
35154
35154
  lines.push(line);
35155
35155
  }
35156
35156
  return lines.join("\n");
35157
35157
  }
35158
35158
  function renderProperties(props) {
35159
- const items = [];
35160
- if (props.language) items.push(`**Language**: ${props.language}`);
35161
- if (props.locale?.country) items.push(`**Country**: ${props.locale.country}`);
35162
- if (props.paymentCurrency) items.push(`**Currency**: ${props.paymentCurrency}`);
35163
- if (props.timeZone) items.push(`**Timezone**: ${props.timeZone}`);
35164
- if (props.email) items.push(`**Email**: ${props.email}`);
35165
- if (props.phone) items.push(`**Phone**: ${props.phone}`);
35166
- return items.join("\n");
35167
- }
35168
- function renderCmsCollections(collections) {
35169
- const nonEmpty = collections.filter(
35170
- (c) => c.displayName || c.fields && c.fields.length > 0
35171
- );
35172
- if (!nonEmpty.length) return "";
35173
- const lines = [];
35174
- for (const col of nonEmpty) {
35175
- const name = col.displayName ?? col.id ?? "Unnamed";
35176
- lines.push(`- **${name}**`);
35177
- const customFields = (col.fields ?? []).filter((f) => !f.systemField);
35178
- if (customFields.length) {
35179
- for (const field of customFields) {
35180
- const fieldName = field.displayName ?? field.key ?? "";
35181
- let fieldLine = ` - ${fieldName}`;
35182
- if (field.type) fieldLine += ` (\`${field.type}\`)`;
35183
- if (field.referencedCollection) {
35184
- fieldLine += ` \u2192 \`${field.referencedCollection}\``;
35185
- }
35186
- lines.push(fieldLine);
35187
- }
35188
- }
35189
- }
35190
- return lines.join("\n");
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");
35191
35177
  }
35192
35178
  function renderSite(site, index) {
35193
35179
  const lines = [];
@@ -35223,15 +35209,6 @@ function renderSite(site, index) {
35223
35209
  lines.push("");
35224
35210
  lines.push(appsContent);
35225
35211
  }
35226
- if (site.cmsCollections?.length) {
35227
- const cmsContent = renderCmsCollections(site.cmsCollections);
35228
- if (cmsContent) {
35229
- lines.push("");
35230
- lines.push("### CMS Collections");
35231
- lines.push("");
35232
- lines.push(cmsContent);
35233
- }
35234
- }
35235
35212
  lines.push("");
35236
35213
  lines.push("---");
35237
35214
  lines.push("");
@@ -35267,6 +35244,17 @@ function enrichDynamicContext(data) {
35267
35244
  sections.push("");
35268
35245
  sections.push("---");
35269
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
+ }
35270
35258
  if (response.sites?.length) {
35271
35259
  for (let i = 0; i < response.sites.length; i++) {
35272
35260
  sections.push(renderSite(response.sites[i], i + 1));
@@ -35299,7 +35287,12 @@ async function getDynamicContext(auth, httpClient6, filter) {
35299
35287
  const response = await httpClient6.request({
35300
35288
  url: DYNAMIC_CONTEXT_URL,
35301
35289
  method: "POST",
35302
- headers: { ...accountHeaders, "Content-Type": "application/json" },
35290
+ headers: {
35291
+ ...accountHeaders,
35292
+ "Content-Type": "application/json",
35293
+ "Petri_ovr": "shouldReturnDynamicContextInMCP#B",
35294
+ "X-Wix-Office": "1"
35295
+ },
35303
35296
  data: body
35304
35297
  });
35305
35298
  return enrichDynamicContext2(response.data);
@@ -36952,13 +36945,15 @@ function addCreateSiteWidgetTool(server, authStrategy, options) {
36952
36945
  "https://*.wix.com",
36953
36946
  "https://*.wixsite.com",
36954
36947
  "https://static.parastorage.com",
36955
- "https://cdn.openai.com"
36948
+ "https://cdn.openai.com",
36949
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36956
36950
  ],
36957
36951
  resource_domains: [
36958
36952
  "https://*.wix.com",
36959
36953
  "https://*.wixsite.com",
36960
36954
  "https://static.parastorage.com",
36961
- "https://cdn.openai.com"
36955
+ "https://cdn.openai.com",
36956
+ "https://*.widgetrenderer.usercontent.microsoft.com"
36962
36957
  ],
36963
36958
  frame_domains: ["https://*.wix.com", "https://*.wixsite.com"],
36964
36959
  redirect_domains: ["https://*.wix.com", "https://*.wixsite.com"]
@@ -37188,13 +37183,15 @@ function addEditSiteWidgetTool(server, authStrategy) {
37188
37183
  "https://*.wix.com",
37189
37184
  "https://*.wixsite.com",
37190
37185
  "https://static.parastorage.com",
37191
- "https://cdn.openai.com"
37186
+ "https://cdn.openai.com",
37187
+ "https://*.widgetrenderer.usercontent.microsoft.com"
37192
37188
  ],
37193
37189
  resource_domains: [
37194
37190
  "https://*.wix.com",
37195
37191
  "https://*.wixsite.com",
37196
37192
  "https://static.parastorage.com",
37197
- "https://cdn.openai.com"
37193
+ "https://cdn.openai.com",
37194
+ "https://*.widgetrenderer.usercontent.microsoft.com"
37198
37195
  ],
37199
37196
  frame_domains: ["https://*.wix.com", "https://*.wixsite.com"],
37200
37197
  redirect_domains: ["https://*.wix.com", "https://*.wixsite.com"]
@@ -38857,7 +38854,8 @@ function addSendMessageToWixelTool(server, authStrategy) {
38857
38854
  "https://cdn.jsdelivr.net",
38858
38855
  "https://unpkg.com",
38859
38856
  "https://*.oaiusercontent.com",
38860
- "https://threejs.org"
38857
+ "https://threejs.org",
38858
+ "https://*.widgetrenderer.usercontent.microsoft.com"
38861
38859
  ],
38862
38860
  resource_domains: [
38863
38861
  "https://wix.to",
@@ -38870,7 +38868,8 @@ function addSendMessageToWixelTool(server, authStrategy) {
38870
38868
  "https://cdn.jsdelivr.net",
38871
38869
  "https://unpkg.com",
38872
38870
  "https://*.oaiusercontent.com",
38873
- "https://threejs.org"
38871
+ "https://threejs.org",
38872
+ "https://*.widgetrenderer.usercontent.microsoft.com"
38874
38873
  ],
38875
38874
  frame_domains: [
38876
38875
  "https://*.wix.com",
@@ -39493,20 +39492,20 @@ function createWixToolkit(options) {
39493
39492
  getTools: () => allTools,
39494
39493
  getTool: (name) => toolsByName.get(name),
39495
39494
  getToolNames: () => allTools.map((t) => t.name),
39496
- preloadReadme: async (filter) => {
39495
+ preloadReadme: async () => {
39497
39496
  const readmeTool = toolsByName.get("WixREADME");
39498
39497
  if (!readmeTool) return null;
39499
39498
  try {
39500
- const result = await readmeTool.execute(filter ?? {});
39499
+ const result = await readmeTool.execute({});
39501
39500
  return extractText(result);
39502
39501
  } catch {
39503
39502
  return null;
39504
39503
  }
39505
39504
  },
39506
- preloadDynamicContext: async (filter) => {
39505
+ preloadDynamicContext: async () => {
39507
39506
  try {
39508
39507
  const httpClient6 = new import_http_client10.HttpClient();
39509
- return await getDynamicContext(authStrategy, httpClient6, filter) || null;
39508
+ return await getDynamicContext(authStrategy, httpClient6, defaults) || null;
39510
39509
  } catch {
39511
39510
  return null;
39512
39511
  }