@wix/mcp 1.0.78 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin-standalone.js +43 -9
- package/build/cjs/index.cjs +384 -175
- package/build/cjs/toolkit.cjs +52 -15
- package/build/dts/account-tools/get-profile-tool.d.ts +5 -0
- package/build/dts/account-tools/get-profile-tool.js +49 -0
- package/build/dts/code-mode/index.d.ts +5 -4
- package/build/dts/code-mode/index.js +6 -68
- package/build/dts/config/default-config.d.ts +2 -2
- package/build/dts/config/default-config.js +32 -8
- package/build/dts/index.d.ts +1 -0
- package/build/dts/index.js +1 -0
- package/build/dts/toolkit-entry.d.cts +2 -0
- package/build/dts/toolkit-entry.d.ts +2 -0
- package/build/dts/toolkit.d.ts +2 -0
- package/build/dts/toolkit.js +14 -20
- package/build/esm/index.js +299 -117
- package/build/esm/toolkit.js +52 -15
- package/package.json +3 -2
package/build/esm/index.js
CHANGED
|
@@ -11069,17 +11069,6 @@ var require_axios6 = __commonJS({
|
|
|
11069
11069
|
}
|
|
11070
11070
|
});
|
|
11071
11071
|
|
|
11072
|
-
// ../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js
|
|
11073
|
-
var ConverterType;
|
|
11074
|
-
var init_domain = __esm({
|
|
11075
|
-
"../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js"() {
|
|
11076
|
-
(function(ConverterType2) {
|
|
11077
|
-
ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
|
|
11078
|
-
ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
|
|
11079
|
-
})(ConverterType = ConverterType || (ConverterType = {}));
|
|
11080
|
-
}
|
|
11081
|
-
});
|
|
11082
|
-
|
|
11083
11072
|
// ../../node_modules/@wix/metro-runtime/es/build/serialization/utils.js
|
|
11084
11073
|
function parseLeanSchemaRef(renderedSchemaName = "") {
|
|
11085
11074
|
const [typeOrName, schemaName] = getSchemaNameAndType(renderedSchemaName);
|
|
@@ -11147,24 +11136,27 @@ function resolveDomain(host) {
|
|
|
11147
11136
|
return resolvedHost.replace(REGEX_CAPTURE_DOMAINS, "._base_domain_").replace(REGEX_CAPTURE_API_DOMAINS, "._api_base_domain_").replace(REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN, "*.dev.wix-code.com");
|
|
11148
11137
|
}
|
|
11149
11138
|
function fixHostExceptions(host) {
|
|
11150
|
-
return host
|
|
11139
|
+
return HOST_ALIASES[host] ?? host;
|
|
11151
11140
|
}
|
|
11152
11141
|
function resolveMappingsByDomain(domain, domainToMappings) {
|
|
11153
11142
|
const mappings = domainToMappings[domain];
|
|
11154
11143
|
if (mappings) {
|
|
11155
11144
|
return mappings;
|
|
11156
11145
|
}
|
|
11157
|
-
const
|
|
11158
|
-
if (!
|
|
11146
|
+
const matchedMappings = resolveRootDomain(domain, domainToMappings) ?? resolveWildcardDomain(domain, domainToMappings);
|
|
11147
|
+
if (!matchedMappings) {
|
|
11148
|
+
if (isBaseDomain(domain)) {
|
|
11149
|
+
const wwwMappings = domainToMappings[WWW_BASE_DOMAIN];
|
|
11150
|
+
if (wwwMappings) {
|
|
11151
|
+
return wwwMappings;
|
|
11152
|
+
}
|
|
11153
|
+
}
|
|
11159
11154
|
const userMappings = domainToMappings[USER_DOMAIN];
|
|
11160
11155
|
if (userMappings) {
|
|
11161
11156
|
return userMappings;
|
|
11162
11157
|
}
|
|
11163
|
-
if (isBaseDomain(domain)) {
|
|
11164
|
-
return domainToMappings[wwwBaseDomain];
|
|
11165
|
-
}
|
|
11166
11158
|
}
|
|
11167
|
-
return
|
|
11159
|
+
return matchedMappings ?? [];
|
|
11168
11160
|
}
|
|
11169
11161
|
function resolveRootDomain(domain, domainToMappings) {
|
|
11170
11162
|
return Object.entries(domainToMappings).find(([entryDomain]) => {
|
|
@@ -11172,6 +11164,22 @@ function resolveRootDomain(domain, domainToMappings) {
|
|
|
11172
11164
|
return rooDomainSegments.join(".") === entryDomain;
|
|
11173
11165
|
})?.[1];
|
|
11174
11166
|
}
|
|
11167
|
+
function resolveWildcardDomain(domain, domainToMappings) {
|
|
11168
|
+
const matchingEntries = Object.entries(domainToMappings).filter(([entryDomain]) => matchesWildcardDomain(domain, entryDomain));
|
|
11169
|
+
const [mostSpecificEntry] = matchingEntries.sort(([entryDomainA], [entryDomainB]) => entryDomainB.length - entryDomainA.length);
|
|
11170
|
+
if (!mostSpecificEntry) {
|
|
11171
|
+
return void 0;
|
|
11172
|
+
}
|
|
11173
|
+
const [, mappings] = mostSpecificEntry;
|
|
11174
|
+
return mappings;
|
|
11175
|
+
}
|
|
11176
|
+
function matchesWildcardDomain(domain, entryDomain) {
|
|
11177
|
+
if (!entryDomain.startsWith(WILDCARD_PREFIX)) {
|
|
11178
|
+
return false;
|
|
11179
|
+
}
|
|
11180
|
+
const suffix = entryDomain.slice(WILDCARD_PREFIX.length - 1);
|
|
11181
|
+
return domain.length > suffix.length && domain.endsWith(suffix);
|
|
11182
|
+
}
|
|
11175
11183
|
function resolvePath(protoPath, mappings) {
|
|
11176
11184
|
const mapping = mappings?.find((m2) => protoPath.startsWith(m2.destPath));
|
|
11177
11185
|
if (!mapping) {
|
|
@@ -11182,19 +11190,30 @@ function resolvePath(protoPath, mappings) {
|
|
|
11182
11190
|
function isBaseDomain(domain) {
|
|
11183
11191
|
return !!domain.match(/\._base_domain_$/);
|
|
11184
11192
|
}
|
|
11185
|
-
var USER_DOMAIN, DOMAINS, WIX_API_DOMAINS, DEV_WIX_CODE_DOMAIN, REGEX_CAPTURE_PROTO_FIELD, REGEX_CAPTURE_DOMAINS, REGEX_CAPTURE_API_DOMAINS, REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN
|
|
11193
|
+
var USER_DOMAIN, WWW_BASE_DOMAIN, WILDCARD_PREFIX, DOMAINS, WIX_API_DOMAINS, DEV_WIX_CODE_DOMAIN, HOST_ALIASES, REGEX_CAPTURE_PROTO_FIELD, REGEX_CAPTURE_DOMAINS, REGEX_CAPTURE_API_DOMAINS, REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN;
|
|
11186
11194
|
var init_url_resolver = __esm({
|
|
11187
11195
|
"../../node_modules/@wix/metro-runtime/es/build/url-resolver.js"() {
|
|
11188
11196
|
init_utils2();
|
|
11189
11197
|
USER_DOMAIN = "_";
|
|
11198
|
+
WWW_BASE_DOMAIN = "www._base_domain_";
|
|
11199
|
+
WILDCARD_PREFIX = "*.";
|
|
11190
11200
|
DOMAINS = ["wix.com", "editorx.com"];
|
|
11191
|
-
WIX_API_DOMAINS = [
|
|
11201
|
+
WIX_API_DOMAINS = [
|
|
11202
|
+
"42.wixprod.net",
|
|
11203
|
+
"uw2-edt-1.wixprod.net",
|
|
11204
|
+
"virginia-edt.wixprod.net"
|
|
11205
|
+
];
|
|
11192
11206
|
DEV_WIX_CODE_DOMAIN = "dev.wix-code.com";
|
|
11207
|
+
HOST_ALIASES = {
|
|
11208
|
+
// payments.base44.com runs customised Business Manager, which needs to work exactly the same as normal BM on manage.wix.com
|
|
11209
|
+
"payments.base44.com": "manage.wix.com",
|
|
11210
|
+
// https://system-kb.wixanswers.com/kb/en/article/editorx-domains-matching-to-wixcom
|
|
11211
|
+
"create.editorx.com": "editor.editorx.com"
|
|
11212
|
+
};
|
|
11193
11213
|
REGEX_CAPTURE_PROTO_FIELD = /{(.*)}/;
|
|
11194
11214
|
REGEX_CAPTURE_DOMAINS = new RegExp(`\\.(${DOMAINS.join("|")})$`);
|
|
11195
11215
|
REGEX_CAPTURE_API_DOMAINS = new RegExp(`\\.(${WIX_API_DOMAINS.join("|")})$`);
|
|
11196
11216
|
REGEX_CAPTURE_DEV_WIX_CODE_DOMAIN = new RegExp(`.*\\.${DEV_WIX_CODE_DOMAIN}$`);
|
|
11197
|
-
wwwBaseDomain = "www._base_domain_";
|
|
11198
11217
|
}
|
|
11199
11218
|
});
|
|
11200
11219
|
|
|
@@ -11303,6 +11322,17 @@ var init_build = __esm({
|
|
|
11303
11322
|
}
|
|
11304
11323
|
});
|
|
11305
11324
|
|
|
11325
|
+
// ../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js
|
|
11326
|
+
var ConverterType;
|
|
11327
|
+
var init_domain = __esm({
|
|
11328
|
+
"../../node_modules/@wix/metro-runtime/es/build/serializer/domain.js"() {
|
|
11329
|
+
(function(ConverterType2) {
|
|
11330
|
+
ConverterType2[ConverterType2["TO_JSON"] = 0] = "TO_JSON";
|
|
11331
|
+
ConverterType2[ConverterType2["FROM_JSON"] = 1] = "FROM_JSON";
|
|
11332
|
+
})(ConverterType || (ConverterType = {}));
|
|
11333
|
+
}
|
|
11334
|
+
});
|
|
11335
|
+
|
|
11306
11336
|
// ../../node_modules/@wix/metro-runtime/es/build/serializer/serializer.js
|
|
11307
11337
|
function schemaSerializer(rootSchema, depSchemas = {}, converterSets) {
|
|
11308
11338
|
return function serialize(json = {}, converterType) {
|
|
@@ -30816,7 +30846,7 @@ var DISCOVERY_FLOWS = [
|
|
|
30816
30846
|
"- METHOD CODE EXAMPLE BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() to get method code examples -> call API using CallWixSiteAPI() based on the method code examples",
|
|
30817
30847
|
"- FULL SCHEMA BASED: BrowseWixRESTDocsMenu() or SearchWixRESTDocumentation() -> find relevant method -> read method article using ReadFullDocsArticle() -> no method code examples found -> inspect the method schema using SearchWixAPISpec or ReadFullDocsMethodSchema -> call API using CallWixSiteAPI() based on the schema"
|
|
30818
30848
|
];
|
|
30819
|
-
function buildSystemReminderGuidelines(includeReadme) {
|
|
30849
|
+
function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance) {
|
|
30820
30850
|
const exception = includeReadme ? "**Exception:** " : "";
|
|
30821
30851
|
const lines = [];
|
|
30822
30852
|
if (includeReadme) {
|
|
@@ -30828,9 +30858,13 @@ function buildSystemReminderGuidelines(includeReadme) {
|
|
|
30828
30858
|
);
|
|
30829
30859
|
}
|
|
30830
30860
|
lines.push(
|
|
30831
|
-
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly
|
|
30832
|
-
`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? "WixREADME and " : ""}all docs/schema/API flows \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
30861
|
+
`${exception}If the user asks to list, show, or find their Wix sites, ${includeReadme ? "skip WixREADME and " : ""}call ListWixSites directly.`
|
|
30833
30862
|
);
|
|
30863
|
+
if (includeImageUploadGuidance) {
|
|
30864
|
+
lines.push(
|
|
30865
|
+
`${exception}If the user wants to upload local or attached image files to a Wix site, skip ${includeReadme ? "WixREADME and " : ""}all docs/schema/API flows \u2014 call UploadImageToWixSite directly. Do NOT use ExecuteWixAPI, SearchWixAPISpec, or any Media Manager REST API for image uploads.`
|
|
30866
|
+
);
|
|
30867
|
+
}
|
|
30834
30868
|
if (includeReadme) {
|
|
30835
30869
|
lines.push(
|
|
30836
30870
|
"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."
|
|
@@ -30857,9 +30891,15 @@ function buildSystemReminderFlows(includeReadme) {
|
|
|
30857
30891
|
lines.push(...DISCOVERY_FLOWS);
|
|
30858
30892
|
return lines.join("\n");
|
|
30859
30893
|
}
|
|
30860
|
-
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
30861
|
-
|
|
30862
|
-
|
|
30894
|
+
var SYSTEM_REMINDER_GUIDELINES = buildSystemReminderGuidelines(
|
|
30895
|
+
true,
|
|
30896
|
+
true
|
|
30897
|
+
);
|
|
30898
|
+
function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
|
|
30899
|
+
const guidelines = buildSystemReminderGuidelines(
|
|
30900
|
+
includeReadme,
|
|
30901
|
+
includeImageUploadGuidance
|
|
30902
|
+
);
|
|
30863
30903
|
const flows = buildSystemReminderFlows(includeReadme);
|
|
30864
30904
|
return dedent_default`
|
|
30865
30905
|
<agent-mandatory-instructions>
|
|
@@ -31070,8 +31110,11 @@ var executeWixApiDescription = dedent_default`
|
|
|
31070
31110
|
|
|
31071
31111
|
${EXECUTE_WIX_API_MULTI_SITE_EXAMPLE}
|
|
31072
31112
|
`;
|
|
31073
|
-
function buildToolDescriptions(includeReadme) {
|
|
31074
|
-
const reminder = buildSystemReminder(
|
|
31113
|
+
function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true) {
|
|
31114
|
+
const reminder = buildSystemReminder(
|
|
31115
|
+
includeReadme,
|
|
31116
|
+
includeImageUploadGuidance
|
|
31117
|
+
);
|
|
31075
31118
|
return {
|
|
31076
31119
|
WixREADME: dedent_default`
|
|
31077
31120
|
# Tool: WixREADME
|
|
@@ -31122,6 +31165,7 @@ function buildToolDescriptions(includeReadme) {
|
|
|
31122
31165
|
**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.
|
|
31123
31166
|
${reminder}
|
|
31124
31167
|
`,
|
|
31168
|
+
get_profile: "Returns the authenticated user's email address",
|
|
31125
31169
|
GetSiteContext: dedent_default`
|
|
31126
31170
|
Fetches deep context for a specific Wix site and returns it as structured markdown.
|
|
31127
31171
|
|
|
@@ -31358,7 +31402,27 @@ function buildToolDescriptions(includeReadme) {
|
|
|
31358
31402
|
|
|
31359
31403
|
Your code MUST be an \`async function()\` expression that returns a value.
|
|
31360
31404
|
|
|
31361
|
-
Top-level verticals
|
|
31405
|
+
Top-level verticals and their subcategories. This is a shallow orientation snapshot, NOT the full tree: every subcategory below contains many more resources, and each resource its methods — none of them listed here. Filter lightIndex by menuPath for the complete live tree:
|
|
31406
|
+
wix-apis
|
|
31407
|
+
├── account-level
|
|
31408
|
+
│ └── accounts, ai-credits, b2b-site-management, domains, enterprise, resellers, sites, studio-workspace, user-management
|
|
31409
|
+
├── app-management
|
|
31410
|
+
│ └── app-billing, app-extensions, app-installations, app-instance, app-permissions, app-tools, bi-event, companion-apps, embedded-scripts, market-listing, oauth-2, site-plugins
|
|
31411
|
+
├── assets
|
|
31412
|
+
│ └── media, pro-gallery, rich-content
|
|
31413
|
+
├── business-management
|
|
31414
|
+
│ └── ai-site-chat, analytics, app-installation, async-job, automations, branches, calendar, captcha, cookie-consent-policy, custom-embeds, dashboard, data-extension-schema, faq-app, functions, get-paid, google-business-profile, headless, locations, marketing, multilingual, notifications, online-programs, payments, secrets, seo, site-properties, site-search, site-urls, tags
|
|
31415
|
+
├── business-solutions
|
|
31416
|
+
│ └── benefit-programs, blog, bookings, cms, coupons, donations, e-commerce, events, forum, gift-cards, meetings, portfolio, pricing-plans, restaurants, stores, suppliers-hub
|
|
31417
|
+
├── crm
|
|
31418
|
+
│ └── communication, community, crm, forms, loyalty-program, members-contacts
|
|
31419
|
+
├── mobile
|
|
31420
|
+
│ └── containers-app
|
|
31421
|
+
├── site
|
|
31422
|
+
│ └── accessibility, viewer
|
|
31423
|
+
└── tools
|
|
31424
|
+
└── dynamic-site-context, semantic-search
|
|
31425
|
+
(each leaf above expands into resources → methods; explore via lightIndex, e.g. lightIndex.filter(r => r.menuPath[1] === "e-commerce"))
|
|
31362
31426
|
|
|
31363
31427
|
Important schema guidance:
|
|
31364
31428
|
- For ExecuteWixAPI, ALWAYS use \`method.publicUrl\`. It is the complete, executable \`https://www.wixapis.com/...\` URL for that method. When \`publicUrl\` is present, never build the execution URL by hand and never expose any other field as "the endpoint".
|
|
@@ -34326,6 +34390,192 @@ request id: ${requestId}` : message;
|
|
|
34326
34390
|
);
|
|
34327
34391
|
}
|
|
34328
34392
|
|
|
34393
|
+
// ../../node_modules/@wix/ambassador-identity-account-v1-user/es/build/http.impl.js
|
|
34394
|
+
init_build();
|
|
34395
|
+
init_ambassador_index();
|
|
34396
|
+
init_build();
|
|
34397
|
+
var _getTeamMemberRequest = {};
|
|
34398
|
+
var _getTeamMemberResponse = { user: "_user" };
|
|
34399
|
+
var _user = { joinedAt: "google.protobuf.Timestamp" };
|
|
34400
|
+
function resolveComWixpressAccountApiTeamServiceUrl(opts) {
|
|
34401
|
+
const domainToMappings = {
|
|
34402
|
+
"api._api_base_domain_": [
|
|
34403
|
+
{
|
|
34404
|
+
srcPath: "/account-server",
|
|
34405
|
+
destPath: ""
|
|
34406
|
+
}
|
|
34407
|
+
],
|
|
34408
|
+
"www._base_domain_": [
|
|
34409
|
+
{
|
|
34410
|
+
srcPath: "/_api/account-server",
|
|
34411
|
+
destPath: ""
|
|
34412
|
+
}
|
|
34413
|
+
],
|
|
34414
|
+
"manage._base_domain_": [
|
|
34415
|
+
{
|
|
34416
|
+
srcPath: "/_api/account-server",
|
|
34417
|
+
destPath: ""
|
|
34418
|
+
},
|
|
34419
|
+
{
|
|
34420
|
+
srcPath: "/account-server",
|
|
34421
|
+
destPath: ""
|
|
34422
|
+
}
|
|
34423
|
+
],
|
|
34424
|
+
"premium._base_domain_": [
|
|
34425
|
+
{
|
|
34426
|
+
srcPath: "/_api/account-server",
|
|
34427
|
+
destPath: ""
|
|
34428
|
+
}
|
|
34429
|
+
],
|
|
34430
|
+
"editor._base_domain_": [
|
|
34431
|
+
{
|
|
34432
|
+
srcPath: "/_api/account-server",
|
|
34433
|
+
destPath: ""
|
|
34434
|
+
}
|
|
34435
|
+
],
|
|
34436
|
+
"blocks._base_domain_": [
|
|
34437
|
+
{
|
|
34438
|
+
srcPath: "/_api/account-server",
|
|
34439
|
+
destPath: ""
|
|
34440
|
+
}
|
|
34441
|
+
],
|
|
34442
|
+
"create.editorx": [
|
|
34443
|
+
{
|
|
34444
|
+
srcPath: "/_api/account-server",
|
|
34445
|
+
destPath: ""
|
|
34446
|
+
}
|
|
34447
|
+
],
|
|
34448
|
+
"bo._base_domain_": [
|
|
34449
|
+
{
|
|
34450
|
+
srcPath: "/account-server",
|
|
34451
|
+
destPath: ""
|
|
34452
|
+
}
|
|
34453
|
+
],
|
|
34454
|
+
"wixbo.ai": [
|
|
34455
|
+
{
|
|
34456
|
+
srcPath: "/account-server",
|
|
34457
|
+
destPath: ""
|
|
34458
|
+
}
|
|
34459
|
+
],
|
|
34460
|
+
"wix-bo.com": [
|
|
34461
|
+
{
|
|
34462
|
+
srcPath: "/account-server",
|
|
34463
|
+
destPath: ""
|
|
34464
|
+
}
|
|
34465
|
+
],
|
|
34466
|
+
"www.wixapis.com": [
|
|
34467
|
+
{
|
|
34468
|
+
srcPath: "/accounts",
|
|
34469
|
+
destPath: ""
|
|
34470
|
+
},
|
|
34471
|
+
{
|
|
34472
|
+
srcPath: "/accounts/v1/accounts",
|
|
34473
|
+
destPath: "/v1/accounts"
|
|
34474
|
+
},
|
|
34475
|
+
{
|
|
34476
|
+
srcPath: "/accounts/v1/account",
|
|
34477
|
+
destPath: "/v1/account"
|
|
34478
|
+
}
|
|
34479
|
+
],
|
|
34480
|
+
"users._base_domain_": [
|
|
34481
|
+
{
|
|
34482
|
+
srcPath: "/_api/account-server",
|
|
34483
|
+
destPath: ""
|
|
34484
|
+
}
|
|
34485
|
+
],
|
|
34486
|
+
"*.dev.wix-code.com": [
|
|
34487
|
+
{
|
|
34488
|
+
srcPath: "/_api/account-server",
|
|
34489
|
+
destPath: ""
|
|
34490
|
+
}
|
|
34491
|
+
],
|
|
34492
|
+
"twins._base_domain_": [
|
|
34493
|
+
{
|
|
34494
|
+
srcPath: "/_api/account-server",
|
|
34495
|
+
destPath: ""
|
|
34496
|
+
}
|
|
34497
|
+
]
|
|
34498
|
+
};
|
|
34499
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
34500
|
+
}
|
|
34501
|
+
function getTeamMember(payload) {
|
|
34502
|
+
const { toJSON: toReq, fromJSON: fromReq } = serializer(_getTeamMemberRequest, {});
|
|
34503
|
+
const { fromJSON: fromRes } = serializer(_getTeamMemberResponse, { _user });
|
|
34504
|
+
function __getTeamMember({ host }) {
|
|
34505
|
+
const serializedData = toReq(payload);
|
|
34506
|
+
const metadata = {
|
|
34507
|
+
entityFqdn: "wix.identity.account.v1.user",
|
|
34508
|
+
method: "GET",
|
|
34509
|
+
methodFqn: "com.wixpress.account.api.TeamService.getTeamMember",
|
|
34510
|
+
migrationOptions: {
|
|
34511
|
+
optInTransformResponse: true
|
|
34512
|
+
},
|
|
34513
|
+
url: resolveComWixpressAccountApiTeamServiceUrl({
|
|
34514
|
+
protoPath: "/v1/team/members",
|
|
34515
|
+
data: serializedData,
|
|
34516
|
+
host
|
|
34517
|
+
}),
|
|
34518
|
+
params: toURLSearchParams(serializedData),
|
|
34519
|
+
transformResponse: fromRes
|
|
34520
|
+
};
|
|
34521
|
+
return metadata;
|
|
34522
|
+
}
|
|
34523
|
+
__getTeamMember.fromReq = fromReq;
|
|
34524
|
+
__getTeamMember.__isAmbassador = true;
|
|
34525
|
+
return __getTeamMember;
|
|
34526
|
+
}
|
|
34527
|
+
|
|
34528
|
+
// src/account-tools/get-profile-tool.ts
|
|
34529
|
+
var WIX_APIS_BASE_URL = "https://www.wixapis.com";
|
|
34530
|
+
var GET_PROFILE_TOOL_NAME = "get_profile";
|
|
34531
|
+
function addGetProfileTool(server, authStrategy, disableTools = [], toolDescriptions, toolHints) {
|
|
34532
|
+
if (disableTools.includes(GET_PROFILE_TOOL_NAME)) {
|
|
34533
|
+
return;
|
|
34534
|
+
}
|
|
34535
|
+
const cache = {};
|
|
34536
|
+
const hints = toolHints?.[GET_PROFILE_TOOL_NAME];
|
|
34537
|
+
server.tool(
|
|
34538
|
+
GET_PROFILE_TOOL_NAME,
|
|
34539
|
+
toolDescriptions?.[GET_PROFILE_TOOL_NAME] ?? defaultToolDescriptions[GET_PROFILE_TOOL_NAME],
|
|
34540
|
+
{},
|
|
34541
|
+
{
|
|
34542
|
+
readOnlyHint: hints?.readOnlyHint ?? true,
|
|
34543
|
+
destructiveHint: hints?.destructiveHint ?? false,
|
|
34544
|
+
openWorldHint: hints?.openWorldHint ?? false
|
|
34545
|
+
},
|
|
34546
|
+
async () => {
|
|
34547
|
+
const profilePromise = cache.profilePromise ??= (async () => {
|
|
34548
|
+
const accountAuthHeaders = await authStrategy.getAccountAuthHeaders();
|
|
34549
|
+
const httpClient6 = createHttpClient2({
|
|
34550
|
+
baseURL: WIX_APIS_BASE_URL,
|
|
34551
|
+
headers: accountAuthHeaders
|
|
34552
|
+
});
|
|
34553
|
+
const response = await httpClient6.request(getTeamMember({}));
|
|
34554
|
+
const email2 = response.data.user?.email;
|
|
34555
|
+
if (!email2) {
|
|
34556
|
+
throw new Error("The current Wix user profile has no email address.");
|
|
34557
|
+
}
|
|
34558
|
+
return { email: email2 };
|
|
34559
|
+
})();
|
|
34560
|
+
const profile = await profilePromise.catch(async (error2) => {
|
|
34561
|
+
cache.profilePromise = void 0;
|
|
34562
|
+
rethrowIfUnauthorized(error2);
|
|
34563
|
+
await authStrategy.enforceValidWixToken?.(error2);
|
|
34564
|
+
throw error2;
|
|
34565
|
+
});
|
|
34566
|
+
return {
|
|
34567
|
+
content: [
|
|
34568
|
+
{
|
|
34569
|
+
type: "text",
|
|
34570
|
+
text: profile.email
|
|
34571
|
+
}
|
|
34572
|
+
],
|
|
34573
|
+
structuredContent: profile
|
|
34574
|
+
};
|
|
34575
|
+
}
|
|
34576
|
+
);
|
|
34577
|
+
}
|
|
34578
|
+
|
|
34329
34579
|
// ../../node_modules/@wix/bi-logger-wix-code-data/dist/esm/v2/index.js
|
|
34330
34580
|
function siteCreatedUsingWixMcpSrc39Evid1608(params) {
|
|
34331
34581
|
return { evid: 1608, src: 39, endpoint: "", params };
|
|
@@ -34569,7 +34819,7 @@ function listPublishedSiteUrls(payload) {
|
|
|
34569
34819
|
}
|
|
34570
34820
|
|
|
34571
34821
|
// src/site-widget-tools/utils.ts
|
|
34572
|
-
var
|
|
34822
|
+
var WIX_APIS_BASE_URL2 = "https://www.wixapis.com";
|
|
34573
34823
|
async function publishSite2({
|
|
34574
34824
|
siteAuthorization,
|
|
34575
34825
|
siteId,
|
|
@@ -34579,7 +34829,7 @@ async function publishSite2({
|
|
|
34579
34829
|
Authorization: `Bearer ${siteAuthorization}`,
|
|
34580
34830
|
"wix-site-id": siteId
|
|
34581
34831
|
};
|
|
34582
|
-
const httpClient6 = createHttpClient2({ baseURL:
|
|
34832
|
+
const httpClient6 = createHttpClient2({ baseURL: WIX_APIS_BASE_URL2, headers });
|
|
34583
34833
|
const response = await httpClient6.request(publishSite({}));
|
|
34584
34834
|
if (response.status !== 200) {
|
|
34585
34835
|
console.error(`[publishSite] Failed to publish site for job ${jobId}`, {
|
|
@@ -41476,10 +41726,10 @@ async function buildHarmonySite({
|
|
|
41476
41726
|
}
|
|
41477
41727
|
|
|
41478
41728
|
// src/site-widget-tools/suggested-domain-tool/index.ts
|
|
41479
|
-
var
|
|
41729
|
+
var WIX_APIS_BASE_URL3 = "https://www.wixapis.com";
|
|
41480
41730
|
async function fetchSiteDisplayName(siteAuthorization, siteId) {
|
|
41481
41731
|
const response = await fetch(
|
|
41482
|
-
`${
|
|
41732
|
+
`${WIX_APIS_BASE_URL3}/site-properties/v4/properties`,
|
|
41483
41733
|
{
|
|
41484
41734
|
headers: {
|
|
41485
41735
|
Authorization: siteAuthorization,
|
|
@@ -41603,7 +41853,7 @@ function addSuggestedDomainTool(server, authStrategy) {
|
|
|
41603
41853
|
}
|
|
41604
41854
|
}
|
|
41605
41855
|
const response = await fetch(
|
|
41606
|
-
`${
|
|
41856
|
+
`${WIX_APIS_BASE_URL3}/domain-search/v2/suggest-domains?${params}`,
|
|
41607
41857
|
{
|
|
41608
41858
|
method: "GET",
|
|
41609
41859
|
headers: {
|
|
@@ -42544,7 +42794,7 @@ function getEditorUrls(payload) {
|
|
|
42544
42794
|
}
|
|
42545
42795
|
|
|
42546
42796
|
// src/site-widget-tools/create-site-from-template-tool/index.ts
|
|
42547
|
-
var
|
|
42797
|
+
var WIX_APIS_BASE_URL4 = "https://www.wixapis.com";
|
|
42548
42798
|
var CREATE_SITE_FROM_TEMPLATE_WIDGET_URI = "ui://widget/create-site-from-template.html";
|
|
42549
42799
|
function addCreateSiteFromTemplateTool(server, authStrategy, options) {
|
|
42550
42800
|
const resourceMeta = {
|
|
@@ -42676,7 +42926,7 @@ function addCreateSiteFromTemplateTool(server, authStrategy, options) {
|
|
|
42676
42926
|
}
|
|
42677
42927
|
async function createSiteFromTemplate(templateId, accountHeaders) {
|
|
42678
42928
|
const accountHttpClient = createHttpClient2({
|
|
42679
|
-
baseURL:
|
|
42929
|
+
baseURL: WIX_APIS_BASE_URL4,
|
|
42680
42930
|
headers: accountHeaders
|
|
42681
42931
|
});
|
|
42682
42932
|
const response = await accountHttpClient.request(
|
|
@@ -42712,7 +42962,7 @@ async function publishCreatedSite(siteId, siteHeaders, panorama) {
|
|
|
42712
42962
|
async function fetchEditorUrls(siteId, siteHeaders, panorama) {
|
|
42713
42963
|
try {
|
|
42714
42964
|
const siteHttpClient = createHttpClient2({
|
|
42715
|
-
baseURL:
|
|
42965
|
+
baseURL: WIX_APIS_BASE_URL4,
|
|
42716
42966
|
headers: {
|
|
42717
42967
|
...siteHeaders,
|
|
42718
42968
|
"wix-site-id": siteHeaders["wix-site-id"] ?? siteId
|
|
@@ -45330,16 +45580,7 @@ async function addCodeModeTools(server, options) {
|
|
|
45330
45580
|
toolDescriptions,
|
|
45331
45581
|
maxResponseSize
|
|
45332
45582
|
} = options;
|
|
45333
|
-
|
|
45334
|
-
await addSearchTool(
|
|
45335
|
-
server,
|
|
45336
|
-
codeModeBaseUrl,
|
|
45337
|
-
disableTools,
|
|
45338
|
-
toolDescriptions,
|
|
45339
|
-
maxResponseSize,
|
|
45340
|
-
authStrategy
|
|
45341
|
-
);
|
|
45342
|
-
}
|
|
45583
|
+
addSearchCodeModeTool(server, options);
|
|
45343
45584
|
if (!disableTools.includes(EXECUTE_TOOL_NAME) && authStrategy) {
|
|
45344
45585
|
addExecuteCodeModeTool(server, {
|
|
45345
45586
|
codeModeBaseUrl,
|
|
@@ -45390,69 +45631,6 @@ function addExecuteCodeModeTool(server, options) {
|
|
|
45390
45631
|
maxResponseSize
|
|
45391
45632
|
});
|
|
45392
45633
|
}
|
|
45393
|
-
var CATEGORY_TREE_CODE = `async function() {
|
|
45394
|
-
const tree = {};
|
|
45395
|
-
lightIndex.forEach(r => {
|
|
45396
|
-
const top = r.menuPath[0];
|
|
45397
|
-
const sub = r.menuPath[1];
|
|
45398
|
-
if (!tree[top]) tree[top] = {};
|
|
45399
|
-
if (sub) { if (!tree[top][sub]) tree[top][sub] = 0; tree[top][sub]++; }
|
|
45400
|
-
});
|
|
45401
|
-
return Object.entries(tree).map(([cat, subs]) => {
|
|
45402
|
-
const total = Object.values(subs).reduce((a, b) => a + b, 0);
|
|
45403
|
-
return cat + ' [' + total + ' resources]: ' + Object.keys(subs).join(', ');
|
|
45404
|
-
}).join('\\n');
|
|
45405
|
-
}`;
|
|
45406
|
-
async function fetchCategoryTree(codeModeBaseUrl, authorization3) {
|
|
45407
|
-
try {
|
|
45408
|
-
const resp = await fetch(`${codeModeBaseUrl}/api/code-mode/category-tree`, {
|
|
45409
|
-
headers: authorization3 ? { Authorization: authorization3 } : {}
|
|
45410
|
-
});
|
|
45411
|
-
if (resp.ok) {
|
|
45412
|
-
const data = await resp.json();
|
|
45413
|
-
if (typeof data.result === "string") return data.result;
|
|
45414
|
-
}
|
|
45415
|
-
} catch {
|
|
45416
|
-
}
|
|
45417
|
-
return fetchCategoryTreeViaSearch(
|
|
45418
|
-
`${codeModeBaseUrl}/api/code-mode/search`,
|
|
45419
|
-
authorization3
|
|
45420
|
-
);
|
|
45421
|
-
}
|
|
45422
|
-
async function fetchCategoryTreeViaSearch(searchUrl, authorization3) {
|
|
45423
|
-
try {
|
|
45424
|
-
const resp = await fetch(searchUrl, {
|
|
45425
|
-
method: "POST",
|
|
45426
|
-
headers: {
|
|
45427
|
-
"Content-Type": "application/json",
|
|
45428
|
-
...authorization3 ? { Authorization: authorization3 } : {}
|
|
45429
|
-
},
|
|
45430
|
-
body: JSON.stringify({ code: CATEGORY_TREE_CODE })
|
|
45431
|
-
});
|
|
45432
|
-
if (!resp.ok) return null;
|
|
45433
|
-
const data = await resp.json();
|
|
45434
|
-
return typeof data.result === "string" ? data.result : null;
|
|
45435
|
-
} catch {
|
|
45436
|
-
return null;
|
|
45437
|
-
}
|
|
45438
|
-
}
|
|
45439
|
-
async function addSearchTool(server, codeModeBaseUrl, _disableTools, toolDescriptions, maxResponseSize, authStrategy) {
|
|
45440
|
-
let description = toolDescriptions?.[SEARCH_TOOL_NAME] ?? defaultToolDescriptions.SearchWixAPISpec;
|
|
45441
|
-
const categoryTree = await fetchCategoryTree(
|
|
45442
|
-
codeModeBaseUrl,
|
|
45443
|
-
await resolveLoopbackAuthorization(authStrategy)
|
|
45444
|
-
);
|
|
45445
|
-
if (categoryTree) {
|
|
45446
|
-
description = description.replace(/Top-level verticals:.*$/m, categoryTree);
|
|
45447
|
-
}
|
|
45448
|
-
registerSearchTool(
|
|
45449
|
-
server,
|
|
45450
|
-
codeModeBaseUrl,
|
|
45451
|
-
description,
|
|
45452
|
-
maxResponseSize,
|
|
45453
|
-
authStrategy
|
|
45454
|
-
);
|
|
45455
|
-
}
|
|
45456
45634
|
var SEARCH_MAX_RESPONSE_CHARS = 64e3;
|
|
45457
45635
|
async function resolveLoopbackAuthorization(authStrategy) {
|
|
45458
45636
|
try {
|
|
@@ -45773,13 +45951,13 @@ function createWixToolkit(options) {
|
|
|
45773
45951
|
clientName,
|
|
45774
45952
|
hooks,
|
|
45775
45953
|
conversationId,
|
|
45776
|
-
includeReadmeMentions = false
|
|
45954
|
+
includeReadmeMentions = false,
|
|
45955
|
+
includeImageUploadGuidance = false
|
|
45777
45956
|
} = options;
|
|
45778
45957
|
const authStrategy = normalizeAuth(auth);
|
|
45779
45958
|
const executeWixApiRequested = isExecuteWixApiRequested(api);
|
|
45780
|
-
|
|
45959
|
+
const descriptionsWithoutReadme = buildToolDescriptions(includeReadmeMentions, includeImageUploadGuidance);
|
|
45781
45960
|
if (!includeReadmeMentions) {
|
|
45782
|
-
descriptionsWithoutReadme = buildToolDescriptions(false);
|
|
45783
45961
|
delete descriptionsWithoutReadme.WixREADME;
|
|
45784
45962
|
}
|
|
45785
45963
|
const sessionId = v4_default();
|
|
@@ -45796,13 +45974,16 @@ function createWixToolkit(options) {
|
|
|
45796
45974
|
authStrategy,
|
|
45797
45975
|
dynamicContextEnabled: true,
|
|
45798
45976
|
// README-free defaults first so consumer overrides still win.
|
|
45799
|
-
toolDescriptions:
|
|
45977
|
+
toolDescriptions: {
|
|
45978
|
+
...descriptionsWithoutReadme,
|
|
45979
|
+
...docsOptions.toolDescriptions
|
|
45980
|
+
}
|
|
45800
45981
|
});
|
|
45801
45982
|
} else {
|
|
45802
45983
|
addDocsTools(server, void 0, {
|
|
45803
45984
|
authStrategy,
|
|
45804
45985
|
dynamicContextEnabled: true,
|
|
45805
|
-
|
|
45986
|
+
toolDescriptions: descriptionsWithoutReadme
|
|
45806
45987
|
});
|
|
45807
45988
|
}
|
|
45808
45989
|
if (api) {
|
|
@@ -45815,7 +45996,7 @@ function createWixToolkit(options) {
|
|
|
45815
45996
|
maxResponseSize,
|
|
45816
45997
|
codeModeBaseUrl = "https://mcp.wix.com"
|
|
45817
45998
|
} = api;
|
|
45818
|
-
const effectiveToolDescriptions =
|
|
45999
|
+
const effectiveToolDescriptions = {
|
|
45819
46000
|
...descriptionsWithoutReadme,
|
|
45820
46001
|
...executeWixApiRequested ? executeCodeModeToolDescriptions : {},
|
|
45821
46002
|
...toolDescriptions
|
|
@@ -46065,6 +46246,7 @@ export {
|
|
|
46065
46246
|
addDocsTools,
|
|
46066
46247
|
addEditSiteWidgetTool,
|
|
46067
46248
|
addExecuteCodeModeTool,
|
|
46249
|
+
addGetProfileTool,
|
|
46068
46250
|
addGetWixelAssetTool,
|
|
46069
46251
|
addGetWixelJobStatusTool,
|
|
46070
46252
|
addGetWixelProjectAssetsTool,
|