@productmaker/mcp 11.1.0 → 11.1.1
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/dist/http.js +1835 -929
- package/dist/stdio.js +1824 -918
- package/package.json +1 -1
package/dist/http.js
CHANGED
|
@@ -1435,6 +1435,7 @@ function requireKieImageId(ids, index, label) {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
__name(requireKieImageId, "requireKieImageId");
|
|
1437
1437
|
var KIE_FLARE_IMAGE_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.imageToImage, 1, "flare-imageToImage");
|
|
1438
|
+
var KIE_FLARE_TEXT_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.textToImage, 1, "flare-textToImage");
|
|
1438
1439
|
function canonicalImageModelInput(raw) {
|
|
1439
1440
|
if (raw === void 0) return void 0;
|
|
1440
1441
|
const token = resolveImageToken(raw);
|
|
@@ -6317,6 +6318,7 @@ var BillingRecordInput = z31.object({
|
|
|
6317
6318
|
taskId: z31.string().uuid().optional(),
|
|
6318
6319
|
mixTaskId: z31.string().uuid().optional(),
|
|
6319
6320
|
productResearchRunId: z31.string().uuid().optional(),
|
|
6321
|
+
servicePageId: z31.string().uuid().optional(),
|
|
6320
6322
|
provider: BillingProvider,
|
|
6321
6323
|
label: z31.string().optional(),
|
|
6322
6324
|
units: z31.number().int().nonnegative().optional(),
|
|
@@ -6327,7 +6329,8 @@ var BillingRecordInput = z31.object({
|
|
|
6327
6329
|
const scopedIds = [
|
|
6328
6330
|
value.taskId,
|
|
6329
6331
|
value.mixTaskId,
|
|
6330
|
-
value.productResearchRunId
|
|
6332
|
+
value.productResearchRunId,
|
|
6333
|
+
value.servicePageId
|
|
6331
6334
|
].filter(Boolean);
|
|
6332
6335
|
if (scopedIds.length > 1) {
|
|
6333
6336
|
ctx.addIssue({
|
|
@@ -19983,137 +19986,1040 @@ var StoredLandingDirectorSchema = z89.object({
|
|
|
19983
19986
|
}))
|
|
19984
19987
|
});
|
|
19985
19988
|
|
|
19986
|
-
// ../../packages/types/src/
|
|
19989
|
+
// ../../packages/types/src/service-landing-artifact.ts
|
|
19990
|
+
import { z as z91 } from "zod";
|
|
19991
|
+
|
|
19992
|
+
// ../../packages/types/src/service-landing-primitives.ts
|
|
19987
19993
|
import { z as z90 } from "zod";
|
|
19988
|
-
var
|
|
19994
|
+
var OptionalTextSchema = z90.string().trim().min(1).max(500).optional();
|
|
19995
|
+
var AssetIdSchema = z90.string().uuid().transform((value) => value.toLowerCase());
|
|
19996
|
+
var ServiceLandingPrimaryCtaSchema = z90.object({
|
|
19997
|
+
channelIndex: z90.number().int().nonnegative(),
|
|
19998
|
+
label: z90.string().trim().min(1).max(80)
|
|
19999
|
+
}).strict();
|
|
20000
|
+
|
|
20001
|
+
// ../../packages/types/src/service-landing-artifact.ts
|
|
20002
|
+
var SERVICE_LANDING_SCHEMA_VERSION = 1;
|
|
20003
|
+
var SERVICE_LANDING_CATALOG_VERSION = 1;
|
|
20004
|
+
var SERVICE_LANDING_LAYOUTS = [
|
|
20005
|
+
"editorial",
|
|
20006
|
+
"studio",
|
|
20007
|
+
"professional"
|
|
20008
|
+
];
|
|
20009
|
+
var SERVICE_LANDING_PALETTES = [
|
|
20010
|
+
"light",
|
|
20011
|
+
"dark",
|
|
20012
|
+
"sand",
|
|
20013
|
+
"sage",
|
|
20014
|
+
"ocean"
|
|
20015
|
+
];
|
|
20016
|
+
var SERVICE_LANDING_MOTION = [
|
|
20017
|
+
"none",
|
|
20018
|
+
"fade"
|
|
20019
|
+
];
|
|
20020
|
+
var SERVICE_LANDING_SECTION_VARIANTS = {
|
|
20021
|
+
hero: [
|
|
20022
|
+
"centered",
|
|
20023
|
+
"split"
|
|
20024
|
+
],
|
|
20025
|
+
services: [
|
|
20026
|
+
"cards",
|
|
20027
|
+
"list"
|
|
20028
|
+
],
|
|
20029
|
+
about: [
|
|
20030
|
+
"plain",
|
|
20031
|
+
"split"
|
|
20032
|
+
],
|
|
20033
|
+
faq: [
|
|
20034
|
+
"accordion",
|
|
20035
|
+
"list"
|
|
20036
|
+
],
|
|
20037
|
+
contact: [
|
|
20038
|
+
"card",
|
|
20039
|
+
"banner"
|
|
20040
|
+
]
|
|
20041
|
+
};
|
|
20042
|
+
var SafeTextSchema = z91.string().trim().min(1).max(500);
|
|
20043
|
+
var GlobalPhoneSchema = z91.string().trim().regex(/^\+?[1-9][0-9 ()-]*$/).refine((value) => {
|
|
20044
|
+
const digits = value.replace(/\D/g, "");
|
|
20045
|
+
return digits.length >= 7 && digits.length <= 15;
|
|
20046
|
+
}, "phone must contain between 7 and 15 digits");
|
|
20047
|
+
function isSafePublicServiceLandingUrl(value) {
|
|
20048
|
+
try {
|
|
20049
|
+
const url = new URL(value);
|
|
20050
|
+
const hostname = url.hostname.toLowerCase().replace(/\.$/, "");
|
|
20051
|
+
if (url.protocol !== "https:" && url.protocol !== "http:" || !hostname.includes(".") || url.username || url.password || hostname === "localhost" || hostname.endsWith(".localhost") || hostname.endsWith(".local") || hostname.endsWith(".internal") || hostname.startsWith("[") || /^\d+(?:\.\d+){3}$/.test(hostname)) return false;
|
|
20052
|
+
return hostname.split(".").every((label) => label.length > 0 && label.length <= 63 && /^[a-z0-9-]+$/.test(label) && !label.startsWith("-") && !label.endsWith("-"));
|
|
20053
|
+
} catch {
|
|
20054
|
+
return false;
|
|
20055
|
+
}
|
|
20056
|
+
}
|
|
20057
|
+
__name(isSafePublicServiceLandingUrl, "isSafePublicServiceLandingUrl");
|
|
20058
|
+
var SupportedCurrencies = new Set(Intl.supportedValuesOf("currency"));
|
|
20059
|
+
var CurrencySchema2 = z91.string().regex(/^[A-Z]{3}$/).refine((value) => SupportedCurrencies.has(value), "currency must be a supported ISO 4217 code");
|
|
20060
|
+
var FixedPriceSchema = z91.object({
|
|
20061
|
+
kind: z91.enum([
|
|
20062
|
+
"fixed",
|
|
20063
|
+
"from"
|
|
20064
|
+
]),
|
|
20065
|
+
amountMinor: z91.number().int().nonnegative().safe(),
|
|
20066
|
+
currency: CurrencySchema2
|
|
20067
|
+
}).strict();
|
|
20068
|
+
var RangePriceSchema = z91.object({
|
|
20069
|
+
kind: z91.literal("range"),
|
|
20070
|
+
minMinor: z91.number().int().nonnegative().safe(),
|
|
20071
|
+
maxMinor: z91.number().int().nonnegative().safe(),
|
|
20072
|
+
currency: CurrencySchema2
|
|
20073
|
+
}).strict().superRefine((value, context) => {
|
|
20074
|
+
if (value.minMinor > value.maxMinor) {
|
|
20075
|
+
context.addIssue({
|
|
20076
|
+
code: z91.ZodIssueCode.custom,
|
|
20077
|
+
path: [
|
|
20078
|
+
"maxMinor"
|
|
20079
|
+
],
|
|
20080
|
+
message: "maxMinor must be at least minMinor"
|
|
20081
|
+
});
|
|
20082
|
+
}
|
|
20083
|
+
});
|
|
20084
|
+
var NonAmountPriceSchema = z91.object({
|
|
20085
|
+
kind: z91.enum([
|
|
20086
|
+
"quote",
|
|
20087
|
+
"hidden"
|
|
20088
|
+
])
|
|
20089
|
+
}).strict();
|
|
20090
|
+
var LabelPriceSchema = z91.object({
|
|
20091
|
+
kind: z91.literal("label"),
|
|
20092
|
+
label: z91.string().trim().min(1).max(180)
|
|
20093
|
+
}).strict();
|
|
20094
|
+
var ServiceLandingPriceSchema = z91.union([
|
|
20095
|
+
FixedPriceSchema,
|
|
20096
|
+
RangePriceSchema,
|
|
20097
|
+
NonAmountPriceSchema,
|
|
20098
|
+
LabelPriceSchema
|
|
20099
|
+
]);
|
|
20100
|
+
var WhatsAppChannelSchema = z91.object({
|
|
20101
|
+
kind: z91.literal("whatsapp"),
|
|
20102
|
+
value: GlobalPhoneSchema,
|
|
20103
|
+
label: OptionalTextSchema
|
|
20104
|
+
}).strict();
|
|
20105
|
+
var PhoneChannelSchema = z91.object({
|
|
20106
|
+
kind: z91.literal("phone"),
|
|
20107
|
+
value: GlobalPhoneSchema,
|
|
20108
|
+
label: OptionalTextSchema
|
|
20109
|
+
}).strict();
|
|
20110
|
+
var EmailChannelSchema = z91.object({
|
|
20111
|
+
kind: z91.literal("email"),
|
|
20112
|
+
value: z91.string().trim().email().max(254),
|
|
20113
|
+
label: OptionalTextSchema
|
|
20114
|
+
}).strict();
|
|
20115
|
+
var BookingUrlChannelSchema = z91.object({
|
|
20116
|
+
kind: z91.literal("booking_url"),
|
|
20117
|
+
value: z91.string().trim().url().max(2048).refine((value) => {
|
|
20118
|
+
return isSafePublicServiceLandingUrl(value);
|
|
20119
|
+
}, "booking URL must use a safe public http or https origin"),
|
|
20120
|
+
label: OptionalTextSchema
|
|
20121
|
+
}).strict();
|
|
20122
|
+
var ServiceLandingContactChannelSchema = z91.discriminatedUnion("kind", [
|
|
20123
|
+
WhatsAppChannelSchema,
|
|
20124
|
+
PhoneChannelSchema,
|
|
20125
|
+
EmailChannelSchema,
|
|
20126
|
+
BookingUrlChannelSchema
|
|
20127
|
+
]);
|
|
20128
|
+
var ServiceLandingServiceSchema = z91.object({
|
|
20129
|
+
id: z91.string().uuid(),
|
|
20130
|
+
name: z91.string().trim().min(1).max(120),
|
|
20131
|
+
description: OptionalTextSchema,
|
|
20132
|
+
inclusions: z91.array(z91.string().trim().min(1).max(160)).max(12),
|
|
20133
|
+
price: ServiceLandingPriceSchema
|
|
20134
|
+
}).strict();
|
|
20135
|
+
var HeroSectionSchema = z91.object({
|
|
20136
|
+
type: z91.literal("hero"),
|
|
20137
|
+
variant: z91.enum(SERVICE_LANDING_SECTION_VARIANTS.hero),
|
|
20138
|
+
heading: OptionalTextSchema,
|
|
20139
|
+
summary: OptionalTextSchema,
|
|
20140
|
+
mediaAssetId: AssetIdSchema.optional()
|
|
20141
|
+
}).strict();
|
|
20142
|
+
var ServicesSectionSchema = z91.object({
|
|
20143
|
+
type: z91.literal("services"),
|
|
20144
|
+
variant: z91.enum(SERVICE_LANDING_SECTION_VARIANTS.services),
|
|
20145
|
+
heading: OptionalTextSchema,
|
|
20146
|
+
serviceIds: z91.array(AssetIdSchema).min(1).max(12)
|
|
20147
|
+
}).strict();
|
|
20148
|
+
var AboutSectionSchema = z91.object({
|
|
20149
|
+
type: z91.literal("about"),
|
|
20150
|
+
variant: z91.enum(SERVICE_LANDING_SECTION_VARIANTS.about),
|
|
20151
|
+
heading: OptionalTextSchema,
|
|
20152
|
+
body: SafeTextSchema
|
|
20153
|
+
}).strict();
|
|
20154
|
+
var FaqSectionSchema = z91.object({
|
|
20155
|
+
type: z91.literal("faq"),
|
|
20156
|
+
variant: z91.enum(SERVICE_LANDING_SECTION_VARIANTS.faq),
|
|
20157
|
+
heading: OptionalTextSchema,
|
|
20158
|
+
items: z91.array(z91.object({
|
|
20159
|
+
question: z91.string().trim().min(1).max(180),
|
|
20160
|
+
answer: z91.string().trim().min(1).max(500)
|
|
20161
|
+
}).strict()).min(1).max(8)
|
|
20162
|
+
}).strict();
|
|
20163
|
+
var ContactSectionSchema = z91.object({
|
|
20164
|
+
type: z91.literal("contact"),
|
|
20165
|
+
variant: z91.enum(SERVICE_LANDING_SECTION_VARIANTS.contact),
|
|
20166
|
+
heading: OptionalTextSchema
|
|
20167
|
+
}).strict();
|
|
20168
|
+
var ServiceLandingSectionSchema = z91.discriminatedUnion("type", [
|
|
20169
|
+
HeroSectionSchema,
|
|
20170
|
+
ServicesSectionSchema,
|
|
20171
|
+
AboutSectionSchema,
|
|
20172
|
+
FaqSectionSchema,
|
|
20173
|
+
ContactSectionSchema
|
|
20174
|
+
]);
|
|
20175
|
+
var ServiceLandingThemeSchema = z91.object({
|
|
20176
|
+
layout: z91.enum(SERVICE_LANDING_LAYOUTS),
|
|
20177
|
+
palette: z91.enum(SERVICE_LANDING_PALETTES),
|
|
20178
|
+
motion: z91.enum(SERVICE_LANDING_MOTION),
|
|
20179
|
+
colors: z91.object({
|
|
20180
|
+
primaryColor: z91.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20181
|
+
secondaryColor: z91.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20182
|
+
backgroundColor: z91.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20183
|
+
accentColor: z91.string().regex(/^#[0-9a-fA-F]{6}$/).optional()
|
|
20184
|
+
}).strict().optional()
|
|
20185
|
+
}).strict();
|
|
20186
|
+
var ServiceLandingContactSchema = z91.object({
|
|
20187
|
+
channels: z91.array(ServiceLandingContactChannelSchema).max(4),
|
|
20188
|
+
primaryCta: ServiceLandingPrimaryCtaSchema.optional()
|
|
20189
|
+
}).strict();
|
|
20190
|
+
var ServiceLandingCodeSchema = z91.object({
|
|
20191
|
+
html: z91.string().trim().min(1).max(18e4),
|
|
20192
|
+
css: z91.string().trim().max(1e5).default(""),
|
|
20193
|
+
assetIds: z91.array(AssetIdSchema).max(24)
|
|
20194
|
+
}).strict();
|
|
20195
|
+
function isRecord2(value) {
|
|
20196
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
20197
|
+
}
|
|
20198
|
+
__name(isRecord2, "isRecord");
|
|
20199
|
+
var CODE_ARTIFACT_DEFAULT_THEME = {
|
|
20200
|
+
layout: "studio",
|
|
20201
|
+
palette: "light",
|
|
20202
|
+
motion: "none"
|
|
20203
|
+
};
|
|
20204
|
+
function applyCodeArtifactDefaults(value) {
|
|
20205
|
+
if (!isRecord2(value) || value.code === void 0) return value;
|
|
20206
|
+
const business = isRecord2(value.business) ? value.business : {};
|
|
20207
|
+
const contact = isRecord2(value.contact) ? {
|
|
20208
|
+
...value.contact,
|
|
20209
|
+
...value.contact.channels === void 0 ? {
|
|
20210
|
+
channels: []
|
|
20211
|
+
} : {}
|
|
20212
|
+
} : value.contact === void 0 ? {
|
|
20213
|
+
channels: []
|
|
20214
|
+
} : value.contact;
|
|
20215
|
+
const name = business.name;
|
|
20216
|
+
return {
|
|
20217
|
+
...value,
|
|
20218
|
+
business: {
|
|
20219
|
+
...business,
|
|
20220
|
+
...name === void 0 || typeof name === "string" && name.trim().length === 0 ? {
|
|
20221
|
+
name: "Tu marca"
|
|
20222
|
+
} : {}
|
|
20223
|
+
},
|
|
20224
|
+
theme: value.theme === void 0 ? CODE_ARTIFACT_DEFAULT_THEME : value.theme,
|
|
20225
|
+
services: value.services === void 0 ? [] : value.services,
|
|
20226
|
+
contact,
|
|
20227
|
+
sections: value.sections === void 0 ? [] : value.sections
|
|
20228
|
+
};
|
|
20229
|
+
}
|
|
20230
|
+
__name(applyCodeArtifactDefaults, "applyCodeArtifactDefaults");
|
|
20231
|
+
var ServiceLandingArtifactSchema = z91.preprocess(applyCodeArtifactDefaults, z91.object({
|
|
20232
|
+
schemaVersion: z91.literal(SERVICE_LANDING_SCHEMA_VERSION),
|
|
20233
|
+
catalogVersion: z91.literal(SERVICE_LANDING_CATALOG_VERSION),
|
|
20234
|
+
business: z91.object({
|
|
20235
|
+
name: z91.string().trim().min(1).max(120),
|
|
20236
|
+
description: OptionalTextSchema,
|
|
20237
|
+
/** Server-owned asset id; the renderer resolves it through the page owner. */
|
|
20238
|
+
logoAssetId: AssetIdSchema.optional()
|
|
20239
|
+
}).strict(),
|
|
20240
|
+
theme: ServiceLandingThemeSchema,
|
|
20241
|
+
services: z91.array(ServiceLandingServiceSchema).max(12),
|
|
20242
|
+
contact: ServiceLandingContactSchema,
|
|
20243
|
+
sections: z91.array(ServiceLandingSectionSchema).max(5),
|
|
20244
|
+
/** Complete model-authored body and stylesheet; the public renderer sanitizes both. */
|
|
20245
|
+
code: ServiceLandingCodeSchema.optional()
|
|
20246
|
+
}).strict().superRefine((artifact, context) => {
|
|
20247
|
+
if (artifact.code) {
|
|
20248
|
+
if (artifact.sections.length || new Set(artifact.code.assetIds).size !== artifact.code.assetIds.length) {
|
|
20249
|
+
context.addIssue({
|
|
20250
|
+
code: z91.ZodIssueCode.custom,
|
|
20251
|
+
path: [
|
|
20252
|
+
"code"
|
|
20253
|
+
],
|
|
20254
|
+
message: "Code drafts cannot mix catalog sections or duplicate asset references"
|
|
20255
|
+
});
|
|
20256
|
+
}
|
|
20257
|
+
const ids = artifact.services.map((service) => service.id);
|
|
20258
|
+
if (new Set(ids).size !== ids.length) {
|
|
20259
|
+
context.addIssue({
|
|
20260
|
+
code: z91.ZodIssueCode.custom,
|
|
20261
|
+
path: [
|
|
20262
|
+
"services"
|
|
20263
|
+
],
|
|
20264
|
+
message: "service ids must be unique"
|
|
20265
|
+
});
|
|
20266
|
+
}
|
|
20267
|
+
return;
|
|
20268
|
+
}
|
|
20269
|
+
if (artifact.services.length === 0) {
|
|
20270
|
+
context.addIssue({
|
|
20271
|
+
code: z91.ZodIssueCode.custom,
|
|
20272
|
+
path: [
|
|
20273
|
+
"services"
|
|
20274
|
+
],
|
|
20275
|
+
message: "catalog artifacts require at least one service"
|
|
20276
|
+
});
|
|
20277
|
+
}
|
|
20278
|
+
if (!artifact.contact.primaryCta) {
|
|
20279
|
+
context.addIssue({
|
|
20280
|
+
code: z91.ZodIssueCode.custom,
|
|
20281
|
+
path: [
|
|
20282
|
+
"contact",
|
|
20283
|
+
"primaryCta"
|
|
20284
|
+
],
|
|
20285
|
+
message: "catalog artifacts require a primary CTA"
|
|
20286
|
+
});
|
|
20287
|
+
} else if (artifact.contact.primaryCta.channelIndex >= artifact.contact.channels.length) {
|
|
20288
|
+
context.addIssue({
|
|
20289
|
+
code: z91.ZodIssueCode.custom,
|
|
20290
|
+
path: [
|
|
20291
|
+
"contact",
|
|
20292
|
+
"primaryCta",
|
|
20293
|
+
"channelIndex"
|
|
20294
|
+
],
|
|
20295
|
+
message: "CTA channel does not exist"
|
|
20296
|
+
});
|
|
20297
|
+
}
|
|
20298
|
+
const sectionTypes = artifact.sections.map((section) => section.type);
|
|
20299
|
+
if (new Set(sectionTypes).size !== sectionTypes.length) {
|
|
20300
|
+
context.addIssue({
|
|
20301
|
+
code: z91.ZodIssueCode.custom,
|
|
20302
|
+
path: [
|
|
20303
|
+
"sections"
|
|
20304
|
+
],
|
|
20305
|
+
message: "section types must be unique"
|
|
20306
|
+
});
|
|
20307
|
+
}
|
|
20308
|
+
if (sectionTypes[0] !== "hero") {
|
|
20309
|
+
context.addIssue({
|
|
20310
|
+
code: z91.ZodIssueCode.custom,
|
|
20311
|
+
path: [
|
|
20312
|
+
"sections",
|
|
20313
|
+
0
|
|
20314
|
+
],
|
|
20315
|
+
message: "hero must be the first section"
|
|
20316
|
+
});
|
|
20317
|
+
}
|
|
20318
|
+
if (!sectionTypes.includes("services") || !sectionTypes.includes("contact")) {
|
|
20319
|
+
context.addIssue({
|
|
20320
|
+
code: z91.ZodIssueCode.custom,
|
|
20321
|
+
path: [
|
|
20322
|
+
"sections"
|
|
20323
|
+
],
|
|
20324
|
+
message: "services and contact sections are required"
|
|
20325
|
+
});
|
|
20326
|
+
}
|
|
20327
|
+
const serviceIds = new Set(artifact.services.map((service) => service.id));
|
|
20328
|
+
if (serviceIds.size !== artifact.services.length) {
|
|
20329
|
+
context.addIssue({
|
|
20330
|
+
code: z91.ZodIssueCode.custom,
|
|
20331
|
+
path: [
|
|
20332
|
+
"services"
|
|
20333
|
+
],
|
|
20334
|
+
message: "service ids must be unique"
|
|
20335
|
+
});
|
|
20336
|
+
}
|
|
20337
|
+
for (const [index, section] of artifact.sections.entries()) {
|
|
20338
|
+
if (section.type !== "services") continue;
|
|
20339
|
+
const ids = new Set(section.serviceIds);
|
|
20340
|
+
if (ids.size !== section.serviceIds.length || section.serviceIds.some((id) => !serviceIds.has(id))) {
|
|
20341
|
+
context.addIssue({
|
|
20342
|
+
code: z91.ZodIssueCode.custom,
|
|
20343
|
+
path: [
|
|
20344
|
+
"sections",
|
|
20345
|
+
index,
|
|
20346
|
+
"serviceIds"
|
|
20347
|
+
],
|
|
20348
|
+
message: "service section references must be unique and belong to the artifact"
|
|
20349
|
+
});
|
|
20350
|
+
}
|
|
20351
|
+
}
|
|
20352
|
+
}));
|
|
20353
|
+
|
|
20354
|
+
// ../../packages/types/src/service-landing-facts-brand.ts
|
|
20355
|
+
import { z as z92 } from "zod";
|
|
20356
|
+
var ServiceLandingServiceFactsSchema = z92.object({
|
|
20357
|
+
id: z92.string().uuid(),
|
|
20358
|
+
name: z92.string().trim().min(1).max(120).optional(),
|
|
20359
|
+
description: OptionalTextSchema,
|
|
20360
|
+
inclusions: z92.array(z92.string().trim().min(1).max(160)).max(12).default([]),
|
|
20361
|
+
price: ServiceLandingPriceSchema.optional()
|
|
20362
|
+
}).strict();
|
|
20363
|
+
var ServicePageFactsSchema = z92.object({
|
|
20364
|
+
business: z92.object({
|
|
20365
|
+
name: z92.string().trim().min(1).max(120).optional(),
|
|
20366
|
+
description: OptionalTextSchema,
|
|
20367
|
+
audience: OptionalTextSchema,
|
|
20368
|
+
deliveryMode: z92.enum([
|
|
20369
|
+
"in_person",
|
|
20370
|
+
"remote",
|
|
20371
|
+
"hybrid"
|
|
20372
|
+
]).optional(),
|
|
20373
|
+
coverage: OptionalTextSchema
|
|
20374
|
+
}).strict(),
|
|
20375
|
+
services: z92.array(ServiceLandingServiceFactsSchema).max(12).default([]),
|
|
20376
|
+
contact: z92.object({
|
|
20377
|
+
channels: z92.array(ServiceLandingContactChannelSchema).max(4).default([]),
|
|
20378
|
+
primaryCta: ServiceLandingPrimaryCtaSchema.optional()
|
|
20379
|
+
}).strict(),
|
|
20380
|
+
credentials: z92.array(z92.string().trim().min(1).max(180)).max(12).default([])
|
|
20381
|
+
}).strict();
|
|
20382
|
+
var ServicePageBrandCatalogPriceSchema = ServiceLandingPriceSchema.refine((price) => price.kind === "fixed", "Brand catalog prices must be fixed prices");
|
|
20383
|
+
var ServicePageBrandContextSchema = z92.object({
|
|
20384
|
+
identity: z92.object({
|
|
20385
|
+
name: z92.string().trim().min(1).max(120),
|
|
20386
|
+
oneLiner: z92.string().trim().min(1).max(500).optional(),
|
|
20387
|
+
overview: z92.string().trim().min(1).max(2e3).optional(),
|
|
20388
|
+
aboutParagraph: z92.string().trim().min(1).max(2e3).optional()
|
|
20389
|
+
}).strict(),
|
|
20390
|
+
verbal: z92.object({
|
|
20391
|
+
toneAdjectives: z92.array(z92.string().trim().min(1).max(60)).max(12),
|
|
20392
|
+
coreValues: z92.array(z92.string().trim().min(1).max(120)).max(12),
|
|
20393
|
+
doWords: z92.array(z92.string().trim().min(1).max(40)).max(20),
|
|
20394
|
+
dontWords: z92.array(z92.string().trim().min(1).max(40)).max(20),
|
|
20395
|
+
keyMessages: z92.array(z92.string().trim().min(1).max(200)).max(5)
|
|
20396
|
+
}).strict(),
|
|
20397
|
+
catalog: z92.array(z92.object({
|
|
20398
|
+
name: z92.string().trim().min(1).max(120),
|
|
20399
|
+
price: ServicePageBrandCatalogPriceSchema.optional()
|
|
20400
|
+
}).strict()).max(12).optional(),
|
|
20401
|
+
visual: z92.object({
|
|
20402
|
+
primaryColor: z92.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20403
|
+
secondaryColor: z92.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20404
|
+
tertiaryColor: z92.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20405
|
+
neutralColor: z92.string().regex(/^#[0-9a-fA-F]{6}$/).optional(),
|
|
20406
|
+
accentColors: z92.array(z92.string().regex(/^#[0-9a-fA-F]{6}$/)).max(8),
|
|
20407
|
+
designDirection: z92.enum([
|
|
20408
|
+
"editorial_minimal",
|
|
20409
|
+
"playful_bold",
|
|
20410
|
+
"luxury_serif",
|
|
20411
|
+
"tech_clean",
|
|
20412
|
+
"earthy_organic",
|
|
20413
|
+
"heritage_classic",
|
|
20414
|
+
"neon_futurist",
|
|
20415
|
+
"hand_crafted",
|
|
20416
|
+
"corporate_modern",
|
|
20417
|
+
"streetwear_drop"
|
|
20418
|
+
]).optional(),
|
|
20419
|
+
buttonStyle: z92.enum([
|
|
20420
|
+
"solid_sharp",
|
|
20421
|
+
"solid_rounded",
|
|
20422
|
+
"pill",
|
|
20423
|
+
"outline",
|
|
20424
|
+
"ghost",
|
|
20425
|
+
"underline_only"
|
|
20426
|
+
]).optional(),
|
|
20427
|
+
radiusScale: z92.enum([
|
|
20428
|
+
"none",
|
|
20429
|
+
"subtle",
|
|
20430
|
+
"medium",
|
|
20431
|
+
"large",
|
|
20432
|
+
"pill"
|
|
20433
|
+
]).optional(),
|
|
20434
|
+
photographyStyle: z92.enum([
|
|
20435
|
+
"studio_product",
|
|
20436
|
+
"lifestyle_human",
|
|
20437
|
+
"ugc_raw",
|
|
20438
|
+
"editorial_fashion",
|
|
20439
|
+
"flat_illustration",
|
|
20440
|
+
"mixed"
|
|
20441
|
+
]).optional(),
|
|
20442
|
+
visualAesthetics: z92.array(z92.string().trim().min(1).max(60)).max(20)
|
|
20443
|
+
}).strict()
|
|
20444
|
+
}).strict();
|
|
20445
|
+
var ServicePageStatusSchema = z92.enum([
|
|
20446
|
+
"draft",
|
|
20447
|
+
"published",
|
|
20448
|
+
"unpublished"
|
|
20449
|
+
]);
|
|
20450
|
+
var ServicePageSourceKindSchema = z92.enum([
|
|
20451
|
+
"manual_text",
|
|
20452
|
+
"document",
|
|
20453
|
+
"brand",
|
|
20454
|
+
"instagram",
|
|
20455
|
+
"logo"
|
|
20456
|
+
]);
|
|
20457
|
+
var ServicePageSourceStatusSchema = z92.enum([
|
|
20458
|
+
"received",
|
|
20459
|
+
"reading",
|
|
20460
|
+
"ready",
|
|
20461
|
+
"needs_manual_review",
|
|
20462
|
+
"failed"
|
|
20463
|
+
]);
|
|
20464
|
+
var ServicePageParserMetadataSchema = z92.object({
|
|
20465
|
+
truncated: z92.boolean(),
|
|
20466
|
+
status: z92.enum([
|
|
20467
|
+
"ready",
|
|
20468
|
+
"needs_manual_review"
|
|
20469
|
+
]),
|
|
20470
|
+
locations: z92.array(z92.object({
|
|
20471
|
+
source: z92.string().trim().min(1).max(255),
|
|
20472
|
+
locator: z92.string().trim().min(1).max(120),
|
|
20473
|
+
text: z92.string().max(2e3),
|
|
20474
|
+
line: z92.number().int().positive().optional(),
|
|
20475
|
+
page: z92.number().int().positive().optional(),
|
|
20476
|
+
sheet: z92.string().trim().min(1).max(255).optional(),
|
|
20477
|
+
cell: z92.string().trim().min(1).max(64).optional()
|
|
20478
|
+
}).strict()).max(1e3).optional(),
|
|
20479
|
+
pages: z92.array(z92.object({
|
|
20480
|
+
source: z92.string().trim().min(1).max(255),
|
|
20481
|
+
page: z92.number().int().positive(),
|
|
20482
|
+
locator: z92.string().trim().min(1).max(120)
|
|
20483
|
+
}).strict()).max(50).optional(),
|
|
20484
|
+
sheets: z92.array(z92.object({
|
|
20485
|
+
name: z92.string().trim().min(1).max(255),
|
|
20486
|
+
selected: z92.boolean(),
|
|
20487
|
+
nonEmptyCells: z92.number().int().nonnegative().nullable(),
|
|
20488
|
+
summary: z92.string().max(2e3)
|
|
20489
|
+
}).strict()).max(100).optional(),
|
|
20490
|
+
warnings: z92.array(z92.object({
|
|
20491
|
+
code: z92.enum([
|
|
20492
|
+
"text_truncated",
|
|
20493
|
+
"pdf_scanned",
|
|
20494
|
+
"formula_without_cached_value",
|
|
20495
|
+
"cell_limit_reached",
|
|
20496
|
+
"sheet_selection_applied",
|
|
20497
|
+
"no_sheets_selected",
|
|
20498
|
+
"no_extractable_text",
|
|
20499
|
+
"text_locators_truncated"
|
|
20500
|
+
]),
|
|
20501
|
+
message: z92.string().max(500),
|
|
20502
|
+
source: z92.string().trim().min(1).max(255),
|
|
20503
|
+
page: z92.number().int().positive().optional(),
|
|
20504
|
+
sheet: z92.string().trim().min(1).max(255).optional(),
|
|
20505
|
+
cell: z92.string().trim().min(1).max(64).optional()
|
|
20506
|
+
}).strict()).max(100).optional()
|
|
20507
|
+
}).strict();
|
|
20508
|
+
var ServicePageSourceSchema = z92.object({
|
|
20509
|
+
id: z92.string().uuid(),
|
|
20510
|
+
kind: ServicePageSourceKindSchema,
|
|
20511
|
+
status: ServicePageSourceStatusSchema,
|
|
20512
|
+
displayName: z92.string().trim().min(1).max(180).optional(),
|
|
20513
|
+
extractedCharacterCount: z92.number().int().nonnegative().max(3e4).optional(),
|
|
20514
|
+
errorCode: z92.string().regex(/^[A-Z0-9_]{1,64}$/).optional(),
|
|
20515
|
+
parserMetadata: ServicePageParserMetadataSchema.optional()
|
|
20516
|
+
}).strict();
|
|
20517
|
+
var ServicePageFactConflictSchema = z92.object({
|
|
20518
|
+
fieldPath: z92.string().trim().min(1).max(180),
|
|
20519
|
+
candidates: z92.array(z92.object({
|
|
20520
|
+
id: z92.string().uuid(),
|
|
20521
|
+
value: z92.string().trim().min(1).max(500),
|
|
20522
|
+
sourceIds: z92.array(z92.string().uuid()).min(1).max(10)
|
|
20523
|
+
}).strict()).min(2).max(8)
|
|
20524
|
+
}).strict();
|
|
20525
|
+
var ServicePageFactProvenanceSchema = z92.object({
|
|
20526
|
+
fieldPath: z92.string().trim().min(1).max(180),
|
|
20527
|
+
sourceIds: z92.array(z92.string().uuid()).min(1).max(10),
|
|
20528
|
+
evidence: z92.string().trim().max(1e3).optional()
|
|
20529
|
+
}).strict();
|
|
20530
|
+
var ServicePageFactsReviewSchema = z92.object({
|
|
20531
|
+
facts: ServicePageFactsSchema,
|
|
20532
|
+
sources: z92.array(ServicePageSourceSchema).max(50),
|
|
20533
|
+
provenance: z92.array(ServicePageFactProvenanceSchema).max(100),
|
|
20534
|
+
missingFields: z92.array(z92.string().trim().min(1).max(180)).max(30),
|
|
20535
|
+
conflicts: z92.array(ServicePageFactConflictSchema).max(30),
|
|
20536
|
+
confirmed: z92.boolean(),
|
|
20537
|
+
confirmedAt: z92.string().datetime().optional()
|
|
20538
|
+
}).strict();
|
|
20539
|
+
|
|
20540
|
+
// ../../packages/types/src/service-landing-api.ts
|
|
20541
|
+
import { z as z93 } from "zod";
|
|
20542
|
+
var ServicePageCreateRequestSchema = z93.object({
|
|
20543
|
+
brandId: z93.string().uuid(),
|
|
20544
|
+
includeBrandLogo: z93.boolean().optional(),
|
|
20545
|
+
idempotencyKey: z93.string().uuid().optional()
|
|
20546
|
+
}).strict();
|
|
20547
|
+
var ServicePageFactsUpdateRequestSchema = z93.object({
|
|
20548
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20549
|
+
idempotencyKey: z93.string().uuid(),
|
|
20550
|
+
facts: ServicePageFactsSchema
|
|
20551
|
+
}).strict();
|
|
20552
|
+
var ServicePageFactsConfirmRequestSchema = z93.object({
|
|
20553
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20554
|
+
idempotencyKey: z93.string().uuid(),
|
|
20555
|
+
resolutions: z93.array(z93.object({
|
|
20556
|
+
fieldPath: z93.string().trim().min(1).max(180),
|
|
20557
|
+
candidateId: z93.string().uuid()
|
|
20558
|
+
}).strict()).max(30)
|
|
20559
|
+
}).strict();
|
|
20560
|
+
var ServicePageIntakeRequestSchema = z93.object({
|
|
20561
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20562
|
+
idempotencyKey: z93.string().uuid(),
|
|
20563
|
+
text: z93.string().trim().max(3e4).optional(),
|
|
20564
|
+
profileUrl: z93.string().trim().url().max(2048).refine((value) => {
|
|
20565
|
+
try {
|
|
20566
|
+
const url = new URL(value);
|
|
20567
|
+
const host = url.hostname.toLowerCase().replace(/^www\./, "");
|
|
20568
|
+
return url.protocol === "https:" && [
|
|
20569
|
+
"instagram.com",
|
|
20570
|
+
"instagr.am"
|
|
20571
|
+
].includes(host) && /^\/[A-Za-z0-9._]+\/?$/.test(url.pathname);
|
|
20572
|
+
} catch {
|
|
20573
|
+
return false;
|
|
20574
|
+
}
|
|
20575
|
+
}, "profileUrl must be an HTTPS Instagram profile URL").optional()
|
|
20576
|
+
}).strict();
|
|
20577
|
+
var ServicePageQuotePurposeSchema = z93.enum([
|
|
20578
|
+
"fact_extraction",
|
|
20579
|
+
"generation"
|
|
20580
|
+
]);
|
|
20581
|
+
var ServicePageQuoteRequestSchema = z93.object({
|
|
20582
|
+
expectedRevision: z93.number().int().nonnegative()
|
|
20583
|
+
}).strict();
|
|
20584
|
+
var SERVICE_PAGE_EDIT_INSTRUCTION_MAX_CHARS = 2e3;
|
|
20585
|
+
var SERVICE_PAGE_EDIT_MAX_ATTEMPTS = 4;
|
|
20586
|
+
var SERVICE_PAGE_EDIT_WINDOW_MS = SERVICE_PAGE_EDIT_MAX_ATTEMPTS * 3e5;
|
|
20587
|
+
var SERVICE_PAGE_CHAT_ATTACHMENT_MAX_SELECTION = 4;
|
|
20588
|
+
var ServicePageAttachmentRefSchema = z93.object({
|
|
20589
|
+
kind: z93.enum([
|
|
20590
|
+
"source",
|
|
20591
|
+
"asset"
|
|
20592
|
+
]),
|
|
20593
|
+
id: z93.string().uuid().transform((id) => id.toLowerCase())
|
|
20594
|
+
}).strict();
|
|
20595
|
+
var ServicePageAttachmentRefsSchema = z93.array(ServicePageAttachmentRefSchema).max(SERVICE_PAGE_CHAT_ATTACHMENT_MAX_SELECTION).superRefine((refs, ctx) => {
|
|
20596
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20597
|
+
refs.forEach((ref, index) => {
|
|
20598
|
+
const key = `${ref.kind}:${ref.id}`;
|
|
20599
|
+
if (seen.has(key)) {
|
|
20600
|
+
ctx.addIssue({
|
|
20601
|
+
code: z93.ZodIssueCode.custom,
|
|
20602
|
+
path: [
|
|
20603
|
+
index
|
|
20604
|
+
],
|
|
20605
|
+
message: "Attachment references must be unique."
|
|
20606
|
+
});
|
|
20607
|
+
}
|
|
20608
|
+
seen.add(key);
|
|
20609
|
+
});
|
|
20610
|
+
});
|
|
20611
|
+
var ServicePageChatAttachmentStatusSchema = z93.enum([
|
|
20612
|
+
"ready",
|
|
20613
|
+
"needs_manual_review"
|
|
20614
|
+
]);
|
|
20615
|
+
var ServicePageChatAttachmentSchema = z93.object({
|
|
20616
|
+
ref: ServicePageAttachmentRefSchema,
|
|
20617
|
+
displayName: z93.string().trim().min(1).max(180),
|
|
20618
|
+
mediaType: z93.string().trim().min(1).max(127),
|
|
20619
|
+
status: ServicePageChatAttachmentStatusSchema
|
|
20620
|
+
}).strict();
|
|
20621
|
+
var ServicePageChatAttachmentUploadResponseSchema = z93.object({
|
|
20622
|
+
attachments: z93.array(ServicePageChatAttachmentSchema).min(1).max(10)
|
|
20623
|
+
}).strict();
|
|
20624
|
+
var ServicePageChatAttachmentUploadRequestSchema = z93.object({
|
|
20625
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20626
|
+
idempotencyKey: z93.string().uuid(),
|
|
20627
|
+
profileUrl: z93.string().url().max(2048).optional()
|
|
20628
|
+
}).strict();
|
|
20629
|
+
var ServicePageEditInstructionSchema = z93.string().trim().min(3).max(SERVICE_PAGE_EDIT_INSTRUCTION_MAX_CHARS);
|
|
20630
|
+
var ServicePageEditEstimateRequestSchema = z93.object({
|
|
20631
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20632
|
+
baseCandidateOperationId: z93.string().uuid().transform((id) => id.toLowerCase()).optional(),
|
|
20633
|
+
instruction: ServicePageEditInstructionSchema.optional(),
|
|
20634
|
+
attachmentRefs: ServicePageAttachmentRefsSchema.optional()
|
|
20635
|
+
}).strict();
|
|
20636
|
+
var ServicePageEditEstimateResponseSchema = z93.object({
|
|
20637
|
+
estimatedMinCostCredits: z93.number().int().nonnegative(),
|
|
20638
|
+
estimatedMaxCostCredits: z93.number().int().nonnegative(),
|
|
20639
|
+
maximumAuthorizedCostCredits: z93.number().int().nonnegative(),
|
|
20640
|
+
maximumMediaCostCredits: z93.number().int().nonnegative()
|
|
20641
|
+
}).strict();
|
|
20642
|
+
var ServicePageGenerationQuoteRequestSchema = z93.object({
|
|
20643
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20644
|
+
baseCandidateOperationId: z93.string().uuid().transform((id) => id.toLowerCase()).optional(),
|
|
20645
|
+
instruction: ServicePageEditInstructionSchema.optional(),
|
|
20646
|
+
attachmentRefs: ServicePageAttachmentRefsSchema.optional()
|
|
20647
|
+
}).strict();
|
|
20648
|
+
var ServicePageQuoteResponseSchema = z93.object({
|
|
20649
|
+
quoteId: z93.string().uuid(),
|
|
20650
|
+
purpose: ServicePageQuotePurposeSchema,
|
|
20651
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20652
|
+
requestHash: z93.string().regex(/^[a-f0-9]{64}$/),
|
|
20653
|
+
estimatedCostCents: z93.number().int().nonnegative(),
|
|
20654
|
+
credits: z93.number().int().nonnegative(),
|
|
20655
|
+
estimatedMinCostCredits: z93.number().int().nonnegative().optional(),
|
|
20656
|
+
estimatedMaxCostCredits: z93.number().int().nonnegative().optional(),
|
|
20657
|
+
maximumMediaCostCredits: z93.number().int().nonnegative().optional(),
|
|
20658
|
+
currency: z93.literal("USD"),
|
|
20659
|
+
expiresAt: z93.string().datetime(),
|
|
20660
|
+
requiresConfirmation: z93.literal(true)
|
|
20661
|
+
}).strict();
|
|
20662
|
+
var ServicePageGenerateRequestSchema = z93.object({
|
|
20663
|
+
quoteId: z93.string().uuid(),
|
|
20664
|
+
idempotencyKey: z93.string().uuid(),
|
|
20665
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20666
|
+
baseCandidateOperationId: z93.string().uuid().transform((id) => id.toLowerCase()).optional(),
|
|
20667
|
+
instruction: ServicePageEditInstructionSchema.optional(),
|
|
20668
|
+
attachmentRefs: ServicePageAttachmentRefsSchema.optional()
|
|
20669
|
+
}).strict();
|
|
20670
|
+
var ServicePageFactExtractionRequestSchema = ServicePageGenerateRequestSchema.omit({
|
|
20671
|
+
instruction: true
|
|
20672
|
+
});
|
|
20673
|
+
var ServicePageOperationStatusSchema = z93.enum([
|
|
20674
|
+
"queued",
|
|
20675
|
+
"running",
|
|
20676
|
+
"succeeded",
|
|
20677
|
+
"failed",
|
|
20678
|
+
"conflict",
|
|
20679
|
+
"requires_reconciliation"
|
|
20680
|
+
]);
|
|
20681
|
+
var ServicePageOperationResponseSchema = z93.object({
|
|
20682
|
+
opId: z93.string().uuid(),
|
|
20683
|
+
servicePageId: z93.string().uuid(),
|
|
20684
|
+
kind: z93.enum([
|
|
20685
|
+
"fact_extraction",
|
|
20686
|
+
"generation"
|
|
20687
|
+
]),
|
|
20688
|
+
status: ServicePageOperationStatusSchema,
|
|
20689
|
+
expectedRevision: z93.number().int().nonnegative().optional(),
|
|
20690
|
+
revision: z93.number().int().nonnegative().optional(),
|
|
20691
|
+
candidateCode: ServiceLandingCodeSchema.optional(),
|
|
20692
|
+
candidateFacts: ServicePageFactsSchema.optional(),
|
|
20693
|
+
candidateArtifact: ServiceLandingArtifactSchema.optional(),
|
|
20694
|
+
errorCode: z93.string().regex(/^[A-Z0-9_]{1,64}$/).optional(),
|
|
20695
|
+
recoverable: z93.boolean()
|
|
20696
|
+
}).strict();
|
|
20697
|
+
var ServicePageEditHistoryItemSchema = z93.object({
|
|
20698
|
+
opId: z93.string().uuid(),
|
|
20699
|
+
instruction: ServicePageEditInstructionSchema,
|
|
20700
|
+
status: ServicePageOperationStatusSchema,
|
|
20701
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20702
|
+
resultRevision: z93.number().int().nonnegative().nullable(),
|
|
20703
|
+
createdAt: z93.string().datetime(),
|
|
20704
|
+
completedAt: z93.string().datetime().nullable(),
|
|
20705
|
+
errorCode: z93.string().regex(/^[A-Z0-9_]{1,64}$/).nullable(),
|
|
20706
|
+
attachments: z93.array(z93.object({
|
|
20707
|
+
ref: ServicePageAttachmentRefSchema,
|
|
20708
|
+
displayName: z93.string().trim().min(1).max(180)
|
|
20709
|
+
}).strict()).max(4)
|
|
20710
|
+
}).strict();
|
|
20711
|
+
var ServicePageEditHistorySchema = z93.array(ServicePageEditHistoryItemSchema).max(50).default([]);
|
|
20712
|
+
var ServicePageOperationJobSchema = z93.object({
|
|
20713
|
+
operationId: z93.string().uuid(),
|
|
20714
|
+
servicePageId: z93.string().uuid(),
|
|
20715
|
+
userId: z93.string().min(1).max(256),
|
|
20716
|
+
kind: z93.enum([
|
|
20717
|
+
"fact_extraction",
|
|
20718
|
+
"generation"
|
|
20719
|
+
])
|
|
20720
|
+
}).strict();
|
|
20721
|
+
var ServicePageDraftUpdateRequestSchema = z93.object({
|
|
20722
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20723
|
+
idempotencyKey: z93.string().uuid(),
|
|
20724
|
+
candidateOperationId: z93.string().uuid().transform((id) => id.toLowerCase()).optional(),
|
|
20725
|
+
artifact: ServiceLandingArtifactSchema
|
|
20726
|
+
}).strict();
|
|
20727
|
+
var ServicePagePublishRequestSchema = z93.object({
|
|
20728
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20729
|
+
slug: z93.string().trim().toLowerCase().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
|
|
20730
|
+
idempotencyKey: z93.string().uuid()
|
|
20731
|
+
}).strict();
|
|
20732
|
+
var ServicePageUnpublishRequestSchema = z93.object({
|
|
20733
|
+
publishedRevision: z93.number().int().positive(),
|
|
20734
|
+
idempotencyKey: z93.string().uuid()
|
|
20735
|
+
}).strict();
|
|
20736
|
+
var ServicePageSummarySchema = z93.object({
|
|
20737
|
+
id: z93.string().uuid(),
|
|
20738
|
+
brandId: z93.string().uuid().nullable(),
|
|
20739
|
+
businessName: z93.string().trim().min(1).max(120).nullable(),
|
|
20740
|
+
status: ServicePageStatusSchema,
|
|
20741
|
+
draftRevision: z93.number().int().nonnegative(),
|
|
20742
|
+
publishedRevision: z93.number().int().nonnegative().nullable(),
|
|
20743
|
+
slug: z93.string().nullable(),
|
|
20744
|
+
publicUrl: z93.string().url().nullable(),
|
|
20745
|
+
updatedAt: z93.string().datetime()
|
|
20746
|
+
}).strict();
|
|
20747
|
+
var ServicePagePublicAssetSchema = z93.object({
|
|
20748
|
+
url: z93.string().max(2048).regex(/^\/v1\/service-pages\/(?:public\/[a-z0-9-]+|[0-9a-f-]{36})\/assets\/[0-9a-f-]{36}$/i),
|
|
20749
|
+
mimeType: z93.enum([
|
|
20750
|
+
"image/jpeg",
|
|
20751
|
+
"image/png",
|
|
20752
|
+
"image/webp",
|
|
20753
|
+
"video/mp4"
|
|
20754
|
+
]).optional(),
|
|
20755
|
+
width: z93.number().int().positive().max(12e3),
|
|
20756
|
+
height: z93.number().int().positive().max(12e3),
|
|
20757
|
+
alt: z93.string().trim().min(1).max(180),
|
|
20758
|
+
variants: z93.array(z93.object({
|
|
20759
|
+
url: z93.string().max(2048).regex(/^\/v1\/service-pages\/(?:public\/[a-z0-9-]+|[0-9a-f-]{36})\/assets\/[0-9a-f-]{36}$/i),
|
|
20760
|
+
width: z93.number().int().positive().max(12e3),
|
|
20761
|
+
height: z93.number().int().positive().max(12e3)
|
|
20762
|
+
}).strict()).max(3).optional()
|
|
20763
|
+
}).strict();
|
|
20764
|
+
var ServicePageDetailSchema = ServicePageSummarySchema.extend({
|
|
20765
|
+
facts: ServicePageFactsSchema,
|
|
20766
|
+
sources: z93.array(ServicePageSourceSchema).max(50),
|
|
20767
|
+
provenance: z93.array(ServicePageFactProvenanceSchema).max(100),
|
|
20768
|
+
missingFields: z93.array(z93.string().trim().min(1).max(180)).max(30),
|
|
20769
|
+
conflicts: z93.array(ServicePageFactConflictSchema).max(30),
|
|
20770
|
+
factsConfirmed: z93.boolean(),
|
|
20771
|
+
factsConfirmedAt: z93.string().datetime().nullable(),
|
|
20772
|
+
/** True only after a confirmed source-backed extraction result was persisted. */
|
|
20773
|
+
factExtractionCompleted: z93.boolean(),
|
|
20774
|
+
artifact: ServiceLandingArtifactSchema.nullable(),
|
|
20775
|
+
assetsById: z93.record(AssetIdSchema, ServicePagePublicAssetSchema),
|
|
20776
|
+
editHistory: ServicePageEditHistorySchema
|
|
20777
|
+
}).strict();
|
|
20778
|
+
var ServicePageListResponseSchema = z93.object({
|
|
20779
|
+
pages: z93.array(ServicePageSummarySchema)
|
|
20780
|
+
}).strict();
|
|
20781
|
+
var ServicePageIntakeResponseSchema = z93.object({
|
|
20782
|
+
servicePageId: z93.string().uuid(),
|
|
20783
|
+
draftRevision: z93.number().int().nonnegative(),
|
|
20784
|
+
sources: z93.array(ServicePageSourceSchema).max(50),
|
|
20785
|
+
facts: ServicePageFactsSchema,
|
|
20786
|
+
missingFields: z93.array(z93.string().trim().min(1).max(180)).max(30),
|
|
20787
|
+
conflicts: z93.array(ServicePageFactConflictSchema).max(30),
|
|
20788
|
+
assetsById: z93.record(AssetIdSchema, ServicePagePublicAssetSchema)
|
|
20789
|
+
}).strict();
|
|
20790
|
+
var ServicePagePreviewResponseSchema = z93.object({
|
|
20791
|
+
servicePageId: z93.string().uuid(),
|
|
20792
|
+
revision: z93.number().int().nonnegative(),
|
|
20793
|
+
artifact: ServiceLandingArtifactSchema,
|
|
20794
|
+
assetsById: z93.record(AssetIdSchema, ServicePagePublicAssetSchema)
|
|
20795
|
+
}).strict();
|
|
20796
|
+
var ServicePagePreviewRequestSchema = z93.object({
|
|
20797
|
+
expectedRevision: z93.number().int().nonnegative(),
|
|
20798
|
+
candidateOperationId: z93.string().uuid().optional(),
|
|
20799
|
+
artifact: ServiceLandingArtifactSchema.optional()
|
|
20800
|
+
}).strict().superRefine((request, context) => {
|
|
20801
|
+
if (!request.artifact && !request.candidateOperationId) {
|
|
20802
|
+
context.addIssue({
|
|
20803
|
+
code: z93.ZodIssueCode.custom,
|
|
20804
|
+
message: "Preview requires an artifact or a candidate operation"
|
|
20805
|
+
});
|
|
20806
|
+
}
|
|
20807
|
+
});
|
|
20808
|
+
var ServicePagePublicReadSchema = z93.object({
|
|
20809
|
+
slug: z93.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).max(64),
|
|
20810
|
+
publicUrl: z93.string().url(),
|
|
20811
|
+
canonicalUrl: z93.string().url(),
|
|
20812
|
+
title: z93.string().trim().min(1).max(160),
|
|
20813
|
+
description: z93.string().trim().min(1).max(300),
|
|
20814
|
+
ogImageAssetId: AssetIdSchema.optional(),
|
|
20815
|
+
publishedRevision: z93.number().int().positive(),
|
|
20816
|
+
artifact: ServiceLandingArtifactSchema,
|
|
20817
|
+
assetsById: z93.record(AssetIdSchema, ServicePagePublicAssetSchema)
|
|
20818
|
+
}).strict();
|
|
20819
|
+
|
|
20820
|
+
// ../../packages/types/src/service-landing-analytics.ts
|
|
20821
|
+
import { z as z94 } from "zod";
|
|
20822
|
+
var DimensionsSchema = z94.object({
|
|
20823
|
+
action: z94.enum([
|
|
20824
|
+
"open",
|
|
20825
|
+
"create",
|
|
20826
|
+
"delete",
|
|
20827
|
+
"intake",
|
|
20828
|
+
"extract",
|
|
20829
|
+
"confirm_facts",
|
|
20830
|
+
"generate",
|
|
20831
|
+
"recover",
|
|
20832
|
+
"save",
|
|
20833
|
+
"publish",
|
|
20834
|
+
"unpublish",
|
|
20835
|
+
"preview",
|
|
20836
|
+
"change_design",
|
|
20837
|
+
"contact_click"
|
|
20838
|
+
]),
|
|
20839
|
+
stage: z94.enum([
|
|
20840
|
+
"intake",
|
|
20841
|
+
"review",
|
|
20842
|
+
"generation",
|
|
20843
|
+
"editor",
|
|
20844
|
+
"publication",
|
|
20845
|
+
"public"
|
|
20846
|
+
]),
|
|
20847
|
+
brandPresence: z94.enum([
|
|
20848
|
+
"none",
|
|
20849
|
+
"selected"
|
|
20850
|
+
]),
|
|
20851
|
+
sourceKind: z94.enum([
|
|
20852
|
+
"none",
|
|
20853
|
+
"manual",
|
|
20854
|
+
"brand",
|
|
20855
|
+
"documents",
|
|
20856
|
+
"photos",
|
|
20857
|
+
"instagram",
|
|
20858
|
+
"mixed"
|
|
20859
|
+
]),
|
|
20860
|
+
// Closed tool choice only; prompts, provider IDs and business inputs stay private.
|
|
20861
|
+
mediaKind: z94.enum([
|
|
20862
|
+
"none",
|
|
20863
|
+
"images",
|
|
20864
|
+
"videos",
|
|
20865
|
+
"mixed"
|
|
20866
|
+
]).optional()
|
|
20867
|
+
});
|
|
20868
|
+
var ReasonSchema = z94.enum([
|
|
20869
|
+
"validation",
|
|
20870
|
+
"not_found",
|
|
20871
|
+
"conflict",
|
|
20872
|
+
"quote_expired",
|
|
20873
|
+
"credits",
|
|
20874
|
+
"provider",
|
|
20875
|
+
"network",
|
|
20876
|
+
"unknown"
|
|
20877
|
+
]);
|
|
20878
|
+
var SignalSchema = z94.discriminatedUnion("kind", [
|
|
20879
|
+
DimensionsSchema.extend({
|
|
20880
|
+
kind: z94.enum([
|
|
20881
|
+
"started",
|
|
20882
|
+
"completed",
|
|
20883
|
+
"variant"
|
|
20884
|
+
])
|
|
20885
|
+
}),
|
|
20886
|
+
DimensionsSchema.extend({
|
|
20887
|
+
kind: z94.literal("failed"),
|
|
20888
|
+
reason: ReasonSchema
|
|
20889
|
+
})
|
|
20890
|
+
]);
|
|
20891
|
+
|
|
20892
|
+
// ../../packages/types/src/flight-recorder.ts
|
|
20893
|
+
import { z as z95 } from "zod";
|
|
20894
|
+
var FlightRecorderGenerationTypeSchema = z95.enum([
|
|
19989
20895
|
"initial",
|
|
19990
20896
|
"regeneration",
|
|
19991
20897
|
"edit",
|
|
19992
20898
|
"retry"
|
|
19993
20899
|
]);
|
|
19994
|
-
var FlightRecorderProviderSchema =
|
|
20900
|
+
var FlightRecorderProviderSchema = z95.enum([
|
|
19995
20901
|
"kie",
|
|
19996
20902
|
"fal"
|
|
19997
20903
|
]);
|
|
19998
|
-
var FlightRecorderElementSchema =
|
|
19999
|
-
name:
|
|
20000
|
-
description:
|
|
20001
|
-
frontalImageUrl:
|
|
20002
|
-
referenceImageUrls:
|
|
20003
|
-
videoUrl:
|
|
20004
|
-
});
|
|
20005
|
-
var FlightRecorderDistillationSchema =
|
|
20006
|
-
actorGender: CreativeGenderPin.or(
|
|
20007
|
-
voiceId:
|
|
20008
|
-
cameraMotion:
|
|
20009
|
-
}).catchall(
|
|
20010
|
-
var FlightRecorderEntrySchema =
|
|
20011
|
-
schemaVersion:
|
|
20012
|
-
id:
|
|
20013
|
-
taskId:
|
|
20014
|
-
runId:
|
|
20015
|
-
sequence:
|
|
20016
|
-
timestamp:
|
|
20017
|
-
provider: FlightRecorderProviderSchema.or(
|
|
20018
|
-
model:
|
|
20019
|
-
prompt:
|
|
20020
|
-
durationSeconds:
|
|
20021
|
-
aspectRatio:
|
|
20022
|
-
resolution:
|
|
20023
|
-
startImageUrl:
|
|
20024
|
-
endImageUrl:
|
|
20025
|
-
generateAudio:
|
|
20904
|
+
var FlightRecorderElementSchema = z95.object({
|
|
20905
|
+
name: z95.string().optional(),
|
|
20906
|
+
description: z95.string().optional(),
|
|
20907
|
+
frontalImageUrl: z95.string().optional(),
|
|
20908
|
+
referenceImageUrls: z95.array(z95.string()).optional(),
|
|
20909
|
+
videoUrl: z95.string().optional()
|
|
20910
|
+
});
|
|
20911
|
+
var FlightRecorderDistillationSchema = z95.object({
|
|
20912
|
+
actorGender: CreativeGenderPin.or(z95.string()).optional(),
|
|
20913
|
+
voiceId: z95.string().optional(),
|
|
20914
|
+
cameraMotion: z95.string().optional()
|
|
20915
|
+
}).catchall(z95.unknown());
|
|
20916
|
+
var FlightRecorderEntrySchema = z95.object({
|
|
20917
|
+
schemaVersion: z95.literal(1).optional(),
|
|
20918
|
+
id: z95.string().min(1),
|
|
20919
|
+
taskId: z95.string().min(1),
|
|
20920
|
+
runId: z95.string().min(1),
|
|
20921
|
+
sequence: z95.number().int().nonnegative(),
|
|
20922
|
+
timestamp: z95.string().min(1),
|
|
20923
|
+
provider: FlightRecorderProviderSchema.or(z95.string()),
|
|
20924
|
+
model: z95.string().min(1),
|
|
20925
|
+
prompt: z95.string(),
|
|
20926
|
+
durationSeconds: z95.number().nonnegative(),
|
|
20927
|
+
aspectRatio: z95.string().optional(),
|
|
20928
|
+
resolution: z95.string().optional(),
|
|
20929
|
+
startImageUrl: z95.string().optional(),
|
|
20930
|
+
endImageUrl: z95.string().optional(),
|
|
20931
|
+
generateAudio: z95.boolean().optional(),
|
|
20026
20932
|
// Correlation & pipeline metadata
|
|
20027
|
-
angleKey:
|
|
20028
|
-
sceneIndex:
|
|
20933
|
+
angleKey: z95.string().optional(),
|
|
20934
|
+
sceneIndex: z95.number().int().nonnegative().optional(),
|
|
20029
20935
|
generationType: FlightRecorderGenerationTypeSchema,
|
|
20030
|
-
operationId:
|
|
20031
|
-
revisionId:
|
|
20032
|
-
attemptNumber:
|
|
20936
|
+
operationId: z95.string().min(1).optional(),
|
|
20937
|
+
revisionId: z95.string().min(1).optional(),
|
|
20938
|
+
attemptNumber: z95.number().int().nonnegative().default(1),
|
|
20033
20939
|
// Elements & Distillation
|
|
20034
|
-
elements:
|
|
20940
|
+
elements: z95.array(FlightRecorderElementSchema).optional(),
|
|
20035
20941
|
distillation: FlightRecorderDistillationSchema.optional(),
|
|
20036
20942
|
// Raw payload (sanitized of secrets)
|
|
20037
|
-
rawPayload:
|
|
20943
|
+
rawPayload: z95.record(z95.unknown())
|
|
20038
20944
|
});
|
|
20039
|
-
var FlightRecorderQuerySchema =
|
|
20040
|
-
taskId:
|
|
20041
|
-
runId:
|
|
20042
|
-
sceneIndex:
|
|
20043
|
-
angleKey:
|
|
20945
|
+
var FlightRecorderQuerySchema = z95.object({
|
|
20946
|
+
taskId: z95.string().min(1),
|
|
20947
|
+
runId: z95.string().optional(),
|
|
20948
|
+
sceneIndex: z95.number().int().nonnegative().optional(),
|
|
20949
|
+
angleKey: z95.string().optional(),
|
|
20044
20950
|
generationType: FlightRecorderGenerationTypeSchema.optional(),
|
|
20045
|
-
cursor:
|
|
20046
|
-
limit:
|
|
20951
|
+
cursor: z95.number().int().nonnegative().optional(),
|
|
20952
|
+
limit: z95.number().int().positive().optional()
|
|
20047
20953
|
});
|
|
20048
|
-
var FlightRecorderResponseSchema =
|
|
20049
|
-
taskId:
|
|
20050
|
-
runId:
|
|
20051
|
-
entries:
|
|
20954
|
+
var FlightRecorderResponseSchema = z95.object({
|
|
20955
|
+
taskId: z95.string().min(1),
|
|
20956
|
+
runId: z95.string().min(1),
|
|
20957
|
+
entries: z95.array(FlightRecorderEntrySchema),
|
|
20052
20958
|
lastCall: FlightRecorderEntrySchema.nullable(),
|
|
20053
|
-
count:
|
|
20054
|
-
nextCursor:
|
|
20959
|
+
count: z95.number().int().nonnegative(),
|
|
20960
|
+
nextCursor: z95.number().int().nonnegative().nullable()
|
|
20055
20961
|
});
|
|
20056
20962
|
|
|
20057
20963
|
// ../../packages/types/src/video-script-requests.ts
|
|
20058
|
-
import { z as
|
|
20059
|
-
var ApproveVideoScriptSceneEdit =
|
|
20060
|
-
index:
|
|
20061
|
-
dialogue:
|
|
20964
|
+
import { z as z96 } from "zod";
|
|
20965
|
+
var ApproveVideoScriptSceneEdit = z96.object({
|
|
20966
|
+
index: z96.number().int().nonnegative().describe("\xCDndice de la escena (0-based, mismo que devuelve get_video_script)."),
|
|
20967
|
+
dialogue: z96.string().trim().max(VIDEO_SCRIPT_APPROVAL_MAX_DIALOGUE_CHARS).describe('Di\xE1logo final de la escena. Puede ser el original sin cambios o la edici\xF3n del usuario. Vac\xEDo ("") s\xF3lo es v\xE1lido en escenas silenciosas por dise\xF1o (productOnly o \xE1ngulos winner-copy); en una escena hablada el backend lo rechaza con 400.')
|
|
20062
20968
|
}).strict();
|
|
20063
|
-
var ApproveVideoScriptCapabilityRequest =
|
|
20064
|
-
taskId:
|
|
20065
|
-
angleKey:
|
|
20066
|
-
scenes:
|
|
20969
|
+
var ApproveVideoScriptCapabilityRequest = z96.object({
|
|
20970
|
+
taskId: z96.string().min(1).describe("ID de la tarea."),
|
|
20971
|
+
angleKey: z96.string().trim().min(1).max(120).optional().describe('Mismo angleKey usado en get_video_script. REQUERIDO en multi-angle (si se omite el backend resuelve a "angle_0" literal). En single-angle puede omitirse.'),
|
|
20972
|
+
scenes: z96.array(ApproveVideoScriptSceneEdit).min(1).max(VIDEO_SCRIPT_APPROVAL_MAX_SCENES).describe("Escenas con los di\xE1logos finales. El backend mergea por `index` \u2014 las escenas NO incluidas conservan el di\xE1logo original. Debe haber entre 1 y 50 entradas. Para cada entrada que mandes con un dialogue distinto del original, el backend valida minWords \u2264 words \u2264 maxWords y rechaza con 400 si te sales del rango.")
|
|
20067
20973
|
}).strict();
|
|
20068
20974
|
var REGENERATE_VIDEO_SCRIPT_NARRATIVE_STYLE_DESCRIPTION = 'Narrativa para el nuevo guion. Incluye valores hist\xF3ricos porque esta herramienta tambi\xE9n regenera tareas antiguas. REQUERIDO \u2014 el backend NO acepta "mantener la actual"; siempre tienes que elegir una. Si el usuario quiere re-rolear con la misma narrativa, pasa la que ya tiene el \xE1ngulo (la ves en get_video_script o en get_task_status).';
|
|
20069
|
-
var RegenerateVideoScriptCapabilityRequest =
|
|
20070
|
-
taskId:
|
|
20071
|
-
angleKey:
|
|
20975
|
+
var RegenerateVideoScriptCapabilityRequest = z96.object({
|
|
20976
|
+
taskId: z96.string().min(1).describe("ID de la tarea."),
|
|
20977
|
+
angleKey: z96.string().min(1).describe('Clave del \xE1ngulo a regenerar. Single-angle: pasa "angle_0". Multi-angle: el mismo que devuelve get_video_script. NO se puede omitir \u2014 el backend lo exige siempre.'),
|
|
20072
20978
|
narrativeStyle: NarrativeStyle.describe(REGENERATE_VIDEO_SCRIPT_NARRATIVE_STYLE_DESCRIPTION),
|
|
20073
|
-
narrativeSelection:
|
|
20979
|
+
narrativeSelection: z96.enum([
|
|
20074
20980
|
"market",
|
|
20075
20981
|
"guided"
|
|
20076
20982
|
]).optional().describe("Elecci\xF3n expl\xEDcita del usuario: market usa el estudio de mercado disponible; guided usa la narrativa elegida. Omitir conserva el comportamiento existente.")
|
|
20077
20983
|
}).strict();
|
|
20078
20984
|
|
|
20079
20985
|
// ../../packages/types/src/classic-landing-delivery.ts
|
|
20080
|
-
import { z as
|
|
20081
|
-
var Url =
|
|
20986
|
+
import { z as z97 } from "zod";
|
|
20987
|
+
var Url = z97.string().url().refine((value) => {
|
|
20082
20988
|
const url = new URL(value);
|
|
20083
20989
|
return [
|
|
20084
20990
|
"https:",
|
|
20085
20991
|
"http:"
|
|
20086
20992
|
].includes(url.protocol) && !url.username && !url.password;
|
|
20087
20993
|
}, "Invalid owned asset URL");
|
|
20088
|
-
var ClassicLandingAssetBlockSchema =
|
|
20089
|
-
|
|
20090
|
-
kind:
|
|
20091
|
-
ownerTaskId:
|
|
20092
|
-
sourceIndex:
|
|
20093
|
-
variantIndex:
|
|
20994
|
+
var ClassicLandingAssetBlockSchema = z97.discriminatedUnion("kind", [
|
|
20995
|
+
z97.object({
|
|
20996
|
+
kind: z97.literal("image"),
|
|
20997
|
+
ownerTaskId: z97.string().uuid(),
|
|
20998
|
+
sourceIndex: z97.number().int().positive(),
|
|
20999
|
+
variantIndex: z97.number().int().nonnegative(),
|
|
20094
21000
|
url: Url,
|
|
20095
|
-
role:
|
|
20096
|
-
width:
|
|
20097
|
-
height:
|
|
21001
|
+
role: z97.string(),
|
|
21002
|
+
width: z97.number().positive().optional(),
|
|
21003
|
+
height: z97.number().positive().optional()
|
|
20098
21004
|
}).strict(),
|
|
20099
|
-
|
|
20100
|
-
kind:
|
|
20101
|
-
ownerTaskId:
|
|
20102
|
-
gifId:
|
|
20103
|
-
gifRevision:
|
|
21005
|
+
z97.object({
|
|
21006
|
+
kind: z97.literal("gif"),
|
|
21007
|
+
ownerTaskId: z97.string().uuid(),
|
|
21008
|
+
gifId: z97.string().uuid(),
|
|
21009
|
+
gifRevision: z97.number().int().nonnegative(),
|
|
20104
21010
|
demo: LandingGifReadableSchema,
|
|
20105
|
-
historicalDelivery:
|
|
21011
|
+
historicalDelivery: z97.literal(true).optional()
|
|
20106
21012
|
}).strict()
|
|
20107
21013
|
]);
|
|
20108
|
-
var PublishedClassicLandingSchema =
|
|
20109
|
-
version:
|
|
20110
|
-
ownerTaskId:
|
|
20111
|
-
documentRevision:
|
|
20112
|
-
ownerRevisions:
|
|
20113
|
-
ownerTaskId:
|
|
20114
|
-
landingRevision:
|
|
21014
|
+
var PublishedClassicLandingSchema = z97.object({
|
|
21015
|
+
version: z97.literal(1),
|
|
21016
|
+
ownerTaskId: z97.string().uuid(),
|
|
21017
|
+
documentRevision: z97.number().int().nonnegative(),
|
|
21018
|
+
ownerRevisions: z97.array(z97.object({
|
|
21019
|
+
ownerTaskId: z97.string().uuid(),
|
|
21020
|
+
landingRevision: z97.number().int().nonnegative()
|
|
20115
21021
|
}).strict()).max(100),
|
|
20116
|
-
blocks:
|
|
21022
|
+
blocks: z97.array(ClassicLandingAssetBlockSchema).max(100)
|
|
20117
21023
|
}).strict().superRefine((snapshot, ctx) => {
|
|
20118
21024
|
const expectedOwners = /* @__PURE__ */ new Set([
|
|
20119
21025
|
snapshot.ownerTaskId,
|
|
@@ -20121,14 +21027,14 @@ var PublishedClassicLandingSchema = z92.object({
|
|
|
20121
21027
|
]);
|
|
20122
21028
|
const owners = snapshot.ownerRevisions.map((owner) => owner.ownerTaskId);
|
|
20123
21029
|
if (new Set(owners).size !== owners.length || owners.length !== expectedOwners.size || owners.some((owner) => !expectedOwners.has(owner))) ctx.addIssue({
|
|
20124
|
-
code:
|
|
21030
|
+
code: z97.ZodIssueCode.custom,
|
|
20125
21031
|
path: [
|
|
20126
21032
|
"ownerRevisions"
|
|
20127
21033
|
],
|
|
20128
21034
|
message: "Every published owner requires one revision fence"
|
|
20129
21035
|
});
|
|
20130
21036
|
if (snapshot.blocks.filter((block) => block.kind === "image").length > 20) ctx.addIssue({
|
|
20131
|
-
code:
|
|
21037
|
+
code: z97.ZodIssueCode.custom,
|
|
20132
21038
|
path: [
|
|
20133
21039
|
"blocks"
|
|
20134
21040
|
],
|
|
@@ -20138,7 +21044,7 @@ var PublishedClassicLandingSchema = z92.object({
|
|
|
20138
21044
|
for (const block of snapshot.blocks) {
|
|
20139
21045
|
const id = block.kind === "gif" ? `gif:${block.gifId}` : `image:${block.ownerTaskId}:${block.sourceIndex}`;
|
|
20140
21046
|
if (ids.has(id)) ctx.addIssue({
|
|
20141
|
-
code:
|
|
21047
|
+
code: z97.ZodIssueCode.custom,
|
|
20142
21048
|
message: "Duplicate published block"
|
|
20143
21049
|
});
|
|
20144
21050
|
ids.add(id);
|
|
@@ -20146,86 +21052,86 @@ var PublishedClassicLandingSchema = z92.object({
|
|
|
20146
21052
|
...block,
|
|
20147
21053
|
state: "ready"
|
|
20148
21054
|
}))) ctx.addIssue({
|
|
20149
|
-
code:
|
|
21055
|
+
code: z97.ZodIssueCode.custom,
|
|
20150
21056
|
message: "Invalid published GIF"
|
|
20151
21057
|
});
|
|
20152
21058
|
}
|
|
20153
21059
|
});
|
|
20154
21060
|
|
|
20155
21061
|
// ../../packages/types/src/dropi-financial.ts
|
|
20156
|
-
import { z as
|
|
20157
|
-
var DropiCountrySchema =
|
|
20158
|
-
var DropiCountryQuerySchema =
|
|
21062
|
+
import { z as z98 } from "zod";
|
|
21063
|
+
var DropiCountrySchema = z98.enum(DROPI_COUNTRY_CODES);
|
|
21064
|
+
var DropiCountryQuerySchema = z98.object({
|
|
20159
21065
|
countryCode: DropiCountrySchema.default("CO")
|
|
20160
21066
|
}).strict();
|
|
20161
|
-
var ConnectDropiFinancialSchema =
|
|
21067
|
+
var ConnectDropiFinancialSchema = z98.object({
|
|
20162
21068
|
countryCode: DropiCountrySchema.default("CO"),
|
|
20163
|
-
integrationKey:
|
|
21069
|
+
integrationKey: z98.string().trim().min(1).max(4096).regex(/^[\x21-\x7e]+$/)
|
|
20164
21070
|
}).strict();
|
|
20165
|
-
var SyncDropiFinancialSchema =
|
|
21071
|
+
var SyncDropiFinancialSchema = z98.object({
|
|
20166
21072
|
countryCode: DropiCountrySchema.optional(),
|
|
20167
|
-
operationId:
|
|
20168
|
-
since:
|
|
20169
|
-
until:
|
|
21073
|
+
operationId: z98.string().uuid().optional(),
|
|
21074
|
+
since: z98.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
|
|
21075
|
+
until: z98.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
|
|
20170
21076
|
}).strict();
|
|
20171
|
-
var connectionCountries =
|
|
20172
|
-
var DropiFinancialConnectionsSchema =
|
|
21077
|
+
var connectionCountries = z98.array(DropiCountrySchema).max(DROPI_COUNTRY_CODES.length).refine((countries) => new Set(countries).size === countries.length);
|
|
21078
|
+
var DropiFinancialConnectionsSchema = z98.object({
|
|
20173
21079
|
connectedCountries: connectionCountries,
|
|
20174
21080
|
/** Effective connect availability after flags, proxy and scoped-identity readiness. */
|
|
20175
21081
|
enabledCountries: connectionCountries
|
|
20176
21082
|
}).strict();
|
|
20177
|
-
var DropiFinancialStatusSchema =
|
|
20178
|
-
enabled:
|
|
20179
|
-
connected:
|
|
21083
|
+
var DropiFinancialStatusSchema = z98.object({
|
|
21084
|
+
enabled: z98.boolean(),
|
|
21085
|
+
connected: z98.boolean(),
|
|
20180
21086
|
countryCode: DropiCountrySchema,
|
|
20181
21087
|
/** Configured environment allowlist; selected-country availability is `enabled`. */
|
|
20182
|
-
enabledCountries:
|
|
20183
|
-
environment:
|
|
21088
|
+
enabledCountries: z98.array(DropiCountrySchema).optional(),
|
|
21089
|
+
environment: z98.enum([
|
|
20184
21090
|
"sandbox",
|
|
20185
21091
|
"production"
|
|
20186
21092
|
]),
|
|
20187
|
-
lastSyncAt:
|
|
20188
|
-
lastError:
|
|
20189
|
-
historyNext:
|
|
20190
|
-
historyUntil:
|
|
20191
|
-
changesThrough:
|
|
20192
|
-
manualNext:
|
|
20193
|
-
manual:
|
|
20194
|
-
since:
|
|
20195
|
-
until:
|
|
20196
|
-
next:
|
|
21093
|
+
lastSyncAt: z98.string().nullable(),
|
|
21094
|
+
lastError: z98.string().nullable(),
|
|
21095
|
+
historyNext: z98.string().nullable(),
|
|
21096
|
+
historyUntil: z98.string().nullable(),
|
|
21097
|
+
changesThrough: z98.string().nullable(),
|
|
21098
|
+
manualNext: z98.string().nullable(),
|
|
21099
|
+
manual: z98.object({
|
|
21100
|
+
since: z98.string(),
|
|
21101
|
+
until: z98.string(),
|
|
21102
|
+
next: z98.string().nullable()
|
|
20197
21103
|
}).nullable(),
|
|
20198
|
-
retentionSince:
|
|
20199
|
-
});
|
|
20200
|
-
var DropiFinancialSyncResultSchema =
|
|
20201
|
-
orders:
|
|
20202
|
-
written:
|
|
20203
|
-
updated:
|
|
20204
|
-
pending:
|
|
20205
|
-
next:
|
|
20206
|
-
historyNext:
|
|
20207
|
-
changesThrough:
|
|
20208
|
-
since:
|
|
20209
|
-
until:
|
|
20210
|
-
unmatched:
|
|
20211
|
-
externalProductId:
|
|
20212
|
-
orders:
|
|
21104
|
+
retentionSince: z98.string()
|
|
21105
|
+
});
|
|
21106
|
+
var DropiFinancialSyncResultSchema = z98.object({
|
|
21107
|
+
orders: z98.number().int().nonnegative(),
|
|
21108
|
+
written: z98.number().int().nonnegative(),
|
|
21109
|
+
updated: z98.number().int().nonnegative(),
|
|
21110
|
+
pending: z98.boolean(),
|
|
21111
|
+
next: z98.string().nullable(),
|
|
21112
|
+
historyNext: z98.string().nullable(),
|
|
21113
|
+
changesThrough: z98.string().nullable(),
|
|
21114
|
+
since: z98.string(),
|
|
21115
|
+
until: z98.string(),
|
|
21116
|
+
unmatched: z98.array(z98.object({
|
|
21117
|
+
externalProductId: z98.string(),
|
|
21118
|
+
orders: z98.number().int().nonnegative()
|
|
20213
21119
|
}))
|
|
20214
21120
|
});
|
|
20215
21121
|
|
|
20216
21122
|
// ../../packages/types/src/service-website-capture.ts
|
|
20217
|
-
import { z as
|
|
21123
|
+
import { z as z99 } from "zod";
|
|
20218
21124
|
var WEBSITE_CAPTURE_MAX_RESEARCH_BYTES = 1024 * 1024;
|
|
20219
21125
|
var WEBSITE_CAPTURE_MAX_FILES = 100;
|
|
20220
21126
|
var WEBSITE_CAPTURE_MAX_FILE_BYTES = 8 * 1024 * 1024;
|
|
20221
21127
|
var WEBSITE_CAPTURE_MAX_BUNDLE_BYTES = 30 * 1024 * 1024;
|
|
20222
|
-
var WebsiteCaptureCauseSchema =
|
|
21128
|
+
var WebsiteCaptureCauseSchema = z99.enum([
|
|
20223
21129
|
"site_blocked",
|
|
20224
21130
|
"site_unreachable",
|
|
20225
21131
|
"not_enough_content",
|
|
20226
21132
|
"internal"
|
|
20227
21133
|
]);
|
|
20228
|
-
var WebsiteCaptureStatusSchema =
|
|
21134
|
+
var WebsiteCaptureStatusSchema = z99.enum([
|
|
20229
21135
|
"queued",
|
|
20230
21136
|
"capturing",
|
|
20231
21137
|
"ready",
|
|
@@ -20247,128 +21153,128 @@ function normalizeWebsiteCaptureUrl(value) {
|
|
|
20247
21153
|
}
|
|
20248
21154
|
}
|
|
20249
21155
|
__name(normalizeWebsiteCaptureUrl, "normalizeWebsiteCaptureUrl");
|
|
20250
|
-
var WebsiteCaptureRequestSchema =
|
|
20251
|
-
url:
|
|
21156
|
+
var WebsiteCaptureRequestSchema = z99.object({
|
|
21157
|
+
url: z99.string().trim().max(2048).url().refine((value) => normalizeWebsiteCaptureUrl(value) !== null, "Use an HTTP(S) URL without credentials").transform((value) => normalizeWebsiteCaptureUrl(value)),
|
|
20252
21158
|
language: MotionGraphicsLanguageSchema
|
|
20253
21159
|
}).strict();
|
|
20254
|
-
var WebsiteCaptureResponseSchema =
|
|
20255
|
-
captureId:
|
|
21160
|
+
var WebsiteCaptureResponseSchema = z99.object({
|
|
21161
|
+
captureId: z99.string().uuid(),
|
|
20256
21162
|
status: WebsiteCaptureStatusSchema,
|
|
20257
|
-
expiresAt:
|
|
20258
|
-
previewUrl:
|
|
21163
|
+
expiresAt: z99.string().datetime(),
|
|
21164
|
+
previewUrl: z99.string().url().optional(),
|
|
20259
21165
|
cause: WebsiteCaptureCauseSchema.optional()
|
|
20260
21166
|
});
|
|
20261
21167
|
var WebsiteCaptureJobSchema = WebsiteCaptureRequestSchema.extend({
|
|
20262
|
-
captureId:
|
|
20263
|
-
attempt:
|
|
20264
|
-
leaseUntil:
|
|
21168
|
+
captureId: z99.string().uuid(),
|
|
21169
|
+
attempt: z99.number().int().positive(),
|
|
21170
|
+
leaseUntil: z99.string().datetime()
|
|
20265
21171
|
});
|
|
20266
|
-
var WebsiteCaptureClaimResponseSchema =
|
|
21172
|
+
var WebsiteCaptureClaimResponseSchema = z99.object({
|
|
20267
21173
|
capture: WebsiteCaptureJobSchema.nullable()
|
|
20268
21174
|
});
|
|
20269
21175
|
var attempt = {
|
|
20270
|
-
attempt:
|
|
21176
|
+
attempt: z99.number().int().positive()
|
|
20271
21177
|
};
|
|
20272
|
-
var digest =
|
|
20273
|
-
var WebsiteCaptureUploadRequestSchema =
|
|
21178
|
+
var digest = z99.string().regex(/^[a-f0-9]{64}$/);
|
|
21179
|
+
var WebsiteCaptureUploadRequestSchema = z99.object({
|
|
20274
21180
|
...attempt,
|
|
20275
|
-
contentLength:
|
|
21181
|
+
contentLength: z99.number().int().positive().max(WEBSITE_CAPTURE_MAX_BUNDLE_BYTES),
|
|
20276
21182
|
sha256: digest
|
|
20277
21183
|
}).strict();
|
|
20278
|
-
var WebsiteCaptureDoneRequestSchema =
|
|
21184
|
+
var WebsiteCaptureDoneRequestSchema = z99.object({
|
|
20279
21185
|
...attempt,
|
|
20280
21186
|
sha256: digest
|
|
20281
21187
|
}).strict();
|
|
20282
|
-
var WebsiteCaptureFailedRequestSchema =
|
|
21188
|
+
var WebsiteCaptureFailedRequestSchema = z99.object({
|
|
20283
21189
|
...attempt,
|
|
20284
21190
|
cause: WebsiteCaptureCauseSchema
|
|
20285
21191
|
}).strict();
|
|
20286
|
-
var WebsiteCaptureBundleSchema =
|
|
20287
|
-
version:
|
|
20288
|
-
files:
|
|
20289
|
-
path:
|
|
20290
|
-
base64:
|
|
21192
|
+
var WebsiteCaptureBundleSchema = z99.object({
|
|
21193
|
+
version: z99.literal(1),
|
|
21194
|
+
files: z99.array(z99.object({
|
|
21195
|
+
path: z99.string().max(140).regex(/^research\/(?:page\.json|(?:desktop|mobile)-[1-9]\d*\.jpg|logo\.(?:png|svg)|image-[1-9]\d*\.(?:png|jpg|jpeg|webp|svg|avif)|font-[1-9]\d*\.(?:woff2?|ttf|otf))$/),
|
|
21196
|
+
base64: z99.string().max(Math.ceil(WEBSITE_CAPTURE_MAX_FILE_BYTES / 3) * 4).regex(/^[A-Za-z0-9+/]*={0,2}$/).refine((value) => value.length % 4 === 0),
|
|
20291
21197
|
sha256: digest
|
|
20292
21198
|
}).strict()).min(1).max(WEBSITE_CAPTURE_MAX_FILES)
|
|
20293
21199
|
}).strict().refine((bundle) => new Set(bundle.files.map((file) => file.path)).size === bundle.files.length, "Duplicate capture file");
|
|
20294
|
-
var WebsiteCaptureScreenshotSchema =
|
|
20295
|
-
file:
|
|
20296
|
-
scrollTop:
|
|
20297
|
-
});
|
|
20298
|
-
var WebsiteCaptureAccessSchema =
|
|
20299
|
-
publicContentText:
|
|
20300
|
-
passwordGate:
|
|
20301
|
-
challengeGate:
|
|
20302
|
-
blockingOverlay:
|
|
20303
|
-
});
|
|
20304
|
-
var WebsiteCaptureResearchSchema =
|
|
20305
|
-
requestedUrl:
|
|
20306
|
-
capturedAt:
|
|
20307
|
-
locale:
|
|
20308
|
-
bodyTextTruncated:
|
|
20309
|
-
finalUrl:
|
|
20310
|
-
lang:
|
|
20311
|
-
title:
|
|
20312
|
-
description:
|
|
20313
|
-
openGraph:
|
|
20314
|
-
title:
|
|
20315
|
-
description:
|
|
20316
|
-
image:
|
|
20317
|
-
siteName:
|
|
21200
|
+
var WebsiteCaptureScreenshotSchema = z99.object({
|
|
21201
|
+
file: z99.string(),
|
|
21202
|
+
scrollTop: z99.number()
|
|
21203
|
+
});
|
|
21204
|
+
var WebsiteCaptureAccessSchema = z99.object({
|
|
21205
|
+
publicContentText: z99.string().max(8e3),
|
|
21206
|
+
passwordGate: z99.boolean(),
|
|
21207
|
+
challengeGate: z99.boolean(),
|
|
21208
|
+
blockingOverlay: z99.boolean()
|
|
21209
|
+
});
|
|
21210
|
+
var WebsiteCaptureResearchSchema = z99.object({
|
|
21211
|
+
requestedUrl: z99.string().url(),
|
|
21212
|
+
capturedAt: z99.string().datetime(),
|
|
21213
|
+
locale: z99.string(),
|
|
21214
|
+
bodyTextTruncated: z99.boolean(),
|
|
21215
|
+
finalUrl: z99.string().url(),
|
|
21216
|
+
lang: z99.string().nullable(),
|
|
21217
|
+
title: z99.string(),
|
|
21218
|
+
description: z99.string(),
|
|
21219
|
+
openGraph: z99.object({
|
|
21220
|
+
title: z99.string(),
|
|
21221
|
+
description: z99.string(),
|
|
21222
|
+
image: z99.string(),
|
|
21223
|
+
siteName: z99.string()
|
|
20318
21224
|
}),
|
|
20319
|
-
themeColor:
|
|
20320
|
-
headings:
|
|
20321
|
-
h1:
|
|
20322
|
-
h2:
|
|
20323
|
-
h3:
|
|
21225
|
+
themeColor: z99.string(),
|
|
21226
|
+
headings: z99.object({
|
|
21227
|
+
h1: z99.array(z99.string()),
|
|
21228
|
+
h2: z99.array(z99.string()),
|
|
21229
|
+
h3: z99.array(z99.string())
|
|
20324
21230
|
}),
|
|
20325
|
-
callsToAction:
|
|
20326
|
-
listItems:
|
|
20327
|
-
bodyText:
|
|
21231
|
+
callsToAction: z99.array(z99.string()),
|
|
21232
|
+
listItems: z99.array(z99.string()),
|
|
21233
|
+
bodyText: z99.string(),
|
|
20328
21234
|
access: WebsiteCaptureAccessSchema.optional(),
|
|
20329
|
-
consent:
|
|
20330
|
-
pressed:
|
|
20331
|
-
removed:
|
|
21235
|
+
consent: z99.object({
|
|
21236
|
+
pressed: z99.string().nullable(),
|
|
21237
|
+
removed: z99.number().nonnegative()
|
|
20332
21238
|
}).optional(),
|
|
20333
|
-
overlaysDismissed:
|
|
20334
|
-
style:
|
|
20335
|
-
bodyBackground:
|
|
20336
|
-
bodyColor:
|
|
20337
|
-
bodyFont:
|
|
20338
|
-
headingFont:
|
|
20339
|
-
headingColor:
|
|
20340
|
-
actionColors:
|
|
20341
|
-
color:
|
|
20342
|
-
uses:
|
|
21239
|
+
overlaysDismissed: z99.number().int().nonnegative().optional(),
|
|
21240
|
+
style: z99.object({
|
|
21241
|
+
bodyBackground: z99.string(),
|
|
21242
|
+
bodyColor: z99.string(),
|
|
21243
|
+
bodyFont: z99.string(),
|
|
21244
|
+
headingFont: z99.string().nullable(),
|
|
21245
|
+
headingColor: z99.string().nullable(),
|
|
21246
|
+
actionColors: z99.array(z99.object({
|
|
21247
|
+
color: z99.string(),
|
|
21248
|
+
uses: z99.number()
|
|
20343
21249
|
}))
|
|
20344
21250
|
}),
|
|
20345
|
-
images:
|
|
20346
|
-
file:
|
|
20347
|
-
src:
|
|
20348
|
-
alt:
|
|
20349
|
-
width:
|
|
20350
|
-
height:
|
|
20351
|
-
isOpenGraph:
|
|
21251
|
+
images: z99.array(z99.object({
|
|
21252
|
+
file: z99.string(),
|
|
21253
|
+
src: z99.string(),
|
|
21254
|
+
alt: z99.string(),
|
|
21255
|
+
width: z99.number().nullable(),
|
|
21256
|
+
height: z99.number().nullable(),
|
|
21257
|
+
isOpenGraph: z99.boolean()
|
|
20352
21258
|
})),
|
|
20353
|
-
logo:
|
|
20354
|
-
file:
|
|
20355
|
-
svg:
|
|
20356
|
-
width:
|
|
20357
|
-
height:
|
|
21259
|
+
logo: z99.object({
|
|
21260
|
+
file: z99.literal("logo.png"),
|
|
21261
|
+
svg: z99.literal("logo.svg").optional(),
|
|
21262
|
+
width: z99.number(),
|
|
21263
|
+
height: z99.number()
|
|
20358
21264
|
}).nullable(),
|
|
20359
|
-
fonts:
|
|
20360
|
-
family:
|
|
20361
|
-
weight:
|
|
20362
|
-
style:
|
|
20363
|
-
unicodeRange:
|
|
20364
|
-
file:
|
|
21265
|
+
fonts: z99.array(z99.object({
|
|
21266
|
+
family: z99.string(),
|
|
21267
|
+
weight: z99.string(),
|
|
21268
|
+
style: z99.string(),
|
|
21269
|
+
unicodeRange: z99.string().nullable(),
|
|
21270
|
+
file: z99.string().optional()
|
|
20365
21271
|
}).transform((font) => ({
|
|
20366
21272
|
...font,
|
|
20367
21273
|
file: font.file
|
|
20368
21274
|
}))),
|
|
20369
|
-
screenshots:
|
|
20370
|
-
desktop:
|
|
20371
|
-
mobile:
|
|
21275
|
+
screenshots: z99.object({
|
|
21276
|
+
desktop: z99.array(WebsiteCaptureScreenshotSchema),
|
|
21277
|
+
mobile: z99.array(WebsiteCaptureScreenshotSchema)
|
|
20372
21278
|
})
|
|
20373
21279
|
});
|
|
20374
21280
|
|
|
@@ -20881,23 +21787,23 @@ import { InsufficientScopeError, InvalidTokenError } from "@modelcontextprotocol
|
|
|
20881
21787
|
import { createRemoteJWKSet as createRemoteJWKSet2, jwtVerify as jwtVerify2 } from "jose";
|
|
20882
21788
|
|
|
20883
21789
|
// src/auth/oauth-config.ts
|
|
20884
|
-
import { z as
|
|
21790
|
+
import { z as z100 } from "zod";
|
|
20885
21791
|
var MCP_RESOURCE = new URL("https://mcp.productmaker.app/mcp");
|
|
20886
21792
|
var MCP_SCOPE = "mcp:access";
|
|
20887
21793
|
var REFRESH_SCOPE = "offline_access";
|
|
20888
21794
|
var STATIC_CLIENT_ISSUER = new URL(MCP_RESOURCE.origin);
|
|
20889
|
-
var oauthEnvSchema =
|
|
20890
|
-
MCP_REMOTE_AUTH_MODE:
|
|
20891
|
-
MCP_AUTH0_ISSUER:
|
|
20892
|
-
MCP_AUTH0_AUDIENCE:
|
|
21795
|
+
var oauthEnvSchema = z100.object({
|
|
21796
|
+
MCP_REMOTE_AUTH_MODE: z100.literal("oauth"),
|
|
21797
|
+
MCP_AUTH0_ISSUER: z100.string().trim().min(1),
|
|
21798
|
+
MCP_AUTH0_AUDIENCE: z100.string().trim().refine((value) => value === MCP_RESOURCE.href, {
|
|
20893
21799
|
message: `must equal ${MCP_RESOURCE.href}`
|
|
20894
21800
|
}),
|
|
20895
|
-
MCP_AUTH0_CLIENT_ID:
|
|
20896
|
-
MCP_AUTH0_CLIENT_SECRET:
|
|
20897
|
-
PM_API_AUDIENCE:
|
|
20898
|
-
AUTH0_AUDIENCE:
|
|
20899
|
-
MCP_STATIC_CLIENT_ID:
|
|
20900
|
-
MCP_STATIC_CLIENT_SECRET:
|
|
21801
|
+
MCP_AUTH0_CLIENT_ID: z100.string().trim().min(1),
|
|
21802
|
+
MCP_AUTH0_CLIENT_SECRET: z100.string().trim().min(1),
|
|
21803
|
+
PM_API_AUDIENCE: z100.string().trim().min(1),
|
|
21804
|
+
AUTH0_AUDIENCE: z100.string().trim().min(1),
|
|
21805
|
+
MCP_STATIC_CLIENT_ID: z100.string().trim().min(1).optional(),
|
|
21806
|
+
MCP_STATIC_CLIENT_SECRET: z100.string().trim().min(1).optional()
|
|
20901
21807
|
});
|
|
20902
21808
|
function formatZodIssues(error) {
|
|
20903
21809
|
return error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ");
|
|
@@ -22051,7 +22957,7 @@ var ApiClient = class {
|
|
|
22051
22957
|
};
|
|
22052
22958
|
|
|
22053
22959
|
// src/index.ts
|
|
22054
|
-
var MCP_VERSION = "11.1.
|
|
22960
|
+
var MCP_VERSION = "11.1.1";
|
|
22055
22961
|
|
|
22056
22962
|
// src/meta-upload-app.ts
|
|
22057
22963
|
import { readFileSync } from "fs";
|
|
@@ -22123,7 +23029,7 @@ function registerMediaUploadAppResource(server, resolveEndpoint) {
|
|
|
22123
23029
|
__name(registerMediaUploadAppResource, "registerMediaUploadAppResource");
|
|
22124
23030
|
|
|
22125
23031
|
// src/tools/tasks.ts
|
|
22126
|
-
import { z as
|
|
23032
|
+
import { z as z105 } from "zod";
|
|
22127
23033
|
|
|
22128
23034
|
// src/resolve-image.ts
|
|
22129
23035
|
import { lookup as dnsLookup } from "dns/promises";
|
|
@@ -22684,9 +23590,9 @@ async function resolveMediaRef(ref, opts) {
|
|
|
22684
23590
|
__name(resolveMediaRef, "resolveMediaRef");
|
|
22685
23591
|
|
|
22686
23592
|
// src/tools/shared.ts
|
|
22687
|
-
import { z as
|
|
22688
|
-
var Lang =
|
|
22689
|
-
var Country =
|
|
23593
|
+
import { z as z101 } from "zod";
|
|
23594
|
+
var Lang = z101.string().regex(/^[a-z]{2}(?:[-_][a-zA-Z]{2})?$/, "Usa un c\xF3digo de idioma BCP-47, por ejemplo es, en-US o pt-BR").max(10);
|
|
23595
|
+
var Country = z101.string().min(2).max(3);
|
|
22690
23596
|
var LandingStrategyEnum = LandingStrategySchema;
|
|
22691
23597
|
var LandingImageFormatEnum = LandingImageFormatSchema;
|
|
22692
23598
|
var VideoPresetEnum = VideoPreset.extract([
|
|
@@ -22790,7 +23696,7 @@ function animationStyleApplies(videoPreset, angleNarratives) {
|
|
|
22790
23696
|
return ANIMATED_VIDEO_PRESETS.has(videoPreset ?? "") || (angleNarratives ?? []).some((n) => ANIMATED_NARRATIVE_STYLES.has(n));
|
|
22791
23697
|
}
|
|
22792
23698
|
__name(animationStyleApplies, "animationStyleApplies");
|
|
22793
|
-
var VideoTierEnum =
|
|
23699
|
+
var VideoTierEnum = z101.enum([
|
|
22794
23700
|
"basic"
|
|
22795
23701
|
]);
|
|
22796
23702
|
function resolveVideoTier(_tier) {
|
|
@@ -22848,10 +23754,10 @@ var ImageCreativeStyleEnum = ImageCreativeStyle;
|
|
|
22848
23754
|
var ImageCreativeArchetypeEnum = ImageCreativeArchetype;
|
|
22849
23755
|
var ImageCreativeVisualTreatmentEnum = ImageCreativeVisualTreatment;
|
|
22850
23756
|
var ImageCreativeAspectRatioEnum = ImageCreativeAspectRatio;
|
|
22851
|
-
var ImageRefSchema =
|
|
22852
|
-
url:
|
|
22853
|
-
path:
|
|
22854
|
-
assetId:
|
|
23757
|
+
var ImageRefSchema = z101.object({
|
|
23758
|
+
url: z101.string().url().optional().describe('URL p\xFAblica HTTPS de la foto. Ej: una URL de Shopify CDN, Cloudinary, Imgur. \xDAsala cuando el usuario te diga "est\xE1 en X.com/foto.jpg" o cuando la foto ya est\xE9 hospedada.'),
|
|
23759
|
+
path: z101.string().min(1).optional().describe('Ruta del archivo en el computador del usuario. Ej: "/Users/maria/Desktop/foto.jpg", "~/Pictures/camiseta.png", "C:\\Users\\Maria\\Desktop\\foto.jpg". El MCP local la lee del disco y la sube. SOLO funciona cuando el MCP corre local (stdio). NO funciona en mcp.productmaker.app (HTTP) \u2014 ah\xED usa `url`.'),
|
|
23760
|
+
assetId: z101.string().uuid().optional().describe("ID opaco devuelto por check_media_upload. \xDAsalo para una imagen subida desde el MCP App; ProductMaker adopta el archivo directamente y el MCP nunca descarga sus bytes.")
|
|
22855
23761
|
}).refine((v) => [
|
|
22856
23762
|
v.url,
|
|
22857
23763
|
v.path,
|
|
@@ -22859,11 +23765,11 @@ var ImageRefSchema = z96.object({
|
|
|
22859
23765
|
].filter(Boolean).length === 1, {
|
|
22860
23766
|
message: "each image entry must have exactly one of `url`, `path`, or `assetId`"
|
|
22861
23767
|
});
|
|
22862
|
-
var ImagesInput =
|
|
23768
|
+
var ImagesInput = z101.array(ImageRefSchema).min(1).max(5).superRefine((images, ctx) => {
|
|
22863
23769
|
const assetCount = images.filter((image) => Boolean(image.assetId)).length;
|
|
22864
23770
|
if (assetCount > 0 && assetCount !== images.length) {
|
|
22865
23771
|
ctx.addIssue({
|
|
22866
|
-
code:
|
|
23772
|
+
code: z101.ZodIssueCode.custom,
|
|
22867
23773
|
message: "all image entries must use assetId, or all must use URL/path sources"
|
|
22868
23774
|
});
|
|
22869
23775
|
}
|
|
@@ -22884,10 +23790,10 @@ function asText(value) {
|
|
|
22884
23790
|
};
|
|
22885
23791
|
}
|
|
22886
23792
|
__name(asText, "asText");
|
|
22887
|
-
function
|
|
23793
|
+
function isRecord3(v) {
|
|
22888
23794
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
22889
23795
|
}
|
|
22890
|
-
__name(
|
|
23796
|
+
__name(isRecord3, "isRecord");
|
|
22891
23797
|
function escapeMdLabel(s) {
|
|
22892
23798
|
return s.replace(/[[\](){}\x60<>\r\n\\*_]/g, " ").replace(/\s+/g, " ").trim();
|
|
22893
23799
|
}
|
|
@@ -22936,14 +23842,14 @@ async function submitCreative(api, opts) {
|
|
|
22936
23842
|
});
|
|
22937
23843
|
}
|
|
22938
23844
|
__name(submitCreative, "submitCreative");
|
|
22939
|
-
var ResearchTargetCountryEnum =
|
|
23845
|
+
var ResearchTargetCountryEnum = z101.enum([
|
|
22940
23846
|
"CO",
|
|
22941
23847
|
"MX",
|
|
22942
23848
|
"PE",
|
|
22943
23849
|
"EC",
|
|
22944
23850
|
"CL"
|
|
22945
23851
|
]);
|
|
22946
|
-
var ResearchCategoryEnum =
|
|
23852
|
+
var ResearchCategoryEnum = z101.enum([
|
|
22947
23853
|
"auto",
|
|
22948
23854
|
"automotive",
|
|
22949
23855
|
"kitchen",
|
|
@@ -23561,7 +24467,7 @@ function translateError(err) {
|
|
|
23561
24467
|
return mcp(code, err.message);
|
|
23562
24468
|
}
|
|
23563
24469
|
if (err instanceof ApiHttpError) {
|
|
23564
|
-
const body =
|
|
24470
|
+
const body = isRecord3(err.body) ? err.body : {};
|
|
23565
24471
|
if (body.code === McpErrorCode.SHOPIFY_PUBLISH_INPUT_REQUIRED || body.code === McpErrorCode.SHOPIFY_PUBLISH_CONTEXT_CHANGED || body.code === McpErrorCode.SHOPIFY_PUBLISH_CORRECTION_REQUIRES_EDITOR || body.code === McpErrorCode.SHOPIFY_PUBLISH_CORRECTION_NOT_CONVERGED || body.code === McpErrorCode.SHOPIFY_PUBLISH_VERIFICATION_FAILED || body.code === McpErrorCode.SHOPIFY_PUBLISH_TARGET_INCOMPATIBLE || body.code === McpErrorCode.SHOPIFY_THEME_SETUP_REQUIRED || body.code === McpErrorCode.SHOPIFY_PUBLISH_FAILED) {
|
|
23566
24472
|
const parsed = ShopifyPublishErrorResponse.safeParse(body);
|
|
23567
24473
|
if (!parsed.success) return mcp(McpErrorCode.INTERNAL, resolveMessage(McpErrorCode.INTERNAL, void 0));
|
|
@@ -24255,29 +25161,29 @@ ${parsed.data.error ? `${escapeMarkdownText(parsed.data.error)}
|
|
|
24255
25161
|
__name(renderVideoScriptMarkdown, "renderVideoScriptMarkdown");
|
|
24256
25162
|
|
|
24257
25163
|
// src/tools/media-presentation.ts
|
|
24258
|
-
import { z as
|
|
24259
|
-
var HttpsPresentationUrlSchema =
|
|
25164
|
+
import { z as z102 } from "zod";
|
|
25165
|
+
var HttpsPresentationUrlSchema = z102.string().url().max(2048).refine((value) => new URL(value).protocol === "https:");
|
|
24260
25166
|
var ProductMakerPreviewUrlSchema = HttpsPresentationUrlSchema.refine((value) => {
|
|
24261
25167
|
const hostname = new URL(value).hostname.toLowerCase();
|
|
24262
25168
|
return hostname === "productmaker.app" || hostname.endsWith(".productmaker.app");
|
|
24263
25169
|
}, "preview URL must be owned by ProductMaker");
|
|
24264
|
-
var positiveIntAtMost = /* @__PURE__ */ __name((maximum) =>
|
|
24265
|
-
var PresentationImageSchema =
|
|
24266
|
-
kind:
|
|
25170
|
+
var positiveIntAtMost = /* @__PURE__ */ __name((maximum) => z102.number().int().positive().max(maximum), "positiveIntAtMost");
|
|
25171
|
+
var PresentationImageSchema = z102.object({
|
|
25172
|
+
kind: z102.literal("image"),
|
|
24267
25173
|
url: HttpsPresentationUrlSchema,
|
|
24268
|
-
mimeType:
|
|
25174
|
+
mimeType: z102.enum([
|
|
24269
25175
|
"image/jpeg",
|
|
24270
25176
|
"image/png"
|
|
24271
25177
|
]),
|
|
24272
25178
|
byteSize: positiveIntAtMost(5 * 1024 * 1024),
|
|
24273
25179
|
width: positiveIntAtMost(16384),
|
|
24274
25180
|
height: positiveIntAtMost(16384),
|
|
24275
|
-
alt:
|
|
25181
|
+
alt: z102.string().trim().min(1).max(240)
|
|
24276
25182
|
}).strict();
|
|
24277
25183
|
var McpMediaPresentationSchema = PresentationImageSchema;
|
|
24278
|
-
var GalleryImageSchema =
|
|
25184
|
+
var GalleryImageSchema = z102.object({
|
|
24279
25185
|
url: ProductMakerPreviewUrlSchema,
|
|
24280
|
-
alt:
|
|
25186
|
+
alt: z102.string().trim().min(1).max(240)
|
|
24281
25187
|
});
|
|
24282
25188
|
var MCP_GALLERY_IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
24283
25189
|
async function imageBlocks(image, transport) {
|
|
@@ -24334,12 +25240,12 @@ async function buildMcpMediaPresentationContent(rawPresentation, transport = "ht
|
|
|
24334
25240
|
];
|
|
24335
25241
|
}
|
|
24336
25242
|
__name(buildMcpMediaPresentationContent, "buildMcpMediaPresentationContent");
|
|
24337
|
-
var OwnedImagePreviewSchema =
|
|
25243
|
+
var OwnedImagePreviewSchema = z102.object({
|
|
24338
25244
|
url: HttpsPresentationUrlSchema.refine((value) => {
|
|
24339
25245
|
const url = new URL(value);
|
|
24340
25246
|
return !url.username && !url.password && !isPrivateHost(url.hostname);
|
|
24341
25247
|
}, "Preview URL must be public HTTPS without credentials"),
|
|
24342
|
-
alt:
|
|
25248
|
+
alt: z102.string().trim().min(1).max(240)
|
|
24343
25249
|
});
|
|
24344
25250
|
async function buildMcpImagePreviewContent(rawPreview, transport = "http") {
|
|
24345
25251
|
const preview2 = OwnedImagePreviewSchema.safeParse(rawPreview);
|
|
@@ -24422,7 +25328,7 @@ async function buildMcpImageGalleryContent(rawItems, transport = "http") {
|
|
|
24422
25328
|
__name(buildMcpImageGalleryContent, "buildMcpImageGalleryContent");
|
|
24423
25329
|
|
|
24424
25330
|
// src/tools/animated-video.ts
|
|
24425
|
-
import { z as
|
|
25331
|
+
import { z as z103 } from "zod";
|
|
24426
25332
|
|
|
24427
25333
|
// src/tools/paid-confirmation.ts
|
|
24428
25334
|
function describeMarketStudyChoice(enabled) {
|
|
@@ -24535,17 +25441,17 @@ function sortCanonical(items) {
|
|
|
24535
25441
|
});
|
|
24536
25442
|
}
|
|
24537
25443
|
__name(sortCanonical, "sortCanonical");
|
|
24538
|
-
function
|
|
25444
|
+
function isRecord4(value) {
|
|
24539
25445
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24540
25446
|
}
|
|
24541
|
-
__name(
|
|
25447
|
+
__name(isRecord4, "isRecord");
|
|
24542
25448
|
function collectLanguageCodes(value, out) {
|
|
24543
25449
|
if (Array.isArray(value)) {
|
|
24544
25450
|
const items = value;
|
|
24545
25451
|
for (const item of items) collectLanguageCodes(item, out);
|
|
24546
25452
|
return out;
|
|
24547
25453
|
}
|
|
24548
|
-
if (!
|
|
25454
|
+
if (!isRecord4(value)) return out;
|
|
24549
25455
|
for (const [key, entry] of Object.entries(value)) {
|
|
24550
25456
|
if (LANGUAGE_FIELDS.has(key) && typeof entry === "string") {
|
|
24551
25457
|
const base = entry.trim().split(/[-_]/)[0]?.toLowerCase();
|
|
@@ -24591,7 +25497,7 @@ function normalizeForKey(value, languages) {
|
|
|
24591
25497
|
const items = value;
|
|
24592
25498
|
return items.map((item) => normalizeForKey(item, languages));
|
|
24593
25499
|
}
|
|
24594
|
-
if (!
|
|
25500
|
+
if (!isRecord4(value)) return value;
|
|
24595
25501
|
const out = {};
|
|
24596
25502
|
for (const [key, entry] of Object.entries(value)) {
|
|
24597
25503
|
if (PARAPHRASE_PRONE_FIELDS.has(key)) {
|
|
@@ -24663,25 +25569,25 @@ function animatedVideoMaxPriceText(durationSec) {
|
|
|
24663
25569
|
return `m\xE1ximo ${animatedVideoCredits(durationSec)} cr\xE9ditos (se devuelve lo que no use)`;
|
|
24664
25570
|
}
|
|
24665
25571
|
__name(animatedVideoMaxPriceText, "animatedVideoMaxPriceText");
|
|
24666
|
-
var DurationInput =
|
|
24667
|
-
var CreateAnimatedVideoInput =
|
|
24668
|
-
action:
|
|
25572
|
+
var DurationInput = z103.union(MOTION_GRAPHICS_DURATIONS.map((d) => z103.literal(d)));
|
|
25573
|
+
var CreateAnimatedVideoInput = z103.object({
|
|
25574
|
+
action: z103.enum([
|
|
24669
25575
|
"prepare",
|
|
24670
25576
|
"status",
|
|
24671
25577
|
"cancel",
|
|
24672
25578
|
"generate"
|
|
24673
25579
|
]).default("prepare").describe("prepare inicia una captura gratuita; status consulta websiteCaptureId; cancel la cancela; generate requiere captura ready y confirmaci\xF3n expl\xEDcita del usuario despu\xE9s de mostrar vista previa y precio."),
|
|
24674
|
-
websiteCaptureId:
|
|
24675
|
-
generationRequestId:
|
|
24676
|
-
confirmed:
|
|
25580
|
+
websiteCaptureId: z103.string().uuid().optional().describe("ID de la captura preparada. Obligatorio para status/cancel/generate; no inventarlo."),
|
|
25581
|
+
generationRequestId: z103.string().uuid().optional().describe("Identidad opcional de una generaci\xF3n confirmada. Repite el mismo UUID al recuperar una respuesta perdida; usa otro \xFAnicamente cuando el usuario pida y confirme otro video, nunca por un error de transporte."),
|
|
25582
|
+
confirmed: z103.boolean().optional().describe("Solo true despu\xE9s de que el usuario confirme esta captura, formato, duraci\xF3n, idioma y precio. Obligatorio para generate; preparar no genera ni cobra."),
|
|
24677
25583
|
// Plain text, not `.url()`: users type «cal.com», and the web accepts it.
|
|
24678
25584
|
// normalizeWebAddress (shared with the web) adds https:// and refuses
|
|
24679
25585
|
// anything that is not a public http(s) address.
|
|
24680
|
-
landingUrl:
|
|
25586
|
+
landingUrl: z103.string().trim().min(1).optional().describe("Enlace p\xFAblico de la p\xE1gina del servicio, como lo dio el usuario (\xABcal.com\xBB o \xABhttps://cal.com\xBB). El video sale de lo que muestra esa p\xE1gina: su marca, colores y mensajes."),
|
|
24681
25587
|
format: MotionGraphicsFormatSchema.optional().describe('Formato: "vertical" (9:16, Reels/TikTok), "square" (1:1, feed) u "horizontal" (16:9, YouTube/web). Si el usuario no lo dijo, PREG\xDANTALE.'),
|
|
24682
25588
|
durationSec: DurationInput.optional().describe(`Duraci\xF3n en segundos: ${MOTION_GRAPHICS_DURATIONS.join(", ")}. Fija el precio (ver la descripci\xF3n de la herramienta). Si el usuario no la dijo, PREG\xDANTALE.`),
|
|
24683
25589
|
language: MotionGraphicsLanguageSchema.optional().describe('Idioma de los textos del video: "es", "en" o "pt".'),
|
|
24684
|
-
notes:
|
|
25590
|
+
notes: z103.string().trim().max(MOTION_GRAPHICS_NOTES_MAX_CHARS).optional().describe("Opcional. Indicaciones para el video en lenguaje natural (ej. enf\xF3cate en los precios, tono m\xE1s formal, menciona la prueba gratis).")
|
|
24685
25591
|
}).strict();
|
|
24686
25592
|
function captureNextAction(capture) {
|
|
24687
25593
|
if (capture.status === "ready") return "Muestra la vista previa al usuario y confirma formato, duraci\xF3n, idioma y precio. Solo despu\xE9s llama create_animated_video con action=generate, este websiteCaptureId y confirmed=true.";
|
|
@@ -24714,35 +25620,35 @@ var FORMAT_LABELS = {
|
|
|
24714
25620
|
square: "cuadrado 1:1",
|
|
24715
25621
|
horizontal: "horizontal 16:9"
|
|
24716
25622
|
};
|
|
24717
|
-
var AnimatedVideoResultSchema =
|
|
24718
|
-
status:
|
|
25623
|
+
var AnimatedVideoResultSchema = z103.object({
|
|
25624
|
+
status: z103.enum([
|
|
24719
25625
|
"pending",
|
|
24720
25626
|
"done",
|
|
24721
25627
|
"error"
|
|
24722
25628
|
]),
|
|
24723
|
-
serviceMode:
|
|
24724
|
-
finalMp4Url:
|
|
24725
|
-
error:
|
|
24726
|
-
motionGraphics:
|
|
25629
|
+
serviceMode: z103.literal("motion_graphics"),
|
|
25630
|
+
finalMp4Url: z103.string().optional(),
|
|
25631
|
+
error: z103.string().optional(),
|
|
25632
|
+
motionGraphics: z103.object({
|
|
24727
25633
|
stage: MotionGraphicsStageSchema,
|
|
24728
25634
|
format: MotionGraphicsFormatSchema,
|
|
24729
|
-
durationSec:
|
|
24730
|
-
width:
|
|
24731
|
-
height:
|
|
25635
|
+
durationSec: z103.number(),
|
|
25636
|
+
width: z103.number().optional(),
|
|
25637
|
+
height: z103.number().optional(),
|
|
24732
25638
|
language: MotionGraphicsLanguageSchema.optional(),
|
|
24733
|
-
queuedAt:
|
|
24734
|
-
jobsAhead:
|
|
24735
|
-
stageStartedAt:
|
|
24736
|
-
renderProgress:
|
|
25639
|
+
queuedAt: z103.string().optional(),
|
|
25640
|
+
jobsAhead: z103.number().int().nonnegative().optional(),
|
|
25641
|
+
stageStartedAt: z103.string().optional(),
|
|
25642
|
+
renderProgress: z103.number().optional(),
|
|
24737
25643
|
// AI clip fields (absent on a video paid before clips, or from an API
|
|
24738
25644
|
// that predates them). Lenient: an unreadable value is dropped
|
|
24739
25645
|
// instead of hiding the status.
|
|
24740
|
-
clipCount:
|
|
24741
|
-
clipsUsed:
|
|
24742
|
-
clipPriceCents:
|
|
24743
|
-
clipsRefunded:
|
|
24744
|
-
activity:
|
|
24745
|
-
previewUrl:
|
|
25646
|
+
clipCount: z103.number().int().nonnegative().optional().catch(void 0),
|
|
25647
|
+
clipsUsed: z103.number().int().nonnegative().optional().catch(void 0),
|
|
25648
|
+
clipPriceCents: z103.number().finite().nonnegative().optional().catch(void 0),
|
|
25649
|
+
clipsRefunded: z103.number().int().nonnegative().optional().catch(void 0),
|
|
25650
|
+
activity: z103.array(MotionGraphicsActivitySchema).optional().catch(void 0),
|
|
25651
|
+
previewUrl: z103.string().optional()
|
|
24746
25652
|
}).passthrough()
|
|
24747
25653
|
}).passthrough();
|
|
24748
25654
|
function parseAnimatedVideoResult(value) {
|
|
@@ -24958,10 +25864,10 @@ function registerAnimatedVideoTools(server, api) {
|
|
|
24958
25864
|
__name(registerAnimatedVideoTools, "registerAnimatedVideoTools");
|
|
24959
25865
|
|
|
24960
25866
|
// src/tools/winning-product-image.ts
|
|
24961
|
-
import { z as
|
|
24962
|
-
var WinnerReferenceInput =
|
|
24963
|
-
runId:
|
|
24964
|
-
candidateSourceId:
|
|
25867
|
+
import { z as z104 } from "zod";
|
|
25868
|
+
var WinnerReferenceInput = z104.object({
|
|
25869
|
+
runId: z104.string().uuid(),
|
|
25870
|
+
candidateSourceId: z104.string().trim().min(1).max(160)
|
|
24965
25871
|
}).strict().describe("Referencia opaca de un producto devuelto por find_winning_products/get_product_research_run.");
|
|
24966
25872
|
async function resolveWinnerImages(api, winnerReference, images) {
|
|
24967
25873
|
if (!winnerReference) return images;
|
|
@@ -24998,62 +25904,62 @@ var createProductTaskSingleOutputDescription = renderCreateProductTaskAvoidWhenF
|
|
|
24998
25904
|
var CREATE_SERVICE_VIDEO_ON_MCP = PRODUCTMAKER_MCP_CAPABILITY_NAMES.includes("create_service_video");
|
|
24999
25905
|
var listTasksGuidance = getProductMakerCapabilityModelGuidance("list_tasks");
|
|
25000
25906
|
var editTaskDraftGuidance = getProductMakerCapabilityModelGuidance("edit_task_draft");
|
|
25001
|
-
var CreateProductTaskInput =
|
|
25907
|
+
var CreateProductTaskInput = z105.object({
|
|
25002
25908
|
images: ImagesInput.optional().describe("1\u20135 fotos del mismo producto. Omitir \xFAnicamente cuando projectId apunta a un proyecto propio con imagen guardada."),
|
|
25003
25909
|
winnerReference: WinnerReferenceInput.optional().describe(WINNER_IMAGE_CHOICE_GUIDANCE),
|
|
25004
|
-
projectId:
|
|
25005
|
-
productUrl:
|
|
25910
|
+
projectId: z105.string().uuid().optional().describe("Opcional. Proyecto guiado propio. Permite continuar sin volver a subir la imagen guardada; nunca evita cr\xE9ditos, cuotas ni confirmaciones."),
|
|
25911
|
+
productUrl: z105.string().url().optional().describe("Opcional. URL de la p\xE1gina del producto (Shopify, AliExpress, Amazon, etc.) para enriquecer el contexto. Si se omite, la IA infiere todo desde la imagen."),
|
|
25006
25912
|
language: Lang.describe('C\xF3digo de idioma para el contenido generado. Ejemplos: "es", "en", "pt". REQUERIDO \u2014 si el usuario no lo especific\xF3, PREG\xDANTALE antes de invocar. NUNCA infieras desde el contexto del chat ni asumas "es" por default.'),
|
|
25007
25913
|
country: Country.describe('C\xF3digo ISO del pa\xEDs objetivo. Ejemplos: "CO", "MX", "US", "AR". Define moneda, m\xE9todos de pago locales y tono. REQUERIDO \u2014 si el usuario no lo especific\xF3, PREG\xDANTALE antes de invocar. NUNCA infieras desde el contexto del chat.'),
|
|
25008
|
-
price:
|
|
25009
|
-
compareAtPrice:
|
|
25010
|
-
offer:
|
|
25011
|
-
paymentMethods:
|
|
25012
|
-
productContext:
|
|
25013
|
-
productLabel:
|
|
25914
|
+
price: z105.string().min(1).max(120).optional().describe('Precio que se mostrar\xE1 en la landing y video. Formato libre \u2014 ej. "$89.900", "USD 29.99", "MXN 599". Opcional pero MUY IMPACTANTE: si el usuario no lo mencion\xF3, PREG\xDANTALE antes de invocar. Si te dice "t\xFA elige", om\xEDtelo y el backend sugiere uno.'),
|
|
25915
|
+
compareAtPrice: z105.string().min(1).max(120).optional().describe('Opcional. Precio anterior para comunicar un descuento real en landing e im\xE1genes. Ej. "$129.000" cuando price="$89.900".'),
|
|
25916
|
+
offer: z105.string().min(1).max(240).optional().describe('Oferta o promoci\xF3n a destacar. Ej. "2x1", "Env\xEDo gratis hoy", "50% OFF". Opcional pero MUY IMPACTANTE: si el usuario no lo mencion\xF3, PREG\xDANTALE antes de invocar (es v\xE1lido que diga "sin oferta"). Si te dice "t\xFA elige", om\xEDtelo.'),
|
|
25917
|
+
paymentMethods: z105.string().min(1).max(240).optional().describe('Opcional. M\xE9todos de pago que puede mostrar la landing. Ej. "Tarjeta, PSE, Nequi, Contraentrega". Si se omite, la landing no muestra m\xE9todos de pago.'),
|
|
25918
|
+
productContext: z105.string().max(PRODUCT_CONTEXT_MAX_CHARS).optional().describe("Opcional. Informacion adicional del producto que la IA debe usar como contexto prioritario: uso real, comprador, restricciones, diferenciadores o direccion creativa. No reemplaza la investigacion de competencia; si hay competencia, guia el primer angulo y los outputs no deben contradecirlo."),
|
|
25919
|
+
productLabel: z105.string().trim().max(80).optional().describe('Opcional. Qu\xE9 es el producto, en pocas palabras (ej. "quita pelusas para ropa"). Es AUTORITATIVO: si lo env\xEDas, la IA usa esta identidad y no la reemplaza por otra categor\xEDa. Si lo omites, la IA detecta el producto desde la imagen.'),
|
|
25014
25920
|
videoPreset: VideoPresetEnum.default("auto").describe('Opcional. Tipo/narrativa del video \u2014 \xFAnico campo de "estilo" que el usuario controla. Default "auto" (la IA escoge tras analizar el producto). Todos los presets funcionan a 15s (single_call) y 30s (Multiescena); "problem_solution" en single_call abre sin el producto y el producto entra por referencia en su beat de soluci\xF3n. Opciones: "auto", "ugc_dynamic" (review con experiencia y prueba), "ugc_how_to" (tutorial con pasos y resultado visible), "ugc_unboxing_chaos" (apertura y primera prueba), "problem_solution" (problema concreto, producto como soluci\xF3n y CTA), "product_showcase" (producto ejecutando una funci\xF3n real), "wearable_showcase" (prenda o accesorio modelado), "cinematic" (TV spot con receta cinematogr\xE1fica), "wild_card" (idea imposible: un truco visual que en la vida real no podr\xEDa pasar, y al cierre la invitaci\xF3n a comprar), "pixar_problem" (problema animado 3D), "pixar_sassy" (producto que habla). Si el usuario pide algo fuera de esta lista, p\xEDdele una opci\xF3n v\xE1lida.'),
|
|
25015
25921
|
animationStyle: AnimationStyleEnum.optional().describe('Opcional. Estilo visual SOLO para presets animados ("pixar_problem" o "pixar_sassy") \u2014 la API lo rechaza con cualquier otro preset. Opciones: "pixar_3d" (default, look 3D de pel\xEDcula animada), "claymation" (plastilina stop-motion artesanal), "wes_anderson" (tableau sim\xE9trico pastel), "sci_fi" (futurista con HUDs y ne\xF3n), "realista" (fotorrealista, fiel al producto). Si el usuario pide un look animado sin nombrar el estilo, omite el campo.'),
|
|
25016
|
-
durationSeconds:
|
|
25017
|
-
|
|
25018
|
-
|
|
25922
|
+
durationSeconds: z105.union([
|
|
25923
|
+
z105.literal(15),
|
|
25924
|
+
z105.literal(30)
|
|
25019
25925
|
]).default(15).describe("Opcional. Duraci\xF3n objetivo del video: 15s (single_call, default) o 30s (Multiescena, aproximadamente 30s y facturado por escena)."),
|
|
25020
|
-
pauseForAngleReview:
|
|
25021
|
-
aiDecidesAll:
|
|
25926
|
+
pauseForAngleReview: z105.boolean().optional().describe("Compatibilidad heredada. MCP deriva esta pausa de aiDecidesAll: manual siempre pausa y autom\xE1tico siempre la omite. No uses este campo para saltar reviews."),
|
|
25927
|
+
aiDecidesAll: z105.boolean().optional().describe("Mapea el toggle web \u201CDejar que la IA decida todo\u201D. Si true, ProductMaker omite reviews. Act\xEDvalo \xFAnicamente cuando el usuario lo pida expl\xEDcitamente. Omitido/false = reviews conversacionales."),
|
|
25022
25928
|
videoTier: VideoTierEnum.optional().describe('Opcional. Estilo del video. "basic" = "Realista" para 15s; al pedir durationSeconds=30 el sistema selecciona internamente Multiescena. No se expone el tier interno directamente.'),
|
|
25023
25929
|
videoStructure: VideoStructureEnum.default("single_take").describe('Opcional. Formato: "single_take" = Un solo clip (generado completo; puede incluir cambios de plano) o "multi_scene" = Multiescena. Default: single_take.'),
|
|
25024
25930
|
videoQuality: VideoQualityEnum.default("economy").describe('Opcional. Calidad: "economy" = Econ\xF3mico, "medium" = Medio o "pro" = Pro. El proveedor se elige internamente. Default: economy.'),
|
|
25025
25931
|
videoResolution: VideoResolutionEnum.optional().describe('Opcional. Resoluci\xF3n del render. En la web se pregunta "\xBFResoluci\xF3n del video?". "480p" = excelente calidad y m\xE1s econ\xF3mico (RECOMENDADO, default si se omite); "720p" = m\xE1xima nitidez, entre 3% y 15% m\xE1s caro seg\xFAn formato y tier. Si el usuario no menciona resoluci\xF3n, OMITE este campo (el backend usa 480p).'),
|
|
25026
|
-
videoAngleCount:
|
|
25932
|
+
videoAngleCount: z105.number().int().min(1).max(3).optional().describe("Cantidad de videos a renderizar: 1, 2 o 3. REQUERIDO cuando outputs incluye video (o se omite outputs, cuyo default incluye video); om\xEDtelo s\xF3lo cuando no se generar\xE1 video. Preg\xFAntalo incluso con aiDecidesAll=true porque cambia el costo."),
|
|
25027
25933
|
angleNarratives: PublicNarrativeStyleEnum.array().max(3).optional().describe('Opcional. Narrativa POR \xC1NGULO (posicional). Valores actuales: "review", "ugc_how_to", "ugc_unboxing_chaos", "problem_product_cta" (problema concreto, producto como soluci\xF3n y CTA), "product_showcase", "wearable_showcase", "cinematic", "wild_card", "animated_problem_pixar", "sassy_product_pixar", "market" (narrativa an\xE1lisis de mercado: adapta el video a los patrones ganadores estudiados de la competencia; requiere competitorScanEnabled: true). angleNarratives[i] fuerza la narrativa del \xE1ngulo i; las posiciones restantes las elige la IA. La lista no puede superar videoAngleCount.'),
|
|
25028
|
-
outputs:
|
|
25934
|
+
outputs: z105.array(z105.enum([
|
|
25029
25935
|
"landing",
|
|
25030
25936
|
"video",
|
|
25031
25937
|
"image"
|
|
25032
25938
|
])).min(1).max(3).optional().describe(`Opcional. Qu\xE9 outputs generar. Default: todos ["landing","video","image"]. Para 2 outputs: ["landing","image"] (sin video), ["video","image"] (sin landing), ["landing","video"] (sin imagen). ${createProductTaskSingleOutputDescription}`),
|
|
25033
|
-
includeInitialLandingGif:
|
|
25034
|
-
competitorScanEnabled:
|
|
25939
|
+
includeInitialLandingGif: z105.boolean().optional().describe("Opcional. En nuevas landings cl\xE1sicas habilitadas, omitirlo incluye el primer GIF del producto y su coste en el total. Env\xEDa false si el usuario lo excluye: no se genera ni se reserva su coste. Conserva la elecci\xF3n al confirmar y al reintentar."),
|
|
25940
|
+
competitorScanEnabled: z105.boolean().optional().describe("Opcional. Default false: omitirlo significa SIN estudio de mercado. Antes de crear, llama estimate_market_study_cost con kind=product_task, muestra al usuario el costo con y sin estudio y preg\xFAntale si lo quiere; env\xEDa true solo si lo acepta (o si solicita la narrativa an\xE1lisis de mercado). Si la tarea incluye video, true analiza anuncios de la competencia y desbloquea la narrativa an\xE1lisis de mercado; si el estudio no encuentra datos suficientes, degrada al planner cl\xE1sico."),
|
|
25035
25941
|
generateAiEdit: AiEditRequestSchema.optional().describe('Opcional. Pide la Edici\xF3n con IA: una pasada que a\xF1ade texto, efectos y m\xFAsica sobre cada video entregado (variante with_ai_edit; se cobra al entregar, por video). Nivel: "economy" (Econ\xF3mica, Sonnet 5.5, m\xE1s barata) o "pro" (Opus 5.5, mejor calidad, ~10 min). true equivale a "pro"; false/omitido = sin edici\xF3n.'),
|
|
25036
|
-
replicateWinnerWhenFound:
|
|
25037
|
-
brandId:
|
|
25038
|
-
actorId:
|
|
25942
|
+
replicateWinnerWhenFound: z105.boolean().optional().describe("Conserva la preferencia de copiar un ganador si existe. false estudia el mercado sin reemplazar un \xE1ngulo por el anuncio ganador. No a\xF1ade una pregunta obligatoria."),
|
|
25943
|
+
brandId: z105.string().uuid().optional().describe("Opcional. ID de una marca del usuario; si se env\xEDa, el sistema usa su voz, colores y persona para enriquecer los outputs generados."),
|
|
25944
|
+
actorId: z105.string().trim().min(1).max(120).optional().describe("Opcional. ID de un personaje guardado (usa list_actors para verlos). Si lo env\xEDas, su foto y su voz mandan sobre la descripci\xF3n de texto."),
|
|
25039
25945
|
creativeGender: CreativeGenderEnum.optional().describe('Opcional. QUI\xC9N APARECE EN PANTALLA en todos los creativos de la task: el presentador del video, las personas fotografiadas en la landing y la persona del anuncio. NO es la voz. M\xE1ndalo en cuanto el usuario lo diga en cualquier momento de la conversaci\xF3n y con cualquier redacci\xF3n ("quiero una mujer", "que salga un hombre", "esto es para hombres"): si no lo mandas, el g\xE9nero lo inventa la IA y el usuario recibe lo contrario de lo que pidi\xF3 sin ning\xFAn aviso. "mixed" solo cuando pida expl\xEDcitamente ambos. Si adem\xE1s mandas actorId, el personaje guardado manda sobre este campo.'),
|
|
25040
|
-
creativeDirection:
|
|
25041
|
-
headline:
|
|
25042
|
-
subheadline:
|
|
25946
|
+
creativeDirection: z105.string().max(500).optional().describe('Opcional. Direcci\xF3n creativa en texto libre (colores, mood, estilo) que aplica a los outputs de IMAGEN y LANDING (no al video \u2014 el estilo/ambiente del video se dirige con scriptNotes). M\xC1XIMA PRIORIDAD: anula marca, colores y estilo por defecto. Ej. "amarillo y azul, minimalista". M\xE1x 500 caracteres.'),
|
|
25947
|
+
headline: z105.string().max(120).optional().describe("Opcional. Titular EXACTO a renderizar. Se imprime tal cual: la IA no lo reescribe, no lo acorta y no lo traduce. Se aplica a las IM\xC1GENES y a la portada de la landing de esta task (el video no lo usa; para el video usa scriptNotes). \xDAsalo cuando el copy es de marca y no es negociable. M\xE1x 120 caracteres. Si lo omites, la IA escribe el titular."),
|
|
25948
|
+
subheadline: z105.string().max(160).optional().describe("Opcional. Subt\xEDtulo EXACTO a renderizar, misma regla que headline. Independiente: puedes fijar solo el subt\xEDtulo. M\xE1x 160 caracteres."),
|
|
25043
25949
|
landingStrategy: LandingStrategyEnum.optional().describe('Opcional. Estructura de la landing cl\xE1sica cuando landing est\xE1 entre outputs: "classic" (estructura original probada y recomendada; default del primer rollout), "auto" (la IA decide; experimental), "pain_solution", "social_proof" (Landing Viral: UGC, WhatsApp, Instagram y evidencia social), "benefits_clarity", "offer_value" o "lifestyle_identity". Default "classic".'),
|
|
25044
25950
|
landingImageFormat: LandingImageFormatEnum.default("9:16").describe('Opcional. Formato/relaci\xF3n de aspecto de las im\xE1genes de la landing cl\xE1sica cuando landing est\xE1 entre outputs: "9:16" (vertical, por defecto), "4:5" (vertical compacto para feed) o "1:1" (cuadrado). Default "9:16".')
|
|
25045
25951
|
}).strict();
|
|
25046
|
-
var CreateServiceVideoInput =
|
|
25047
|
-
landingUrl:
|
|
25048
|
-
additionalContext:
|
|
25952
|
+
var CreateServiceVideoInput = z105.object({
|
|
25953
|
+
landingUrl: z105.string().url().describe("URL p\xFAblica de la landing del servicio. Es suficiente para generar el video; los medios son opcionales en la web."),
|
|
25954
|
+
additionalContext: z105.string().max(3e3).optional().describe('Instrucci\xF3n natural prioritaria. Ej.: "adapta el ritmo de estos competidores", "enfatiza reservas de demos" o restricciones de claims.'),
|
|
25049
25955
|
language: Lang.describe("Idioma del video: es, en o pt."),
|
|
25050
|
-
voiceId:
|
|
25051
|
-
brandId:
|
|
25052
|
-
reviewMode:
|
|
25956
|
+
voiceId: z105.string().trim().min(1).pipe(VoiceId).optional().describe('Opcional. Voz para toda la narraci\xF3n. Usa "auto" para que la IA la alinee con el presentador. Las voces del banco compartido fueron retiradas.'),
|
|
25957
|
+
brandId: z105.string().uuid().optional().describe("Marca guardada del usuario. Aplica voz, mensajes, paleta y persona predeterminada."),
|
|
25958
|
+
reviewMode: z105.enum([
|
|
25053
25959
|
"automatic",
|
|
25054
25960
|
"guided"
|
|
25055
25961
|
]).default("automatic").describe("automatic = la IA elige concepto y guion sin pausas; guided = el usuario aprueba concepto y storyboard."),
|
|
25056
|
-
videoPreset:
|
|
25962
|
+
videoPreset: z105.enum([
|
|
25057
25963
|
"auto",
|
|
25058
25964
|
"ugc_dynamic",
|
|
25059
25965
|
"ugc_how_to",
|
|
@@ -25063,128 +25969,128 @@ var CreateServiceVideoInput = z100.object({
|
|
|
25063
25969
|
videoQuality: VideoQualityEnum.default("economy").describe('Opcional. Calidad: "economy" = Econ\xF3mico, "medium" = Medio o "pro" = Pro. El proveedor se elige internamente. Default: economy.'),
|
|
25064
25970
|
videoResolution: VideoResolutionEnum.default("480p").describe('Opcional. Resoluci\xF3n: "480p" o "720p". 720p cuesta m\xE1s por segundo y solo est\xE1 disponible en "economy" y "pro" (Medio = 768P). Default: 480p.')
|
|
25065
25971
|
}).strict();
|
|
25066
|
-
var GetTaskStatusInput =
|
|
25067
|
-
taskId:
|
|
25068
|
-
waitSeconds:
|
|
25972
|
+
var GetTaskStatusInput = z105.object({
|
|
25973
|
+
taskId: z105.string().min(1),
|
|
25974
|
+
waitSeconds: z105.number().int().min(0).max(120).optional()
|
|
25069
25975
|
});
|
|
25070
|
-
var ListTasksInput =
|
|
25071
|
-
limit:
|
|
25072
|
-
offset:
|
|
25073
|
-
search:
|
|
25976
|
+
var ListTasksInput = z105.object({
|
|
25977
|
+
limit: z105.number().int().min(1).max(50).optional(),
|
|
25978
|
+
offset: z105.number().int().min(0).optional(),
|
|
25979
|
+
search: z105.string().optional()
|
|
25074
25980
|
});
|
|
25075
25981
|
var MCP_REVIEW_LIST_FIELD_MAX = IMAGE_WIZARD_LIST_FIELD_MAX;
|
|
25076
25982
|
var MCP_REVIEW_FEATURE_ITEM_MAX = IMAGE_FEATURE_ITEM_MAX;
|
|
25077
|
-
var EditTaskDraftInput =
|
|
25078
|
-
taskId:
|
|
25079
|
-
angleIndex:
|
|
25080
|
-
angle:
|
|
25081
|
-
angle:
|
|
25082
|
-
buyerPersona:
|
|
25083
|
-
actor:
|
|
25084
|
-
actorId:
|
|
25085
|
-
gender:
|
|
25983
|
+
var EditTaskDraftInput = z105.object({
|
|
25984
|
+
taskId: z105.string().min(1),
|
|
25985
|
+
angleIndex: z105.number().int().min(0),
|
|
25986
|
+
angle: z105.object({
|
|
25987
|
+
angle: z105.string().min(1).max(480),
|
|
25988
|
+
buyerPersona: z105.string().min(1).max(360),
|
|
25989
|
+
actor: z105.string().min(1).max(360).optional(),
|
|
25990
|
+
actorId: z105.string().trim().min(1).optional().describe("Opcional. ID de un personaje guardado (usa list_actors para verlos). Si lo env\xEDas, su foto y su voz mandan sobre la descripci\xF3n de texto."),
|
|
25991
|
+
gender: z105.enum([
|
|
25086
25992
|
"female",
|
|
25087
25993
|
"male"
|
|
25088
25994
|
]).optional(),
|
|
25089
|
-
scriptNotes:
|
|
25995
|
+
scriptNotes: z105.string().max(2e3).optional()
|
|
25090
25996
|
})
|
|
25091
25997
|
});
|
|
25092
|
-
var PendingActionPayload =
|
|
25093
|
-
|
|
25094
|
-
kind:
|
|
25998
|
+
var PendingActionPayload = z105.discriminatedUnion("kind", [
|
|
25999
|
+
z105.object({
|
|
26000
|
+
kind: z105.literal("product_reference_set_approval"),
|
|
25095
26001
|
scope: ProductReferenceScopeEnum.optional(),
|
|
25096
|
-
scopeKey:
|
|
25097
|
-
scopeSnapshotId:
|
|
25098
|
-
expectedScopeHash:
|
|
26002
|
+
scopeKey: z105.string().min(1).max(120).optional(),
|
|
26003
|
+
scopeSnapshotId: z105.string().uuid().optional(),
|
|
26004
|
+
expectedScopeHash: z105.string().min(1).max(128).optional(),
|
|
25099
26005
|
decision: ProductReferenceResolutionDecisionEnum,
|
|
25100
26006
|
reason: ProductReferenceRejectionReasonEnum.optional(),
|
|
25101
|
-
affectedRefKeys:
|
|
25102
|
-
affectedPhotoNumbers:
|
|
25103
|
-
recoveryAction:
|
|
26007
|
+
affectedRefKeys: z105.array(z105.string().min(1).max(200)).min(1).optional(),
|
|
26008
|
+
affectedPhotoNumbers: z105.array(z105.number().int().positive()).min(1).optional(),
|
|
26009
|
+
recoveryAction: z105.enum([
|
|
25104
26010
|
"remove",
|
|
25105
26011
|
"replace",
|
|
25106
26012
|
"upload",
|
|
25107
26013
|
"return_to_selection"
|
|
25108
26014
|
]).optional()
|
|
25109
26015
|
}),
|
|
25110
|
-
|
|
25111
|
-
kind:
|
|
25112
|
-
selectedPhotoNumbers:
|
|
26016
|
+
z105.object({
|
|
26017
|
+
kind: z105.literal("product_reference_confirmation"),
|
|
26018
|
+
selectedPhotoNumbers: z105.array(z105.number().int().positive().max(5)).min(1).max(5).optional().describe("Opcional. N\xFAmeros visibles de las fotos que el usuario quiere conservar; las dem\xE1s se deseleccionan. Debe quedar al menos una."),
|
|
25113
26019
|
userChoice: ProductReferenceUserChoiceEnum.optional(),
|
|
25114
|
-
confirmedProductNames:
|
|
26020
|
+
confirmedProductNames: z105.array(z105.string().min(1).max(120)).min(2).max(8).optional(),
|
|
25115
26021
|
videoStructure: VideoStructureEnum.optional().describe("Opcional. Formato para reanudar el video: single_take (Un solo clip, generado completo; puede incluir cambios de plano) o multi_scene (Multiescena). El backend vuelve a validar que sea compatible con el agrupamiento confirmado."),
|
|
25116
26022
|
videoQuality: VideoQualityEnum.optional().describe("Opcional. Calidad para reanudar el video: economy (Econ\xF3mico), medium (Medio) o pro. El proveedor se elige internamente y el backend vuelve a cotizar la ruta."),
|
|
25117
|
-
useMultiSceneShowcase:
|
|
26023
|
+
useMultiSceneShowcase: z105.boolean().optional().describe("Compatibilidad con confirmaciones antiguas: si es true junto con userChoice=variants, conserva el showcase multiescena.")
|
|
25118
26024
|
}),
|
|
25119
|
-
|
|
25120
|
-
kind:
|
|
26025
|
+
z105.object({
|
|
26026
|
+
kind: z105.literal("angle_review_approval"),
|
|
25121
26027
|
// All edits are optional — empty action body just approves the
|
|
25122
26028
|
// backend-generated draft as-is. Field shapes mirror the angle-review
|
|
25123
26029
|
// request contracts in @packages/types/wizard.ts; the handler routes to
|
|
25124
26030
|
// the dedicated video/image/autopilot endpoint based on StatusResponse.kind.
|
|
25125
|
-
customAngle:
|
|
26031
|
+
customAngle: z105.string().min(1).max(480).optional(),
|
|
25126
26032
|
// Keep the shared MCP action within the strictest downstream contract:
|
|
25127
26033
|
// autopilot/image resume endpoints cap these fields at 1500 characters.
|
|
25128
|
-
painPoints:
|
|
25129
|
-
benefits:
|
|
26034
|
+
painPoints: z105.string().max(MCP_REVIEW_LIST_FIELD_MAX).optional(),
|
|
26035
|
+
benefits: z105.string().max(MCP_REVIEW_LIST_FIELD_MAX).optional(),
|
|
25130
26036
|
// Same policy as the two fields above: the strictest downstream contract
|
|
25131
26037
|
// wins. The image endpoint caps each feature at 240 while landing/video
|
|
25132
26038
|
// accept 300, and this single action routes to whichever the task is — so
|
|
25133
26039
|
// accepting 300 here turns a 250-character feature on an image task into
|
|
25134
26040
|
// an opaque HTTP 400 after the model already believed it had been saved.
|
|
25135
|
-
features:
|
|
25136
|
-
buyerPersona:
|
|
26041
|
+
features: z105.array(z105.string().min(1).max(MCP_REVIEW_FEATURE_ITEM_MAX)).max(10).optional(),
|
|
26042
|
+
buyerPersona: z105.string().min(1).max(360).optional(),
|
|
25137
26043
|
narrativeStyle: PublicNarrativeStyleEnum.optional().describe('Narrativa del video. "problem_product_cta" (Problema y Soluci\xF3n) funciona en ambos formatos \u2014 en Un solo clip abre sin producto y el producto entra por referencia en su beat. La familia storyteller ("animated_storyteller", "animated_inner_journey", "animated_object_soul", "animated_timeline") no est\xE1 disponible por ahora.'),
|
|
25138
|
-
actor:
|
|
25139
|
-
actorId:
|
|
25140
|
-
creativeDirection:
|
|
25141
|
-
selectedAngleNumbers:
|
|
25142
|
-
angleEdits:
|
|
25143
|
-
angleNumber:
|
|
25144
|
-
narrativeSelection:
|
|
26044
|
+
actor: z105.string().min(1).max(360).optional().describe("Nueva descripci\xF3n del presentador. Al enviarla sin actorId, se elimina autom\xE1ticamente cualquier actor guardado previo de esos \xE1ngulos."),
|
|
26045
|
+
actorId: z105.string().max(120).nullable().optional(),
|
|
26046
|
+
creativeDirection: z105.string().max(2e3).optional(),
|
|
26047
|
+
selectedAngleNumbers: z105.array(z105.number().int().positive()).min(1).max(3).optional().describe("N\xFAmeros visibles (1-based) de los \xE1ngulos que el usuario quiere renderizar. Deben ser \xFAnicos, existir en la review y no superar el videoAngleCount autorizado."),
|
|
26048
|
+
angleEdits: z105.array(z105.object({
|
|
26049
|
+
angleNumber: z105.number().int().positive(),
|
|
26050
|
+
narrativeSelection: z105.enum([
|
|
25145
26051
|
"market",
|
|
25146
26052
|
"guided"
|
|
25147
26053
|
]).optional().describe("Elecci\xF3n expl\xEDcita: market usa el estudio disponible; guided usa la narrativa elegida para este \xE1ngulo."),
|
|
25148
|
-
angle:
|
|
25149
|
-
buyerPersona:
|
|
26054
|
+
angle: z105.string().min(1).max(480).optional(),
|
|
26055
|
+
buyerPersona: z105.string().min(1).max(360).optional(),
|
|
25150
26056
|
narrativeStyle: PublicNarrativeStyleEnum.optional().describe('Narrativa del video. "problem_product_cta" (Problema y Soluci\xF3n) funciona en ambos formatos \u2014 en Un solo clip abre sin producto y el producto entra por referencia en su beat. La familia storyteller ("animated_storyteller", "animated_inner_journey", "animated_object_soul", "animated_timeline") no est\xE1 disponible por ahora.'),
|
|
25151
|
-
actor:
|
|
25152
|
-
actorId:
|
|
25153
|
-
creativeDirection:
|
|
26057
|
+
actor: z105.string().min(1).max(360).optional(),
|
|
26058
|
+
actorId: z105.string().max(120).nullable().optional(),
|
|
26059
|
+
creativeDirection: z105.string().max(2e3).optional()
|
|
25154
26060
|
}).strict()).max(3).optional().describe("Ediciones independientes por n\xFAmero visible de \xE1ngulo. S\xF3lo se aceptan para \xE1ngulos incluidos en selectedAngleNumbers (o en la selecci\xF3n por defecto)."),
|
|
25155
|
-
gapDurationSeconds:
|
|
25156
|
-
|
|
25157
|
-
|
|
26061
|
+
gapDurationSeconds: z105.union([
|
|
26062
|
+
z105.literal(15),
|
|
26063
|
+
z105.literal(30)
|
|
25158
26064
|
]).optional().describe("Opcional. Solo para aceptar expl\xEDcitamente la recomendaci\xF3n gapDurationChoice del status. 30 env\xEDa el override double_30s para el \xE1ngulo recomendado; 15 u omitido conserva la duraci\xF3n cotizada.")
|
|
25159
26065
|
}),
|
|
25160
|
-
|
|
25161
|
-
kind:
|
|
25162
|
-
angleId:
|
|
25163
|
-
angleNumber:
|
|
25164
|
-
content:
|
|
25165
|
-
creativeDirection:
|
|
25166
|
-
actor:
|
|
26066
|
+
z105.object({
|
|
26067
|
+
kind: z105.literal("service_angle_approval"),
|
|
26068
|
+
angleId: z105.string().uuid().optional(),
|
|
26069
|
+
angleNumber: z105.number().int().positive().optional(),
|
|
26070
|
+
content: z105.string().min(1).max(480).optional(),
|
|
26071
|
+
creativeDirection: z105.string().min(1).max(1500).optional(),
|
|
26072
|
+
actor: z105.string().min(1).max(360).optional()
|
|
25167
26073
|
}),
|
|
25168
|
-
|
|
25169
|
-
kind:
|
|
25170
|
-
voiceovers:
|
|
25171
|
-
visualDirections:
|
|
25172
|
-
voiceoversByScene:
|
|
25173
|
-
visualDirectionsByScene:
|
|
26074
|
+
z105.object({
|
|
26075
|
+
kind: z105.literal("service_script_approval"),
|
|
26076
|
+
voiceovers: z105.record(z105.string(), z105.string().min(1).max(600)).optional(),
|
|
26077
|
+
visualDirections: z105.record(z105.string(), z105.string().min(1).max(1200)).optional(),
|
|
26078
|
+
voiceoversByScene: z105.record(z105.string(), z105.string().min(1).max(600)).optional(),
|
|
26079
|
+
visualDirectionsByScene: z105.record(z105.string(), z105.string().min(1).max(1200)).optional()
|
|
25174
26080
|
})
|
|
25175
26081
|
]);
|
|
25176
|
-
var ResolvePendingActionInput =
|
|
25177
|
-
taskId:
|
|
26082
|
+
var ResolvePendingActionInput = z105.object({
|
|
26083
|
+
taskId: z105.string().min(1),
|
|
25178
26084
|
action: PendingActionPayload
|
|
25179
26085
|
}).strict();
|
|
25180
26086
|
function resolveVariantConfirmVideoTier(action) {
|
|
25181
26087
|
return action.useMultiSceneShowcase && action.userChoice === "variants" ? "standard" : void 0;
|
|
25182
26088
|
}
|
|
25183
26089
|
__name(resolveVariantConfirmVideoTier, "resolveVariantConfirmVideoTier");
|
|
25184
|
-
var StatusForResolveSchema =
|
|
26090
|
+
var StatusForResolveSchema = z105.object({
|
|
25185
26091
|
// Metadata used to select the backend resume contract. Older API responses
|
|
25186
26092
|
// may omit these fields, so the resolver keeps the generic fallback.
|
|
25187
|
-
kind:
|
|
26093
|
+
kind: z105.enum([
|
|
25188
26094
|
"autopilot",
|
|
25189
26095
|
"video",
|
|
25190
26096
|
"image",
|
|
@@ -25192,18 +26098,18 @@ var StatusForResolveSchema = z100.object({
|
|
|
25192
26098
|
"mix",
|
|
25193
26099
|
"service"
|
|
25194
26100
|
]).optional(),
|
|
25195
|
-
selectedOutputs:
|
|
26101
|
+
selectedOutputs: z105.array(z105.enum([
|
|
25196
26102
|
"landing",
|
|
25197
26103
|
"video",
|
|
25198
26104
|
"image"
|
|
25199
26105
|
])).optional(),
|
|
25200
|
-
videoAngleCount:
|
|
25201
|
-
ugcFormat:
|
|
26106
|
+
videoAngleCount: z105.number().int().min(1).max(3).optional(),
|
|
26107
|
+
ugcFormat: z105.enum([
|
|
25202
26108
|
"single_8s",
|
|
25203
26109
|
"single_15s",
|
|
25204
26110
|
"double_30s"
|
|
25205
26111
|
]).optional(),
|
|
25206
|
-
videoStyle:
|
|
26112
|
+
videoStyle: z105.enum([
|
|
25207
26113
|
"ugc",
|
|
25208
26114
|
"cartoon_3d",
|
|
25209
26115
|
"product_only",
|
|
@@ -25213,13 +26119,13 @@ var StatusForResolveSchema = z100.object({
|
|
|
25213
26119
|
videoQuality: VideoQualityEnum.optional(),
|
|
25214
26120
|
videoRouteId: VideoRouteIdEnum.optional(),
|
|
25215
26121
|
videoModel: TaskVideoModelEnum.optional(),
|
|
25216
|
-
videoTier:
|
|
26122
|
+
videoTier: z105.enum([
|
|
25217
26123
|
"legacy",
|
|
25218
26124
|
"standard",
|
|
25219
26125
|
"pro",
|
|
25220
26126
|
"single_call"
|
|
25221
26127
|
]).optional(),
|
|
25222
|
-
videoResolution:
|
|
26128
|
+
videoResolution: z105.enum([
|
|
25223
26129
|
"480p",
|
|
25224
26130
|
"720p"
|
|
25225
26131
|
]).optional(),
|
|
@@ -25227,60 +26133,60 @@ var StatusForResolveSchema = z100.object({
|
|
|
25227
26133
|
// A task created before a narrative was blocked/hidden must still parse,
|
|
25228
26134
|
// or resolve_pending_action could never approve it.
|
|
25229
26135
|
narrativeStyle: NarrativeStyle.optional(),
|
|
25230
|
-
pauseForVideoScriptReview:
|
|
25231
|
-
pendingUserAction:
|
|
25232
|
-
kind:
|
|
25233
|
-
candidateGrouping:
|
|
25234
|
-
selectedImageUrls:
|
|
25235
|
-
proposedProductNames:
|
|
26136
|
+
pauseForVideoScriptReview: z105.boolean().optional(),
|
|
26137
|
+
pendingUserAction: z105.object({
|
|
26138
|
+
kind: z105.string(),
|
|
26139
|
+
candidateGrouping: z105.string().optional(),
|
|
26140
|
+
selectedImageUrls: z105.array(z105.string()).optional(),
|
|
26141
|
+
proposedProductNames: z105.array(z105.string()).optional(),
|
|
25236
26142
|
// Adaptive reference questions are server-owned. Echo only the evidence
|
|
25237
26143
|
// identity and the choices shown by the current snapshot; never accept a
|
|
25238
26144
|
// client-supplied reference set as authorization.
|
|
25239
|
-
options:
|
|
25240
|
-
mode:
|
|
26145
|
+
options: z105.array(ProductReferenceUserChoiceEnum).max(4).optional(),
|
|
26146
|
+
mode: z105.enum([
|
|
25241
26147
|
"question",
|
|
25242
26148
|
"visual_recovery"
|
|
25243
26149
|
]).optional(),
|
|
25244
26150
|
/** Hand-mirrored from packages/types result.ts — see CLAUDE.md § MCP Server Sync. */
|
|
25245
|
-
canKeepSelection:
|
|
25246
|
-
decisionKey:
|
|
25247
|
-
questionOrdinal:
|
|
25248
|
-
questionCeiling:
|
|
25249
|
-
|
|
25250
|
-
|
|
26151
|
+
canKeepSelection: z105.boolean().optional(),
|
|
26152
|
+
decisionKey: z105.string().optional(),
|
|
26153
|
+
questionOrdinal: z105.number().int().min(1).max(5).optional(),
|
|
26154
|
+
questionCeiling: z105.union([
|
|
26155
|
+
z105.literal(3),
|
|
26156
|
+
z105.literal(5)
|
|
25251
26157
|
]).optional(),
|
|
25252
|
-
referenceEvidenceVersion:
|
|
25253
|
-
expectedEvidenceHash:
|
|
25254
|
-
question:
|
|
25255
|
-
prompt:
|
|
25256
|
-
helpText:
|
|
25257
|
-
options:
|
|
26158
|
+
referenceEvidenceVersion: z105.number().int().positive().optional(),
|
|
26159
|
+
expectedEvidenceHash: z105.string().optional(),
|
|
26160
|
+
question: z105.object({
|
|
26161
|
+
prompt: z105.string().min(1).max(240),
|
|
26162
|
+
helpText: z105.string().min(1).max(300).optional(),
|
|
26163
|
+
options: z105.array(z105.object({
|
|
25258
26164
|
value: ProductReferenceUserChoiceEnum,
|
|
25259
|
-
label:
|
|
25260
|
-
description:
|
|
26165
|
+
label: z105.string().min(1).max(120),
|
|
26166
|
+
description: z105.string().min(1).max(240).optional()
|
|
25261
26167
|
})).min(2).max(4)
|
|
25262
26168
|
}).optional(),
|
|
25263
26169
|
scope: ProductReferenceScopeEnum.optional(),
|
|
25264
|
-
scopeKey:
|
|
25265
|
-
scopeSnapshotId:
|
|
25266
|
-
scopeHash:
|
|
25267
|
-
baseReferenceSetHash:
|
|
25268
|
-
phase:
|
|
26170
|
+
scopeKey: z105.string().optional(),
|
|
26171
|
+
scopeSnapshotId: z105.string().uuid().optional(),
|
|
26172
|
+
scopeHash: z105.string().optional(),
|
|
26173
|
+
baseReferenceSetHash: z105.string().optional(),
|
|
26174
|
+
phase: z105.enum([
|
|
25269
26175
|
"preparation",
|
|
25270
26176
|
"final"
|
|
25271
26177
|
]).optional(),
|
|
25272
|
-
selectedRefKeys:
|
|
25273
|
-
allowedDecisions:
|
|
25274
|
-
previews:
|
|
25275
|
-
refKey:
|
|
26178
|
+
selectedRefKeys: z105.array(z105.string().min(1).max(200)).optional(),
|
|
26179
|
+
allowedDecisions: z105.array(ProductReferenceResolutionDecisionEnum).optional(),
|
|
26180
|
+
previews: z105.array(z105.object({
|
|
26181
|
+
refKey: z105.string().min(1).max(200)
|
|
25276
26182
|
}).passthrough()).optional(),
|
|
25277
|
-
customAngleDraft:
|
|
25278
|
-
painPointsDraft:
|
|
25279
|
-
benefitsDraft:
|
|
25280
|
-
featuresDraft:
|
|
25281
|
-
angleOptions:
|
|
25282
|
-
index:
|
|
25283
|
-
angle:
|
|
26183
|
+
customAngleDraft: z105.string().optional(),
|
|
26184
|
+
painPointsDraft: z105.string().optional(),
|
|
26185
|
+
benefitsDraft: z105.string().optional(),
|
|
26186
|
+
featuresDraft: z105.array(z105.string()).optional(),
|
|
26187
|
+
angleOptions: z105.array(z105.object({
|
|
26188
|
+
index: z105.number().int().nonnegative(),
|
|
26189
|
+
angle: z105.string().min(1)
|
|
25284
26190
|
}).passthrough()).min(1).max(5).optional(),
|
|
25285
26191
|
// Recommendation consumed only when the caller explicitly sends
|
|
25286
26192
|
// gapDurationSeconds: 30 in the angle approval action.
|
|
@@ -25290,17 +26196,17 @@ var StatusForResolveSchema = z100.object({
|
|
|
25290
26196
|
// keys. `actorId` (the saved custom actor the picker stored) was silently
|
|
25291
26197
|
// dropped here, so the approval handler below could not echo it back on the
|
|
25292
26198
|
// PATCH — the selection looked accepted and reached no render.
|
|
25293
|
-
angles:
|
|
25294
|
-
id:
|
|
25295
|
-
content:
|
|
25296
|
-
creativeDirection:
|
|
25297
|
-
actor:
|
|
25298
|
-
actorId:
|
|
26199
|
+
angles: z105.array(z105.object({
|
|
26200
|
+
id: z105.string().uuid(),
|
|
26201
|
+
content: z105.string(),
|
|
26202
|
+
creativeDirection: z105.string(),
|
|
26203
|
+
actor: z105.string(),
|
|
26204
|
+
actorId: z105.string().nullable().optional()
|
|
25299
26205
|
}).passthrough()).optional(),
|
|
25300
|
-
panels:
|
|
25301
|
-
beatId:
|
|
25302
|
-
voiceover:
|
|
25303
|
-
visualDirection:
|
|
26206
|
+
panels: z105.array(z105.object({
|
|
26207
|
+
beatId: z105.string(),
|
|
26208
|
+
voiceover: z105.string(),
|
|
26209
|
+
visualDirection: z105.string()
|
|
25304
26210
|
}).passthrough()).optional()
|
|
25305
26211
|
}).optional()
|
|
25306
26212
|
}).passthrough();
|
|
@@ -25652,8 +26558,8 @@ ANTES de invocar, resume outputs, cantidad de videos y datos comerciales, explic
|
|
|
25652
26558
|
server.registerTool("verify_landing_commerce", {
|
|
25653
26559
|
description: getProductMakerCapabilityModelGuidance("verify_landing_commerce").summary + " Verifica una correcci\xF3n manual de precios, tachados o packs de una landing editable existente. Solo relee Shopify y los recibos externos; no cambia precios, inventario, SKU ni compra una edici\xF3n. Pasa taskId y editId de la edici\xF3n ya conocida; nunca inventes IDs ni pidas repetir el cambio. Devuelve el estado can\xF3nico por proveedor: conserva el aviso pendiente hasta confirmar los valores reales. Solo despu\xE9s de confirmar todos los valores, el servidor puede volver a habilitar la compra. Web guardada no demuestra publicaci\xF3n p\xFAblica ni checkout; muestra las correcciones y enlaces pendientes sin c\xF3digos t\xE9cnicos. La disponibilidad del editor conserva sus permisos actuales.",
|
|
25654
26560
|
inputSchema: {
|
|
25655
|
-
taskId:
|
|
25656
|
-
editId:
|
|
26561
|
+
taskId: z105.string().uuid(),
|
|
26562
|
+
editId: z105.string().uuid()
|
|
25657
26563
|
},
|
|
25658
26564
|
annotations: OVERWRITES_EXTERNAL
|
|
25659
26565
|
}, async (input) => {
|
|
@@ -26293,7 +27199,7 @@ ANTES de invocar, resume outputs, cantidad de videos y datos comerciales, explic
|
|
|
26293
27199
|
__name(registerTaskTools, "registerTaskTools");
|
|
26294
27200
|
|
|
26295
27201
|
// src/tools/creatives.ts
|
|
26296
|
-
import { z as
|
|
27202
|
+
import { z as z106 } from "zod";
|
|
26297
27203
|
var generateFreeVideoGuidance = getProductMakerCapabilityModelGuidance("generate_free_video");
|
|
26298
27204
|
var generateVideoCreativeGuidance = getProductMakerCapabilityModelGuidance("generate_video_creative");
|
|
26299
27205
|
var generateImageCreativesGuidance = getProductMakerCapabilityModelGuidance("generate_image_creatives");
|
|
@@ -26304,72 +27210,72 @@ var CreativeRefs = {
|
|
|
26304
27210
|
images: ImagesInput,
|
|
26305
27211
|
language: Lang.describe('Idioma del contenido. Ej. "es", "en", "pt". REQUERIDO \u2014 si el usuario no lo dijo, PREG\xDANTALE antes de invocar. NUNCA infieras desde el contexto del chat ni asumas un default.'),
|
|
26306
27212
|
country: Country.describe('Pa\xEDs objetivo ISO. Ej. "CO", "MX", "US", "AR". Define moneda, m\xE9todos de pago y tono. REQUERIDO \u2014 si el usuario no lo dijo, PREG\xDANTALE antes de invocar. NUNCA infieras desde el contexto del chat ni asumas un default.'),
|
|
26307
|
-
price:
|
|
26308
|
-
offer:
|
|
26309
|
-
compareAtPrice:
|
|
26310
|
-
productContext:
|
|
26311
|
-
productLabel:
|
|
26312
|
-
buyerPersona:
|
|
26313
|
-
isCombo:
|
|
26314
|
-
competitorScanEnabled:
|
|
26315
|
-
brandId:
|
|
27213
|
+
price: z106.string().min(1).max(120).optional().describe('Precio en formato libre \u2014 ej. "$89.900", "USD 29.99". Opcional pero MUY IMPACTANTE para conversi\xF3n: si el usuario no lo mencion\xF3, PREG\xDANTALE antes de invocar. Si el usuario te dice "t\xFA elige", omite el campo y la IA del backend sugiere uno.'),
|
|
27214
|
+
offer: z106.string().min(1).max(240).optional().describe('Oferta a destacar \u2014 ej. "2x1", "Env\xEDo gratis", "50% OFF". Opcional pero MUY IMPACTANTE: si el usuario no lo mencion\xF3, PREG\xDANTALE antes de invocar (es v\xE1lido que diga "sin oferta"). Si el usuario te dice "t\xFA elige", omite el campo.'),
|
|
27215
|
+
compareAtPrice: z106.string().min(1).max(120).optional().describe('Opcional. Precio anterior o de referencia para mostrar descuento. Ej. "$129.000" cuando price="$89.900".'),
|
|
27216
|
+
productContext: z106.string().max(3e3).optional().describe("Opcional. Informacion adicional del producto que la IA debe usar como contexto prioritario: uso real, comprador, restricciones, diferenciadores o direccion creativa. No reemplaza la investigacion de competencia; si hay competencia, guia el primer angulo y los outputs no deben contradecirlo."),
|
|
27217
|
+
productLabel: z106.string().trim().max(80).optional().describe('Opcional. Nombre o tipo del producto en pocas palabras (ej. "collar de oro", "quita pelusas para ropa"). Es AUTORITATIVO: la IA usa esta identidad y no la reemplaza por otra categor\xEDa. Si lo omites, la IA lo detecta desde la imagen. NO salta la extracci\xF3n.'),
|
|
27218
|
+
buyerPersona: z106.string().optional().describe('Opcional. Descripci\xF3n del comprador objetivo. Ej. "Mujeres 35-50, profesionales urbanas". Si se omite, la IA infiere desde el \xE1ngulo y producto.'),
|
|
27219
|
+
isCombo: z106.boolean().optional().describe("Opcional. Si true, el creativo presenta el producto como combo/pack. Default false."),
|
|
27220
|
+
competitorScanEnabled: z106.boolean().optional().describe("Opcional. Default false: omitirlo significa SIN estudio de mercado. Antes de crear, llama estimate_market_study_cost, muestra al usuario el costo con y sin estudio y preg\xFAntale si lo quiere; env\xEDa true solo si lo acepta (o si solicita la narrativa an\xE1lisis de mercado). En video, true analiza anuncios de la competencia y desbloquea la narrativa an\xE1lisis de mercado; si el estudio no encuentra datos suficientes, degrada al planner cl\xE1sico."),
|
|
27221
|
+
brandId: z106.string().uuid().optional().describe("Opcional. ID de una marca del usuario; si se env\xEDa, el sistema usa su voz, colores y persona para enriquecer el creativo.")
|
|
26316
27222
|
};
|
|
26317
|
-
var VideoPresenter =
|
|
26318
|
-
|
|
26319
|
-
mode:
|
|
27223
|
+
var VideoPresenter = z106.discriminatedUnion("mode", [
|
|
27224
|
+
z106.object({
|
|
27225
|
+
mode: z106.literal("none")
|
|
26320
27226
|
}).strict(),
|
|
26321
|
-
|
|
26322
|
-
mode:
|
|
26323
|
-
actorId:
|
|
27227
|
+
z106.object({
|
|
27228
|
+
mode: z106.literal("saved_actor"),
|
|
27229
|
+
actorId: z106.string().trim().min(1).max(120).describe("ID devuelto por list_actors para un actor guardado del usuario.")
|
|
26324
27230
|
}).strict(),
|
|
26325
|
-
|
|
26326
|
-
mode:
|
|
26327
|
-
description:
|
|
27231
|
+
z106.object({
|
|
27232
|
+
mode: z106.literal("described"),
|
|
27233
|
+
description: z106.string().trim().min(1).max(500).describe("Descripci\xF3n concreta de la persona que presenta el producto.")
|
|
26328
27234
|
}).strict()
|
|
26329
27235
|
]);
|
|
26330
|
-
var VideoCreativeSetup =
|
|
26331
|
-
|
|
26332
|
-
mode:
|
|
27236
|
+
var VideoCreativeSetup = z106.discriminatedUnion("mode", [
|
|
27237
|
+
z106.object({
|
|
27238
|
+
mode: z106.literal("automatic").describe('S\xF3lo cuando el usuario pidi\xF3 expl\xEDcitamente "decide todo".')
|
|
26333
27239
|
}).strict(),
|
|
26334
|
-
|
|
26335
|
-
mode:
|
|
27240
|
+
z106.object({
|
|
27241
|
+
mode: z106.literal("guided"),
|
|
26336
27242
|
videoPreset: VideoPresetEnum.default("auto").describe('Narrativa opcional. Con estudio de mercado no la preguntes: se usa "auto" y el estudio define la estructura. Sin estudio conserva la elecci\xF3n del usuario. Todas las narrativas funcionan en Un solo clip y Multiescena.'),
|
|
26337
|
-
buyerPersona:
|
|
27243
|
+
buyerPersona: z106.string().trim().min(1).max(360),
|
|
26338
27244
|
animationStyle: AnimationStyleEnum.optional().describe('Opcional. Estilo visual SOLO para presets animados ("pixar_problem" o "pixar_sassy") \u2014 la API lo rechaza con cualquier otro preset. Opciones: "pixar_3d" (default, look 3D de pel\xEDcula animada), "claymation" (plastilina stop-motion artesanal), "wes_anderson" (tableau sim\xE9trico pastel), "sci_fi" (futurista con HUDs y ne\xF3n), "realista" (fotorrealista, fiel al producto). Si el usuario pide un look animado sin nombrar el estilo, omite el campo.'),
|
|
26339
27245
|
presenter: VideoPresenter,
|
|
26340
|
-
creativeDirection:
|
|
27246
|
+
creativeDirection: z106.string().trim().min(1).max(500).nullable().describe("Direcci\xF3n visual elegida. null significa que el usuario deleg\xF3 expl\xEDcitamente esta decisi\xF3n.")
|
|
26341
27247
|
}).strict()
|
|
26342
27248
|
]);
|
|
26343
|
-
var VideoInput =
|
|
27249
|
+
var VideoInput = z106.object({
|
|
26344
27250
|
images: CreativeRefs.images.optional(),
|
|
26345
27251
|
winnerReference: WinnerReferenceInput.optional().describe(WINNER_IMAGE_CHOICE_GUIDANCE),
|
|
26346
|
-
title:
|
|
26347
|
-
primaryAngle:
|
|
27252
|
+
title: z106.string().min(1).describe('T\xEDtulo corto del producto. Aparece en la primera vista del video. Ej. "Crema Anti-Edad Premium".'),
|
|
27253
|
+
primaryAngle: z106.string().min(1).describe('\xC1ngulo de venta principal (frase del beneficio). Ej. "Reduce arrugas en 14 d\xEDas" o "Para quienes odian las cremas grasosas".'),
|
|
26348
27254
|
language: CreativeRefs.language,
|
|
26349
27255
|
country: CreativeRefs.country,
|
|
26350
|
-
aspectRatio:
|
|
27256
|
+
aspectRatio: z106.enum([
|
|
26351
27257
|
"9:16",
|
|
26352
27258
|
"16:9",
|
|
26353
27259
|
"Auto"
|
|
26354
27260
|
]).describe('Relaci\xF3n de aspecto. "9:16" = vertical (TikTok/Reels \u2014 default recomendado para ads). "16:9" = horizontal (YouTube). "Auto" = decide la IA.'),
|
|
26355
27261
|
generateAiEdit: AiEditRequestSchema.optional().describe('Opcional. Pide la Edici\xF3n con IA: una pasada que a\xF1ade texto, efectos y m\xFAsica sobre cada video entregado (variante with_ai_edit; se cobra al entregar, por video). Nivel: "economy" (Econ\xF3mica, Sonnet 5.5, m\xE1s barata) o "pro" (Opus 5.5, mejor calidad, ~10 min). true equivale a "pro"; false/omitido = sin edici\xF3n.'),
|
|
26356
|
-
durationSeconds:
|
|
26357
|
-
videoAngleCount:
|
|
27262
|
+
durationSeconds: z106.number().int().min(4).max(30).default(15).describe("Opcional. Duraci\xF3n objetivo: Un solo clip Econ\xF3mico o Medio usa 15s; Un solo clip Pro usa 15s o 30s; Multiescena usa 15s o 30s totales. La combinaci\xF3n de formato y calidad determina la ruta y el costo."),
|
|
27263
|
+
videoAngleCount: z106.number().int().min(1).max(3).describe("Cantidad de videos a renderizar: 1, 2 o 3. Es una decisi\xF3n de costo obligatoria: preg\xFAntala incluso cuando creativeSetup.mode=automatic."),
|
|
26358
27264
|
angleNarratives: PublicNarrativeStyleEnum.array().max(3).optional().describe('Opcional. Narrativa POR \xC1NGULO (posicional). Valores actuales: "review", "ugc_how_to", "ugc_unboxing_chaos", "problem_product_cta" (problema concreto, producto como soluci\xF3n y CTA), "product_showcase", "wearable_showcase", "cinematic", "wild_card", "animated_problem_pixar", "sassy_product_pixar", "market" (narrativa an\xE1lisis de mercado: adapta el video a los patrones ganadores estudiados de la competencia; requiere competitorScanEnabled: true). angleNarratives[i] fuerza la narrativa del \xE1ngulo i; las posiciones restantes las elige la IA. La lista no puede superar videoAngleCount.'),
|
|
26359
27265
|
creativeSetup: VideoCreativeSetup.describe("Configuraci\xF3n creativa obligatoria. En guided pregunta narrativa, p\xFAblico, presentador y direcci\xF3n antes de confirmar. Usa automatic s\xF3lo si el usuario deleg\xF3 todo expl\xEDcitamente."),
|
|
26360
27266
|
videoStructure: VideoStructureEnum.default("single_take").describe('Opcional. Formato: "single_take" = Un solo clip (generado completo; puede incluir cambios de plano) o "multi_scene" = Multiescena (varias tomas concatenadas). Default: single_take.'),
|
|
26361
27267
|
videoQuality: VideoQualityEnum.default("economy").describe('Opcional. Calidad: "economy" = Econ\xF3mico, "medium" = Medio o "pro" = Pro. El sistema elige el proveedor internamente. Default: economy.'),
|
|
26362
27268
|
videoResolution: VideoResolutionEnum.optional().describe('Opcional. Resoluci\xF3n del render: "480p" o "720p". Si se omite, se usa 480p; elige 720p expl\xEDcitamente si necesitas m\xE1s nitidez.'),
|
|
26363
|
-
features:
|
|
27269
|
+
features: z106.array(z106.string()).optional().describe('Opcional. Lista de features/beneficios clave a mencionar. Ej. ["resistente al agua", "bater\xEDa 24h", "carga inal\xE1mbrica"].'),
|
|
26364
27270
|
price: CreativeRefs.price,
|
|
26365
27271
|
offer: CreativeRefs.offer,
|
|
26366
27272
|
productContext: CreativeRefs.productContext,
|
|
26367
27273
|
productLabel: CreativeRefs.productLabel,
|
|
26368
|
-
cta:
|
|
26369
|
-
scriptNotes:
|
|
27274
|
+
cta: z106.string().optional().describe('Opcional. Call-to-action final del video. Ej. "Compra ahora", "Pide el tuyo hoy", "Link en bio". Si se omite, la IA escribe uno.'),
|
|
27275
|
+
scriptNotes: z106.string().optional().describe('Opcional. Notas/restricciones para el guion (la IA las usa al redactar). Ej. "No mencionar la marca X", "Tono divertido, no cl\xEDnico", "Mencionar 2x1". NO es el guion literal: creativeSetup.mode=guided activa siempre la revisi\xF3n palabra-por-palabra con get_video_script / approve_video_script.'),
|
|
26370
27276
|
creativeGender: CreativeGenderEnum.optional().describe('Opcional. QUI\xC9N APARECE EN PANTALLA en el video: mujer ("female"), hombre ("male") o ambos ("mixed"). NO es la voz; cuando se fija, la voz se alinea sola con el personaje. M\xE1ndalo en cuanto el usuario diga qui\xE9n debe SALIR en el video, con cualquier redacci\xF3n ("quiero una mujer", "que salga un hombre", "protagonista femenina"): si no lo mandas, el g\xE9nero lo inventa la IA y el usuario puede recibir lo contrario de lo que pidi\xF3 sin ning\xFAn aviso. NO lo mandes cuando hable del P\xDABLICO COMPRADOR ("esto es para hombres", "mi p\xFAblico son mujeres", "va dirigido a mam\xE1s"): eso es a qui\xE9n se le vende, no qui\xE9n act\xFAa, y fijarlo ah\xED pinea un protagonista que nadie pidi\xF3. "mixed" solo cuando pida expl\xEDcitamente ambos, y ten en cuenta que no garantiza una mezcla: no fija ning\xFAn g\xE9nero y cada creativo elige su protagonista. No lo preguntes como paso obligatorio. Si creativeSetup.presenter.mode="saved_actor", el personaje guardado manda sobre este campo.'),
|
|
26371
27277
|
competitorScanEnabled: CreativeRefs.competitorScanEnabled,
|
|
26372
|
-
replicateWinnerWhenFound:
|
|
27278
|
+
replicateWinnerWhenFound: z106.boolean().optional().describe("Conserva la preferencia de copiar un ganador si existe. false permite estudiar el mercado sin reemplazar un \xE1ngulo por el anuncio ganador. No a\xF1adas una pregunta obligatoria para este campo."),
|
|
26373
27279
|
brandId: CreativeRefs.brandId
|
|
26374
27280
|
}).strict();
|
|
26375
27281
|
var FreeVideoQualityEnum = VideoQualityEnum;
|
|
@@ -26387,7 +27293,7 @@ var FREE_VIDEO_DURATIONS_BY_QUALITY = {
|
|
|
26387
27293
|
length: 29
|
|
26388
27294
|
}, (_, index) => index + 2)
|
|
26389
27295
|
};
|
|
26390
|
-
var FreeVideoModelIdEnum =
|
|
27296
|
+
var FreeVideoModelIdEnum = z106.enum([
|
|
26391
27297
|
"grok-imagine-video-1-5-preview",
|
|
26392
27298
|
"minimax-h3/reference-to-video",
|
|
26393
27299
|
"wan/3-0-video",
|
|
@@ -26398,66 +27304,66 @@ var FREE_SELECTABLE_MODEL_IDS = [
|
|
|
26398
27304
|
"minimax-h3/reference-to-video",
|
|
26399
27305
|
"wan/3-0-video"
|
|
26400
27306
|
];
|
|
26401
|
-
var FreeVideoInput =
|
|
27307
|
+
var FreeVideoInput = z106.object({
|
|
26402
27308
|
images: ImagesInput.optional().describe("Opcional. 1-5 fotos del producto. Om\xEDtelo para generar desde texto puro."),
|
|
26403
|
-
rawPrompt:
|
|
27309
|
+
rawPrompt: z106.string().trim().min(1).max(2e3).describe("Prompt o guion exacto del video. Si activas subt\xEDtulos, este mismo texto se usa como guion de subt\xEDtulos."),
|
|
26404
27310
|
language: CreativeRefs.language,
|
|
26405
27311
|
quality: FreeVideoQualityEnum.describe('Calidad del video: "economy" = Econ\xF3mico, "medium" = Medio o "pro" = Pro (Wan).'),
|
|
26406
27312
|
// Retired in MCP 7.0.0 (Task 11): kept in the schema, accepted, and
|
|
26407
27313
|
// parsed ONLY so the handler can reject it with a message naming its
|
|
26408
27314
|
// replacement — dropping it silently would turn a caller's explicit
|
|
26409
27315
|
// Pro++ pick into a quiet fallback to Wan.
|
|
26410
|
-
freeProModel:
|
|
27316
|
+
freeProModel: z106.enum([
|
|
26411
27317
|
"wan",
|
|
26412
27318
|
"seedance"
|
|
26413
27319
|
]).optional().describe("ELIMINADO en MCP 7.0.0 \u2014 usa `modelId`. Enviar este campo produce un error."),
|
|
26414
27320
|
modelId: FreeVideoModelIdEnum.optional().describe('Opcional. Elige expl\xEDcitamente el modelo del registro en vez del default de la calidad: "grok-imagine-video-1-5-preview" (Grok 1.5), "minimax-h3/reference-to-video" (H3 Max) o "wan/3-0-video" (Wan 3.0). Om\xEDtelo para usar el modelo por defecto de la calidad elegida. El modelo determina la duraci\xF3n permitida (Grok 6/8/10/15s, H3 Max 4-15s, Wan 2-30s) y el precio. "bytedance/seedance-2-5" est\xE1 inactivo y se rechaza con un error claro, nunca un 500.'),
|
|
26415
|
-
durationSeconds:
|
|
27321
|
+
durationSeconds: z106.number().int().min(2).max(30).describe("Duraci\xF3n exacta. Econ\xF3mico: 6, 8, 10 o 15s; Medio: enteros de 4 a 15s; Pro Wan: 2 a 30s; Pro++ Seedance: 4 a 30s."),
|
|
26416
27322
|
videoResolution: VideoResolutionEnum.describe("Resoluci\xF3n del video: 480p o 720p."),
|
|
26417
|
-
generateAiMusic:
|
|
27323
|
+
generateAiMusic: z106.boolean().default(false).describe('Opcional. Agrega m\xFAsica instrumental IA debajo del audio nativo. Default false. Equivale a generateAiEdit (nivel "pro"): la Edici\xF3n con IA trae su propia m\xFAsica.'),
|
|
26418
27324
|
generateAiEdit: AiEditRequestSchema.optional().describe('Opcional. Pide la Edici\xF3n con IA: una pasada que a\xF1ade texto, gr\xE1ficos y m\xFAsica sobre el video ya entregado (variante with_ai_edit; se cobra al entregar). Nivel: "economy" (Econ\xF3mica, Sonnet 5.5, m\xE1s barata) o "pro" (Opus 5.5, mejor calidad, ~10 min). true equivale a "pro". Default sin edici\xF3n.'),
|
|
26419
|
-
addSubtitles:
|
|
26420
|
-
idempotencyKey:
|
|
27325
|
+
addSubtitles: z106.boolean().default(false).describe("Opcional. Quema subt\xEDtulos usando el rawPrompt exacto. Default false."),
|
|
27326
|
+
idempotencyKey: z106.string().uuid().optional().describe("Opcional. Se acepta por compatibilidad pero se ignora: la identidad del reintento se deriva autom\xE1ticamente de los argumentos sem\xE1nticos, as\xED que un retry con los mismos argumentos ya es idempotente sin este campo.")
|
|
26421
27327
|
}).strict();
|
|
26422
27328
|
var imageStyleList = ImageCreativeStyleEnum.options.join(" | ");
|
|
26423
|
-
var ImageCreativeSetup =
|
|
26424
|
-
|
|
26425
|
-
mode:
|
|
27329
|
+
var ImageCreativeSetup = z106.discriminatedUnion("mode", [
|
|
27330
|
+
z106.object({
|
|
27331
|
+
mode: z106.literal("automatic")
|
|
26426
27332
|
}).strict(),
|
|
26427
|
-
|
|
26428
|
-
mode:
|
|
26429
|
-
creativeArchetype:
|
|
27333
|
+
z106.object({
|
|
27334
|
+
mode: z106.literal("guided"),
|
|
27335
|
+
creativeArchetype: z106.union([
|
|
26430
27336
|
ImageCreativeArchetypeEnum,
|
|
26431
|
-
|
|
27337
|
+
z106.literal("ai_decides")
|
|
26432
27338
|
]),
|
|
26433
|
-
visualTreatment:
|
|
27339
|
+
visualTreatment: z106.union([
|
|
26434
27340
|
ImageCreativeVisualTreatmentEnum,
|
|
26435
|
-
|
|
27341
|
+
z106.literal("ai_decides")
|
|
26436
27342
|
]),
|
|
26437
27343
|
aspectRatio: ImageCreativeAspectRatioEnum,
|
|
26438
|
-
nVariants:
|
|
26439
|
-
|
|
26440
|
-
|
|
26441
|
-
|
|
26442
|
-
|
|
26443
|
-
|
|
27344
|
+
nVariants: z106.union([
|
|
27345
|
+
z106.literal(1),
|
|
27346
|
+
z106.literal(2),
|
|
27347
|
+
z106.literal(3),
|
|
27348
|
+
z106.literal(4),
|
|
27349
|
+
z106.literal(6)
|
|
26444
27350
|
]),
|
|
26445
|
-
imageModel:
|
|
26446
|
-
styleMix:
|
|
26447
|
-
generateAdCopy:
|
|
26448
|
-
competitorScanEnabled:
|
|
26449
|
-
productContext:
|
|
26450
|
-
creativeDirection:
|
|
26451
|
-
brandColors:
|
|
26452
|
-
headline:
|
|
26453
|
-
subheadline:
|
|
27351
|
+
imageModel: z106.enum(PUBLIC_IMAGE_QUALITY_INPUTS).describe('Calidad: "image:1k" (Est\xE1ndar) o "image:2k" (Premium). Los tokens gpt-image-2-5:{1k,2k} y gpt-image-2:{1k,2k} se siguen aceptando.'),
|
|
27352
|
+
styleMix: z106.boolean().nullable().describe("Decisi\xF3n s\xF3lo para 2\u20134 variantes. Usa null para 1 o 6, cuando la UI no hace esta pregunta."),
|
|
27353
|
+
generateAdCopy: z106.boolean(),
|
|
27354
|
+
competitorScanEnabled: z106.boolean(),
|
|
27355
|
+
productContext: z106.string().trim().min(1).max(3e3).nullable(),
|
|
27356
|
+
creativeDirection: z106.string().trim().min(1).max(500).nullable(),
|
|
27357
|
+
brandColors: z106.string().trim().min(1).max(240).nullable().describe('Colores en lenguaje natural, igual que en el chat web. Ej. "Azul y Dorado". null significa sin colores espec\xEDficos.'),
|
|
27358
|
+
headline: z106.string().trim().min(1).max(120).nullable(),
|
|
27359
|
+
subheadline: z106.string().trim().min(1).max(160).nullable()
|
|
26454
27360
|
}).strict()
|
|
26455
27361
|
]).superRefine((setup, context) => {
|
|
26456
27362
|
if (setup.mode !== "guided") return;
|
|
26457
27363
|
const needsStyleMix = setup.nVariants >= 2 && setup.nVariants <= 4;
|
|
26458
27364
|
if (needsStyleMix && setup.styleMix === null) {
|
|
26459
27365
|
context.addIssue({
|
|
26460
|
-
code:
|
|
27366
|
+
code: z106.ZodIssueCode.custom,
|
|
26461
27367
|
path: [
|
|
26462
27368
|
"styleMix"
|
|
26463
27369
|
],
|
|
@@ -26466,7 +27372,7 @@ var ImageCreativeSetup = z101.discriminatedUnion("mode", [
|
|
|
26466
27372
|
}
|
|
26467
27373
|
if (!needsStyleMix && setup.styleMix !== null) {
|
|
26468
27374
|
context.addIssue({
|
|
26469
|
-
code:
|
|
27375
|
+
code: z106.ZodIssueCode.custom,
|
|
26470
27376
|
path: [
|
|
26471
27377
|
"styleMix"
|
|
26472
27378
|
],
|
|
@@ -26475,7 +27381,7 @@ var ImageCreativeSetup = z101.discriminatedUnion("mode", [
|
|
|
26475
27381
|
}
|
|
26476
27382
|
if (imageResolutionOf(setup.imageModel) === "2k" && setup.aspectRatio === "4:5") {
|
|
26477
27383
|
context.addIssue({
|
|
26478
|
-
code:
|
|
27384
|
+
code: z106.ZodIssueCode.custom,
|
|
26479
27385
|
path: [
|
|
26480
27386
|
"aspectRatio"
|
|
26481
27387
|
],
|
|
@@ -26483,55 +27389,55 @@ var ImageCreativeSetup = z101.discriminatedUnion("mode", [
|
|
|
26483
27389
|
});
|
|
26484
27390
|
}
|
|
26485
27391
|
});
|
|
26486
|
-
var LandingCreativeSetup =
|
|
26487
|
-
|
|
26488
|
-
mode:
|
|
27392
|
+
var LandingCreativeSetup = z106.discriminatedUnion("mode", [
|
|
27393
|
+
z106.object({
|
|
27394
|
+
mode: z106.literal("automatic")
|
|
26489
27395
|
}).strict(),
|
|
26490
|
-
|
|
26491
|
-
mode:
|
|
27396
|
+
z106.object({
|
|
27397
|
+
mode: z106.literal("guided"),
|
|
26492
27398
|
landingStrategy: LandingStrategyEnum,
|
|
26493
27399
|
landingImageFormat: LandingImageFormatEnum,
|
|
26494
|
-
competitorScanEnabled:
|
|
26495
|
-
paymentMethods:
|
|
26496
|
-
productContext:
|
|
26497
|
-
creativeDirection:
|
|
26498
|
-
headline:
|
|
26499
|
-
subheadline:
|
|
27400
|
+
competitorScanEnabled: z106.boolean(),
|
|
27401
|
+
paymentMethods: z106.string().trim().min(1).max(240).nullable(),
|
|
27402
|
+
productContext: z106.string().trim().min(1).max(3e3).nullable(),
|
|
27403
|
+
creativeDirection: z106.string().trim().min(1).max(500).nullable(),
|
|
27404
|
+
headline: z106.string().trim().min(1).max(120).nullable(),
|
|
27405
|
+
subheadline: z106.string().trim().min(1).max(160).nullable()
|
|
26500
27406
|
}).strict()
|
|
26501
27407
|
]);
|
|
26502
|
-
var ImageInput =
|
|
27408
|
+
var ImageInput = z106.object({
|
|
26503
27409
|
images: CreativeRefs.images.optional(),
|
|
26504
27410
|
winnerReference: WinnerReferenceInput.optional().describe(WINNER_IMAGE_CHOICE_GUIDANCE),
|
|
26505
|
-
productTitle:
|
|
26506
|
-
primaryAngle:
|
|
27411
|
+
productTitle: z106.string().min(1).describe('Nombre del producto. Ej. "Crema Anti-Edad Premium".'),
|
|
27412
|
+
primaryAngle: z106.string().min(1).optional().describe('Opcional. \xC1ngulo de venta principal. Si se omite, ProductMaker lo genera y creativeSetup.mode="guided" lo muestra para revisi\xF3n antes de crear las im\xE1genes.'),
|
|
26507
27413
|
buyerPersona: CreativeRefs.buyerPersona,
|
|
26508
27414
|
language: CreativeRefs.language,
|
|
26509
27415
|
country: CreativeRefs.country,
|
|
26510
27416
|
creativeSetup: ImageCreativeSetup.describe("Configuraci\xF3n obligatoria equivalente al wizard web. Usa guided salvo que el usuario delegue expl\xEDcitamente todo; presenta las decisiones guiadas en un \xFAnico checklist compacto."),
|
|
26511
27417
|
imageStyle: ImageCreativeStyleEnum.optional().describe(`Opcional. Estilo del shot del producto. Valores: ${imageStyleList}. Si se omite, la IA escoge seg\xFAn el archetype.`),
|
|
26512
|
-
features:
|
|
27418
|
+
features: z106.array(z106.string()).optional().describe('Opcional. Features/beneficios a destacar visualmente. Ej. ["resistente al agua", "ultra liviano"].'),
|
|
26513
27419
|
price: CreativeRefs.price,
|
|
26514
|
-
omitPrice:
|
|
27420
|
+
omitPrice: z106.boolean().optional().describe("Pon true \xFAnicamente cuando el usuario pida expl\xEDcitamente una imagen sin precio. Evita que el backend reutilice un precio extra\xEDdo del producto. No lo combines con price ni compareAtPrice."),
|
|
26515
27421
|
compareAtPrice: CreativeRefs.compareAtPrice,
|
|
26516
27422
|
offer: CreativeRefs.offer,
|
|
26517
27423
|
productLabel: CreativeRefs.productLabel,
|
|
26518
27424
|
isCombo: CreativeRefs.isCombo,
|
|
26519
27425
|
brandId: CreativeRefs.brandId
|
|
26520
27426
|
});
|
|
26521
|
-
var EditImageCreativeInput =
|
|
26522
|
-
taskId:
|
|
26523
|
-
variantIndex:
|
|
26524
|
-
clientRequestId:
|
|
26525
|
-
instruction:
|
|
27427
|
+
var EditImageCreativeInput = z106.object({
|
|
27428
|
+
taskId: z106.string().uuid().describe("ID de la tarea de imagen ya finalizada."),
|
|
27429
|
+
variantIndex: z106.number().int().min(0).max(10).describe("\xCDndice de la variante a corregir (0 = primera imagen)."),
|
|
27430
|
+
clientRequestId: z106.string().min(1).max(160).optional().describe("Identidad estable de esta correcci\xF3n; reutil\xEDzala al reconciliar una respuesta perdida, no para otra instrucci\xF3n."),
|
|
27431
|
+
instruction: z106.string().min(1).max(1e3).describe('Qu\xE9 cambiar en esa imagen. Ej. "quita el badge de env\xEDo gratis", "cambia el fondo a blanco".')
|
|
26526
27432
|
});
|
|
26527
|
-
var LandingInput =
|
|
26528
|
-
includeInitialLandingGif:
|
|
27433
|
+
var LandingInput = z106.object({
|
|
27434
|
+
includeInitialLandingGif: z106.boolean().optional().describe("Opcional. En nuevas landings cl\xE1sicas habilitadas, omitirlo incluye el primer GIF del producto y su coste en el total. Env\xEDa false si el usuario lo excluye: no se genera ni se reserva su coste. Conserva la elecci\xF3n al confirmar y al reintentar."),
|
|
26529
27435
|
images: CreativeRefs.images.optional(),
|
|
26530
27436
|
winnerReference: WinnerReferenceInput.optional().describe(WINNER_IMAGE_CHOICE_GUIDANCE),
|
|
26531
27437
|
language: CreativeRefs.language,
|
|
26532
27438
|
country: CreativeRefs.country,
|
|
26533
27439
|
creativeSetup: LandingCreativeSetup.describe("Configuraci\xF3n obligatoria de landing cl\xE1sica equivalente al wizard web. No expone landing editable/code mientras siga siendo admin-only."),
|
|
26534
|
-
salesAngle:
|
|
27440
|
+
salesAngle: z106.string().optional().describe('Opcional. \xC1ngulo de venta principal. Ej. "Reduce arrugas en 14 d\xEDas". Si se omite, la IA lo deduce de la imagen.'),
|
|
26535
27441
|
buyerPersona: CreativeRefs.buyerPersona,
|
|
26536
27442
|
price: CreativeRefs.price,
|
|
26537
27443
|
compareAtPrice: CreativeRefs.compareAtPrice,
|
|
@@ -26813,8 +27719,8 @@ function registerCreativeTools(server, api, { transport = "http" } = {}) {
|
|
|
26813
27719
|
server.registerTool("get_image_edit_status", {
|
|
26814
27720
|
description: imageEditStatusGuidance.summary,
|
|
26815
27721
|
inputSchema: {
|
|
26816
|
-
taskId:
|
|
26817
|
-
operationId:
|
|
27722
|
+
taskId: z106.string().uuid(),
|
|
27723
|
+
operationId: z106.string().uuid()
|
|
26818
27724
|
},
|
|
26819
27725
|
annotations: READS_INTERNAL
|
|
26820
27726
|
}, async (input) => {
|
|
@@ -26871,10 +27777,10 @@ function registerCreativeTools(server, api, { transport = "http" } = {}) {
|
|
|
26871
27777
|
__name(registerCreativeTools, "registerCreativeTools");
|
|
26872
27778
|
|
|
26873
27779
|
// src/tools/creative-variants.ts
|
|
26874
|
-
import { z as
|
|
27780
|
+
import { z as z107 } from "zod";
|
|
26875
27781
|
var estimateCreativeVariantGuidance = getProductMakerCapabilityModelGuidance("estimate_creative_variant");
|
|
26876
27782
|
var createCreativeVariantGuidance = getProductMakerCapabilityModelGuidance("create_creative_variant");
|
|
26877
|
-
var LandingSectionKeyEnum =
|
|
27783
|
+
var LandingSectionKeyEnum = z107.enum([
|
|
26878
27784
|
"problem_hook",
|
|
26879
27785
|
"problem_cost",
|
|
26880
27786
|
"solution_mechanism",
|
|
@@ -26914,24 +27820,24 @@ var LandingSectionKeyEnum = z102.enum([
|
|
|
26914
27820
|
"lifestyle_fit",
|
|
26915
27821
|
"join_lifestyle"
|
|
26916
27822
|
]);
|
|
26917
|
-
var CreativeVariantKindEnum =
|
|
27823
|
+
var CreativeVariantKindEnum = z107.enum([
|
|
26918
27824
|
"video",
|
|
26919
27825
|
"image",
|
|
26920
27826
|
"landing"
|
|
26921
27827
|
]);
|
|
26922
|
-
var EstimateCreativeVariantInputBase =
|
|
26923
|
-
sourceTaskId:
|
|
27828
|
+
var EstimateCreativeVariantInputBase = z107.object({
|
|
27829
|
+
sourceTaskId: z107.string().uuid().describe("ID de la tarea original completada."),
|
|
26924
27830
|
kind: CreativeVariantKindEnum,
|
|
26925
27831
|
videoPreset: TaskCreativeVariantVideoPresetEnum.optional().describe("Opcional para video. Solo cambia el preset p\xFAblico; el servidor conserva el modelo/tier del task origen."),
|
|
26926
27832
|
videoResolution: VideoResolutionEnum.optional().describe("Opcional para video. Resoluci\xF3n del nuevo render."),
|
|
26927
|
-
nVariants:
|
|
27833
|
+
nVariants: z107.number().int().min(1).max(3).optional().describe("Opcional para imagen. N\xFAmero de im\xE1genes adicionales (1-3)."),
|
|
26928
27834
|
sectionKey: LandingSectionKeyEnum.optional().describe("Opcional para landing. Si ya conoces la secci\xF3n, evita cotizar la clasificaci\xF3n con IA."),
|
|
26929
|
-
instructions:
|
|
27835
|
+
instructions: z107.string().trim().min(1).max(2e3).optional().describe("Opcional para landing. Si se env\xEDa sin sectionKey, el estimado suma la clasificaci\xF3n pagada con IA.")
|
|
26930
27836
|
}).strict();
|
|
26931
27837
|
var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine((input, ctx) => {
|
|
26932
27838
|
if (input.kind === "video" && input.nVariants !== void 0) {
|
|
26933
27839
|
ctx.addIssue({
|
|
26934
|
-
code:
|
|
27840
|
+
code: z107.ZodIssueCode.custom,
|
|
26935
27841
|
path: [
|
|
26936
27842
|
"nVariants"
|
|
26937
27843
|
],
|
|
@@ -26941,7 +27847,7 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26941
27847
|
if (input.kind !== "video") {
|
|
26942
27848
|
if (input.videoPreset !== void 0) {
|
|
26943
27849
|
ctx.addIssue({
|
|
26944
|
-
code:
|
|
27850
|
+
code: z107.ZodIssueCode.custom,
|
|
26945
27851
|
path: [
|
|
26946
27852
|
"videoPreset"
|
|
26947
27853
|
],
|
|
@@ -26950,7 +27856,7 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26950
27856
|
}
|
|
26951
27857
|
if (input.videoResolution !== void 0) {
|
|
26952
27858
|
ctx.addIssue({
|
|
26953
|
-
code:
|
|
27859
|
+
code: z107.ZodIssueCode.custom,
|
|
26954
27860
|
path: [
|
|
26955
27861
|
"videoResolution"
|
|
26956
27862
|
],
|
|
@@ -26960,7 +27866,7 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26960
27866
|
}
|
|
26961
27867
|
if (input.kind !== "image" && input.nVariants !== void 0) {
|
|
26962
27868
|
ctx.addIssue({
|
|
26963
|
-
code:
|
|
27869
|
+
code: z107.ZodIssueCode.custom,
|
|
26964
27870
|
path: [
|
|
26965
27871
|
"nVariants"
|
|
26966
27872
|
],
|
|
@@ -26970,7 +27876,7 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26970
27876
|
if (input.kind !== "landing") {
|
|
26971
27877
|
if (input.sectionKey !== void 0) {
|
|
26972
27878
|
ctx.addIssue({
|
|
26973
|
-
code:
|
|
27879
|
+
code: z107.ZodIssueCode.custom,
|
|
26974
27880
|
path: [
|
|
26975
27881
|
"sectionKey"
|
|
26976
27882
|
],
|
|
@@ -26979,7 +27885,7 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26979
27885
|
}
|
|
26980
27886
|
if (input.instructions !== void 0) {
|
|
26981
27887
|
ctx.addIssue({
|
|
26982
|
-
code:
|
|
27888
|
+
code: z107.ZodIssueCode.custom,
|
|
26983
27889
|
path: [
|
|
26984
27890
|
"instructions"
|
|
26985
27891
|
],
|
|
@@ -26988,31 +27894,31 @@ var EstimateCreativeVariantInput = EstimateCreativeVariantInputBase.superRefine(
|
|
|
26988
27894
|
}
|
|
26989
27895
|
}
|
|
26990
27896
|
});
|
|
26991
|
-
var CreateCreativeVariantInputBase =
|
|
26992
|
-
sourceTaskId:
|
|
27897
|
+
var CreateCreativeVariantInputBase = z107.object({
|
|
27898
|
+
sourceTaskId: z107.string().uuid().describe("ID de la tarea original completada."),
|
|
26993
27899
|
kind: CreativeVariantKindEnum,
|
|
26994
|
-
confirm:
|
|
26995
|
-
clientRequestId:
|
|
26996
|
-
angle:
|
|
26997
|
-
buyerPersona:
|
|
26998
|
-
scriptNotes:
|
|
26999
|
-
creativeDirection:
|
|
27900
|
+
confirm: z107.literal(true).describe("Confirmaci\xF3n expl\xEDcita del usuario despu\xE9s de mostrarle el estimado de cr\xE9ditos."),
|
|
27901
|
+
clientRequestId: z107.string().uuid().describe("UUID estable para esta intenci\xF3n (obligatorio por compatibilidad de contrato; el servidor deriva la identidad real del request desde los argumentos sem\xE1nticos, as\xED que un UUID nuevo en un retry NO crea una variante duplicada). Si la API devuelve status=error, una nueva generaci\xF3n exige otra confirmaci\xF3n."),
|
|
27902
|
+
angle: z107.string().trim().min(1).max(500).optional().describe("\xC1ngulo nuevo para video o imagen."),
|
|
27903
|
+
buyerPersona: z107.string().trim().min(1).max(360).optional().describe("Buyer persona coherente con el \xE1ngulo."),
|
|
27904
|
+
scriptNotes: z107.string().trim().min(1).max(2e3).optional().describe("Direcci\xF3n breve del guion para una variante de video."),
|
|
27905
|
+
creativeDirection: z107.string().trim().min(1).max(2e3).optional().describe("Direcci\xF3n creativa para una variante de imagen."),
|
|
27000
27906
|
videoPreset: TaskCreativeVariantVideoPresetEnum.optional().describe("Opcional para video. Preset p\xFAblico; el servidor resuelve modelo/tier desde el task origen."),
|
|
27001
27907
|
videoResolution: VideoResolutionEnum.optional().describe("Opcional para video."),
|
|
27002
|
-
generateAiMusic:
|
|
27003
|
-
nVariants:
|
|
27908
|
+
generateAiMusic: z107.boolean().optional().describe("Opcional para video."),
|
|
27909
|
+
nVariants: z107.number().int().min(1).max(3).optional().describe("Opcional para imagen. N\xFAmero de im\xE1genes adicionales (1-3)."),
|
|
27004
27910
|
imageStyle: ImageCreativeStyleEnum.optional().describe("Opcional para imagen."),
|
|
27005
27911
|
creativeArchetype: ImageCreativeArchetypeEnum.optional().describe("Opcional para imagen."),
|
|
27006
27912
|
visualTreatment: ImageCreativeVisualTreatmentEnum.optional().describe("Opcional para imagen."),
|
|
27007
27913
|
aspectRatio: ImageCreativeAspectRatioEnum.optional().describe("Opcional para imagen."),
|
|
27008
|
-
styleMix:
|
|
27914
|
+
styleMix: z107.boolean().optional().describe("Opcional para imagen."),
|
|
27009
27915
|
sectionKey: LandingSectionKeyEnum.optional().describe("Opcional para landing. Si se omite, se clasifica con IA a partir de instructions."),
|
|
27010
|
-
instructions:
|
|
27916
|
+
instructions: z107.string().trim().min(1).max(2e3).optional().describe("Solicitud libre para una nueva secci\xF3n de landing. La IA la clasifica si no env\xEDas sectionKey.")
|
|
27011
27917
|
}).strict();
|
|
27012
27918
|
var CreateCreativeVariantInput = CreateCreativeVariantInputBase.superRefine((input, ctx) => {
|
|
27013
27919
|
if ((input.kind === "video" || input.kind === "image") && !input.angle) {
|
|
27014
27920
|
ctx.addIssue({
|
|
27015
|
-
code:
|
|
27921
|
+
code: z107.ZodIssueCode.custom,
|
|
27016
27922
|
path: [
|
|
27017
27923
|
"angle"
|
|
27018
27924
|
],
|
|
@@ -27021,7 +27927,7 @@ var CreateCreativeVariantInput = CreateCreativeVariantInputBase.superRefine((inp
|
|
|
27021
27927
|
}
|
|
27022
27928
|
if (input.kind === "landing" && !input.sectionKey && !input.instructions) {
|
|
27023
27929
|
ctx.addIssue({
|
|
27024
|
-
code:
|
|
27930
|
+
code: z107.ZodIssueCode.custom,
|
|
27025
27931
|
path: [
|
|
27026
27932
|
"instructions"
|
|
27027
27933
|
],
|
|
@@ -27067,7 +27973,7 @@ var CreateCreativeVariantInput = CreateCreativeVariantInputBase.superRefine((inp
|
|
|
27067
27973
|
for (const field of fieldsByKind[input.kind]) {
|
|
27068
27974
|
if (input[field] !== void 0) {
|
|
27069
27975
|
ctx.addIssue({
|
|
27070
|
-
code:
|
|
27976
|
+
code: z107.ZodIssueCode.custom,
|
|
27071
27977
|
path: [
|
|
27072
27978
|
field
|
|
27073
27979
|
],
|
|
@@ -27200,13 +28106,13 @@ function registerCreativeVariantTools(server, api) {
|
|
|
27200
28106
|
__name(registerCreativeVariantTools, "registerCreativeVariantTools");
|
|
27201
28107
|
|
|
27202
28108
|
// src/tools/script-review.ts
|
|
27203
|
-
import { z as
|
|
28109
|
+
import { z as z108 } from "zod";
|
|
27204
28110
|
var getVideoScriptGuidance = getProductMakerCapabilityModelGuidance("get_video_script");
|
|
27205
28111
|
var regenerateVideoScriptGuidance = getProductMakerCapabilityModelGuidance("regenerate_video_script");
|
|
27206
28112
|
var approveVideoScriptGuidance = getProductMakerCapabilityModelGuidance("approve_video_script");
|
|
27207
|
-
var GetVideoScriptInput =
|
|
27208
|
-
taskId:
|
|
27209
|
-
angleKey:
|
|
28113
|
+
var GetVideoScriptInput = z108.object({
|
|
28114
|
+
taskId: z108.string().min(1).describe("ID de la tarea (la misma que devolvi\xF3 create_product_task / generate_video_creative)."),
|
|
28115
|
+
angleKey: z108.string().min(1).optional().describe('Clave del \xE1ngulo cuyo guion se quiere leer (formato "angle_0", "angle_1", ...). REQUERIDO para tareas multi-angle: si se omite, el backend resuelve a "angle_0" LITERAL (no "el primer pendiente"), as\xED que en multi-angle donde angle_0 ya est\xE9 aprobado/saltado obtendr\xEDas status="approved" y nunca alcanzar\xEDas el \xE1ngulo realmente pendiente. Para single-angle puede omitirse.')
|
|
27210
28116
|
}).strict();
|
|
27211
28117
|
var ApproveVideoScriptInput = ApproveVideoScriptCapabilityRequest;
|
|
27212
28118
|
var RegenerateVideoScriptInput = RegenerateVideoScriptCapabilityRequest.extend({
|
|
@@ -27289,7 +28195,7 @@ function registerScriptReviewTools(server, api) {
|
|
|
27289
28195
|
__name(registerScriptReviewTools, "registerScriptReviewTools");
|
|
27290
28196
|
|
|
27291
28197
|
// src/tools/connections.ts
|
|
27292
|
-
import { z as
|
|
28198
|
+
import { z as z109 } from "zod";
|
|
27293
28199
|
var listShopifyShopsGuidance = getProductMakerCapabilityModelGuidance("list_shopify_shops");
|
|
27294
28200
|
var listShopifyProductsGuidance = getProductMakerCapabilityModelGuidance("list_shopify_products");
|
|
27295
28201
|
var listMetaAdAccountsGuidance = getProductMakerCapabilityModelGuidance("list_meta_ad_accounts");
|
|
@@ -27298,7 +28204,7 @@ var listTikTokAdvertisersGuidance = getProductMakerCapabilityModelGuidance("list
|
|
|
27298
28204
|
function registerConnectionTools(server, api) {
|
|
27299
28205
|
server.registerTool("list_shopify_shops", {
|
|
27300
28206
|
description: listShopifyShopsGuidance.summary + " Si la lista est\xE1 vac\xEDa, dile al usuario que conecte una tienda en productmaker.app/integrations antes de intentar publicar.",
|
|
27301
|
-
inputSchema:
|
|
28207
|
+
inputSchema: z109.object({}).shape,
|
|
27302
28208
|
annotations: READS_INTERNAL
|
|
27303
28209
|
}, async () => {
|
|
27304
28210
|
try {
|
|
@@ -27310,10 +28216,10 @@ function registerConnectionTools(server, api) {
|
|
|
27310
28216
|
});
|
|
27311
28217
|
server.registerTool("list_shopify_products", {
|
|
27312
28218
|
description: listShopifyProductsGuidance.summary + ' Usa el `id` devuelto junto con `publicationMode="existing"` en `publish_to_shopify`. Si `taskId` se proporciona, la respuesta tambi\xE9n indica el producto publicado actualmente para esa tarea y tienda. No modifica Shopify.',
|
|
27313
|
-
inputSchema:
|
|
27314
|
-
shopDomain:
|
|
27315
|
-
query:
|
|
27316
|
-
taskId:
|
|
28219
|
+
inputSchema: z109.object({
|
|
28220
|
+
shopDomain: z109.string().min(3).max(120),
|
|
28221
|
+
query: z109.string().trim().max(120).optional(),
|
|
28222
|
+
taskId: z109.string().uuid().optional()
|
|
27317
28223
|
}).shape,
|
|
27318
28224
|
annotations: READS_EXTERNAL
|
|
27319
28225
|
}, async ({ shopDomain, query, taskId }) => {
|
|
@@ -27331,7 +28237,7 @@ function registerConnectionTools(server, api) {
|
|
|
27331
28237
|
});
|
|
27332
28238
|
server.registerTool("list_meta_ad_accounts", {
|
|
27333
28239
|
description: listMetaAdAccountsGuidance.summary + " Para publicar, prefiere `list_meta_destinations`, que tambi\xE9n devuelve el portfolio y las p\xE1ginas disponibles. Si est\xE1 vac\xEDa, ind\xEDcale al usuario conectar Meta en productmaker.app/integrations.",
|
|
27334
|
-
inputSchema:
|
|
28240
|
+
inputSchema: z109.object({}).shape,
|
|
27335
28241
|
annotations: READS_EXTERNAL
|
|
27336
28242
|
}, async () => {
|
|
27337
28243
|
try {
|
|
@@ -27343,7 +28249,7 @@ function registerConnectionTools(server, api) {
|
|
|
27343
28249
|
});
|
|
27344
28250
|
server.registerTool("list_meta_destinations", {
|
|
27345
28251
|
description: listMetaDestinationsGuidance.summary + " Es obligatorio llamar esta herramienta antes de publicar, mostrar las opciones y enviar al publicador el `portfolioId`, `adAccountId` y `pageId` elegidos; nunca elijas silenciosamente la primera p\xE1gina o cuenta. No modifica Meta.",
|
|
27346
|
-
inputSchema:
|
|
28252
|
+
inputSchema: z109.object({}).shape,
|
|
27347
28253
|
annotations: READS_EXTERNAL,
|
|
27348
28254
|
_meta: {
|
|
27349
28255
|
"openai/widgetAccessible": true
|
|
@@ -27358,7 +28264,7 @@ function registerConnectionTools(server, api) {
|
|
|
27358
28264
|
});
|
|
27359
28265
|
server.registerTool("list_tiktok_advertisers", {
|
|
27360
28266
|
description: listTikTokAdvertisersGuidance.summary + " Si est\xE1 vac\xEDa, ind\xEDcale al usuario conectar TikTok en productmaker.app/integrations.",
|
|
27361
|
-
inputSchema:
|
|
28267
|
+
inputSchema: z109.object({}).shape,
|
|
27362
28268
|
annotations: READS_EXTERNAL
|
|
27363
28269
|
}, async () => {
|
|
27364
28270
|
try {
|
|
@@ -27372,7 +28278,7 @@ function registerConnectionTools(server, api) {
|
|
|
27372
28278
|
__name(registerConnectionTools, "registerConnectionTools");
|
|
27373
28279
|
|
|
27374
28280
|
// src/tools/actors.ts
|
|
27375
|
-
import { z as
|
|
28281
|
+
import { z as z110 } from "zod";
|
|
27376
28282
|
var listActorsGuidance = getProductMakerCapabilityModelGuidance("list_actors");
|
|
27377
28283
|
var actorVoiceGuidance = {
|
|
27378
28284
|
capabilities: getProductMakerCapabilityModelGuidance("get_actor_voice_capabilities"),
|
|
@@ -27412,7 +28318,7 @@ function sanitizeVoiceResult(value) {
|
|
|
27412
28318
|
__name(sanitizeVoiceResult, "sanitizeVoiceResult");
|
|
27413
28319
|
function registerActorTools(server, api) {
|
|
27414
28320
|
const actor = {
|
|
27415
|
-
actorId:
|
|
28321
|
+
actorId: z110.string().min(1).max(64)
|
|
27416
28322
|
};
|
|
27417
28323
|
const safe = /* @__PURE__ */ __name(async (request) => {
|
|
27418
28324
|
try {
|
|
@@ -27441,8 +28347,8 @@ function registerActorTools(server, api) {
|
|
|
27441
28347
|
inputSchema: {
|
|
27442
28348
|
...actor,
|
|
27443
28349
|
draft: ActorVoiceDraftSchema,
|
|
27444
|
-
requestKey:
|
|
27445
|
-
acceptedQuoteId:
|
|
28350
|
+
requestKey: z110.string().trim().min(1).max(128),
|
|
28351
|
+
acceptedQuoteId: z110.string().trim().min(1).max(128)
|
|
27446
28352
|
},
|
|
27447
28353
|
annotations: CREATES_PAID
|
|
27448
28354
|
}, async ({ actorId, ...body }) => safe(api.postJson(`/v1/actors/${encodeURIComponent(actorId)}/voice/previews`, body)));
|
|
@@ -27450,7 +28356,7 @@ function registerActorTools(server, api) {
|
|
|
27450
28356
|
description: actorVoiceGuidance.get.summary,
|
|
27451
28357
|
inputSchema: {
|
|
27452
28358
|
...actor,
|
|
27453
|
-
candidateId:
|
|
28359
|
+
candidateId: z110.string().min(1).max(64)
|
|
27454
28360
|
},
|
|
27455
28361
|
annotations: READS_INTERNAL
|
|
27456
28362
|
}, async ({ actorId, candidateId }) => safe(api.getJson(`/v1/actors/${encodeURIComponent(actorId)}/voice/previews/${encodeURIComponent(candidateId)}`)));
|
|
@@ -27458,15 +28364,15 @@ function registerActorTools(server, api) {
|
|
|
27458
28364
|
description: actorVoiceGuidance.approve.summary,
|
|
27459
28365
|
inputSchema: {
|
|
27460
28366
|
...actor,
|
|
27461
|
-
candidateId:
|
|
27462
|
-
expectedRevision:
|
|
27463
|
-
expectedApprovedRevision:
|
|
28367
|
+
candidateId: z110.string().min(1).max(64),
|
|
28368
|
+
expectedRevision: z110.number().int().positive(),
|
|
28369
|
+
expectedApprovedRevision: z110.number().int().positive().nullable().optional()
|
|
27464
28370
|
},
|
|
27465
28371
|
annotations: CREATES_INTERNAL
|
|
27466
28372
|
}, async ({ actorId, ...body }) => safe(api.postJson(`/v1/actors/${encodeURIComponent(actorId)}/voice/approve`, body)));
|
|
27467
28373
|
server.registerTool("list_actors", {
|
|
27468
28374
|
description: listActorsGuidance.summary + " Devuelve id, nombre, descripci\xF3n, g\xE9nero y voz privada del personaje. Cuando el personaje tiene una voz personalizada, `voice.identityId` y `voice.revision` identifican la versi\xF3n aprobada \u2014 conserva la revisi\xF3n al llamar `approve_actor_voice` (expectedApprovedRevision) para reemplazarla. Los IDs de proveedor nunca se exponen por MCP. Usa el `id` como `actorId` al crear o editar una tarea. Solo aparecen los personajes listos para usar; si la lista est\xE1 vac\xEDa, dile al usuario que cree uno en productmaker.app antes de intentar asignarlo. No modifica nada.",
|
|
27469
|
-
inputSchema:
|
|
28375
|
+
inputSchema: z110.object({}).shape,
|
|
27470
28376
|
annotations: READS_INTERNAL
|
|
27471
28377
|
}, async () => {
|
|
27472
28378
|
try {
|
|
@@ -27499,7 +28405,7 @@ function registerActorTools(server, api) {
|
|
|
27499
28405
|
__name(registerActorTools, "registerActorTools");
|
|
27500
28406
|
|
|
27501
28407
|
// src/tools/publish.ts
|
|
27502
|
-
import { z as
|
|
28408
|
+
import { z as z111 } from "zod";
|
|
27503
28409
|
|
|
27504
28410
|
// src/tools/meta-publish-attempt-id.ts
|
|
27505
28411
|
var META_PUBLISH_NAMESPACE = "7b19c9ac-b4eb-4db1-970e-c2f24ce30b98";
|
|
@@ -27538,40 +28444,40 @@ var publishToShopifyGuidance = getProductMakerCapabilityModelGuidance("publish_t
|
|
|
27538
28444
|
var publishToMetaGuidance = getProductMakerCapabilityModelGuidance("publish_to_meta");
|
|
27539
28445
|
var publishCreativesToMetaGuidance = getProductMakerCapabilityModelGuidance("publish_creatives_to_meta");
|
|
27540
28446
|
var publishToTikTokGuidance = getProductMakerCapabilityModelGuidance("publish_to_tiktok");
|
|
27541
|
-
var ShopifyInput =
|
|
27542
|
-
taskId:
|
|
27543
|
-
shopDomain:
|
|
28447
|
+
var ShopifyInput = z111.object({
|
|
28448
|
+
taskId: z111.string().min(1),
|
|
28449
|
+
shopDomain: z111.string().min(1),
|
|
27544
28450
|
/** Override: number of landing images to include. Default = ALL images the
|
|
27545
28451
|
* task generated (the MCP fetches /v1/results first to count). Bounded
|
|
27546
28452
|
* generously here; the backend validates each index against
|
|
27547
28453
|
* landing.images.length and rejects out-of-range. */
|
|
27548
|
-
numLandingImages:
|
|
27549
|
-
variantIndex:
|
|
28454
|
+
numLandingImages: z111.number().int().min(1).max(20).optional(),
|
|
28455
|
+
variantIndex: z111.number().int().min(0).optional(),
|
|
27550
28456
|
/** ASK THE USER before setting: "¿Tu producto tiene variantes (talla, color, etc.)?".
|
|
27551
28457
|
* When true, the landing renders variant-picker pills; when false, it ships
|
|
27552
28458
|
* a single-option product page. Defaults to false. */
|
|
27553
|
-
showVariantPicker:
|
|
28459
|
+
showVariantPicker: z111.boolean().optional(),
|
|
27554
28460
|
/** Default `auto` updates the product previously published for this task and
|
|
27555
28461
|
* shop. Use `existing` with targetProductId to choose another product, or
|
|
27556
28462
|
* `new` only when the user explicitly wants a duplicate/new listing. */
|
|
27557
|
-
publicationMode:
|
|
28463
|
+
publicationMode: z111.enum([
|
|
27558
28464
|
"auto",
|
|
27559
28465
|
"existing",
|
|
27560
28466
|
"new"
|
|
27561
28467
|
]).optional(),
|
|
27562
28468
|
/** Shopify product GID, numeric id, or admin product URL. Required when
|
|
27563
28469
|
* publicationMode is `existing`. */
|
|
27564
|
-
targetProductId:
|
|
28470
|
+
targetProductId: z111.string().trim().min(1).max(300).optional(),
|
|
27565
28471
|
/** Add an announcement bar text above add-to-cart (optional). */
|
|
27566
|
-
announcementBarEnabled:
|
|
27567
|
-
announcementBarText:
|
|
28472
|
+
announcementBarEnabled: z111.boolean().optional(),
|
|
28473
|
+
announcementBarText: z111.string().trim().min(1).max(SHOPIFY_ANNOUNCEMENT_BAR_MAX_LENGTH).optional(),
|
|
27568
28474
|
commerceCorrection: PublishCommerceCorrectionSchema.optional().describe("Complete seller-confirmed commerce values, with the revision and fingerprint returned in recovery. Never invent missing prices or convert currency."),
|
|
27569
|
-
confirmed:
|
|
28475
|
+
confirmed: z111.boolean().optional().describe("Required as true only when submitting commerceCorrection, after showing its values and obtaining explicit seller confirmation.")
|
|
27570
28476
|
});
|
|
27571
28477
|
var ShopifyInputWithAnnouncementBarValidation = ShopifyInput.superRefine((value, ctx) => {
|
|
27572
28478
|
if (value.commerceCorrection && value.confirmed !== true) {
|
|
27573
28479
|
ctx.addIssue({
|
|
27574
|
-
code:
|
|
28480
|
+
code: z111.ZodIssueCode.custom,
|
|
27575
28481
|
path: [
|
|
27576
28482
|
"confirmed"
|
|
27577
28483
|
],
|
|
@@ -27580,7 +28486,7 @@ var ShopifyInputWithAnnouncementBarValidation = ShopifyInput.superRefine((value,
|
|
|
27580
28486
|
}
|
|
27581
28487
|
if (value.announcementBarEnabled && !value.announcementBarText) {
|
|
27582
28488
|
ctx.addIssue({
|
|
27583
|
-
code:
|
|
28489
|
+
code: z111.ZodIssueCode.custom,
|
|
27584
28490
|
path: [
|
|
27585
28491
|
"announcementBarText"
|
|
27586
28492
|
],
|
|
@@ -27589,7 +28495,7 @@ var ShopifyInputWithAnnouncementBarValidation = ShopifyInput.superRefine((value,
|
|
|
27589
28495
|
}
|
|
27590
28496
|
if (!value.announcementBarEnabled && value.announcementBarText) {
|
|
27591
28497
|
ctx.addIssue({
|
|
27592
|
-
code:
|
|
28498
|
+
code: z111.ZodIssueCode.custom,
|
|
27593
28499
|
path: [
|
|
27594
28500
|
"announcementBarText"
|
|
27595
28501
|
],
|
|
@@ -27603,91 +28509,91 @@ function parseShopifyInput(rawInput) {
|
|
|
27603
28509
|
return parsed.data;
|
|
27604
28510
|
}
|
|
27605
28511
|
__name(parseShopifyInput, "parseShopifyInput");
|
|
27606
|
-
var McpCampaignConfig =
|
|
28512
|
+
var McpCampaignConfig = z111.object({
|
|
27607
28513
|
/** ALWAYS in US dollars, whatever the ad account's currency is. ProductMaker
|
|
27608
28514
|
* converts to the account currency server-side. Do NOT pre-convert: on a COP
|
|
27609
28515
|
* account the user's "60.000 al día" is `dailyBudgetUsd: 15`, not 60000. */
|
|
27610
|
-
dailyBudgetUsd:
|
|
28516
|
+
dailyBudgetUsd: z111.number().positive().optional(),
|
|
27611
28517
|
/** ISO-3166-1 alpha-2 country codes or resolvable names (CountryIso2Schema
|
|
27612
28518
|
* normalizes at validation). Meta accepts max 1 (single-country ad set).
|
|
27613
28519
|
* TikTok takes only the first entry. */
|
|
27614
|
-
targetCountries:
|
|
27615
|
-
campaignName:
|
|
28520
|
+
targetCountries: z111.array(CountryIso2Schema).max(1).optional(),
|
|
28521
|
+
campaignName: z111.string().trim().min(1).max(100).optional()
|
|
27616
28522
|
});
|
|
27617
28523
|
var McpAdAccountId = MetaAdAccountId.describe('Meta ad account id. Accepts "act_1234567890" or the bare numeric id "1234567890".');
|
|
27618
|
-
var MetaInput =
|
|
27619
|
-
taskId:
|
|
28524
|
+
var MetaInput = z111.object({
|
|
28525
|
+
taskId: z111.string().min(1),
|
|
27620
28526
|
/** Exact Meta Business portfolio selected from `list_meta_destinations`. */
|
|
27621
|
-
portfolioId:
|
|
28527
|
+
portfolioId: z111.string().trim().min(1),
|
|
27622
28528
|
/** Exact Facebook Page selected from `list_meta_destinations`. */
|
|
27623
|
-
pageId:
|
|
28529
|
+
pageId: z111.string().trim().min(1),
|
|
27624
28530
|
adAccountId: McpAdAccountId,
|
|
27625
|
-
pixelId:
|
|
27626
|
-
landingUrl:
|
|
28531
|
+
pixelId: z111.string().min(1).optional(),
|
|
28532
|
+
landingUrl: z111.string().url().optional(),
|
|
27627
28533
|
/** Select which angles to publish by 0-based index. Omit to publish all
|
|
27628
28534
|
* successful angles. Example: a task with 3 angles → `[0,2]` publishes #0 + #2. */
|
|
27629
|
-
angleIndexes:
|
|
28535
|
+
angleIndexes: z111.array(z111.number().int().nonnegative()).optional(),
|
|
27630
28536
|
campaignConfig: McpCampaignConfig.optional(),
|
|
27631
28537
|
/** Override the ad's primary text (body copy). If omitted, ProductMaker
|
|
27632
28538
|
* uses the auto-generated copy attached to the task. Capped at 500 chars
|
|
27633
28539
|
* (Meta's primary-text limit). */
|
|
27634
|
-
primaryText:
|
|
28540
|
+
primaryText: z111.string().trim().min(1).max(500).optional(),
|
|
27635
28541
|
/** Optional WhatsApp number. When set, the ad button opens a WhatsApp chat
|
|
27636
28542
|
* (wa.me) instead of a landing page. */
|
|
27637
|
-
phoneNumber:
|
|
28543
|
+
phoneNumber: z111.string().min(8).max(32).optional()
|
|
27638
28544
|
});
|
|
27639
|
-
var GroupedTaskSource =
|
|
27640
|
-
type:
|
|
27641
|
-
taskId:
|
|
27642
|
-
angleIndex:
|
|
27643
|
-
videoVariant:
|
|
28545
|
+
var GroupedTaskSource = z111.object({
|
|
28546
|
+
type: z111.literal("task"),
|
|
28547
|
+
taskId: z111.string().min(1),
|
|
28548
|
+
angleIndex: z111.number().int().min(0).optional(),
|
|
28549
|
+
videoVariant: z111.enum([
|
|
27644
28550
|
"with_subtitles",
|
|
27645
28551
|
"without_subtitles"
|
|
27646
28552
|
]).optional(),
|
|
27647
|
-
imageVariantIndex:
|
|
27648
|
-
});
|
|
27649
|
-
var GroupedMediaSource =
|
|
27650
|
-
type:
|
|
27651
|
-
url:
|
|
27652
|
-
path:
|
|
27653
|
-
thumbnailUrl:
|
|
27654
|
-
thumbnailPath:
|
|
28553
|
+
imageVariantIndex: z111.number().int().min(0).optional()
|
|
28554
|
+
});
|
|
28555
|
+
var GroupedMediaSource = z111.object({
|
|
28556
|
+
type: z111.literal("media"),
|
|
28557
|
+
url: z111.string().url().optional().describe("Public HTTPS media URL. For a file on the user laptop, use request_media_upload on the hosted MCP instead."),
|
|
28558
|
+
path: z111.string().min(1).optional().describe('Local file path only when this MCP runs over stdio. On the hosted MCP, call request_media_upload and then use source.type="asset".'),
|
|
28559
|
+
thumbnailUrl: z111.string().url().optional(),
|
|
28560
|
+
thumbnailPath: z111.string().min(1).optional()
|
|
27655
28561
|
}).refine((value) => Boolean(value.url) !== Boolean(value.path), {
|
|
27656
28562
|
message: "media source needs exactly one of `url` or `path`"
|
|
27657
28563
|
}).refine((value) => !(value.thumbnailUrl && value.thumbnailPath), {
|
|
27658
28564
|
message: "media source needs at most one of `thumbnailUrl` or `thumbnailPath`"
|
|
27659
28565
|
});
|
|
27660
|
-
var GroupedUploadedAssetSource =
|
|
27661
|
-
type:
|
|
28566
|
+
var GroupedUploadedAssetSource = z111.object({
|
|
28567
|
+
type: z111.literal("asset"),
|
|
27662
28568
|
/** Returned by check_media_upload. ProductMaker resolves ownership server-side. */
|
|
27663
|
-
assetId:
|
|
27664
|
-
thumbnailAssetId:
|
|
28569
|
+
assetId: z111.string().uuid(),
|
|
28570
|
+
thumbnailAssetId: z111.string().uuid().optional()
|
|
27665
28571
|
});
|
|
27666
|
-
var GroupedCreative =
|
|
27667
|
-
type:
|
|
28572
|
+
var GroupedCreative = z111.object({
|
|
28573
|
+
type: z111.enum([
|
|
27668
28574
|
"image",
|
|
27669
28575
|
"video"
|
|
27670
28576
|
]),
|
|
27671
|
-
source:
|
|
28577
|
+
source: z111.union([
|
|
27672
28578
|
GroupedTaskSource,
|
|
27673
28579
|
GroupedMediaSource,
|
|
27674
28580
|
GroupedUploadedAssetSource
|
|
27675
28581
|
]),
|
|
27676
|
-
title:
|
|
27677
|
-
description:
|
|
28582
|
+
title: z111.string().max(120).optional(),
|
|
28583
|
+
description: z111.string().max(500).optional(),
|
|
27678
28584
|
cta: MetaCtaType.optional(),
|
|
27679
|
-
creativeId:
|
|
28585
|
+
creativeId: z111.string().min(1).optional()
|
|
27680
28586
|
});
|
|
27681
|
-
var GroupedCampaignConfigBase =
|
|
28587
|
+
var GroupedCampaignConfigBase = z111.object({
|
|
27682
28588
|
campaignType: MetaCampaignType.default("sales"),
|
|
27683
28589
|
optimizationMode: MetaOptimizationMode.default("advantage_plus"),
|
|
27684
28590
|
budgetMode: MetaBudgetMode.optional(),
|
|
27685
|
-
campaignDailyBudget:
|
|
27686
|
-
adSets:
|
|
27687
|
-
tempId:
|
|
27688
|
-
name:
|
|
27689
|
-
dailyBudget:
|
|
27690
|
-
creativeIds:
|
|
28591
|
+
campaignDailyBudget: z111.number().int().positive().optional(),
|
|
28592
|
+
adSets: z111.array(z111.object({
|
|
28593
|
+
tempId: z111.string().min(1).max(80),
|
|
28594
|
+
name: z111.string().min(1).max(100),
|
|
28595
|
+
dailyBudget: z111.number().int().positive().optional(),
|
|
28596
|
+
creativeIds: z111.array(z111.string().min(1)).min(1)
|
|
27691
28597
|
})).min(1).max(CAMPAIGN_LIMITS.MAX_AD_SETS),
|
|
27692
28598
|
/**
|
|
27693
28599
|
* Valid values are 'landing' and 'whatsapp' — there is no 'website'. This
|
|
@@ -27695,17 +28601,17 @@ var GroupedCampaignConfigBase = z106.object({
|
|
|
27695
28601
|
* opaque `invalid_literal` and made the WhatsApp destination — supported by
|
|
27696
28602
|
* the API since #849 — unreachable from this tool.
|
|
27697
28603
|
*/
|
|
27698
|
-
destination:
|
|
27699
|
-
|
|
27700
|
-
type:
|
|
27701
|
-
landingUrl:
|
|
28604
|
+
destination: z111.discriminatedUnion("type", [
|
|
28605
|
+
z111.object({
|
|
28606
|
+
type: z111.literal("landing"),
|
|
28607
|
+
landingUrl: z111.string().url()
|
|
27702
28608
|
}),
|
|
27703
|
-
|
|
27704
|
-
type:
|
|
27705
|
-
phoneNumber:
|
|
28609
|
+
z111.object({
|
|
28610
|
+
type: z111.literal("whatsapp"),
|
|
28611
|
+
phoneNumber: z111.string().min(8).max(32)
|
|
27706
28612
|
})
|
|
27707
28613
|
]),
|
|
27708
|
-
saveAsDefault:
|
|
28614
|
+
saveAsDefault: z111.boolean().default(false),
|
|
27709
28615
|
budgetPolicy: MetaBudgetPolicy.optional()
|
|
27710
28616
|
});
|
|
27711
28617
|
function resolveBudgetMode(value) {
|
|
@@ -27719,7 +28625,7 @@ var GroupedCampaignConfig = GroupedCampaignConfigBase.superRefine((value, ctx) =
|
|
|
27719
28625
|
const budgetMode = resolveBudgetMode(value);
|
|
27720
28626
|
if (budgetMode === "campaign" && value.campaignDailyBudget === void 0) {
|
|
27721
28627
|
ctx.addIssue({
|
|
27722
|
-
code:
|
|
28628
|
+
code: z111.ZodIssueCode.custom,
|
|
27723
28629
|
path: [
|
|
27724
28630
|
"campaignDailyBudget"
|
|
27725
28631
|
],
|
|
@@ -27730,7 +28636,7 @@ var GroupedCampaignConfig = GroupedCampaignConfigBase.superRefine((value, ctx) =
|
|
|
27730
28636
|
value.adSets.forEach((adSet, index) => {
|
|
27731
28637
|
if (adSet.dailyBudget === void 0) {
|
|
27732
28638
|
ctx.addIssue({
|
|
27733
|
-
code:
|
|
28639
|
+
code: z111.ZodIssueCode.custom,
|
|
27734
28640
|
path: [
|
|
27735
28641
|
"adSets",
|
|
27736
28642
|
index,
|
|
@@ -27745,28 +28651,28 @@ var GroupedCampaignConfig = GroupedCampaignConfigBase.superRefine((value, ctx) =
|
|
|
27745
28651
|
...value,
|
|
27746
28652
|
budgetMode: resolveBudgetMode(value)
|
|
27747
28653
|
}));
|
|
27748
|
-
var PublishCreativesToMetaInputBase =
|
|
27749
|
-
creatives:
|
|
28654
|
+
var PublishCreativesToMetaInputBase = z111.object({
|
|
28655
|
+
creatives: z111.array(GroupedCreative).min(1).max(CAMPAIGN_LIMITS.MAX_CREATIVES),
|
|
27750
28656
|
/** Exact Meta Business portfolio selected from `list_meta_destinations`. */
|
|
27751
|
-
portfolioId:
|
|
28657
|
+
portfolioId: z111.string().trim().min(1),
|
|
27752
28658
|
/** Exact Facebook Page selected from `list_meta_destinations`. */
|
|
27753
|
-
pageId:
|
|
28659
|
+
pageId: z111.string().trim().min(1),
|
|
27754
28660
|
adAccountId: McpAdAccountId,
|
|
27755
|
-
pixelId:
|
|
28661
|
+
pixelId: z111.string().min(1).optional(),
|
|
27756
28662
|
/** Required unless `campaignConfig.destination` is whatsapp — see the
|
|
27757
28663
|
* superRefine below. Mirrors the API's `FacebookCreateCampaignFromTasksBodySchema`. */
|
|
27758
|
-
landingUrl:
|
|
28664
|
+
landingUrl: z111.string().url().optional(),
|
|
27759
28665
|
/** ISO-2 code or resolvable country name — mirrors the API contract
|
|
27760
28666
|
* (CountryIso2Schema), which normalizes names to alpha-2 at validation. */
|
|
27761
28667
|
targetCountry: CountryIso2Schema,
|
|
27762
|
-
campaignName:
|
|
28668
|
+
campaignName: z111.string().trim().min(1).max(100),
|
|
27763
28669
|
campaignConfig: GroupedCampaignConfig.optional()
|
|
27764
28670
|
});
|
|
27765
28671
|
var PublishCreativesToMetaInput = PublishCreativesToMetaInputBase.superRefine((value, ctx) => {
|
|
27766
28672
|
const destination = value.campaignConfig?.destination;
|
|
27767
28673
|
if (destination?.type !== "whatsapp" && destination?.type !== "landing" && !value.landingUrl) {
|
|
27768
28674
|
ctx.addIssue({
|
|
27769
|
-
code:
|
|
28675
|
+
code: z111.ZodIssueCode.custom,
|
|
27770
28676
|
path: [
|
|
27771
28677
|
"landingUrl"
|
|
27772
28678
|
],
|
|
@@ -27775,7 +28681,7 @@ var PublishCreativesToMetaInput = PublishCreativesToMetaInputBase.superRefine((v
|
|
|
27775
28681
|
}
|
|
27776
28682
|
if (destination?.type === "landing" && value.landingUrl && destination.landingUrl !== value.landingUrl) {
|
|
27777
28683
|
ctx.addIssue({
|
|
27778
|
-
code:
|
|
28684
|
+
code: z111.ZodIssueCode.custom,
|
|
27779
28685
|
path: [
|
|
27780
28686
|
"campaignConfig",
|
|
27781
28687
|
"destination",
|
|
@@ -27794,16 +28700,16 @@ var PublishCreativesToMetaInput = PublishCreativesToMetaInputBase.superRefine((v
|
|
|
27794
28700
|
}
|
|
27795
28701
|
return value;
|
|
27796
28702
|
});
|
|
27797
|
-
var PresignUploadResponseSchema =
|
|
27798
|
-
uploadUrl:
|
|
28703
|
+
var PresignUploadResponseSchema = z111.object({
|
|
28704
|
+
uploadUrl: z111.string().url().refine((value) => {
|
|
27799
28705
|
const url = new URL(value);
|
|
27800
28706
|
return !url.username && !url.password && url.protocol === "https:";
|
|
27801
28707
|
}, "presigned upload URL must be HTTPS without embedded credentials"),
|
|
27802
|
-
publicUrl:
|
|
28708
|
+
publicUrl: z111.string().url().refine((value) => {
|
|
27803
28709
|
const url = new URL(value);
|
|
27804
28710
|
return !url.username && !url.password;
|
|
27805
28711
|
}, "public media URL must not contain embedded credentials"),
|
|
27806
|
-
stagingAssetId:
|
|
28712
|
+
stagingAssetId: z111.string().uuid()
|
|
27807
28713
|
});
|
|
27808
28714
|
async function uploadResolvedMedia(api, media, assetRole) {
|
|
27809
28715
|
if (!media.buffer) throw new ResolveMediaError("INVALID_INPUT", "resolved media has no bytes");
|
|
@@ -27828,16 +28734,16 @@ async function resolveAndUploadMedia(api, ref, expectedKind, assetRole, transpor
|
|
|
27828
28734
|
return uploadResolvedMedia(api, media, assetRole);
|
|
27829
28735
|
}
|
|
27830
28736
|
__name(resolveAndUploadMedia, "resolveAndUploadMedia");
|
|
27831
|
-
var TikTokInput =
|
|
27832
|
-
taskId:
|
|
27833
|
-
advertiserId:
|
|
27834
|
-
pixelId:
|
|
27835
|
-
landingUrl:
|
|
27836
|
-
angleIndexes:
|
|
28737
|
+
var TikTokInput = z111.object({
|
|
28738
|
+
taskId: z111.string().min(1),
|
|
28739
|
+
advertiserId: z111.string().min(1),
|
|
28740
|
+
pixelId: z111.string().min(1).optional(),
|
|
28741
|
+
landingUrl: z111.string().url().optional(),
|
|
28742
|
+
angleIndexes: z111.array(z111.number().int().nonnegative()).optional(),
|
|
27837
28743
|
campaignConfig: McpCampaignConfig.optional(),
|
|
27838
28744
|
/** Override the ad's description (TikTok's body copy). If omitted,
|
|
27839
28745
|
* ProductMaker uses the auto-generated copy attached to the task. */
|
|
27840
|
-
primaryText:
|
|
28746
|
+
primaryText: z111.string().trim().min(1).max(500).optional()
|
|
27841
28747
|
});
|
|
27842
28748
|
function registerPublishTools(server, api, opts = {}) {
|
|
27843
28749
|
const transport = opts.transport ?? "http";
|
|
@@ -27889,7 +28795,7 @@ function registerPublishTools(server, api, opts = {}) {
|
|
|
27889
28795
|
return renderShopifyPublishMarkdown(r);
|
|
27890
28796
|
} catch (e) {
|
|
27891
28797
|
const error = translateError(e);
|
|
27892
|
-
if (
|
|
28798
|
+
if (isRecord3(error.data) && [
|
|
27893
28799
|
"SHOPIFY_PUBLISH_INPUT_REQUIRED",
|
|
27894
28800
|
"SHOPIFY_PUBLISH_CONTEXT_CHANGED",
|
|
27895
28801
|
"SHOPIFY_PUBLISH_CORRECTION_REQUIRES_EDITOR",
|
|
@@ -27939,7 +28845,7 @@ function registerPublishTools(server, api, opts = {}) {
|
|
|
27939
28845
|
body.campaignOverrides = toMetaCampaignOverrides(campaignConfig);
|
|
27940
28846
|
}
|
|
27941
28847
|
if (phoneNumber) {
|
|
27942
|
-
const overrides =
|
|
28848
|
+
const overrides = isRecord3(body.campaignOverrides) ? body.campaignOverrides : {};
|
|
27943
28849
|
body.campaignOverrides = {
|
|
27944
28850
|
...overrides,
|
|
27945
28851
|
destination: {
|
|
@@ -28160,9 +29066,9 @@ __name(renderBundleMappingMarkdown, "renderBundleMappingMarkdown");
|
|
|
28160
29066
|
async function fetchLandingImageCount(api, taskId) {
|
|
28161
29067
|
try {
|
|
28162
29068
|
const r = await api.getJson(`/v1/results/${encodeURIComponent(taskId)}`);
|
|
28163
|
-
if (!
|
|
29069
|
+
if (!isRecord3(r)) return 0;
|
|
28164
29070
|
const landing = r.landing;
|
|
28165
|
-
if (!
|
|
29071
|
+
if (!isRecord3(landing)) return 0;
|
|
28166
29072
|
const images = landing.images;
|
|
28167
29073
|
return Array.isArray(images) ? images.length : 0;
|
|
28168
29074
|
} catch {
|
|
@@ -28189,39 +29095,39 @@ __name(toTikTokCampaignConfig, "toTikTokCampaignConfig");
|
|
|
28189
29095
|
|
|
28190
29096
|
// src/tools/meta-upload.ts
|
|
28191
29097
|
import { registerAppTool } from "@modelcontextprotocol/ext-apps/server";
|
|
28192
|
-
import { z as
|
|
29098
|
+
import { z as z112 } from "zod";
|
|
28193
29099
|
var requestMediaUploadGuidance = getProductMakerCapabilityModelGuidance("request_media_upload");
|
|
28194
|
-
var UploadSessionInputBase =
|
|
28195
|
-
mediaKind:
|
|
29100
|
+
var UploadSessionInputBase = z112.object({
|
|
29101
|
+
mediaKind: z112.enum([
|
|
28196
29102
|
"image",
|
|
28197
29103
|
"video",
|
|
28198
29104
|
"mixed"
|
|
28199
29105
|
]).default("mixed").describe("The kind of file the user will select. Use image for product references and landing pages, video for a single video, and mixed only when the consumer supports both."),
|
|
28200
|
-
assetRole:
|
|
29106
|
+
assetRole: z112.enum([
|
|
28201
29107
|
"media",
|
|
28202
29108
|
"thumbnail"
|
|
28203
29109
|
]).default("media").describe("Use media for the creative itself; thumbnail only for an image thumbnail."),
|
|
28204
|
-
uploadPurpose:
|
|
29110
|
+
uploadPurpose: z112.enum([
|
|
28205
29111
|
"product_reference",
|
|
28206
29112
|
"creative",
|
|
28207
29113
|
"generic"
|
|
28208
29114
|
]).default("generic").describe("The user's purpose for these files. Use product_reference for a product photo used by tasks or landings, creative for media that will become an ad or creative, and generic only when neither applies."),
|
|
28209
|
-
maxFiles:
|
|
29115
|
+
maxFiles: z112.number().int().min(1).max(10).optional().describe("Optional batch limit: image accepts 1-5, video exactly 1, and mixed 1-10.")
|
|
28210
29116
|
});
|
|
28211
|
-
var OpenAiFileReference =
|
|
28212
|
-
download_url:
|
|
28213
|
-
file_id:
|
|
28214
|
-
mime_type:
|
|
28215
|
-
file_name:
|
|
29117
|
+
var OpenAiFileReference = z112.object({
|
|
29118
|
+
download_url: z112.string().url().describe("Required by ChatGPT's openai/fileParams schema. The App prefers getFileDownloadUrl(file_id) for a fresh URL, and the server never fetches this value."),
|
|
29119
|
+
file_id: z112.string().min(1),
|
|
29120
|
+
mime_type: z112.string().min(1).optional(),
|
|
29121
|
+
file_name: z112.string().min(1).optional()
|
|
28216
29122
|
});
|
|
28217
29123
|
var UploadSessionToolInputShape = {
|
|
28218
29124
|
...UploadSessionInputBase.shape,
|
|
28219
|
-
files:
|
|
29125
|
+
files: z112.array(OpenAiFileReference).max(10).optional().describe("Optional OpenAI-hosted file references provided by ChatGPT. They are only metadata for the UI bridge and are never forwarded to ProductMaker.")
|
|
28220
29126
|
};
|
|
28221
|
-
var UploadSessionToolInput =
|
|
29127
|
+
var UploadSessionToolInput = z112.object(UploadSessionToolInputShape).superRefine((value, ctx) => {
|
|
28222
29128
|
if (value.assetRole === "thumbnail" && value.mediaKind !== "image") {
|
|
28223
29129
|
ctx.addIssue({
|
|
28224
|
-
code:
|
|
29130
|
+
code: z112.ZodIssueCode.custom,
|
|
28225
29131
|
path: [
|
|
28226
29132
|
"mediaKind"
|
|
28227
29133
|
],
|
|
@@ -28230,7 +29136,7 @@ var UploadSessionToolInput = z107.object(UploadSessionToolInputShape).superRefin
|
|
|
28230
29136
|
}
|
|
28231
29137
|
if (value.mediaKind === "video" && value.maxFiles !== void 0 && value.maxFiles !== 1) {
|
|
28232
29138
|
ctx.addIssue({
|
|
28233
|
-
code:
|
|
29139
|
+
code: z112.ZodIssueCode.custom,
|
|
28234
29140
|
path: [
|
|
28235
29141
|
"maxFiles"
|
|
28236
29142
|
],
|
|
@@ -28239,7 +29145,7 @@ var UploadSessionToolInput = z107.object(UploadSessionToolInputShape).superRefin
|
|
|
28239
29145
|
}
|
|
28240
29146
|
if (value.mediaKind === "image" && (value.maxFiles ?? 1) > 5) {
|
|
28241
29147
|
ctx.addIssue({
|
|
28242
|
-
code:
|
|
29148
|
+
code: z112.ZodIssueCode.custom,
|
|
28243
29149
|
path: [
|
|
28244
29150
|
"maxFiles"
|
|
28245
29151
|
],
|
|
@@ -28247,38 +29153,38 @@ var UploadSessionToolInput = z107.object(UploadSessionToolInputShape).superRefin
|
|
|
28247
29153
|
});
|
|
28248
29154
|
}
|
|
28249
29155
|
});
|
|
28250
|
-
var UploadSessionResponse =
|
|
28251
|
-
sessionId:
|
|
28252
|
-
uploadPageUrl:
|
|
28253
|
-
mediaKind:
|
|
29156
|
+
var UploadSessionResponse = z112.object({
|
|
29157
|
+
sessionId: z112.string().uuid(),
|
|
29158
|
+
uploadPageUrl: z112.string().url(),
|
|
29159
|
+
mediaKind: z112.enum([
|
|
28254
29160
|
"image",
|
|
28255
29161
|
"video",
|
|
28256
29162
|
"mixed"
|
|
28257
29163
|
]),
|
|
28258
|
-
assetRole:
|
|
29164
|
+
assetRole: z112.enum([
|
|
28259
29165
|
"media",
|
|
28260
29166
|
"thumbnail"
|
|
28261
29167
|
]),
|
|
28262
|
-
maxFiles:
|
|
28263
|
-
expiresAt:
|
|
29168
|
+
maxFiles: z112.number().int().positive(),
|
|
29169
|
+
expiresAt: z112.string().datetime()
|
|
28264
29170
|
});
|
|
28265
|
-
var UploadStatusInput =
|
|
28266
|
-
sessionId:
|
|
29171
|
+
var UploadStatusInput = z112.object({
|
|
29172
|
+
sessionId: z112.string().uuid().describe("The sessionId returned by request_media_upload.")
|
|
28267
29173
|
});
|
|
28268
|
-
var UniversalUploadStatusResponse =
|
|
28269
|
-
|
|
28270
|
-
status:
|
|
28271
|
-
assets:
|
|
29174
|
+
var UniversalUploadStatusResponse = z112.discriminatedUnion("status", [
|
|
29175
|
+
z112.object({
|
|
29176
|
+
status: z112.literal("pending"),
|
|
29177
|
+
assets: z112.array(z112.never()).length(0)
|
|
28272
29178
|
}),
|
|
28273
|
-
|
|
28274
|
-
status:
|
|
28275
|
-
assets:
|
|
28276
|
-
assetId:
|
|
28277
|
-
mediaKind:
|
|
29179
|
+
z112.object({
|
|
29180
|
+
status: z112.literal("uploaded"),
|
|
29181
|
+
assets: z112.array(z112.object({
|
|
29182
|
+
assetId: z112.string().uuid(),
|
|
29183
|
+
mediaKind: z112.enum([
|
|
28278
29184
|
"image",
|
|
28279
29185
|
"video"
|
|
28280
29186
|
]),
|
|
28281
|
-
assetRole:
|
|
29187
|
+
assetRole: z112.enum([
|
|
28282
29188
|
"media",
|
|
28283
29189
|
"thumbnail"
|
|
28284
29190
|
])
|
|
@@ -28286,13 +29192,13 @@ var UniversalUploadStatusResponse = z107.discriminatedUnion("status", [
|
|
|
28286
29192
|
})
|
|
28287
29193
|
]);
|
|
28288
29194
|
var UniversalUploadStructuredResponse = UploadSessionResponse.extend({
|
|
28289
|
-
uploadPurpose:
|
|
29195
|
+
uploadPurpose: z112.enum([
|
|
28290
29196
|
"product_reference",
|
|
28291
29197
|
"creative",
|
|
28292
29198
|
"generic"
|
|
28293
29199
|
]),
|
|
28294
|
-
checkToolName:
|
|
28295
|
-
resolveEndpoint:
|
|
29200
|
+
checkToolName: z112.literal("check_media_upload"),
|
|
29201
|
+
resolveEndpoint: z112.string().url()
|
|
28296
29202
|
});
|
|
28297
29203
|
function contextualizeUploadPageUrl(uploadPageUrl, uploadPurpose) {
|
|
28298
29204
|
const url = new URL(uploadPageUrl);
|
|
@@ -28383,15 +29289,15 @@ function registerMediaUploadTools(server, api) {
|
|
|
28383
29289
|
__name(registerMediaUploadTools, "registerMediaUploadTools");
|
|
28384
29290
|
|
|
28385
29291
|
// src/tools/campaigns.ts
|
|
28386
|
-
import { z as
|
|
29292
|
+
import { z as z113 } from "zod";
|
|
28387
29293
|
var getMetaCampaignStatusGuidance = getProductMakerCapabilityModelGuidance("get_meta_campaign_status");
|
|
28388
29294
|
var getTikTokCampaignStatusGuidance = getProductMakerCapabilityModelGuidance("get_tiktok_campaign_status");
|
|
28389
|
-
var MetaStatusInput =
|
|
28390
|
-
campaignId:
|
|
29295
|
+
var MetaStatusInput = z113.object({
|
|
29296
|
+
campaignId: z113.string().min(1).describe("Meta campaign ID returned by publish_to_meta.")
|
|
28391
29297
|
});
|
|
28392
|
-
var TikTokStatusInput =
|
|
28393
|
-
campaignId:
|
|
28394
|
-
advertiserId:
|
|
29298
|
+
var TikTokStatusInput = z113.object({
|
|
29299
|
+
campaignId: z113.string().min(1).describe("TikTok campaign ID returned by publish_to_tiktok."),
|
|
29300
|
+
advertiserId: z113.string().min(1).describe("The same advertiserId used to publish the campaign.")
|
|
28395
29301
|
});
|
|
28396
29302
|
function registerCampaignTools(server, api) {
|
|
28397
29303
|
server.registerTool("get_meta_campaign_status", {
|
|
@@ -28496,10 +29402,10 @@ function renderTikTokStatusMarkdown(r) {
|
|
|
28496
29402
|
__name(renderTikTokStatusMarkdown, "renderTikTokStatusMarkdown");
|
|
28497
29403
|
|
|
28498
29404
|
// ../../packages/product-economics/src/product-costing.ts
|
|
28499
|
-
import { z as
|
|
29405
|
+
import { z as z115 } from "zod";
|
|
28500
29406
|
|
|
28501
29407
|
// ../../packages/product-economics/src/product-costing-countries.ts
|
|
28502
|
-
import { z as
|
|
29408
|
+
import { z as z114 } from "zod";
|
|
28503
29409
|
|
|
28504
29410
|
// ../../packages/product-economics/src/product-costing-shipping-references.json
|
|
28505
29411
|
var product_costing_shipping_references_default = {
|
|
@@ -28563,21 +29469,21 @@ var product_costing_shipping_references_default = {
|
|
|
28563
29469
|
};
|
|
28564
29470
|
|
|
28565
29471
|
// ../../packages/product-economics/src/product-costing-countries.ts
|
|
28566
|
-
var ShippingReferenceSchema =
|
|
28567
|
-
reference:
|
|
28568
|
-
min:
|
|
28569
|
-
max:
|
|
28570
|
-
updatedAt:
|
|
28571
|
-
confidence:
|
|
29472
|
+
var ShippingReferenceSchema = z114.object({
|
|
29473
|
+
reference: z114.number().positive(),
|
|
29474
|
+
min: z114.number().nonnegative(),
|
|
29475
|
+
max: z114.number().positive(),
|
|
29476
|
+
updatedAt: z114.string().date(),
|
|
29477
|
+
confidence: z114.enum([
|
|
28572
29478
|
"high",
|
|
28573
29479
|
"medium",
|
|
28574
29480
|
"medium-low"
|
|
28575
29481
|
]),
|
|
28576
|
-
sources:
|
|
29482
|
+
sources: z114.array(z114.string().url().startsWith("https://")).min(1).max(3)
|
|
28577
29483
|
}).superRefine(({ reference, min, max }, context) => {
|
|
28578
29484
|
if (min > reference || reference > max) {
|
|
28579
29485
|
context.addIssue({
|
|
28580
|
-
code:
|
|
29486
|
+
code: z114.ZodIssueCode.custom,
|
|
28581
29487
|
message: "shipping_reference_outside_range",
|
|
28582
29488
|
path: [
|
|
28583
29489
|
"reference"
|
|
@@ -28585,7 +29491,7 @@ var ShippingReferenceSchema = z109.object({
|
|
|
28585
29491
|
});
|
|
28586
29492
|
}
|
|
28587
29493
|
});
|
|
28588
|
-
var SHIPPING_REFERENCES =
|
|
29494
|
+
var SHIPPING_REFERENCES = z114.record(ShippingReferenceSchema).parse(product_costing_shipping_references_default);
|
|
28589
29495
|
var PRODUCT_COSTING_COUNTRY_CODES = Object.freeze(Object.keys(SHIPPING_REFERENCES));
|
|
28590
29496
|
var SPANISH_LOCALE_COUNTRIES = /* @__PURE__ */ new Set([
|
|
28591
29497
|
"MX",
|
|
@@ -28767,18 +29673,18 @@ function getProductCostingCountryName(country) {
|
|
|
28767
29673
|
__name(getProductCostingCountryName, "getProductCostingCountryName");
|
|
28768
29674
|
|
|
28769
29675
|
// ../../packages/product-economics/src/product-costing.ts
|
|
28770
|
-
var ProductCostingInputSchema =
|
|
28771
|
-
country:
|
|
28772
|
-
supplierCost:
|
|
28773
|
-
shippingCost:
|
|
28774
|
-
returnRate:
|
|
28775
|
-
cancellationRate:
|
|
28776
|
-
adsManagerCpa:
|
|
28777
|
-
desiredMargin:
|
|
29676
|
+
var ProductCostingInputSchema = z115.object({
|
|
29677
|
+
country: z115.string().refine(isProductCostingCountryCode, "unsupported_country"),
|
|
29678
|
+
supplierCost: z115.number().finite().max(Number.MAX_SAFE_INTEGER, "amount_too_large").positive("supplier_cost_positive"),
|
|
29679
|
+
shippingCost: z115.number().finite().max(Number.MAX_SAFE_INTEGER, "amount_too_large").nonnegative("shipping_cost_nonnegative"),
|
|
29680
|
+
returnRate: z115.number().finite().min(0, "rate_nonnegative").lt(1, "rate_below_one"),
|
|
29681
|
+
cancellationRate: z115.number().finite().min(0, "rate_nonnegative").lt(1, "rate_below_one"),
|
|
29682
|
+
adsManagerCpa: z115.number().finite().max(Number.MAX_SAFE_INTEGER, "amount_too_large").nonnegative("cpa_nonnegative"),
|
|
29683
|
+
desiredMargin: z115.number().finite().min(0, "margin_nonnegative").lt(1, "margin_below_one")
|
|
28778
29684
|
}).superRefine(({ returnRate, cancellationRate }, context) => {
|
|
28779
29685
|
if (returnRate + cancellationRate >= 1) {
|
|
28780
29686
|
context.addIssue({
|
|
28781
|
-
code:
|
|
29687
|
+
code: z115.ZodIssueCode.custom,
|
|
28782
29688
|
message: "delivery_rate_positive",
|
|
28783
29689
|
path: [
|
|
28784
29690
|
"cancellationRate"
|
|
@@ -28875,15 +29781,15 @@ function calculateProductCosting(rawInput) {
|
|
|
28875
29781
|
__name(calculateProductCosting, "calculateProductCosting");
|
|
28876
29782
|
|
|
28877
29783
|
// src/tools/product-costing.ts
|
|
28878
|
-
import { z as
|
|
29784
|
+
import { z as z116 } from "zod";
|
|
28879
29785
|
var costProductGuidance = getProductMakerCapabilityModelGuidance("cost_product");
|
|
28880
|
-
var optionalAmount = /* @__PURE__ */ __name((description) =>
|
|
28881
|
-
var optionalPercent = /* @__PURE__ */ __name((description) =>
|
|
28882
|
-
var ProductCostingToolInput =
|
|
28883
|
-
country:
|
|
29786
|
+
var optionalAmount = /* @__PURE__ */ __name((description) => z116.number().finite().max(Number.MAX_SAFE_INTEGER).nonnegative().optional().describe(description), "optionalAmount");
|
|
29787
|
+
var optionalPercent = /* @__PURE__ */ __name((description) => z116.number().finite().min(0).lt(100).optional().describe(description), "optionalPercent");
|
|
29788
|
+
var ProductCostingToolInput = z116.object({
|
|
29789
|
+
country: z116.string().trim().toUpperCase().refine(isProductCostingCountryCode, {
|
|
28884
29790
|
message: "Pa\xEDs no soportado por ProductMaker."
|
|
28885
29791
|
}).optional().describe("C\xF3digo ISO-2 de cualquiera de los pa\xEDses disponibles en ProductMaker. Omite para Colombia."),
|
|
28886
|
-
supplierCost:
|
|
29792
|
+
supplierCost: z116.number().finite().max(Number.MAX_SAFE_INTEGER).positive().optional().describe("Costo real de una unidad con el proveedor, en la moneda del pa\xEDs. Requerido salvo que uses supplierCostCop para Colombia."),
|
|
28887
29793
|
supplierCostCop: optionalAmount("Alias anterior para costo del proveedor en Colombia. Prefiere supplierCost."),
|
|
28888
29794
|
shippingCost: optionalAmount("Costo de un env\xEDo en la moneda del pa\xEDs. Omite para usar el valor gu\xEDa vigente."),
|
|
28889
29795
|
shippingCostCop: optionalAmount("Alias anterior para flete en Colombia. Prefiere shippingCost."),
|
|
@@ -29046,7 +29952,7 @@ function formatPercent(value) {
|
|
|
29046
29952
|
__name(formatPercent, "formatPercent");
|
|
29047
29953
|
|
|
29048
29954
|
// src/tools/product-research.ts
|
|
29049
|
-
import { z as
|
|
29955
|
+
import { z as z117 } from "zod";
|
|
29050
29956
|
|
|
29051
29957
|
// src/tools/product-research-idempotency.ts
|
|
29052
29958
|
var RESEARCH_IDEMPOTENCY_WINDOW_MS = 2 * 60 * 60 * 1e3;
|
|
@@ -29417,17 +30323,17 @@ var TERMINAL2 = /* @__PURE__ */ new Set([
|
|
|
29417
30323
|
]);
|
|
29418
30324
|
var POLL_INTERVAL_MS = 5e3;
|
|
29419
30325
|
var MAX_WAIT_SECONDS = 120;
|
|
29420
|
-
var FindInput =
|
|
30326
|
+
var FindInput = z117.object({
|
|
29421
30327
|
targetCountry: ResearchTargetCountryEnum.describe("Pa\xEDs objetivo. S\xF3lo CO, MX, PE, EC y CL tienen cobertura de investigaci\xF3n."),
|
|
29422
30328
|
categoryKey: ResearchCategoryEnum.default("auto").describe('Categor\xEDa a investigar. Usa "auto" para que la IA elija seg\xFAn el mercado.'),
|
|
29423
|
-
confirmed:
|
|
29424
|
-
waitSeconds:
|
|
30329
|
+
confirmed: z117.boolean().describe(`Ponlo en true SOLO despu\xE9s de que el usuario haya aceptado el cargo de ${PRICE_CREDITS} cr\xE9ditos. No lo asumas.`),
|
|
30330
|
+
waitSeconds: z117.number().int().min(0).max(MAX_WAIT_SECONDS).optional().describe("Segundos a esperar el reporte antes de devolver el runId. M\xE1ximo 120.")
|
|
29425
30331
|
});
|
|
29426
|
-
var GetInput =
|
|
29427
|
-
runId:
|
|
30332
|
+
var GetInput = z117.object({
|
|
30333
|
+
runId: z117.string().uuid().describe("ID del run devuelto por find_winning_products.")
|
|
29428
30334
|
});
|
|
29429
|
-
var ListInput =
|
|
29430
|
-
limit:
|
|
30335
|
+
var ListInput = z117.object({
|
|
30336
|
+
limit: z117.number().int().min(1).max(20).default(10)
|
|
29431
30337
|
});
|
|
29432
30338
|
function textResult(text2) {
|
|
29433
30339
|
return {
|
|
@@ -29566,17 +30472,17 @@ _Esta llamada no cobr\xF3 cr\xE9ditos: se reutiliz\xF3 una investigaci\xF3n reci
|
|
|
29566
30472
|
__name(registerProductResearchTools, "registerProductResearchTools");
|
|
29567
30473
|
|
|
29568
30474
|
// src/tools/dropshipping-projects.ts
|
|
29569
|
-
import { z as
|
|
30475
|
+
import { z as z118 } from "zod";
|
|
29570
30476
|
var startDropshippingProjectGuidance = getProductMakerCapabilityModelGuidance("start_dropshipping_project");
|
|
29571
30477
|
var costDropshippingProjectGuidance = getProductMakerCapabilityModelGuidance("cost_dropshipping_project");
|
|
29572
30478
|
var guideDropshippingLaunchGuidance = getProductMakerCapabilityModelGuidance("guide_dropshipping_launch");
|
|
29573
|
-
var ProjectId =
|
|
29574
|
-
var DropshippingProjectStatus =
|
|
30479
|
+
var ProjectId = z118.string().uuid();
|
|
30480
|
+
var DropshippingProjectStatus = z118.enum([
|
|
29575
30481
|
"active",
|
|
29576
30482
|
"completed",
|
|
29577
30483
|
"archived"
|
|
29578
30484
|
]);
|
|
29579
|
-
var DropshippingProjectPhase =
|
|
30485
|
+
var DropshippingProjectPhase = z118.enum([
|
|
29580
30486
|
"research",
|
|
29581
30487
|
"costing",
|
|
29582
30488
|
"media",
|
|
@@ -29585,21 +30491,21 @@ var DropshippingProjectPhase = z113.enum([
|
|
|
29585
30491
|
"advertising",
|
|
29586
30492
|
"complete"
|
|
29587
30493
|
]);
|
|
29588
|
-
var DropshippingRewardMilestone =
|
|
30494
|
+
var DropshippingRewardMilestone = z118.enum([
|
|
29589
30495
|
"product_selected",
|
|
29590
30496
|
"costing_saved",
|
|
29591
30497
|
"product_media_ready",
|
|
29592
30498
|
"creatives_completed",
|
|
29593
30499
|
"campaign_created"
|
|
29594
30500
|
]);
|
|
29595
|
-
var TargetCountry =
|
|
30501
|
+
var TargetCountry = z118.enum([
|
|
29596
30502
|
"CO",
|
|
29597
30503
|
"MX",
|
|
29598
30504
|
"PE",
|
|
29599
30505
|
"EC",
|
|
29600
30506
|
"CL"
|
|
29601
30507
|
]);
|
|
29602
|
-
var ResearchCategory =
|
|
30508
|
+
var ResearchCategory = z118.enum([
|
|
29603
30509
|
"auto",
|
|
29604
30510
|
"automotive",
|
|
29605
30511
|
"kitchen",
|
|
@@ -29614,7 +30520,7 @@ var ResearchCategory = z113.enum([
|
|
|
29614
30520
|
"garden",
|
|
29615
30521
|
"cleaning"
|
|
29616
30522
|
]);
|
|
29617
|
-
var HttpUrl3 =
|
|
30523
|
+
var HttpUrl3 = z118.string().url().max(2e3).refine((value) => {
|
|
29618
30524
|
try {
|
|
29619
30525
|
return [
|
|
29620
30526
|
"http:",
|
|
@@ -29624,45 +30530,45 @@ var HttpUrl3 = z113.string().url().max(2e3).refine((value) => {
|
|
|
29624
30530
|
return false;
|
|
29625
30531
|
}
|
|
29626
30532
|
}, "URL must use HTTP(S)");
|
|
29627
|
-
var ResearchCandidateOrigin =
|
|
29628
|
-
type:
|
|
30533
|
+
var ResearchCandidateOrigin = z118.object({
|
|
30534
|
+
type: z118.literal("research_candidate"),
|
|
29629
30535
|
runId: ProjectId,
|
|
29630
|
-
candidateSourceId:
|
|
30536
|
+
candidateSourceId: z118.string().min(1).max(160)
|
|
29631
30537
|
});
|
|
29632
|
-
var TaskOrigin =
|
|
29633
|
-
type:
|
|
30538
|
+
var TaskOrigin = z118.object({
|
|
30539
|
+
type: z118.literal("task"),
|
|
29634
30540
|
taskId: ProjectId
|
|
29635
30541
|
});
|
|
29636
|
-
var ManualOrigin =
|
|
29637
|
-
type:
|
|
30542
|
+
var ManualOrigin = z118.object({
|
|
30543
|
+
type: z118.literal("manual"),
|
|
29638
30544
|
clientRequestId: ProjectId,
|
|
29639
|
-
country:
|
|
30545
|
+
country: z118.string().min(2).max(3).optional()
|
|
29640
30546
|
});
|
|
29641
|
-
var StartProjectInput =
|
|
29642
|
-
origin:
|
|
30547
|
+
var StartProjectInput = z118.object({
|
|
30548
|
+
origin: z118.discriminatedUnion("type", [
|
|
29643
30549
|
ResearchCandidateOrigin,
|
|
29644
30550
|
TaskOrigin,
|
|
29645
30551
|
ManualOrigin
|
|
29646
30552
|
]),
|
|
29647
|
-
productName:
|
|
30553
|
+
productName: z118.string().trim().min(1).max(240).optional(),
|
|
29648
30554
|
productUrl: HttpUrl3.optional(),
|
|
29649
|
-
country:
|
|
29650
|
-
languageCode:
|
|
30555
|
+
country: z118.string().min(2).max(3).optional(),
|
|
30556
|
+
languageCode: z118.string().min(2).max(16).optional()
|
|
29651
30557
|
}).strict();
|
|
29652
|
-
var CostProjectInput =
|
|
30558
|
+
var CostProjectInput = z118.object({
|
|
29653
30559
|
projectId: ProjectId,
|
|
29654
|
-
version:
|
|
29655
|
-
country:
|
|
30560
|
+
version: z118.number().int().positive().describe("Version le\xEDda del proyecto. Copia la \xFAltima que viste; no se la pidas al usuario."),
|
|
30561
|
+
country: z118.string().trim().toUpperCase().refine(isProductCostingCountryCode, {
|
|
29656
30562
|
message: "Pa\xEDs no soportado por ProductMaker."
|
|
29657
30563
|
}).describe("C\xF3digo ISO-2 del pa\xEDs del proyecto. Usa el `targetCountry` que devuelve el proyecto."),
|
|
29658
|
-
supplierCost:
|
|
29659
|
-
shippingCost:
|
|
29660
|
-
returnRate:
|
|
29661
|
-
cancellationRate:
|
|
29662
|
-
adsManagerCpa:
|
|
29663
|
-
desiredMargin:
|
|
29664
|
-
});
|
|
29665
|
-
var GuideInput =
|
|
30564
|
+
supplierCost: z118.number().finite().positive().describe("Costo real de una unidad con el proveedor, en la moneda del pa\xEDs. \xDANICO dato que debes pedirle al usuario: nunca lo inventes."),
|
|
30565
|
+
shippingCost: z118.number().finite().nonnegative().optional().describe("Costo de un env\xEDo. Omite para usar el valor gu\xEDa del pa\xEDs en vez de inventarlo."),
|
|
30566
|
+
returnRate: z118.number().finite().min(0).lt(1).optional().describe("Fracci\xF3n de pedidos devueltos (0.25 = 25%). Omite para usar el valor gu\xEDa del pa\xEDs."),
|
|
30567
|
+
cancellationRate: z118.number().finite().min(0).lt(1).optional().describe("Fracci\xF3n de pedidos cancelados (0.15 = 15%). Omite para usar el valor gu\xEDa del pa\xEDs."),
|
|
30568
|
+
adsManagerCpa: z118.number().finite().nonnegative().optional().describe("Costo por compra de Ads Manager. Omite para usar el valor gu\xEDa del pa\xEDs."),
|
|
30569
|
+
desiredMargin: z118.number().finite().min(0).lt(1).optional().describe("Margen deseado (0.1 = 10%). Omite para usar el valor gu\xEDa del pa\xEDs.")
|
|
30570
|
+
});
|
|
30571
|
+
var GuideInput = z118.object({
|
|
29666
30572
|
projectId: ProjectId.optional()
|
|
29667
30573
|
}).strict();
|
|
29668
30574
|
var NEXT_ACTION_KINDS = [
|
|
@@ -29680,29 +30586,29 @@ var NEXT_ACTION_KINDS = [
|
|
|
29680
30586
|
"repair_meta_campaign",
|
|
29681
30587
|
"review_paused_campaign"
|
|
29682
30588
|
];
|
|
29683
|
-
var DropshippingProjectNextAction =
|
|
29684
|
-
kind:
|
|
29685
|
-
href:
|
|
30589
|
+
var DropshippingProjectNextAction = z118.discriminatedUnion("kind", NEXT_ACTION_KINDS.map((kind) => z118.object({
|
|
30590
|
+
kind: z118.literal(kind),
|
|
30591
|
+
href: z118.string().min(1)
|
|
29686
30592
|
})));
|
|
29687
|
-
var CostingInputSchema =
|
|
29688
|
-
country:
|
|
29689
|
-
supplierCost:
|
|
29690
|
-
shippingCost:
|
|
29691
|
-
returnRate:
|
|
29692
|
-
cancellationRate:
|
|
29693
|
-
adsManagerCpa:
|
|
29694
|
-
desiredMargin:
|
|
30593
|
+
var CostingInputSchema = z118.object({
|
|
30594
|
+
country: z118.string().min(2).max(3),
|
|
30595
|
+
supplierCost: z118.number().finite().positive(),
|
|
30596
|
+
shippingCost: z118.number().finite().nonnegative(),
|
|
30597
|
+
returnRate: z118.number().finite().min(0).lt(1),
|
|
30598
|
+
cancellationRate: z118.number().finite().min(0).lt(1),
|
|
30599
|
+
adsManagerCpa: z118.number().finite().nonnegative(),
|
|
30600
|
+
desiredMargin: z118.number().finite().min(0).lt(1)
|
|
29695
30601
|
}).superRefine(({ returnRate, cancellationRate }, context) => {
|
|
29696
30602
|
if (returnRate + cancellationRate >= 1) context.addIssue({
|
|
29697
|
-
code:
|
|
30603
|
+
code: z118.ZodIssueCode.custom,
|
|
29698
30604
|
path: [
|
|
29699
30605
|
"cancellationRate"
|
|
29700
30606
|
]
|
|
29701
30607
|
});
|
|
29702
30608
|
});
|
|
29703
|
-
var FiniteCostingNumber =
|
|
29704
|
-
var CostingResultSchema =
|
|
29705
|
-
country:
|
|
30609
|
+
var FiniteCostingNumber = z118.number().finite();
|
|
30610
|
+
var CostingResultSchema = z118.object({
|
|
30611
|
+
country: z118.string().min(2).max(3),
|
|
29706
30612
|
deliveryRate: FiniteCostingNumber,
|
|
29707
30613
|
adjustedShippingCost: FiniteCostingNumber,
|
|
29708
30614
|
adjustedCpa: FiniteCostingNumber,
|
|
@@ -29715,45 +30621,45 @@ var CostingResultSchema = z113.object({
|
|
|
29715
30621
|
estimatedProfit: FiniteCostingNumber,
|
|
29716
30622
|
actualMargin: FiniteCostingNumber,
|
|
29717
30623
|
breakEvenAdsManagerCpa: FiniteCostingNumber,
|
|
29718
|
-
wasPriceAutoAdjusted:
|
|
29719
|
-
profitabilityStatus:
|
|
29720
|
-
});
|
|
29721
|
-
var RewardProgressSchema =
|
|
29722
|
-
campaignKey:
|
|
29723
|
-
totalCredits:
|
|
29724
|
-
earnedCredits:
|
|
29725
|
-
milestones:
|
|
30624
|
+
wasPriceAutoAdjusted: z118.boolean(),
|
|
30625
|
+
profitabilityStatus: z118.literal("healthy")
|
|
30626
|
+
});
|
|
30627
|
+
var RewardProgressSchema = z118.object({
|
|
30628
|
+
campaignKey: z118.literal("dropshipping-launch-v1"),
|
|
30629
|
+
totalCredits: z118.number().int().positive(),
|
|
30630
|
+
earnedCredits: z118.number().int().nonnegative(),
|
|
30631
|
+
milestones: z118.array(z118.object({
|
|
29726
30632
|
milestone: DropshippingRewardMilestone,
|
|
29727
|
-
credits:
|
|
29728
|
-
available:
|
|
29729
|
-
earned:
|
|
30633
|
+
credits: z118.number().int().positive(),
|
|
30634
|
+
available: z118.boolean().optional(),
|
|
30635
|
+
earned: z118.boolean(),
|
|
29730
30636
|
grantId: ProjectId.nullable(),
|
|
29731
|
-
grantedAt:
|
|
30637
|
+
grantedAt: z118.string().datetime().nullable()
|
|
29732
30638
|
})).length(DropshippingRewardMilestone.options.length)
|
|
29733
30639
|
});
|
|
29734
|
-
var ProjectResponseSchema =
|
|
30640
|
+
var ProjectResponseSchema = z118.object({
|
|
29735
30641
|
id: ProjectId,
|
|
29736
30642
|
taskId: ProjectId.nullable(),
|
|
29737
30643
|
status: DropshippingProjectStatus,
|
|
29738
|
-
originKey:
|
|
30644
|
+
originKey: z118.string().min(1),
|
|
29739
30645
|
researchRunId: ProjectId.nullable(),
|
|
29740
|
-
candidateSourceId:
|
|
29741
|
-
productName:
|
|
30646
|
+
candidateSourceId: z118.string().nullable(),
|
|
30647
|
+
productName: z118.string().nullable(),
|
|
29742
30648
|
productUrl: HttpUrl3.nullable(),
|
|
29743
30649
|
referenceImageUrl: HttpUrl3.nullable(),
|
|
29744
|
-
targetCountry:
|
|
29745
|
-
languageCode:
|
|
29746
|
-
hasReferenceImage:
|
|
29747
|
-
hasWinnerReferenceImage:
|
|
30650
|
+
targetCountry: z118.string().nullable(),
|
|
30651
|
+
languageCode: z118.string().nullable(),
|
|
30652
|
+
hasReferenceImage: z118.boolean(),
|
|
30653
|
+
hasWinnerReferenceImage: z118.boolean(),
|
|
29748
30654
|
costingInput: CostingInputSchema.nullable(),
|
|
29749
30655
|
costingResult: CostingResultSchema.nullable(),
|
|
29750
|
-
costingVersion:
|
|
29751
|
-
version:
|
|
30656
|
+
costingVersion: z118.number().int().positive().nullable(),
|
|
30657
|
+
version: z118.number().int().positive(),
|
|
29752
30658
|
phase: DropshippingProjectPhase,
|
|
29753
30659
|
nextAction: DropshippingProjectNextAction.nullable(),
|
|
29754
30660
|
rewards: RewardProgressSchema,
|
|
29755
|
-
createdAt:
|
|
29756
|
-
updatedAt:
|
|
30661
|
+
createdAt: z118.string().datetime(),
|
|
30662
|
+
updatedAt: z118.string().datetime()
|
|
29757
30663
|
}).passthrough();
|
|
29758
30664
|
var NEXT_ACTION_GUIDANCE = {
|
|
29759
30665
|
cost_product: "Llama `cost_dropshipping_project` con el costo real del proveedor. Nunca lo inventes: p\xEDdeselo al usuario. Es el \xDANICO dato que debes pedirle: omite env\xEDo, devoluciones, cancelaciones, CPA y margen para que ProductMaker use los valores gu\xEDa del pa\xEDs, y luego dile al usuario cu\xE1les us\xF3 por si quiere corregirlos.",
|
|
@@ -29873,58 +30779,58 @@ function registerDropshippingProjectTools(server, api) {
|
|
|
29873
30779
|
__name(registerDropshippingProjectTools, "registerDropshippingProjectTools");
|
|
29874
30780
|
|
|
29875
30781
|
// src/tools/daily-control.ts
|
|
29876
|
-
import { z as
|
|
30782
|
+
import { z as z119 } from "zod";
|
|
29877
30783
|
var getDailyControlGuidance = getProductMakerCapabilityModelGuidance("get_daily_control");
|
|
29878
30784
|
var linkCampaignToProjectGuidance = getProductMakerCapabilityModelGuidance("link_campaign_to_project");
|
|
29879
30785
|
var reportDailyReturnsGuidance = getProductMakerCapabilityModelGuidance("report_daily_returns");
|
|
29880
|
-
var ProviderCampaignIdentifier =
|
|
29881
|
-
var DateOnly =
|
|
29882
|
-
var DailyControlInput =
|
|
30786
|
+
var ProviderCampaignIdentifier = z119.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
30787
|
+
var DateOnly = z119.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
30788
|
+
var DailyControlInput = z119.object({
|
|
29883
30789
|
date: DateOnly.optional().describe("D\xEDa final de la ventana (YYYY-MM-DD). Si se omite, la ventana termina AYER en UTC \u2014 nunca hoy, porque el d\xEDa en curso est\xE1 incompleto \u2014 y el servidor puede correrla un d\xEDa m\xE1s atr\xE1s si en la zona horaria de la tienda ese d\xEDa todav\xEDa no ha cerrado."),
|
|
29884
|
-
days:
|
|
29885
|
-
projectId:
|
|
30790
|
+
days: z119.number().int().min(1).max(14).default(3).describe("Tama\xF1o de la ventana, 1 a 14 d\xEDas."),
|
|
30791
|
+
projectId: z119.string().uuid().optional().describe("Opcional: limita el reporte a un solo proyecto en vez de todos los productos activos.")
|
|
29886
30792
|
}).strict();
|
|
29887
|
-
var LinkCampaignInput =
|
|
29888
|
-
projectId:
|
|
29889
|
-
provider:
|
|
30793
|
+
var LinkCampaignInput = z119.object({
|
|
30794
|
+
projectId: z119.string().uuid(),
|
|
30795
|
+
provider: z119.enum([
|
|
29890
30796
|
"meta",
|
|
29891
30797
|
"tiktok"
|
|
29892
30798
|
]),
|
|
29893
30799
|
accountId: ProviderCampaignIdentifier.describe("Cuenta publicitaria del proveedor. Para Meta el servidor la IGNORA y deriva la cuenta real de la campa\xF1a \u2014 se sigue pidiendo aqu\xED solo porque TikTok s\xED la necesita para resolver la campa\xF1a."),
|
|
29894
30800
|
campaignId: ProviderCampaignIdentifier
|
|
29895
30801
|
}).strict();
|
|
29896
|
-
var ReportReturnsInput =
|
|
29897
|
-
projectId:
|
|
30802
|
+
var ReportReturnsInput = z119.object({
|
|
30803
|
+
projectId: z119.string().uuid(),
|
|
29898
30804
|
date: DateOnly,
|
|
29899
|
-
returnedOrders:
|
|
29900
|
-
note:
|
|
30805
|
+
returnedOrders: z119.number().int().min(0).max(1e5),
|
|
30806
|
+
note: z119.string().trim().max(280).optional()
|
|
29901
30807
|
}).strict();
|
|
29902
|
-
var DailyControlStatusMirror = DailyControlStatusEnum.or(
|
|
29903
|
-
var DailyControlLightMirror = DailyControlLightEnum.or(
|
|
29904
|
-
var DailyControlSourceMirror = DailyControlSourceEnum.or(
|
|
29905
|
-
var DailyControlVerdictMirror = DailyControlVerdictEnum.or(
|
|
29906
|
-
var DailyControlDayMirror =
|
|
29907
|
-
date:
|
|
29908
|
-
returnedOrders:
|
|
30808
|
+
var DailyControlStatusMirror = DailyControlStatusEnum.or(z119.string());
|
|
30809
|
+
var DailyControlLightMirror = DailyControlLightEnum.or(z119.string());
|
|
30810
|
+
var DailyControlSourceMirror = DailyControlSourceEnum.or(z119.string());
|
|
30811
|
+
var DailyControlVerdictMirror = DailyControlVerdictEnum.or(z119.string());
|
|
30812
|
+
var DailyControlDayMirror = z119.object({
|
|
30813
|
+
date: z119.string(),
|
|
30814
|
+
returnedOrders: z119.number(),
|
|
29909
30815
|
returnedSource: DailyControlSourceMirror,
|
|
29910
30816
|
cancelledSource: DailyControlSourceMirror,
|
|
29911
|
-
hasEstimates:
|
|
30817
|
+
hasEstimates: z119.boolean(),
|
|
29912
30818
|
light: DailyControlLightMirror
|
|
29913
30819
|
}).passthrough();
|
|
29914
|
-
var DailyControlProductMirror =
|
|
29915
|
-
projectId:
|
|
29916
|
-
productName:
|
|
30820
|
+
var DailyControlProductMirror = z119.object({
|
|
30821
|
+
projectId: z119.string().uuid(),
|
|
30822
|
+
productName: z119.string().nullable(),
|
|
29917
30823
|
status: DailyControlStatusMirror,
|
|
29918
|
-
statusMessage:
|
|
29919
|
-
days:
|
|
30824
|
+
statusMessage: z119.string().nullable(),
|
|
30825
|
+
days: z119.array(DailyControlDayMirror),
|
|
29920
30826
|
verdict: DailyControlVerdictMirror.nullable(),
|
|
29921
|
-
rationale:
|
|
30827
|
+
rationale: z119.string().nullable()
|
|
29922
30828
|
}).passthrough();
|
|
29923
|
-
var DailyControlResponseMirror =
|
|
29924
|
-
since:
|
|
29925
|
-
until:
|
|
29926
|
-
products:
|
|
29927
|
-
archivedProjectSpend:
|
|
30829
|
+
var DailyControlResponseMirror = z119.object({
|
|
30830
|
+
since: z119.string(),
|
|
30831
|
+
until: z119.string(),
|
|
30832
|
+
products: z119.array(DailyControlProductMirror),
|
|
30833
|
+
archivedProjectSpend: z119.array(z119.unknown())
|
|
29928
30834
|
}).passthrough();
|
|
29929
30835
|
var MCP_WARNINGS_KEY = "_mcpDailyControlWarnings";
|
|
29930
30836
|
function withWarnings(response) {
|
|
@@ -29999,7 +30905,7 @@ __name(registerDailyControlTools, "registerDailyControlTools");
|
|
|
29999
30905
|
// src/tools/product-control.ts
|
|
30000
30906
|
import { readFile, stat } from "fs/promises";
|
|
30001
30907
|
import { basename as basename2, isAbsolute, resolve as resolve3 } from "path";
|
|
30002
|
-
import { z as
|
|
30908
|
+
import { z as z120 } from "zod";
|
|
30003
30909
|
var getProductControlGuidance = getProductMakerCapabilityModelGuidance("get_product_control");
|
|
30004
30910
|
var listImportableProductsGuidance = getProductMakerCapabilityModelGuidance("list_importable_products");
|
|
30005
30911
|
var importProductControlsGuidance = getProductMakerCapabilityModelGuidance("import_product_controls");
|
|
@@ -30012,36 +30918,36 @@ var createOperationGuidance = getProductMakerCapabilityModelGuidance("create_ope
|
|
|
30012
30918
|
var mergeProductsGuidance = getProductMakerCapabilityModelGuidance("merge_products");
|
|
30013
30919
|
var syncShopifyOrdersGuidance = getProductMakerCapabilityModelGuidance("sync_shopify_orders");
|
|
30014
30920
|
var importOrdersFileGuidance = getProductMakerCapabilityModelGuidance("import_orders_file");
|
|
30015
|
-
var DateOnly2 =
|
|
30921
|
+
var DateOnly2 = z120.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
30016
30922
|
var IMPORT_BATCH_MAX2 = 50;
|
|
30017
|
-
var ProductControlListInput =
|
|
30018
|
-
days:
|
|
30923
|
+
var ProductControlListInput = z120.object({
|
|
30924
|
+
days: z120.number().int().min(1).max(14).default(3).describe("Tama\xF1o de la ventana, 1 a 14 d\xEDas."),
|
|
30019
30925
|
date: DateOnly2.optional().describe("D\xEDa final de la ventana (YYYY-MM-DD). Si se omite, termina en el \xFAltimo d\xEDa cerrado \u2014 nunca hoy, que est\xE1 incompleto."),
|
|
30020
|
-
shopDomain:
|
|
30926
|
+
shopDomain: z120.string().min(1).optional().describe("Tienda, si tiene m\xE1s de una conectada.")
|
|
30021
30927
|
}).strict();
|
|
30022
|
-
var ImportableProductsInput =
|
|
30023
|
-
q:
|
|
30024
|
-
after:
|
|
30025
|
-
shopDomain:
|
|
30928
|
+
var ImportableProductsInput = z120.object({
|
|
30929
|
+
q: z120.string().trim().max(120).optional().describe("B\xFAsqueda por t\xEDtulo. Sin esto un cat\xE1logo grande es inrecorrible."),
|
|
30930
|
+
after: z120.string().max(512).optional().describe("Cursor de la p\xE1gina anterior, tal como vino en la respuesta."),
|
|
30931
|
+
shopDomain: z120.string().min(1).optional()
|
|
30026
30932
|
}).strict();
|
|
30027
|
-
var ImportProductControlsInput =
|
|
30028
|
-
shopifyProductIds:
|
|
30933
|
+
var ImportProductControlsInput = z120.object({
|
|
30934
|
+
shopifyProductIds: z120.array(z120.string().min(1).max(64)).min(1).max(IMPORT_BATCH_MAX2).describe("Identificadores tal como vinieron de list_importable_products. NO los inventes ni los deduzcas del t\xEDtulo."),
|
|
30029
30935
|
// Obligatorio, como en el endpoint: con dos tiendas conectadas, importar
|
|
30030
30936
|
// sin decir a cuál archivaría el producto bajo la tienda equivocada.
|
|
30031
|
-
shopDomain:
|
|
30937
|
+
shopDomain: z120.string().min(1)
|
|
30032
30938
|
}).strict();
|
|
30033
|
-
var SetProductCostingInput =
|
|
30034
|
-
shopDomain:
|
|
30035
|
-
shopifyProductId:
|
|
30036
|
-
targetCountry:
|
|
30037
|
-
supplierCost:
|
|
30038
|
-
shippingCost:
|
|
30039
|
-
returnRate:
|
|
30040
|
-
cancellationRate:
|
|
30939
|
+
var SetProductCostingInput = z120.object({
|
|
30940
|
+
shopDomain: z120.string().min(1),
|
|
30941
|
+
shopifyProductId: z120.string().min(1).max(64),
|
|
30942
|
+
targetCountry: z120.string().length(2).describe("Pa\xEDs de venta en ISO-2, que fija moneda y referencia de flete."),
|
|
30943
|
+
supplierCost: z120.number().finite().positive().describe("Lo que le cuesta el producto al proveedor. Nunca cero."),
|
|
30944
|
+
shippingCost: z120.number().finite().nonnegative(),
|
|
30945
|
+
returnRate: z120.number().finite().min(0).lt(1).describe("Proporci\xF3n 0\u20131, no porcentaje: 0.15 es quince por ciento."),
|
|
30946
|
+
cancellationRate: z120.number().finite().min(0).lt(1)
|
|
30041
30947
|
}).strict();
|
|
30042
|
-
var Count =
|
|
30043
|
-
var ReportProductCountsInput =
|
|
30044
|
-
productControlId:
|
|
30948
|
+
var Count = z120.number().int().min(0).max(1e5).nullable().optional();
|
|
30949
|
+
var ReportProductCountsInput = z120.object({
|
|
30950
|
+
productControlId: z120.string().uuid().describe("El identificador que devuelve get_product_control."),
|
|
30045
30951
|
date: DateOnly2,
|
|
30046
30952
|
orders: Count.describe("Pedidos que entraron ese d\xEDa."),
|
|
30047
30953
|
cancelledOrders: Count,
|
|
@@ -30051,36 +30957,36 @@ var ReportProductCountsInput = z115.object({
|
|
|
30051
30957
|
}).strict();
|
|
30052
30958
|
var MAX_ORDERS_FILE_BYTES = 8 * 1024 * 1024;
|
|
30053
30959
|
var SyncShopifyOrdersInput = SyncShopifyOrdersSchema;
|
|
30054
|
-
var ImportOrdersFileInput =
|
|
30960
|
+
var ImportOrdersFileInput = z120.object({
|
|
30055
30961
|
/** Ruta ABSOLUTA en la máquina de quien usa el MCP. */
|
|
30056
|
-
path:
|
|
30057
|
-
operationId:
|
|
30962
|
+
path: z120.string().min(1),
|
|
30963
|
+
operationId: z120.string().uuid().optional(),
|
|
30058
30964
|
/** Solo mirar: devuelve el resumen y no escribe nada. */
|
|
30059
|
-
dryRun:
|
|
30965
|
+
dryRun: z120.boolean().optional()
|
|
30060
30966
|
}).strict();
|
|
30061
|
-
var CreateOperationInput =
|
|
30062
|
-
countryCode:
|
|
30063
|
-
label:
|
|
30967
|
+
var CreateOperationInput = z120.object({
|
|
30968
|
+
countryCode: z120.string().length(2),
|
|
30969
|
+
label: z120.string().trim().min(1).max(60).optional()
|
|
30064
30970
|
}).strict();
|
|
30065
|
-
var MergeProductsInput =
|
|
30066
|
-
sourceId:
|
|
30067
|
-
targetId:
|
|
30971
|
+
var MergeProductsInput = z120.object({
|
|
30972
|
+
sourceId: z120.string().uuid(),
|
|
30973
|
+
targetId: z120.string().uuid()
|
|
30068
30974
|
}).strict();
|
|
30069
|
-
var SetMonthlyExpenseInput =
|
|
30070
|
-
month:
|
|
30975
|
+
var SetMonthlyExpenseInput = z120.object({
|
|
30976
|
+
month: z120.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).optional(),
|
|
30071
30977
|
label: SaveMonthlyExpenseSchema.shape.label,
|
|
30072
|
-
amount:
|
|
30073
|
-
operationId:
|
|
30978
|
+
amount: z120.number().finite().min(0),
|
|
30979
|
+
operationId: z120.string().uuid().optional()
|
|
30074
30980
|
}).strict();
|
|
30075
|
-
var SetAdSpendInput =
|
|
30076
|
-
month:
|
|
30077
|
-
operationId:
|
|
30981
|
+
var SetAdSpendInput = z120.object({
|
|
30982
|
+
month: z120.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).optional(),
|
|
30983
|
+
operationId: z120.string().uuid().optional(),
|
|
30078
30984
|
/** null RETIRA la corrección; cero afirma que no pautó. */
|
|
30079
|
-
amount:
|
|
30985
|
+
amount: z120.number().finite().min(0).nullable()
|
|
30080
30986
|
}).strict();
|
|
30081
|
-
var GetFinancesInput =
|
|
30082
|
-
month:
|
|
30083
|
-
operationId:
|
|
30987
|
+
var GetFinancesInput = z120.object({
|
|
30988
|
+
month: z120.string().regex(/^\d{4}-(0[1-9]|1[0-2])$/).optional().describe("Mes en YYYY-MM. Si se omite, el mes en curso. Solo mes calendario."),
|
|
30989
|
+
operationId: z120.string().uuid().optional().describe("El negocio, si tiene mas de uno. Con uno solo no hace falta decirlo.")
|
|
30084
30990
|
}).strict();
|
|
30085
30991
|
function registerProductControlTools(server, api, { transport = "http" } = {}) {
|
|
30086
30992
|
server.registerTool("get_product_control", {
|
|
@@ -30270,28 +31176,28 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
|
|
|
30270
31176
|
__name(registerProductControlTools, "registerProductControlTools");
|
|
30271
31177
|
|
|
30272
31178
|
// src/tools/market-study-estimate.ts
|
|
30273
|
-
import { z as
|
|
31179
|
+
import { z as z121 } from "zod";
|
|
30274
31180
|
var estimateMarketStudyGuidance = getProductMakerCapabilityModelGuidance("estimate_market_study_cost");
|
|
30275
|
-
var ProductTaskOutputEnum =
|
|
31181
|
+
var ProductTaskOutputEnum = z121.enum([
|
|
30276
31182
|
"landing",
|
|
30277
31183
|
"video",
|
|
30278
31184
|
"image"
|
|
30279
31185
|
]);
|
|
30280
|
-
var EstimateMarketStudyInput =
|
|
30281
|
-
kind:
|
|
31186
|
+
var EstimateMarketStudyInput = z121.object({
|
|
31187
|
+
kind: z121.enum([
|
|
30282
31188
|
"video",
|
|
30283
31189
|
"product_task"
|
|
30284
31190
|
]).describe('"video" para generate_video_creative; "product_task" para create_product_task.'),
|
|
30285
|
-
videoAngleCount:
|
|
30286
|
-
durationSeconds:
|
|
31191
|
+
videoAngleCount: z121.number().int().min(1).max(3).describe("Los mismos 1, 2 o 3 videos que vas a pedir al crear."),
|
|
31192
|
+
durationSeconds: z121.number().int().min(4).max(30).default(15).describe("La misma duraci\xF3n que enviar\xE1s al crear."),
|
|
30287
31193
|
videoStructure: VideoStructureEnum.default("single_take"),
|
|
30288
31194
|
videoQuality: VideoQualityEnum.default("economy"),
|
|
30289
31195
|
videoResolution: VideoResolutionEnum.default("480p"),
|
|
30290
|
-
productImageCount:
|
|
31196
|
+
productImageCount: z121.number().int().min(1).max(5).optional().describe("Cantidad de fotos del producto que adjuntar\xE1s (1-5)."),
|
|
30291
31197
|
outputs: ProductTaskOutputEnum.array().min(1).max(3).optional().describe('Solo para kind="product_task": los mismos outputs de create_product_task. Default: todos.'),
|
|
30292
|
-
generateAiMusic:
|
|
31198
|
+
generateAiMusic: z121.boolean().optional(),
|
|
30293
31199
|
generateAiEdit: AiEditRequestSchema.optional(),
|
|
30294
|
-
replicateWinnerWhenFound:
|
|
31200
|
+
replicateWinnerWhenFound: z121.boolean().optional().describe("La misma preferencia que enviar\xE1s al crear. false excluye la reserva de r\xE9plica del ganador de la cotizaci\xF3n con estudio.")
|
|
30295
31201
|
}).strict();
|
|
30296
31202
|
function buildMarketStudyEstimateRequests(input) {
|
|
30297
31203
|
const quotesVideo = input.kind === "video" || (input.outputs ?? [
|