@wix/mcp 1.0.25 → 1.0.26

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 (44) hide show
  1. package/build/bin-standalone.js +54 -11
  2. package/build/bin-standalone.js.map +3 -3
  3. package/build/cjs/index.cjs +298 -180
  4. package/build/cjs/index.cjs.map +4 -4
  5. package/build/dts/docs/docs.d.ts.map +1 -1
  6. package/build/dts/docs/docs.js +4 -2
  7. package/build/dts/docs/docs.js.map +1 -1
  8. package/build/dts/docs/normalize-menu-content.d.ts +13 -0
  9. package/build/dts/docs/normalize-menu-content.d.ts.map +1 -0
  10. package/build/dts/docs/normalize-menu-content.js +40 -0
  11. package/build/dts/docs/normalize-menu-content.js.map +1 -0
  12. package/build/dts/docs/semanticSearch.d.ts.map +1 -1
  13. package/build/dts/docs/semanticSearch.js +13 -10
  14. package/build/dts/docs/semanticSearch.js.map +1 -1
  15. package/build/dts/docs/semanticSearch.test.js +3 -2
  16. package/build/dts/docs/semanticSearch.test.js.map +1 -1
  17. package/build/dts/index.d.ts +1 -1
  18. package/build/dts/index.d.ts.map +1 -1
  19. package/build/dts/index.js.map +1 -1
  20. package/build/dts/site-widget-tools/index.d.ts +2 -2
  21. package/build/dts/site-widget-tools/index.d.ts.map +1 -1
  22. package/build/dts/site-widget-tools/index.js.map +1 -1
  23. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts +10 -1
  24. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.d.ts.map +1 -1
  25. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js +22 -8
  26. package/build/dts/site-widget-tools/pull-site-creation-job-tool/index.js.map +1 -1
  27. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts +10 -1
  28. package/build/dts/site-widget-tools/site-builder-tool/index.d.ts.map +1 -1
  29. package/build/dts/site-widget-tools/site-builder-tool/index.js +25 -5
  30. package/build/dts/site-widget-tools/site-builder-tool/index.js.map +1 -1
  31. package/build/dts/wixel/api.d.ts +10 -2
  32. package/build/dts/wixel/api.d.ts.map +1 -1
  33. package/build/dts/wixel/api.js +16 -5
  34. package/build/dts/wixel/api.js.map +1 -1
  35. package/build/dts/wixel/index.d.ts.map +1 -1
  36. package/build/dts/wixel/index.js +15 -4
  37. package/build/dts/wixel/index.js.map +1 -1
  38. package/build/dts/wixel/utils.d.ts +2 -0
  39. package/build/dts/wixel/utils.d.ts.map +1 -0
  40. package/build/dts/wixel/utils.js +5 -0
  41. package/build/dts/wixel/utils.js.map +1 -0
  42. package/build/esm/index.js +145 -46
  43. package/build/esm/index.js.map +4 -4
  44. package/package.json +2 -2
@@ -17317,12 +17317,12 @@ var require_index_node2 = __commonJS({
17317
17317
  }
17318
17318
  });
17319
17319
 
17320
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serialization/utils.js
17320
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serialization/utils.js
17321
17321
  var require_utils10 = __commonJS({
17322
- "../../node_modules/@wix/metro-runtime/dist/cjs/serialization/utils.js"(exports2) {
17322
+ "../../node_modules/@wix/metro-runtime/cjs/build/serialization/utils.js"(exports2) {
17323
17323
  "use strict";
17324
- exports2.__esModule = true;
17325
- exports2.parseLeanSchemaRef = parseLeanSchemaRef;
17324
+ Object.defineProperty(exports2, "__esModule", { value: true });
17325
+ exports2.parseLeanSchemaRef = void 0;
17326
17326
  function parseLeanSchemaRef(renderedSchemaName = "") {
17327
17327
  const [typeOrName, schemaName] = getSchemaNameAndType(renderedSchemaName);
17328
17328
  if (schemaName) {
@@ -17335,30 +17335,42 @@ var require_utils10 = __commonJS({
17335
17335
  schemaName: typeOrName
17336
17336
  };
17337
17337
  }
17338
+ exports2.parseLeanSchemaRef = parseLeanSchemaRef;
17338
17339
  var getSchemaNameAndType = (leanSchema) => leanSchema.split("#");
17339
17340
  }
17340
17341
  });
17341
17342
 
17342
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serialization/index.js
17343
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serialization/index.js
17343
17344
  var require_serialization = __commonJS({
17344
- "../../node_modules/@wix/metro-runtime/dist/cjs/serialization/index.js"(exports2) {
17345
+ "../../node_modules/@wix/metro-runtime/cjs/build/serialization/index.js"(exports2) {
17345
17346
  "use strict";
17346
- exports2.__esModule = true;
17347
- var _utils = require_utils10();
17348
- Object.keys(_utils).forEach(function(key) {
17349
- if (key === "default" || key === "__esModule") return;
17350
- if (key in exports2 && exports2[key] === _utils[key]) return;
17351
- exports2[key] = _utils[key];
17352
- });
17347
+ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17348
+ if (k2 === void 0) k2 = k;
17349
+ var desc2 = Object.getOwnPropertyDescriptor(m, k);
17350
+ if (!desc2 || ("get" in desc2 ? !m.__esModule : desc2.writable || desc2.configurable)) {
17351
+ desc2 = { enumerable: true, get: function() {
17352
+ return m[k];
17353
+ } };
17354
+ }
17355
+ Object.defineProperty(o, k2, desc2);
17356
+ }) : (function(o, m, k, k2) {
17357
+ if (k2 === void 0) k2 = k;
17358
+ o[k2] = m[k];
17359
+ }));
17360
+ var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
17361
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
17362
+ };
17363
+ Object.defineProperty(exports2, "__esModule", { value: true });
17364
+ __exportStar2(require_utils10(), exports2);
17353
17365
  }
17354
17366
  });
17355
17367
 
17356
- // ../../node_modules/@wix/metro-runtime/dist/cjs/utils.js
17368
+ // ../../node_modules/@wix/metro-runtime/cjs/build/utils.js
17357
17369
  var require_utils11 = __commonJS({
17358
- "../../node_modules/@wix/metro-runtime/dist/cjs/utils.js"(exports2) {
17370
+ "../../node_modules/@wix/metro-runtime/cjs/build/utils.js"(exports2) {
17359
17371
  "use strict";
17360
- exports2.__esModule = true;
17361
- exports2.findByPath = findByPath;
17372
+ Object.defineProperty(exports2, "__esModule", { value: true });
17373
+ exports2.findByPath = void 0;
17362
17374
  function findByPath(obj, path2, defaultValue, suffix) {
17363
17375
  let result = obj;
17364
17376
  for (const field of path2.split(".")) {
@@ -17369,16 +17381,17 @@ var require_utils11 = __commonJS({
17369
17381
  }
17370
17382
  return `${result}${suffix}`;
17371
17383
  }
17384
+ exports2.findByPath = findByPath;
17372
17385
  }
17373
17386
  });
17374
17387
 
17375
- // ../../node_modules/@wix/metro-runtime/dist/cjs/url-resolver.js
17388
+ // ../../node_modules/@wix/metro-runtime/cjs/build/url-resolver.js
17376
17389
  var require_url_resolver = __commonJS({
17377
- "../../node_modules/@wix/metro-runtime/dist/cjs/url-resolver.js"(exports2) {
17390
+ "../../node_modules/@wix/metro-runtime/cjs/build/url-resolver.js"(exports2) {
17378
17391
  "use strict";
17379
- exports2.__esModule = true;
17380
- exports2.resolveUrl = resolveUrl;
17381
- var _utils = require_utils11();
17392
+ Object.defineProperty(exports2, "__esModule", { value: true });
17393
+ exports2.resolveUrl = void 0;
17394
+ var utils_js_1 = require_utils11();
17382
17395
  var USER_DOMAIN = "_";
17383
17396
  var DOMAINS = ["wix.com", "editorx.com"];
17384
17397
  var WIX_API_DOMAINS = ["42.wixprod.net", "uw2-edt-1.wixprod.net"];
@@ -17393,6 +17406,7 @@ var require_url_resolver = __commonJS({
17393
17406
  const path2 = injectDataIntoProtoPath(opts.protoPath, opts.data || {});
17394
17407
  return resolvePath(path2, mappings);
17395
17408
  }
17409
+ exports2.resolveUrl = resolveUrl;
17396
17410
  function injectDataIntoProtoPath(protoPath, data) {
17397
17411
  return protoPath.split("/").map((path2) => maybeProtoPathToData(path2, data)).join("/");
17398
17412
  }
@@ -17401,7 +17415,7 @@ var require_url_resolver = __commonJS({
17401
17415
  const field = protoRegExpMatch[1];
17402
17416
  if (field) {
17403
17417
  const suffix = protoPath.replace(protoRegExpMatch[0], "");
17404
- return (0, _utils.findByPath)(data, field, protoPath, suffix);
17418
+ return (0, utils_js_1.findByPath)(data, field, protoPath, suffix);
17405
17419
  }
17406
17420
  return protoPath;
17407
17421
  }
@@ -17430,14 +17444,13 @@ var require_url_resolver = __commonJS({
17430
17444
  return rootDomainMappings ?? [];
17431
17445
  }
17432
17446
  function resolveRootDomain(domain, domainToMappings) {
17433
- var _Object$entries$find;
17434
- return (_Object$entries$find = Object.entries(domainToMappings).find(([entryDomain]) => {
17447
+ return Object.entries(domainToMappings).find(([entryDomain]) => {
17435
17448
  const [_, ...rooDomainSegments] = domain.split(".");
17436
17449
  return rooDomainSegments.join(".") === entryDomain;
17437
- })) == null ? void 0 : _Object$entries$find[1];
17450
+ })?.[1];
17438
17451
  }
17439
17452
  function resolvePath(protoPath, mappings) {
17440
- const mapping = mappings == null ? void 0 : mappings.find((m) => protoPath.startsWith(m.destPath));
17453
+ const mapping = mappings?.find((m) => protoPath.startsWith(m.destPath));
17441
17454
  if (!mapping) {
17442
17455
  return protoPath;
17443
17456
  }
@@ -17699,13 +17712,13 @@ var require_base642 = __commonJS({
17699
17712
  }
17700
17713
  });
17701
17714
 
17702
- // ../../node_modules/@wix/metro-runtime/dist/cjs/flatten-params.js
17715
+ // ../../node_modules/@wix/metro-runtime/cjs/build/flatten-params.js
17703
17716
  var require_flatten_params = __commonJS({
17704
- "../../node_modules/@wix/metro-runtime/dist/cjs/flatten-params.js"(exports2) {
17717
+ "../../node_modules/@wix/metro-runtime/cjs/build/flatten-params.js"(exports2) {
17705
17718
  "use strict";
17706
- exports2.__esModule = true;
17707
- exports2.toURLSearchParams = toURLSearchParams;
17708
- var _jsBase = require_base642();
17719
+ Object.defineProperty(exports2, "__esModule", { value: true });
17720
+ exports2.toURLSearchParams = void 0;
17721
+ var js_base64_1 = require_base642();
17709
17722
  function flattenParams(data, path2 = "") {
17710
17723
  const params = {};
17711
17724
  Object.entries(data).forEach(([key, value]) => {
@@ -17728,9 +17741,7 @@ var require_flatten_params = __commonJS({
17728
17741
  const isPayloadNonSerializableAsUrlSearchParams = Object.entries(flatten).some(([key, value]) => key.includes(".") || Array.isArray(value) && value.some((v) => typeof v === "object"));
17729
17742
  const shouldSerializeToRParam = isComplexRequest && isPayloadNonSerializableAsUrlSearchParams;
17730
17743
  if (shouldSerializeToRParam) {
17731
- return new URLSearchParams({
17732
- ".r": (0, _jsBase.encode)(JSON.stringify(params), true)
17733
- });
17744
+ return new URLSearchParams({ ".r": (0, js_base64_1.encode)(JSON.stringify(params), true) });
17734
17745
  } else {
17735
17746
  return Object.entries(flatten).reduce((urlSearchParams, [key, value]) => {
17736
17747
  const keyParams = Array.isArray(value) ? value : [value];
@@ -17744,56 +17755,58 @@ var require_flatten_params = __commonJS({
17744
17755
  }, new URLSearchParams());
17745
17756
  }
17746
17757
  }
17758
+ exports2.toURLSearchParams = toURLSearchParams;
17747
17759
  }
17748
17760
  });
17749
17761
 
17750
- // ../../node_modules/@wix/metro-runtime/dist/cjs/index.js
17751
- var require_cjs5 = __commonJS({
17752
- "../../node_modules/@wix/metro-runtime/dist/cjs/index.js"(exports2) {
17762
+ // ../../node_modules/@wix/metro-runtime/cjs/build/index.js
17763
+ var require_build = __commonJS({
17764
+ "../../node_modules/@wix/metro-runtime/cjs/build/index.js"(exports2) {
17753
17765
  "use strict";
17754
- exports2.__esModule = true;
17755
- var _serialization = require_serialization();
17756
- Object.keys(_serialization).forEach(function(key) {
17757
- if (key === "default" || key === "__esModule") return;
17758
- if (key in exports2 && exports2[key] === _serialization[key]) return;
17759
- exports2[key] = _serialization[key];
17760
- });
17761
- var _urlResolver = require_url_resolver();
17762
- Object.keys(_urlResolver).forEach(function(key) {
17763
- if (key === "default" || key === "__esModule") return;
17764
- if (key in exports2 && exports2[key] === _urlResolver[key]) return;
17765
- exports2[key] = _urlResolver[key];
17766
- });
17767
- var _flattenParams = require_flatten_params();
17768
- Object.keys(_flattenParams).forEach(function(key) {
17769
- if (key === "default" || key === "__esModule") return;
17770
- if (key in exports2 && exports2[key] === _flattenParams[key]) return;
17771
- exports2[key] = _flattenParams[key];
17772
- });
17766
+ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
17767
+ if (k2 === void 0) k2 = k;
17768
+ var desc2 = Object.getOwnPropertyDescriptor(m, k);
17769
+ if (!desc2 || ("get" in desc2 ? !m.__esModule : desc2.writable || desc2.configurable)) {
17770
+ desc2 = { enumerable: true, get: function() {
17771
+ return m[k];
17772
+ } };
17773
+ }
17774
+ Object.defineProperty(o, k2, desc2);
17775
+ }) : (function(o, m, k, k2) {
17776
+ if (k2 === void 0) k2 = k;
17777
+ o[k2] = m[k];
17778
+ }));
17779
+ var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
17780
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
17781
+ };
17782
+ Object.defineProperty(exports2, "__esModule", { value: true });
17783
+ __exportStar2(require_serialization(), exports2);
17784
+ __exportStar2(require_url_resolver(), exports2);
17785
+ __exportStar2(require_flatten_params(), exports2);
17773
17786
  }
17774
17787
  });
17775
17788
 
17776
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/domain.js
17789
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/domain.js
17777
17790
  var require_domain3 = __commonJS({
17778
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/domain.js"(exports2) {
17791
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/domain.js"(exports2) {
17779
17792
  "use strict";
17780
- exports2.__esModule = true;
17793
+ Object.defineProperty(exports2, "__esModule", { value: true });
17781
17794
  exports2.ConverterType = void 0;
17782
- var ConverterType = exports2.ConverterType = /* @__PURE__ */ (function(ConverterType2) {
17795
+ var ConverterType;
17796
+ (function(ConverterType2) {
17783
17797
  ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
17784
17798
  ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
17785
- return ConverterType2;
17786
- })({});
17799
+ })(ConverterType = exports2.ConverterType || (exports2.ConverterType = {}));
17787
17800
  }
17788
17801
  });
17789
17802
 
17790
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/serializer.js
17803
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/serializer.js
17791
17804
  var require_serializer = __commonJS({
17792
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/serializer.js"(exports2) {
17805
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/serializer.js"(exports2) {
17793
17806
  "use strict";
17794
- exports2.__esModule = true;
17795
- exports2.schemaSerializer = schemaSerializer;
17796
- var _ = require_cjs5();
17807
+ Object.defineProperty(exports2, "__esModule", { value: true });
17808
+ exports2.schemaSerializer = void 0;
17809
+ var index_js_1 = require_build();
17797
17810
  function schemaSerializer(rootSchema, depSchemas = {}, converterSets) {
17798
17811
  return function serialize(json = {}, converterType) {
17799
17812
  return typeof json === "string" ? json : transformSchema(rootSchema, json);
@@ -17803,14 +17816,10 @@ var require_serializer = __commonJS({
17803
17816
  return payload;
17804
17817
  }
17805
17818
  Object.entries(payload).forEach(([key, val]) => {
17806
- var _getConverter;
17807
17819
  const renderedSchemaName = schema[key];
17808
- const {
17809
- schemaName,
17810
- schemaType
17811
- } = (0, _.parseLeanSchemaRef)(renderedSchemaName);
17820
+ const { schemaName, schemaType } = (0, index_js_1.parseLeanSchemaRef)(renderedSchemaName);
17812
17821
  const isMap = schemaType === "Map";
17813
- const isRepeatable = ((_getConverter = getConverter(schemaName)) == null || _getConverter.checkRepetable == null ? void 0 : _getConverter.checkRepetable(val)) ?? Array.isArray(val);
17822
+ const isRepeatable = getConverter(schemaName)?.checkRepetable?.(val) ?? Array.isArray(val);
17814
17823
  let parsedValue;
17815
17824
  if (isRepeatable) {
17816
17825
  parsedValue = val.map((v) => applyField(v, schemaName));
@@ -17837,8 +17846,7 @@ var require_serializer = __commonJS({
17837
17846
  throw new Error(`${schemaOrSerializer} is neither schema nor serializable type`);
17838
17847
  }
17839
17848
  function getConverter(name) {
17840
- var _converterSets$name;
17841
- return (_converterSets$name = converterSets[name]) == null ? void 0 : _converterSets$name[converterType];
17849
+ return converterSets[name]?.[converterType];
17842
17850
  }
17843
17851
  function applyFieldOnMap(val, sanitizedSchemaOrSerializer) {
17844
17852
  return Object.entries(val).reduce((acc, [propertyName, value]) => {
@@ -17848,19 +17856,20 @@ var require_serializer = __commonJS({
17848
17856
  }
17849
17857
  };
17850
17858
  }
17859
+ exports2.schemaSerializer = schemaSerializer;
17851
17860
  }
17852
17861
  });
17853
17862
 
17854
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/timestamp.js
17863
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/timestamp.js
17855
17864
  var require_timestamp = __commonJS({
17856
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/timestamp.js"(exports2) {
17865
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/timestamp.js"(exports2) {
17857
17866
  "use strict";
17858
- exports2.__esModule = true;
17867
+ Object.defineProperty(exports2, "__esModule", { value: true });
17859
17868
  exports2.timestamp = void 0;
17860
- var _domain = require_domain3();
17861
- var timestamp = exports2.timestamp = {
17869
+ var domain_js_1 = require_domain3();
17870
+ exports2.timestamp = {
17862
17871
  types: ["google.protobuf.Timestamp"],
17863
- [_domain.ConverterType.TO_JSON]: {
17872
+ [domain_js_1.ConverterType.TO_JSON]: {
17864
17873
  transform: (val) => {
17865
17874
  if (typeof val === "string" || !val) {
17866
17875
  return val;
@@ -17868,23 +17877,23 @@ var require_timestamp = __commonJS({
17868
17877
  return val.toISOString();
17869
17878
  }
17870
17879
  },
17871
- [_domain.ConverterType.FROM_JSON]: {
17880
+ [domain_js_1.ConverterType.FROM_JSON]: {
17872
17881
  transform: (val) => val ? new Date(val) : val
17873
17882
  }
17874
17883
  };
17875
17884
  }
17876
17885
  });
17877
17886
 
17878
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/field-mask.js
17887
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/field-mask.js
17879
17888
  var require_field_mask = __commonJS({
17880
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/field-mask.js"(exports2) {
17889
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/field-mask.js"(exports2) {
17881
17890
  "use strict";
17882
- exports2.__esModule = true;
17891
+ Object.defineProperty(exports2, "__esModule", { value: true });
17883
17892
  exports2.fieldMask = void 0;
17884
- var _domain = require_domain3();
17885
- var fieldMask = exports2.fieldMask = {
17893
+ var domain_js_1 = require_domain3();
17894
+ exports2.fieldMask = {
17886
17895
  types: ["google.protobuf.FieldMask"],
17887
- [_domain.ConverterType.TO_JSON]: {
17896
+ [domain_js_1.ConverterType.TO_JSON]: {
17888
17897
  transform: (val) => val.join(","),
17889
17898
  /**
17890
17899
  * This one handles cases where we have a repeated google.protobuf.FieldMask type,
@@ -17904,7 +17913,7 @@ var require_field_mask = __commonJS({
17904
17913
  return val.some((v) => Array.isArray(v));
17905
17914
  }
17906
17915
  },
17907
- [_domain.ConverterType.FROM_JSON]: {
17916
+ [domain_js_1.ConverterType.FROM_JSON]: {
17908
17917
  transform: (val) => {
17909
17918
  if (typeof val === "object") {
17910
17919
  return val.paths;
@@ -17916,22 +17925,22 @@ var require_field_mask = __commonJS({
17916
17925
  }
17917
17926
  });
17918
17927
 
17919
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/bytes.js
17928
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/bytes.js
17920
17929
  var require_bytes = __commonJS({
17921
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/bytes.js"(exports2) {
17930
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/bytes.js"(exports2) {
17922
17931
  "use strict";
17923
- exports2.__esModule = true;
17932
+ Object.defineProperty(exports2, "__esModule", { value: true });
17924
17933
  exports2.bytes = void 0;
17925
- var _domain = require_domain3();
17926
- var bytes = exports2.bytes = {
17934
+ var domain_js_1 = require_domain3();
17935
+ exports2.bytes = {
17927
17936
  types: ["google.protobuf.BytesValue", "BYTES"],
17928
- [_domain.ConverterType.TO_JSON]: {
17937
+ [domain_js_1.ConverterType.TO_JSON]: {
17929
17938
  transform: (val) => {
17930
17939
  const chars = val.reduce((res, c) => res + String.fromCharCode(c), "");
17931
17940
  return btoa(chars);
17932
17941
  }
17933
17942
  },
17934
- [_domain.ConverterType.FROM_JSON]: {
17943
+ [domain_js_1.ConverterType.FROM_JSON]: {
17935
17944
  transform: (val) => {
17936
17945
  return Uint8Array.from(atob(val), (c) => c.charCodeAt(0));
17937
17946
  }
@@ -17940,20 +17949,17 @@ var require_bytes = __commonJS({
17940
17949
  }
17941
17950
  });
17942
17951
 
17943
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/duration.js
17952
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/duration.js
17944
17953
  var require_duration = __commonJS({
17945
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/duration.js"(exports2) {
17954
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/duration.js"(exports2) {
17946
17955
  "use strict";
17947
- exports2.__esModule = true;
17956
+ Object.defineProperty(exports2, "__esModule", { value: true });
17948
17957
  exports2.duration = void 0;
17949
- var _domain = require_domain3();
17950
- var duration3 = exports2.duration = {
17958
+ var domain_js_1 = require_domain3();
17959
+ exports2.duration = {
17951
17960
  types: ["google.protobuf.Duration"],
17952
- [_domain.ConverterType.TO_JSON]: {
17953
- transform: ({
17954
- seconds = "0",
17955
- nanos = 0
17956
- }) => {
17961
+ [domain_js_1.ConverterType.TO_JSON]: {
17962
+ transform: ({ seconds = "0", nanos = 0 }) => {
17957
17963
  let nanosPortion = "";
17958
17964
  if (nanos !== 0) {
17959
17965
  nanosPortion = `.${nanos.toString().padStart(9, "0")}`;
@@ -17961,7 +17967,7 @@ var require_duration = __commonJS({
17961
17967
  return `${seconds}${nanosPortion}s`;
17962
17968
  }
17963
17969
  },
17964
- [_domain.ConverterType.FROM_JSON]: {
17970
+ [domain_js_1.ConverterType.FROM_JSON]: {
17965
17971
  transform: (val) => {
17966
17972
  const [seconds, nanos] = val.substring(0, val.length - 1).split(".");
17967
17973
  return {
@@ -17982,21 +17988,26 @@ var require_duration = __commonJS({
17982
17988
  }
17983
17989
  });
17984
17990
 
17985
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/float.js
17991
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/float.js
17986
17992
  var require_float = __commonJS({
17987
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/float.js"(exports2) {
17993
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/float.js"(exports2) {
17988
17994
  "use strict";
17989
- exports2.__esModule = true;
17995
+ Object.defineProperty(exports2, "__esModule", { value: true });
17990
17996
  exports2.float = void 0;
17991
- var _domain = require_domain3();
17992
- var float = exports2.float = {
17993
- types: ["FLOAT", "DOUBLE", "google.protobuf.FloatValue", "google.protobuf.DoubleValue"],
17994
- [_domain.ConverterType.TO_JSON]: {
17997
+ var domain_js_1 = require_domain3();
17998
+ exports2.float = {
17999
+ types: [
18000
+ "FLOAT",
18001
+ "DOUBLE",
18002
+ "google.protobuf.FloatValue",
18003
+ "google.protobuf.DoubleValue"
18004
+ ],
18005
+ [domain_js_1.ConverterType.TO_JSON]: {
17995
18006
  transform: (val) => {
17996
18007
  return isFinite(val) ? val : val.toString();
17997
18008
  }
17998
18009
  },
17999
- [_domain.ConverterType.FROM_JSON]: {
18010
+ [domain_js_1.ConverterType.FROM_JSON]: {
18000
18011
  transform: (val) => {
18001
18012
  if (val === "NaN") {
18002
18013
  return NaN;
@@ -18014,27 +18025,33 @@ var require_float = __commonJS({
18014
18025
  }
18015
18026
  });
18016
18027
 
18017
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/converters.js
18028
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/converters.js
18018
18029
  var require_converters = __commonJS({
18019
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/protobuf-converters/converters.js"(exports2) {
18030
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/protobuf-converters/converters.js"(exports2) {
18020
18031
  "use strict";
18021
- exports2.__esModule = true;
18032
+ Object.defineProperty(exports2, "__esModule", { value: true });
18022
18033
  exports2.protobufConverters = void 0;
18023
- var _timestamp = require_timestamp();
18024
- var _fieldMask = require_field_mask();
18025
- var _bytes = require_bytes();
18026
- var _duration = require_duration();
18027
- var _float = require_float();
18028
- var protobufConverters = exports2.protobufConverters = [_timestamp.timestamp, _fieldMask.fieldMask, _bytes.bytes, _duration.duration, _float.float];
18034
+ var timestamp_js_1 = require_timestamp();
18035
+ var field_mask_js_1 = require_field_mask();
18036
+ var bytes_js_1 = require_bytes();
18037
+ var duration_js_1 = require_duration();
18038
+ var float_js_1 = require_float();
18039
+ exports2.protobufConverters = [
18040
+ timestamp_js_1.timestamp,
18041
+ field_mask_js_1.fieldMask,
18042
+ bytes_js_1.bytes,
18043
+ duration_js_1.duration,
18044
+ float_js_1.float
18045
+ ];
18029
18046
  }
18030
18047
  });
18031
18048
 
18032
- // ../../node_modules/@wix/metro-runtime/dist/cjs/serializer/utils.js
18049
+ // ../../node_modules/@wix/metro-runtime/cjs/build/serializer/utils.js
18033
18050
  var require_utils12 = __commonJS({
18034
- "../../node_modules/@wix/metro-runtime/dist/cjs/serializer/utils.js"(exports2) {
18051
+ "../../node_modules/@wix/metro-runtime/cjs/build/serializer/utils.js"(exports2) {
18035
18052
  "use strict";
18036
- exports2.__esModule = true;
18037
- exports2.typeToConverterSet = typeToConverterSet;
18053
+ Object.defineProperty(exports2, "__esModule", { value: true });
18054
+ exports2.typeToConverterSet = void 0;
18038
18055
  function typeToConverterSet(converterSets) {
18039
18056
  return converterSets.reduce((result, converterSet) => {
18040
18057
  const types = converterSet.types.reduce((typeResult, type) => {
@@ -18049,32 +18066,34 @@ var require_utils12 = __commonJS({
18049
18066
  };
18050
18067
  }, {});
18051
18068
  }
18069
+ exports2.typeToConverterSet = typeToConverterSet;
18052
18070
  }
18053
18071
  });
18054
18072
 
18055
- // ../../node_modules/@wix/metro-runtime/dist/cjs/ambassador-index.js
18073
+ // ../../node_modules/@wix/metro-runtime/cjs/build/ambassador-index.js
18056
18074
  var require_ambassador_index = __commonJS({
18057
- "../../node_modules/@wix/metro-runtime/dist/cjs/ambassador-index.js"(exports2) {
18075
+ "../../node_modules/@wix/metro-runtime/cjs/build/ambassador-index.js"(exports2) {
18058
18076
  "use strict";
18059
- exports2.__esModule = true;
18060
- exports2.serializer = serializer;
18061
- var _domain = require_domain3();
18062
- var _serializer = require_serializer();
18063
- var _converters = require_converters();
18064
- var _utils = require_utils12();
18065
- var ambassadorConverters = (0, _utils.typeToConverterSet)([..._converters.protobufConverters]);
18077
+ Object.defineProperty(exports2, "__esModule", { value: true });
18078
+ exports2.serializer = void 0;
18079
+ var domain_js_1 = require_domain3();
18080
+ var serializer_js_1 = require_serializer();
18081
+ var converters_js_1 = require_converters();
18082
+ var utils_js_1 = require_utils12();
18083
+ var ambassadorConverters = (0, utils_js_1.typeToConverterSet)([...converters_js_1.protobufConverters]);
18066
18084
  function serializer(rootSchema, depSchemas = {}) {
18067
- const transform2 = (0, _serializer.schemaSerializer)(rootSchema, depSchemas, ambassadorConverters);
18085
+ const transform2 = (0, serializer_js_1.schemaSerializer)(rootSchema, depSchemas, ambassadorConverters);
18068
18086
  return {
18069
18087
  fromJSON(jsonOrString) {
18070
18088
  const jsonOrText = safeJsonParse(jsonOrString) || jsonOrString;
18071
- return transform2(jsonOrText, _domain.ConverterType.FROM_JSON);
18089
+ return transform2(jsonOrText, domain_js_1.ConverterType.FROM_JSON);
18072
18090
  },
18073
18091
  toJSON(json) {
18074
- return transform2(json, _domain.ConverterType.TO_JSON);
18092
+ return transform2(json, domain_js_1.ConverterType.TO_JSON);
18075
18093
  }
18076
18094
  };
18077
18095
  }
18096
+ exports2.serializer = serializer;
18078
18097
  function safeJsonParse(someString) {
18079
18098
  try {
18080
18099
  return JSON.parse(someString);
@@ -18106,9 +18125,9 @@ var require_http_impl = __commonJS({
18106
18125
  exports2.injectMessages = injectMessages;
18107
18126
  exports2.getVoiceConversationDetails = getVoiceConversationDetails;
18108
18127
  exports2.executeVoiceConversationTool = executeVoiceConversationTool;
18109
- var metro_runtime_1 = require_cjs5();
18128
+ var metro_runtime_1 = require_build();
18110
18129
  var ambassador_1 = require_ambassador_index();
18111
- var metro_runtime_2 = require_cjs5();
18130
+ var metro_runtime_2 = require_build();
18112
18131
  var _abortAssistantMessageGenerationRequest = {};
18113
18132
  var _abortAssistantMessageGenerationResponse = {};
18114
18133
  var _conversation = { createdDate: "google.protobuf.Timestamp" };
@@ -18740,9 +18759,9 @@ var require_http_impl2 = __commonJS({
18740
18759
  exports2.markJobConversationEnded = markJobConversationEnded2;
18741
18760
  exports2.getProcessWidgetStatus = getProcessWidgetStatus2;
18742
18761
  exports2.generateImageForAsset = generateImageForAsset;
18743
- var metro_runtime_1 = require_cjs5();
18762
+ var metro_runtime_1 = require_build();
18744
18763
  var ambassador_1 = require_ambassador_index();
18745
- var metro_runtime_2 = require_cjs5();
18764
+ var metro_runtime_2 = require_build();
18746
18765
  var _generateImageForAssetRequest = {};
18747
18766
  var _generateImageForAssetResponse = {};
18748
18767
  var _getNextAssetSuggestionsRequest = {};
@@ -19157,9 +19176,9 @@ var require_http_impl3 = __commonJS({
19157
19176
  exports2.deleteProject = deleteProject;
19158
19177
  exports2.realtimeUpdateProject = realtimeUpdateProject;
19159
19178
  exports2.deleteProjectsBySiteIds = deleteProjectsBySiteIds;
19160
- var metro_runtime_1 = require_cjs5();
19179
+ var metro_runtime_1 = require_build();
19161
19180
  var ambassador_1 = require_ambassador_index();
19162
- var metro_runtime_2 = require_cjs5();
19181
+ var metro_runtime_2 = require_build();
19163
19182
  var _apiCreateProjectRequest = { project: "_project" };
19164
19183
  var _apiCreateProjectResponse = { project: "_project" };
19165
19184
  var _apiGetProjectRequest = {};
@@ -19757,9 +19776,9 @@ var require_http_impl4 = __commonJS({
19757
19776
  exports2.copyAssetFromTemplate = copyAssetFromTemplate;
19758
19777
  exports2.publish = publish;
19759
19778
  exports2.unpublish = unpublish;
19760
- var metro_runtime_1 = require_cjs5();
19779
+ var metro_runtime_1 = require_build();
19761
19780
  var ambassador_1 = require_ambassador_index();
19762
- var metro_runtime_2 = require_cjs5();
19781
+ var metro_runtime_2 = require_build();
19763
19782
  var _apiCreateAssetRequest = { asset: "_asset" };
19764
19783
  var _apiCreateAssetResponse = { asset: "_asset" };
19765
19784
  var _apiGetAssetRequest = {};
@@ -35564,23 +35583,32 @@ var runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank = f
35564
35583
  const url = new URL(
35565
35584
  `https://www.wixapis.com/mcp-docs-search/v1/search?maxResults=${maxResults}&rerank=${rerank}`
35566
35585
  );
35586
+ const kbNames = [];
35567
35587
  if (toolName === "SDK") {
35568
- url.searchParams.append("kbName", "SDK_SCHEMAS_KB_ID");
35569
- url.searchParams.append("kbName", "SDK_DOCS_KB_ID");
35588
+ kbNames.push(
35589
+ "API_REFERENCE_SDK_KB_ID",
35590
+ "FRONTEND_SDK_AND_EXTENSIONS_KB_ID",
35591
+ "REST_DOCS_KB_ID"
35592
+ );
35570
35593
  } else if (toolName === "REST" || toolName === "BUSINESS_SOLUTIONS") {
35571
35594
  if (toolName === "REST") {
35572
- url.searchParams.append("kbName", "REST_METHODS_KB_ID");
35595
+ kbNames.push("REST_METHODS_KB_ID");
35573
35596
  }
35574
- url.searchParams.append("kbName", "REST_DOCS_KB_ID");
35597
+ kbNames.push("REST_DOCS_KB_ID");
35575
35598
  } else if (toolName === "WDS") {
35576
- url.searchParams.append("kbName", "WDS_DOCS_KB_ID");
35599
+ kbNames.push("WDS_DOCS_KB_ID");
35577
35600
  } else if (toolName === "BUILD_APPS") {
35578
- url.searchParams.append("kbName", "BUILD_APPS_KB_ID");
35601
+ kbNames.push("BUILD_APPS_KB_ID");
35579
35602
  } else if (toolName === "WIX_HEADLESS") {
35580
- url.searchParams.append("kbName", "HEADLESS_KB_ID");
35603
+ kbNames.push("HEADLESS_KB_ID");
35581
35604
  } else if (toolName === "VELO") {
35582
- url.searchParams.append("kbName", "VELO_DOCS_KB_ID");
35583
- url.searchParams.append("kbName", "VELO_METHODS_KB_ID");
35605
+ kbNames.push("VELO_DOCS_KB_ID", "VELO_METHODS_KB_ID");
35606
+ }
35607
+ logger2.log(
35608
+ `[SemanticSearch] Tool: ${toolName}, KBs: [${kbNames.join(", ")}], Query: "${toolParams.searchTerm}"`
35609
+ );
35610
+ for (const kbName of kbNames) {
35611
+ url.searchParams.append("kbName", kbName);
35584
35612
  }
35585
35613
  for (const [key, value] of Object.entries(toolParams)) {
35586
35614
  url.searchParams.append(key, value);
@@ -35769,6 +35797,39 @@ ${preview}${truncated}`);
35769
35797
  return content;
35770
35798
  }
35771
35799
 
35800
+ // src/docs/normalize-menu-content.ts
35801
+ var SCHEMA_HINT = "use ReadFullDocsMethodSchema to get the method full schema";
35802
+ var ARTICLE_HINT = "use ReadFullDocsArticle to see method code examples";
35803
+ var MENU_HINT = "use BrowseWixRESTDocsMenu to browse this category";
35804
+ function safeDecode(encoded) {
35805
+ try {
35806
+ return decodeURIComponent(encoded);
35807
+ } catch {
35808
+ return encoded;
35809
+ }
35810
+ }
35811
+ function normalizeMenuContent(content) {
35812
+ try {
35813
+ content = content.replace(
35814
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-article-content\?articleUrl=([^&)]+)[^)]*schema=true[^)]*\)/g,
35815
+ (_, title, encoded) => `[${title} (${SCHEMA_HINT})](${safeDecode(encoded)})`
35816
+ );
35817
+ content = content.replace(
35818
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-article-content\?articleUrl=([^&)]+)[^)]*\)/g,
35819
+ (_, title, encoded) => `[${title} (${ARTICLE_HINT})](${safeDecode(encoded)})`
35820
+ );
35821
+ content = content.replace(
35822
+ /\[([^\]]+)\]\(https:\/\/[^)]*get-menu-content\?url=([^&)]+)[^)]*\)/g,
35823
+ (_, title, encoded) => `[${title} (${MENU_HINT})](${safeDecode(encoded)})`
35824
+ );
35825
+ } catch (error2) {
35826
+ logger2.error(
35827
+ `[BrowseWixRESTDocsMenu] Failed to normalize menu content: ${error2}`
35828
+ );
35829
+ }
35830
+ return content;
35831
+ }
35832
+
35772
35833
  // ../../node_modules/dedent/dist/dedent.mjs
35773
35834
  function ownKeys2(object3, enumerableOnly) {
35774
35835
  var keys = Object.keys(object3);
@@ -36677,7 +36738,8 @@ var addDocsTools = (server, allowedTools = [
36677
36738
  type: "text",
36678
36739
  text: [
36679
36740
  result,
36680
- "you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method."
36741
+ "you should use ReadFullDocsArticle tool if you want to read full documentation for a specific article or method.",
36742
+ "IMPORTANT: When sharing dev.wix.com/docs/rest or dev.wix.com/docs/api-reference links with the user, add ?apiView=SDK suffix to each link (or &apiView=SDK if the URL already has query params). for other prefix (dev.wix.com/docs/sdk) - no need to add the suffix."
36681
36743
  ].join("\n---\n")
36682
36744
  }
36683
36745
  ]
@@ -37005,7 +37067,7 @@ var addDocsTools = (server, allowedTools = [
37005
37067
  content: [
37006
37068
  {
37007
37069
  type: "text",
37008
- text: content
37070
+ text: normalizeMenuContent(content)
37009
37071
  }
37010
37072
  ]
37011
37073
  };
@@ -37588,7 +37650,7 @@ var PULL_SITE_JOB_TOOL_NAME = "pullSiteCreationJob";
37588
37650
  // src/site-widget-tools/site-builder-tool/index.ts
37589
37651
  var httpClient = (0, import_http_client3.createHttpClient)();
37590
37652
  var CREATE_SITE_WIDGET_URI = "ui://widget/site-builder.html";
37591
- function addCreateSiteWidgetTool(server, authStrategy) {
37653
+ function addCreateSiteWidgetTool(server, authStrategy, options) {
37592
37654
  const { getAccountAuthHeaders } = authStrategy;
37593
37655
  const toolMeta = (widgetPayload) => {
37594
37656
  return {
@@ -37697,18 +37759,35 @@ function addCreateSiteWidgetTool(server, authStrategy) {
37697
37759
  jobId = newJobId;
37698
37760
  console.log(`[${SITE_BUILDER_TOOL_NAME}] Created new job:`, jobId);
37699
37761
  }
37762
+ const isWidgetClient = options?.widgetSupported ?? true;
37763
+ const responseText = isWidgetClient ? "Website build started successfully." : [
37764
+ "Website build started successfully.",
37765
+ "",
37766
+ "<agent_instruction>",
37767
+ "IMPORTANT: The website is now being built. You MUST now poll for the build status by calling the",
37768
+ `"${PULL_SITE_JOB_TOOL_NAME}" tool with jobId: "${jobId}".`,
37769
+ "",
37770
+ "Polling instructions:",
37771
+ `1. Call ${PULL_SITE_JOB_TOOL_NAME} with { "jobId": "${jobId}" }`,
37772
+ '2. If the job status is "IN_PROGRESS" or "STARTED", wait approximately 10 seconds, then call again.',
37773
+ '3. Repeat polling until the job status is "COMPLETED" or "FAILED".',
37774
+ "4. When COMPLETED, share the previewUrl with the user so they can see their new website.",
37775
+ "5. If FAILED, inform the user that the site build failed and suggest they try again.",
37776
+ "",
37777
+ "Do NOT mention the jobId to the user. Just confirm the build has started, then begin polling.",
37778
+ "</agent_instruction>"
37779
+ ].join("\n");
37700
37780
  return {
37701
37781
  content: [
37702
37782
  {
37703
37783
  type: "text",
37704
- text: "Respond only with a confirmation that the website build has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId."
37784
+ text: responseText
37705
37785
  }
37706
37786
  ],
37707
37787
  structuredContent: {
37708
37788
  success: true,
37709
- status: "Respond only with a confirmation that the website build has started and that progress is available in the widget. No other content is allowed. DO NOT mention jobId.",
37789
+ status: "Website build started successfully.",
37710
37790
  jobId
37711
- // Return jobId so model can use it in future calls
37712
37791
  },
37713
37792
  _meta: toolMeta({ jobId, extras: server.getWidgetExtras() })
37714
37793
  };
@@ -37953,13 +38032,13 @@ function siteCreatedUsingWixMcpSrc39Evid1608(params) {
37953
38032
 
37954
38033
  // src/site-widget-tools/pull-site-creation-job-tool/index.ts
37955
38034
  var httpClient3 = (0, import_http_client5.createHttpClient)();
37956
- function addPullSiteJobTool(server, authStrategy) {
38035
+ function addPullSiteJobTool(server, authStrategy, options) {
37957
38036
  const { getAccountAuthHeaders, getSiteAuthHeaders } = authStrategy;
37958
38037
  server.registerTool(
37959
38038
  PULL_SITE_JOB_TOOL_NAME,
37960
38039
  {
37961
38040
  title: "Pull Site Job",
37962
- description: "Pull the status of a site job",
38041
+ description: "Poll the status of a site creation or editing job. Call this tool with the jobId returned by WixSiteBuilder or EditSite to check if the site build is complete. When the job status is COMPLETED, the response includes the previewUrl and editorUrl. Continue polling every 10 seconds until the job reaches COMPLETED or FAILED status.",
37963
38042
  inputSchema: {
37964
38043
  jobId: zod_default.string().describe("The job ID to pull")
37965
38044
  },
@@ -37970,8 +38049,7 @@ function addPullSiteJobTool(server, authStrategy) {
37970
38049
  },
37971
38050
  _meta: {
37972
38051
  "openai/toolInvocation/invoking": "Fetching codegen job",
37973
- "openai/toolInvocation/invoked": "Jobs retrieved",
37974
- "openai/visibility": "private"
38052
+ "openai/toolInvocation/invoked": "Jobs retrieved"
37975
38053
  }
37976
38054
  },
37977
38055
  async (args, { biLogger, setToolBiParams }) => {
@@ -38004,7 +38082,7 @@ function addPullSiteJobTool(server, authStrategy) {
38004
38082
  }
38005
38083
  const job = response.data.job;
38006
38084
  const isEditJob = job.type === "EDIT_SITE";
38007
- const pullJobMessage = job.status === "COMPLETED" ? `Job completed. previewUrl: ${job.data?.previewUrl} editorUrl: ${job.data?.editorUrl} siteId: ${job.data?.siteId}` : "Job in progress";
38085
+ const isWidgetClient = options?.widgetSupported ?? true;
38008
38086
  if (job.status === "COMPLETED" && job.data?.siteId) {
38009
38087
  console.log(`[pullSiteJob] job is completed ${jobId}`);
38010
38088
  try {
@@ -38063,12 +38141,26 @@ function addPullSiteJobTool(server, authStrategy) {
38063
38141
  );
38064
38142
  }
38065
38143
  }
38144
+ const isInProgress = job.status === "IN_PROGRESS" || job.status === "STARTED";
38145
+ let responseText;
38146
+ if (job.status === "COMPLETED") {
38147
+ responseText = isWidgetClient ? "Site successfully created." : `Site successfully created!
38148
+
38149
+ Site URL: ${job.data?.previewUrl}
38150
+ Editor URL: ${job.data?.editorUrl}`;
38151
+ } else if (isInProgress) {
38152
+ const pollingHint = !isWidgetClient ? `
38153
+
38154
+ <agent_instruction>The job is still in progress. Wait approximately 10 seconds and then call ${PULL_SITE_JOB_TOOL_NAME} again with { "jobId": "${jobId}" }. Do not tell the user about polling details.</agent_instruction>` : "";
38155
+ responseText = `Job in progress.${pollingHint}`;
38156
+ } else {
38157
+ responseText = `Job status: ${job.status}`;
38158
+ }
38066
38159
  return {
38067
38160
  content: [
38068
38161
  {
38069
38162
  type: "text",
38070
- text: `Job pulled successfully.
38071
- ${pullJobMessage}`
38163
+ text: responseText
38072
38164
  }
38073
38165
  ],
38074
38166
  structuredContent: { job: response.data.job }
@@ -38165,7 +38257,7 @@ var WWW_PROJECT_V1_PROJECT_API_BASE_URL = "https://manage.wix.com/";
38165
38257
  var WWW_ASSET_V1_ASSET_API_BASE_URL = "https://manage.wix.com/";
38166
38258
 
38167
38259
  // src/wixel/api.ts
38168
- var CONDUCTOR_OVERRIDE = "0061524d-1fe2-4ecc-94a7-44a09d2aab45";
38260
+ var CONDUCTOR_OVERRIDE = "f14cea3d-0f6b-448b-9093-d424ab8073b1";
38169
38261
  var COMMON_HEADERS = {};
38170
38262
  function parseWidget(content) {
38171
38263
  const match = content?.match(/<<(.+?)>>/s);
@@ -38351,7 +38443,8 @@ async function sendMessageToWix({
38351
38443
  message,
38352
38444
  wixelAssistantId = WIXEL_ASSISTANT_ID,
38353
38445
  apiBaseURL = GENIE_CHAT_SERVICE_V1_NO_ENTITY_API_BASE_URL,
38354
- conductorOverride = CONDUCTOR_OVERRIDE
38446
+ conductorOverride = CONDUCTOR_OVERRIDE,
38447
+ images
38355
38448
  }) {
38356
38449
  const httpClient4 = (0, import_http_client6.createHttpClient)({
38357
38450
  headers: {
@@ -38366,6 +38459,13 @@ async function sendMessageToWix({
38366
38459
  messageLength: message.length,
38367
38460
  messagePreview: message.substring(0, 300) + (message.length > 300 ? "..." : "")
38368
38461
  });
38462
+ const attachments = images && images.length > 0 ? {
38463
+ attachments: images.map((image, index) => ({
38464
+ fileName: `Image ${index + 1}`,
38465
+ mimeType: "image/png",
38466
+ url: image.download_url
38467
+ }))
38468
+ } : {};
38369
38469
  const response = await httpClient4.request(
38370
38470
  (0, import_http.createConversationUserMessage)({
38371
38471
  conversationId,
@@ -38377,7 +38477,8 @@ async function sendMessageToWix({
38377
38477
  value: projectId
38378
38478
  }
38379
38479
  ]
38380
- }
38480
+ },
38481
+ ...attachments
38381
38482
  })
38382
38483
  );
38383
38484
  const userMessage = response.data.userMessage;
@@ -38433,7 +38534,8 @@ async function sendMessageToWixWithAutoConfirmation({
38433
38534
  message,
38434
38535
  wixelAssistantId = WIXEL_ASSISTANT_ID,
38435
38536
  apiBaseURL = GENIE_CHAT_SERVICE_V1_NO_ENTITY_API_BASE_URL,
38436
- conductorOverride = CONDUCTOR_OVERRIDE
38537
+ conductorOverride = CONDUCTOR_OVERRIDE,
38538
+ images
38437
38539
  }) {
38438
38540
  const { completedMsg, widget, messageText } = await sendMessageToWix({
38439
38541
  siteAuthHeaders,
@@ -38442,7 +38544,8 @@ async function sendMessageToWixWithAutoConfirmation({
38442
38544
  message,
38443
38545
  wixelAssistantId,
38444
38546
  apiBaseURL,
38445
- conductorOverride
38547
+ conductorOverride,
38548
+ images
38446
38549
  });
38447
38550
  if (widget?.widget === "SINGLE_SELECT_WIDGET" && widget.data?.primaryButton?.respondText) {
38448
38551
  console.log("Auto-confirm SINGLE_SELECT_WIDGET", widget);
@@ -38523,6 +38626,12 @@ async function getAsset({
38523
38626
  return asset;
38524
38627
  }
38525
38628
 
38629
+ // src/wixel/utils.ts
38630
+ var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
38631
+ function isValidUuid(value) {
38632
+ return typeof value === "string" && UUID_REGEX.test(value);
38633
+ }
38634
+
38526
38635
  // src/wixel/index.ts
38527
38636
  var SEND_MESSAGE_TO_WIXEL_TOOL_NAME = "SendMessageToWixel";
38528
38637
  var GET_WIXEL_JOB_STATUS_TOOL_NAME = "getWixelJobStatus";
@@ -38578,7 +38687,8 @@ function addSendMessageToWixelTool(server, authStrategy) {
38578
38687
  const toolMeta = {
38579
38688
  ...widgetMeta,
38580
38689
  "openai/toolInvocation/invoking": "Sending message to Wixel...",
38581
- "openai/toolInvocation/invoked": "Response from Wixel received"
38690
+ "openai/toolInvocation/invoked": "Response from Wixel received",
38691
+ "openai/fileParams": ["images"]
38582
38692
  };
38583
38693
  server.registerResource(
38584
38694
  `${WIDGET_NAME}_RESOURCE`,
@@ -38621,18 +38731,25 @@ You can also use this tool to:
38621
38731
  metaSiteId: external_exports.string().optional().describe("Wixel site ID (auto-creates if not provided)"),
38622
38732
  projectId: external_exports.string().optional().describe("Wixel project ID (auto-creates if not provided)"),
38623
38733
  conversationId: external_exports.string().optional().describe("Existing conversation ID (auto-creates if not provided)"),
38624
- message: external_exports.string().describe("The message to send to Wixel")
38734
+ message: external_exports.string().describe("The message to send to Wixel"),
38735
+ images: external_exports.array(
38736
+ external_exports.object({
38737
+ download_url: external_exports.string().url(),
38738
+ file_id: external_exports.string()
38739
+ })
38740
+ ).optional().describe("Attached image files provided by the user")
38625
38741
  },
38626
38742
  annotations: { readOnlyHint: true },
38627
38743
  _meta: toolMeta
38628
38744
  },
38629
38745
  async (args) => {
38630
38746
  try {
38747
+ console.log(`[Wixel] \u{1F680} Start Building Your asset`, { ...args });
38631
38748
  const accountAuthHeaders = await getAccountAuthHeaders();
38632
38749
  let metaSiteId;
38633
38750
  let projectId;
38634
38751
  let messageHint = "";
38635
- if (args.metaSiteId && args.projectId) {
38752
+ if (isValidUuid(args.metaSiteId) && isValidUuid(args.projectId)) {
38636
38753
  metaSiteId = args.metaSiteId;
38637
38754
  projectId = args.projectId;
38638
38755
  } else {
@@ -38683,7 +38800,8 @@ You can also use this tool to:
38683
38800
  siteAuthHeaders,
38684
38801
  projectId,
38685
38802
  conversationId,
38686
- message: messageWithHint
38803
+ message: messageWithHint,
38804
+ images: args.images
38687
38805
  });
38688
38806
  let widget = parsedWidget;
38689
38807
  let textContent = messageText.replaceAll("**", "");