@productmaker/mcp 12.34.0 → 12.35.0

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/README.md CHANGED
@@ -234,7 +234,7 @@ its service-page editor, including its generation progress.
234
234
  | `set_ad_spend` | Correct by hand what was spent on ads that month. `amount: 0` ASSERTS "I did not advertise"; `null` WITHDRAWS the correction and gives the campaigns back the say. They are not the same |
235
235
  | `prepare_winning_product_image` | Prepare and show the exact photo of a user-selected winning-product candidate for free; securely stages it before the next photo choice. |
236
236
  | `get_product_control` | Read-only daily profitability verdicts and measurement status per store product. Incomplete samples or unmeasured delivered sales must remain explicit; never changes campaigns. Each row carries `creativeMemory`: angles/formats that won or lost and the ordered next-creative suggestions. |
237
- | `get_product_ads` | Read-only Meta figures for each ad (sales angle) of one product on one day: spend, pixel purchases, cost per purchase, video retention and a keep/turn off/review suggestion against the break-even. Each ad's `creative.tags` says «Ganador» when its angle or format won. Pixel purchases are not store orders; never changes ads. |
237
+ | `get_product_ads` | Read-only Meta figures for each ad (sales angle) of one product on one day: spend, pixel purchases, cost per purchase, video retention and a keep/turn off/review suggestion against the break-even. Each ad's `creative.tags` says «Ganador» when its angle or format won, and «Etiquetado por IA» on an ad made outside ProductMaker whose angle and format the AI set (fix it with `correct_product_ad_creative`). Pixel purchases are not store orders; never changes ads. |
238
238
  | `get_product_scoreboard` | Read-only scoreboard of one product test (from the first day its campaigns spent): ad spend and funnel, unique orders, store orders missing from Dropi, duplicates, confirmation/delivery/return rates, measured or estimated money, open-order range and maturity. Missing sources are reported, never zero. |
239
239
  | `list_importable_products` | Read one page of store products eligible for financial control; preserve `hasNextPage` and already-imported markers. |
240
240
  | `import_product_controls` | Add selected store products to financial control. They remain `no_costing` until their real costs are saved. |
@@ -250,6 +250,7 @@ its service-page editor, including its generation progress.
250
250
  | `list_linkable_campaigns` | Read the Meta/TikTok campaigns available to tie to a product, so identifiers never have to be typed. Empty means the ad account is not connected or has no campaigns — connecting happens in Integrations, not here |
251
251
  | `link_product_campaign` | Tie an ad campaign to a product in financial control; its spend then feeds the product's cost-per-sale. The identifiers come from `list_linkable_campaigns` — never invent them. The product is said ONE way: `productControlId`, or `shopDomain` + `shopifyProductId` |
252
252
  | `unlink_product_campaign` | Untie a campaign from a product in financial control; its spend stops counting for that product. The campaign itself stays as it is in Meta or TikTok and can be linked again. Ids come from `get_product_control` — confirm with the person first |
253
+ | `correct_product_ad_creative` | Correct the sales angle and creative format (always sent together) ProductMaker counts for one ad in the product memory (for example one tagged «Etiquetado por IA»). The correction belongs to the seller and the AI never overwrites it; only the ProductMaker registry changes, never the ad in Meta. The `adId` comes from `get_product_ads` — confirm with the person first |
253
254
  | `delete_monthly_expense` | Delete one fixed expense of the month by month + label. To change the amount do NOT delete — `set_monthly_expense` with the new value is the correction |
254
255
  | `remove_product_control` | Remove a product from financial control together with its costs and its linked campaign. The id comes from `get_product_control` — confirm by NAME which product leaves |
255
256
  | `get_agent_memory_brief` | Read the Drop Maker agent's memory at the start of a run: latest playbook, product sheets (stage, target CPA, verdict, links), open experiments, open pending items and recent notes. Business numbers are NOT here — read them from financial control |
package/dist/http.js CHANGED
@@ -11632,8 +11632,9 @@ var AnchoredIntel = z30.object({
11632
11632
  marketProvenanceIds: z30.array(z30.string().min(1)).max(30).optional(),
11633
11633
  marketSnapshotHash: z30.string().min(1).optional()
11634
11634
  });
11635
+ var ANGLE_TEXT_MAX_CHARS = 480;
11635
11636
  var Angle = z30.object({
11636
- angle: z30.string().min(1).max(480),
11637
+ angle: z30.string().min(1).max(ANGLE_TEXT_MAX_CHARS),
11637
11638
  buyerPersona: z30.string().min(1).max(360),
11638
11639
  /** Character description for video (role + appearance + attitude). Drives voice selection and Frame0Spec. */
11639
11640
  actor: z30.string().min(1).max(360).optional(),
@@ -13634,6 +13635,10 @@ var ShopifyBillingCallbackQuery = z43.object({
13634
13635
  charge_id: z43.string().regex(/^\d+$/),
13635
13636
  transactionId: z43.string().guid()
13636
13637
  });
13638
+ var ShopifySubscriptionCallbackQuery = z43.object({
13639
+ charge_id: z43.string().regex(/^\d+$/).optional(),
13640
+ subscriptionId: z43.string().guid()
13641
+ });
13637
13642
  var CancelShopifySubscriptionRequest = z43.object({
13638
13643
  subscriptionId: z43.string().min(1)
13639
13644
  });
@@ -20480,6 +20485,7 @@ var RegenerateEditRequestSchema = z83.object({
20480
20485
  comment: z83.string().min(1).max(2e3)
20481
20486
  });
20482
20487
  var SECTION_PROMPT_MAX_CHARS = 4e3;
20488
+ var FRAME_REGEN_PROMPT_MAX_CHARS = 1500;
20483
20489
  var RegenerateResolvedSectionSchema = z83.object({
20484
20490
  surfaceDarkening: SurfaceDarkeningSchema.optional(),
20485
20491
  surfaceLightening: VideoEditSurfaceSchema.optional(),
@@ -20493,7 +20499,7 @@ var RegenerateResolvedSectionSchema = z83.object({
20493
20499
  // in Fase 1. `frameRegen` mirrors the router's Zod limit; `scriptEdit` uses
20494
20500
  // SCRIPT_EDIT_MAX_CHARS, the same ceiling the router clarifies on.
20495
20501
  frameRegen: z83.object({
20496
- framePrompt: z83.string().trim().min(1).max(1500),
20502
+ framePrompt: z83.string().trim().min(1).max(FRAME_REGEN_PROMPT_MAX_CHARS),
20497
20503
  reason: z83.enum([
20498
20504
  "scenario",
20499
20505
  "appearance",
@@ -24134,6 +24140,22 @@ var CAPABILITY_MODEL_GUIDANCE = {
24134
24140
  "requiere confirmaci\xF3n; su gasto, tambi\xE9n el pasado, deja de contar para ese producto y para el balance del mes"
24135
24141
  ]
24136
24142
  },
24143
+ correct_product_ad_creative: {
24144
+ summary: "Corrige el \xE1ngulo y el formato con que ProductMaker cuenta un anuncio del producto.",
24145
+ useWhen: [
24146
+ "ese anuncio no es de ese \xE1ngulo",
24147
+ "la IA le puso mal el formato a mi video"
24148
+ ],
24149
+ avoidWhen: [
24150
+ "quiere apagar o editar el anuncio en Meta: lo hace ella"
24151
+ ],
24152
+ defaults: [
24153
+ "el adId sale de get_product_ads, nunca se inventa; manda siempre \xE1ngulo y formato, el que no cambia con su valor actual"
24154
+ ],
24155
+ disclosures: [
24156
+ "requiere confirmaci\xF3n; queda como correcci\xF3n suya y la IA no la pisa; no toca Meta"
24157
+ ]
24158
+ },
24137
24159
  delete_monthly_expense: {
24138
24160
  summary: "Borra un gasto fijo del mes.",
24139
24161
  useWhen: [
@@ -25411,6 +25433,19 @@ var CreateManualProductControlResponseSchema = z106.object({
25411
25433
  var ProductControlAdsQuerySchema = z106.object({
25412
25434
  date: z106.string().regex(/^\d{4}-\d{2}-\d{2}$/)
25413
25435
  });
25436
+ var CorrectProductAdCreativeSchema = z106.object({
25437
+ angle: z106.string().trim().min(1).max(ANGLE_TEXT_MAX_CHARS),
25438
+ format: z106.string().trim().toLowerCase().regex(/^[a-z0-9-]{1,24}$/).nullable()
25439
+ }).strict();
25440
+ var CorrectProductAdCreativeResultSchema = z106.object({
25441
+ adId: z106.string(),
25442
+ angle: z106.string().nullable(),
25443
+ format: z106.string().nullable(),
25444
+ tagSource: z106.enum([
25445
+ "ai",
25446
+ "seller"
25447
+ ]).nullable()
25448
+ });
25414
25449
  var ScoreboardDay = z106.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((day) => {
25415
25450
  const date2 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
25416
25451
  return !Number.isNaN(date2.getTime()) && date2.toISOString().slice(0, 10) === day;
@@ -27875,6 +27910,38 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
27875
27910
  ],
27876
27911
  MCP_ONLY_CHANNEL_EXPOSURE
27877
27912
  ),
27913
+ defineCapability(
27914
+ "correct_product_ad_creative",
27915
+ // Filled by the MCP schema fingerprint test.
27916
+ "7a83571a5444efd3a21012ad18260d25750172d09a6537055b4f0751ab4bf362",
27917
+ "state_change",
27918
+ "business",
27919
+ [
27920
+ "state_change"
27921
+ ],
27922
+ [
27923
+ slot("product_control", true, [
27924
+ "productControlId"
27925
+ ]),
27926
+ slot("ad", true, [
27927
+ "adId"
27928
+ ]),
27929
+ slot("sales_angle", true, [
27930
+ "angle"
27931
+ ]),
27932
+ slot("creative_format", true, [
27933
+ "format"
27934
+ ])
27935
+ ],
27936
+ [
27937
+ "product_control",
27938
+ "product_control_ads"
27939
+ ],
27940
+ [
27941
+ "product_control_ads"
27942
+ ],
27943
+ MCP_ONLY_CHANNEL_EXPOSURE
27944
+ ),
27878
27945
  defineCapability(
27879
27946
  "delete_monthly_expense",
27880
27947
  // Filled by the MCP schema fingerprint test.
@@ -35231,7 +35298,7 @@ var ApiClient = class {
35231
35298
  };
35232
35299
 
35233
35300
  // src/index.ts
35234
- var MCP_VERSION = "12.34.0";
35301
+ var MCP_VERSION = "12.35.0";
35235
35302
 
35236
35303
  // src/meta-upload-app.ts
35237
35304
  import { readFileSync } from "fs";
@@ -36645,6 +36712,7 @@ var McpErrorCode = {
36645
36712
  // Drop Maker agent memory
36646
36713
  PRODUCT_CONTROL_NOT_FOUND: "PRODUCT_CONTROL_NOT_FOUND",
36647
36714
  PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED: "PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED",
36715
+ PRODUCT_AD_NOT_FOUND: "PRODUCT_AD_NOT_FOUND",
36648
36716
  AGENT_PRODUCT_NOT_FOUND: "AGENT_PRODUCT_NOT_FOUND",
36649
36717
  AGENT_PRODUCT_NAME_REQUIRED: "AGENT_PRODUCT_NAME_REQUIRED",
36650
36718
  AGENT_EXPERIMENT_NOT_FOUND: "AGENT_EXPERIMENT_NOT_FOUND",
@@ -36913,6 +36981,7 @@ var CODE_MESSAGES = {
36913
36981
  DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND: "That campaign was not found in any of this user's connected ad accounts. Verify the `campaignId` (and `accountId` for TikTok).",
36914
36982
  PRODUCT_CONTROL_NOT_FOUND: "That product is not in this account's financial control. Read get_product_control for the right `productControlId`.",
36915
36983
  PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED: "That campaign is not linked to this product. Read get_product_control to see which campaigns it has.",
36984
+ PRODUCT_AD_NOT_FOUND: "That ad is not in this product's ad registry yet. Read get_product_ads for this product and use an `adId` from it.",
36916
36985
  AGENT_PRODUCT_NOT_FOUND: 'No product with that code in the agent memory. Save it first with save_agent_memory type "product".',
36917
36986
  AGENT_PRODUCT_NAME_REQUIRED: "That product code is new: send its `name` the first time you save it.",
36918
36987
  AGENT_EXPERIMENT_NOT_FOUND: "No experiment with that id in this account's agent memory. Read the brief or search experiments for the right id.",
@@ -36973,6 +37042,7 @@ var CODE_MESSAGES = {
36973
37042
  var AGENT_MEMORY_CODES = [
36974
37043
  McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
36975
37044
  McpErrorCode.PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED,
37045
+ McpErrorCode.PRODUCT_AD_NOT_FOUND,
36976
37046
  McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
36977
37047
  McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
36978
37048
  McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
@@ -45927,6 +45997,7 @@ var linkProductCampaignGuidance = getProductMakerCapabilityModelGuidance("link_p
45927
45997
  var unlinkProductCampaignGuidance = getProductMakerCapabilityModelGuidance("unlink_product_campaign");
45928
45998
  var deleteMonthlyExpenseGuidance = getProductMakerCapabilityModelGuidance("delete_monthly_expense");
45929
45999
  var removeProductControlGuidance = getProductMakerCapabilityModelGuidance("remove_product_control");
46000
+ var correctProductAdCreativeGuidance = getProductMakerCapabilityModelGuidance("correct_product_ad_creative");
45930
46001
  var DateOnly2 = z173.string().regex(/^\d{4}-\d{2}-\d{2}$/);
45931
46002
  var IMPORT_BATCH_MAX2 = 50;
45932
46003
  var ProductControlListInput = z173.object({
@@ -46054,6 +46125,12 @@ var LinkProductCampaignInput = z173.object({
46054
46125
  shopifyProductId: z173.string().min(1).optional().describe("El id del producto en su tienda. Va junto a shopDomain.")
46055
46126
  }).strict();
46056
46127
  var DeleteMonthlyExpenseInput = DeleteMonthlyExpenseSchema;
46128
+ var CorrectProductAdCreativeInput = z173.object({
46129
+ productControlId: z173.string().guid().describe("El id del producto en su control. Sale de get_product_control; nunca se inventa."),
46130
+ adId: z173.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/).describe("El `adId` del anuncio, tal como sale de get_product_ads; nunca se inventa."),
46131
+ angle: z173.string().trim().min(1).max(ANGLE_TEXT_MAX_CHARS).describe("El \xE1ngulo de venta correcto, con las palabras de la persona (p. ej. \xABSin taladro\xBB). Siempre va, aunque solo cambie el formato: manda el que ya tiene si est\xE1 bien."),
46132
+ format: z173.string().trim().toLowerCase().regex(/^[a-z0-9-]{1,24}$/).nullable().describe("El formato creativo correcto (`ugc`, `viral`, `pixar`, `demo-manos`\u2026); `null` lo deja sin formato (una imagen). Siempre va, aunque solo cambie el \xE1ngulo: manda el que ya tiene si est\xE1 bien.")
46133
+ }).strict();
46057
46134
  var UnlinkProductCampaignInput = z173.object({
46058
46135
  productControlId: z173.string().guid().describe("El id del producto en su control. Sale de get_product_control; nunca se inventa."),
46059
46136
  campaignId: z173.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/).describe("La campa\xF1a vinculada que se suelta. Sale de get_product_control; nunca se inventa.")
@@ -46092,7 +46169,7 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
46092
46169
  }
46093
46170
  });
46094
46171
  server.registerTool("get_product_ads", {
46095
- description: getProductAdsGuidance.summary + ' Devuelve cada anuncio de las campa\xF1as de Meta enlazadas al producto, con sus cifras DE META ese d\xEDa: gasto, impresiones, clics, CTR, visitas a la landing, view content, inicios de pago, compras del p\xEDxel, costo por compra y retenci\xF3n del v\xEDdeo (reproducciones, 25/75/100 % y `completionRate`). `verdict` es lo que la pantalla le sugiere: `keep` (mantener), `turn_off` (apagar), `review` (revisar) y `no_data` (todav\xEDa no hay con qu\xE9 juzgarlo); `reason` dice por qu\xE9, y el umbral es `breakEvenCpa`, la publicidad m\xE1xima por compra para no perder. Las compras del p\xEDxel NO son los pedidos de la tienda: el producto se decide con get_product_control y los anuncios se comparan entre s\xED con esto, porque un pedido contraentrega no dice de qu\xE9 anuncio vino. `status` distinto de `ok` no trae anuncios: `meta_not_connected` (conectar Meta), `no_meta_campaign` (enlazar campa\xF1a) o `unavailable` (Meta no respondi\xF3). Si falta un dato o Meta no respondi\xF3 y el usuario tiene su propio MCP de Meta, complementa ah\xED y di de d\xF3nde sale cada cifra. Cada anuncio trae `creative` con el video (`videoId`), su tarea (`taskId`), el \xE1ngulo (`angle`), el formato creativo (`format`: `ugc`, `viral`, `pixar`, `demo-manos`\u2026) y la duraci\xF3n del video (`videoFormat`) con que se public\xF3 (formatos `null` en una imagen); `tags` trae `"Ganador"` cuando la memoria del producto dice que el \xE1ngulo o el formato de ese anuncio gan\xF3 (solo la palabra; las cifras se ven aqu\xED y en `get_product_control`) y viene vac\xEDo si no. `creative: null` significa que ProductMaker no sabe qu\xE9 video lleva ese anuncio (no lo public\xF3 ProductMaker o su nombre no lo dice): no lo adivines. Es READ-ONLY: nunca pausa ni modifica un anuncio; apagar lo decide y lo hace ella en Meta.',
46172
+ description: getProductAdsGuidance.summary + ' Devuelve cada anuncio de las campa\xF1as de Meta enlazadas al producto, con sus cifras DE META ese d\xEDa: gasto, impresiones, clics, CTR, visitas a la landing, view content, inicios de pago, compras del p\xEDxel, costo por compra y retenci\xF3n del v\xEDdeo (reproducciones, 25/75/100 % y `completionRate`). `verdict` es lo que la pantalla le sugiere: `keep` (mantener), `turn_off` (apagar), `review` (revisar) y `no_data` (todav\xEDa no hay con qu\xE9 juzgarlo); `reason` dice por qu\xE9, y el umbral es `breakEvenCpa`, la publicidad m\xE1xima por compra para no perder. Las compras del p\xEDxel NO son los pedidos de la tienda: el producto se decide con get_product_control y los anuncios se comparan entre s\xED con esto, porque un pedido contraentrega no dice de qu\xE9 anuncio vino. `status` distinto de `ok` no trae anuncios: `meta_not_connected` (conectar Meta), `no_meta_campaign` (enlazar campa\xF1a) o `unavailable` (Meta no respondi\xF3). Si falta un dato o Meta no respondi\xF3 y el usuario tiene su propio MCP de Meta, complementa ah\xED y di de d\xF3nde sale cada cifra. Cada anuncio trae `creative` con el video (`videoId`), su tarea (`taskId`), el \xE1ngulo (`angle`), el formato creativo (`format`: `ugc`, `viral`, `pixar`, `demo-manos`\u2026) y la duraci\xF3n del video (`videoFormat`) con que se public\xF3 (formatos `null` en una imagen); `tags` trae `"Ganador"` cuando la memoria del producto dice que el \xE1ngulo o el formato de ese anuncio gan\xF3 (solo la palabra; las cifras se ven aqu\xED y en `get_product_control`) y viene vac\xEDo si no. Un anuncio hecho por fuera de ProductMaker cuyo \xE1ngulo y formato puso la IA trae `"Etiquetado por IA"` en `tags`: dilo as\xED y, si la persona dice que est\xE1 mal, corr\xEDgelo con correct_product_ad_creative. `creative: null` significa que ProductMaker todav\xEDa no sabe qu\xE9 video lleva ese anuncio (no lo public\xF3 ProductMaker, su nombre no lo dice y el cierre de la noche a\xFAn no lo reconoci\xF3 ni lo etiquet\xF3): no lo adivines. Es READ-ONLY: nunca pausa ni modifica un anuncio; apagar lo decide y lo hace ella en Meta.',
46096
46173
  inputSchema: ProductAdsInput.shape,
46097
46174
  annotations: READS_EXTERNAL
46098
46175
  }, async (input) => {
@@ -46439,6 +46516,20 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
46439
46516
  throw translateError(error);
46440
46517
  }
46441
46518
  });
46519
+ server.registerTool("correct_product_ad_creative", {
46520
+ description: correctProductAdCreativeGuidance.summary + " Cambia el \xE1ngulo (`angle`) y el formato creativo (`format`) con que ProductMaker cuenta un anuncio en la memoria del producto, por ejemplo uno \xABEtiquetado por IA\xBB que la IA ley\xF3 mal. Manda SIEMPRE los dos (el que no cambia, con su valor de get_product_ads): la persona confirma el creativo entero. La correcci\xF3n queda como de la persona: ni la IA ni el reconocimiento autom\xE1tico la vuelven a pisar, y desde el pr\xF3ximo cierre de la noche cuenta en la memoria con ese \xE1ngulo. Solo cambia el registro de ProductMaker: NO toca nada en Meta (ni el anuncio, ni su nombre, ni su estado). El anuncio debe haber salido antes en get_product_ads; si no, responde que no lo encuentra. Confirma con la persona el \xE1ngulo y el formato antes de llamarla.",
46521
+ inputSchema: CorrectProductAdCreativeInput.shape,
46522
+ annotations: OVERWRITES_INTERNAL
46523
+ }, async ({ productControlId, adId, angle, format }) => {
46524
+ try {
46525
+ return asText(await api.putJson(`/v1/product-control/${encodeURIComponent(productControlId)}/ads/${encodeURIComponent(adId)}/creative`, {
46526
+ angle,
46527
+ format
46528
+ }));
46529
+ } catch (error) {
46530
+ throw translateError(error);
46531
+ }
46532
+ });
46442
46533
  server.registerTool("delete_monthly_expense", {
46443
46534
  description: deleteMonthlyExpenseGuidance.summary + " Borra por mes + etiqueta, los dos datos que la persona ve en su lista. Para cambiar el monto NO se borra: set_monthly_expense con el valor nuevo es la correcci\xF3n.",
46444
46535
  inputSchema: DeleteMonthlyExpenseInput.shape,
package/dist/stdio.js CHANGED
@@ -11407,8 +11407,9 @@ var AnchoredIntel = z30.object({
11407
11407
  marketProvenanceIds: z30.array(z30.string().min(1)).max(30).optional(),
11408
11408
  marketSnapshotHash: z30.string().min(1).optional()
11409
11409
  });
11410
+ var ANGLE_TEXT_MAX_CHARS = 480;
11410
11411
  var Angle = z30.object({
11411
- angle: z30.string().min(1).max(480),
11412
+ angle: z30.string().min(1).max(ANGLE_TEXT_MAX_CHARS),
11412
11413
  buyerPersona: z30.string().min(1).max(360),
11413
11414
  /** Character description for video (role + appearance + attitude). Drives voice selection and Frame0Spec. */
11414
11415
  actor: z30.string().min(1).max(360).optional(),
@@ -13409,6 +13410,10 @@ var ShopifyBillingCallbackQuery = z43.object({
13409
13410
  charge_id: z43.string().regex(/^\d+$/),
13410
13411
  transactionId: z43.string().guid()
13411
13412
  });
13413
+ var ShopifySubscriptionCallbackQuery = z43.object({
13414
+ charge_id: z43.string().regex(/^\d+$/).optional(),
13415
+ subscriptionId: z43.string().guid()
13416
+ });
13412
13417
  var CancelShopifySubscriptionRequest = z43.object({
13413
13418
  subscriptionId: z43.string().min(1)
13414
13419
  });
@@ -20255,6 +20260,7 @@ var RegenerateEditRequestSchema = z83.object({
20255
20260
  comment: z83.string().min(1).max(2e3)
20256
20261
  });
20257
20262
  var SECTION_PROMPT_MAX_CHARS = 4e3;
20263
+ var FRAME_REGEN_PROMPT_MAX_CHARS = 1500;
20258
20264
  var RegenerateResolvedSectionSchema = z83.object({
20259
20265
  surfaceDarkening: SurfaceDarkeningSchema.optional(),
20260
20266
  surfaceLightening: VideoEditSurfaceSchema.optional(),
@@ -20268,7 +20274,7 @@ var RegenerateResolvedSectionSchema = z83.object({
20268
20274
  // in Fase 1. `frameRegen` mirrors the router's Zod limit; `scriptEdit` uses
20269
20275
  // SCRIPT_EDIT_MAX_CHARS, the same ceiling the router clarifies on.
20270
20276
  frameRegen: z83.object({
20271
- framePrompt: z83.string().trim().min(1).max(1500),
20277
+ framePrompt: z83.string().trim().min(1).max(FRAME_REGEN_PROMPT_MAX_CHARS),
20272
20278
  reason: z83.enum([
20273
20279
  "scenario",
20274
20280
  "appearance",
@@ -23909,6 +23915,22 @@ var CAPABILITY_MODEL_GUIDANCE = {
23909
23915
  "requiere confirmaci\xF3n; su gasto, tambi\xE9n el pasado, deja de contar para ese producto y para el balance del mes"
23910
23916
  ]
23911
23917
  },
23918
+ correct_product_ad_creative: {
23919
+ summary: "Corrige el \xE1ngulo y el formato con que ProductMaker cuenta un anuncio del producto.",
23920
+ useWhen: [
23921
+ "ese anuncio no es de ese \xE1ngulo",
23922
+ "la IA le puso mal el formato a mi video"
23923
+ ],
23924
+ avoidWhen: [
23925
+ "quiere apagar o editar el anuncio en Meta: lo hace ella"
23926
+ ],
23927
+ defaults: [
23928
+ "el adId sale de get_product_ads, nunca se inventa; manda siempre \xE1ngulo y formato, el que no cambia con su valor actual"
23929
+ ],
23930
+ disclosures: [
23931
+ "requiere confirmaci\xF3n; queda como correcci\xF3n suya y la IA no la pisa; no toca Meta"
23932
+ ]
23933
+ },
23912
23934
  delete_monthly_expense: {
23913
23935
  summary: "Borra un gasto fijo del mes.",
23914
23936
  useWhen: [
@@ -25186,6 +25208,19 @@ var CreateManualProductControlResponseSchema = z106.object({
25186
25208
  var ProductControlAdsQuerySchema = z106.object({
25187
25209
  date: z106.string().regex(/^\d{4}-\d{2}-\d{2}$/)
25188
25210
  });
25211
+ var CorrectProductAdCreativeSchema = z106.object({
25212
+ angle: z106.string().trim().min(1).max(ANGLE_TEXT_MAX_CHARS),
25213
+ format: z106.string().trim().toLowerCase().regex(/^[a-z0-9-]{1,24}$/).nullable()
25214
+ }).strict();
25215
+ var CorrectProductAdCreativeResultSchema = z106.object({
25216
+ adId: z106.string(),
25217
+ angle: z106.string().nullable(),
25218
+ format: z106.string().nullable(),
25219
+ tagSource: z106.enum([
25220
+ "ai",
25221
+ "seller"
25222
+ ]).nullable()
25223
+ });
25189
25224
  var ScoreboardDay = z106.string().regex(/^\d{4}-\d{2}-\d{2}$/).refine((day) => {
25190
25225
  const date2 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
25191
25226
  return !Number.isNaN(date2.getTime()) && date2.toISOString().slice(0, 10) === day;
@@ -27650,6 +27685,38 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
27650
27685
  ],
27651
27686
  MCP_ONLY_CHANNEL_EXPOSURE
27652
27687
  ),
27688
+ defineCapability(
27689
+ "correct_product_ad_creative",
27690
+ // Filled by the MCP schema fingerprint test.
27691
+ "7a83571a5444efd3a21012ad18260d25750172d09a6537055b4f0751ab4bf362",
27692
+ "state_change",
27693
+ "business",
27694
+ [
27695
+ "state_change"
27696
+ ],
27697
+ [
27698
+ slot("product_control", true, [
27699
+ "productControlId"
27700
+ ]),
27701
+ slot("ad", true, [
27702
+ "adId"
27703
+ ]),
27704
+ slot("sales_angle", true, [
27705
+ "angle"
27706
+ ]),
27707
+ slot("creative_format", true, [
27708
+ "format"
27709
+ ])
27710
+ ],
27711
+ [
27712
+ "product_control",
27713
+ "product_control_ads"
27714
+ ],
27715
+ [
27716
+ "product_control_ads"
27717
+ ],
27718
+ MCP_ONLY_CHANNEL_EXPOSURE
27719
+ ),
27653
27720
  defineCapability(
27654
27721
  "delete_monthly_expense",
27655
27722
  // Filled by the MCP schema fingerprint test.
@@ -33558,7 +33625,7 @@ var ApiClient = class {
33558
33625
  };
33559
33626
 
33560
33627
  // src/index.ts
33561
- var MCP_VERSION = "12.34.0";
33628
+ var MCP_VERSION = "12.35.0";
33562
33629
 
33563
33630
  // src/meta-upload-app.ts
33564
33631
  import { readFileSync } from "fs";
@@ -34976,6 +35043,7 @@ var McpErrorCode = {
34976
35043
  // Drop Maker agent memory
34977
35044
  PRODUCT_CONTROL_NOT_FOUND: "PRODUCT_CONTROL_NOT_FOUND",
34978
35045
  PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED: "PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED",
35046
+ PRODUCT_AD_NOT_FOUND: "PRODUCT_AD_NOT_FOUND",
34979
35047
  AGENT_PRODUCT_NOT_FOUND: "AGENT_PRODUCT_NOT_FOUND",
34980
35048
  AGENT_PRODUCT_NAME_REQUIRED: "AGENT_PRODUCT_NAME_REQUIRED",
34981
35049
  AGENT_EXPERIMENT_NOT_FOUND: "AGENT_EXPERIMENT_NOT_FOUND",
@@ -35244,6 +35312,7 @@ var CODE_MESSAGES = {
35244
35312
  DROPSHIPPING_PROJECT_CAMPAIGN_NOT_FOUND: "That campaign was not found in any of this user's connected ad accounts. Verify the `campaignId` (and `accountId` for TikTok).",
35245
35313
  PRODUCT_CONTROL_NOT_FOUND: "That product is not in this account's financial control. Read get_product_control for the right `productControlId`.",
35246
35314
  PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED: "That campaign is not linked to this product. Read get_product_control to see which campaigns it has.",
35315
+ PRODUCT_AD_NOT_FOUND: "That ad is not in this product's ad registry yet. Read get_product_ads for this product and use an `adId` from it.",
35247
35316
  AGENT_PRODUCT_NOT_FOUND: 'No product with that code in the agent memory. Save it first with save_agent_memory type "product".',
35248
35317
  AGENT_PRODUCT_NAME_REQUIRED: "That product code is new: send its `name` the first time you save it.",
35249
35318
  AGENT_EXPERIMENT_NOT_FOUND: "No experiment with that id in this account's agent memory. Read the brief or search experiments for the right id.",
@@ -35304,6 +35373,7 @@ var CODE_MESSAGES = {
35304
35373
  var AGENT_MEMORY_CODES = [
35305
35374
  McpErrorCode.PRODUCT_CONTROL_NOT_FOUND,
35306
35375
  McpErrorCode.PRODUCT_CONTROL_CAMPAIGN_NOT_LINKED,
35376
+ McpErrorCode.PRODUCT_AD_NOT_FOUND,
35307
35377
  McpErrorCode.AGENT_PRODUCT_NOT_FOUND,
35308
35378
  McpErrorCode.AGENT_PRODUCT_NAME_REQUIRED,
35309
35379
  McpErrorCode.AGENT_EXPERIMENT_NOT_FOUND,
@@ -44412,6 +44482,7 @@ var linkProductCampaignGuidance = getProductMakerCapabilityModelGuidance("link_p
44412
44482
  var unlinkProductCampaignGuidance = getProductMakerCapabilityModelGuidance("unlink_product_campaign");
44413
44483
  var deleteMonthlyExpenseGuidance = getProductMakerCapabilityModelGuidance("delete_monthly_expense");
44414
44484
  var removeProductControlGuidance = getProductMakerCapabilityModelGuidance("remove_product_control");
44485
+ var correctProductAdCreativeGuidance = getProductMakerCapabilityModelGuidance("correct_product_ad_creative");
44415
44486
  var DateOnly2 = z172.string().regex(/^\d{4}-\d{2}-\d{2}$/);
44416
44487
  var IMPORT_BATCH_MAX2 = 50;
44417
44488
  var ProductControlListInput = z172.object({
@@ -44539,6 +44610,12 @@ var LinkProductCampaignInput = z172.object({
44539
44610
  shopifyProductId: z172.string().min(1).optional().describe("El id del producto en su tienda. Va junto a shopDomain.")
44540
44611
  }).strict();
44541
44612
  var DeleteMonthlyExpenseInput = DeleteMonthlyExpenseSchema;
44613
+ var CorrectProductAdCreativeInput = z172.object({
44614
+ productControlId: z172.string().guid().describe("El id del producto en su control. Sale de get_product_control; nunca se inventa."),
44615
+ adId: z172.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/).describe("El `adId` del anuncio, tal como sale de get_product_ads; nunca se inventa."),
44616
+ angle: z172.string().trim().min(1).max(ANGLE_TEXT_MAX_CHARS).describe("El \xE1ngulo de venta correcto, con las palabras de la persona (p. ej. \xABSin taladro\xBB). Siempre va, aunque solo cambie el formato: manda el que ya tiene si est\xE1 bien."),
44617
+ format: z172.string().trim().toLowerCase().regex(/^[a-z0-9-]{1,24}$/).nullable().describe("El formato creativo correcto (`ugc`, `viral`, `pixar`, `demo-manos`\u2026); `null` lo deja sin formato (una imagen). Siempre va, aunque solo cambie el \xE1ngulo: manda el que ya tiene si est\xE1 bien.")
44618
+ }).strict();
44542
44619
  var UnlinkProductCampaignInput = z172.object({
44543
44620
  productControlId: z172.string().guid().describe("El id del producto en su control. Sale de get_product_control; nunca se inventa."),
44544
44621
  campaignId: z172.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/).describe("La campa\xF1a vinculada que se suelta. Sale de get_product_control; nunca se inventa.")
@@ -44577,7 +44654,7 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
44577
44654
  }
44578
44655
  });
44579
44656
  server.registerTool("get_product_ads", {
44580
- description: getProductAdsGuidance.summary + ' Devuelve cada anuncio de las campa\xF1as de Meta enlazadas al producto, con sus cifras DE META ese d\xEDa: gasto, impresiones, clics, CTR, visitas a la landing, view content, inicios de pago, compras del p\xEDxel, costo por compra y retenci\xF3n del v\xEDdeo (reproducciones, 25/75/100 % y `completionRate`). `verdict` es lo que la pantalla le sugiere: `keep` (mantener), `turn_off` (apagar), `review` (revisar) y `no_data` (todav\xEDa no hay con qu\xE9 juzgarlo); `reason` dice por qu\xE9, y el umbral es `breakEvenCpa`, la publicidad m\xE1xima por compra para no perder. Las compras del p\xEDxel NO son los pedidos de la tienda: el producto se decide con get_product_control y los anuncios se comparan entre s\xED con esto, porque un pedido contraentrega no dice de qu\xE9 anuncio vino. `status` distinto de `ok` no trae anuncios: `meta_not_connected` (conectar Meta), `no_meta_campaign` (enlazar campa\xF1a) o `unavailable` (Meta no respondi\xF3). Si falta un dato o Meta no respondi\xF3 y el usuario tiene su propio MCP de Meta, complementa ah\xED y di de d\xF3nde sale cada cifra. Cada anuncio trae `creative` con el video (`videoId`), su tarea (`taskId`), el \xE1ngulo (`angle`), el formato creativo (`format`: `ugc`, `viral`, `pixar`, `demo-manos`\u2026) y la duraci\xF3n del video (`videoFormat`) con que se public\xF3 (formatos `null` en una imagen); `tags` trae `"Ganador"` cuando la memoria del producto dice que el \xE1ngulo o el formato de ese anuncio gan\xF3 (solo la palabra; las cifras se ven aqu\xED y en `get_product_control`) y viene vac\xEDo si no. `creative: null` significa que ProductMaker no sabe qu\xE9 video lleva ese anuncio (no lo public\xF3 ProductMaker o su nombre no lo dice): no lo adivines. Es READ-ONLY: nunca pausa ni modifica un anuncio; apagar lo decide y lo hace ella en Meta.',
44657
+ description: getProductAdsGuidance.summary + ' Devuelve cada anuncio de las campa\xF1as de Meta enlazadas al producto, con sus cifras DE META ese d\xEDa: gasto, impresiones, clics, CTR, visitas a la landing, view content, inicios de pago, compras del p\xEDxel, costo por compra y retenci\xF3n del v\xEDdeo (reproducciones, 25/75/100 % y `completionRate`). `verdict` es lo que la pantalla le sugiere: `keep` (mantener), `turn_off` (apagar), `review` (revisar) y `no_data` (todav\xEDa no hay con qu\xE9 juzgarlo); `reason` dice por qu\xE9, y el umbral es `breakEvenCpa`, la publicidad m\xE1xima por compra para no perder. Las compras del p\xEDxel NO son los pedidos de la tienda: el producto se decide con get_product_control y los anuncios se comparan entre s\xED con esto, porque un pedido contraentrega no dice de qu\xE9 anuncio vino. `status` distinto de `ok` no trae anuncios: `meta_not_connected` (conectar Meta), `no_meta_campaign` (enlazar campa\xF1a) o `unavailable` (Meta no respondi\xF3). Si falta un dato o Meta no respondi\xF3 y el usuario tiene su propio MCP de Meta, complementa ah\xED y di de d\xF3nde sale cada cifra. Cada anuncio trae `creative` con el video (`videoId`), su tarea (`taskId`), el \xE1ngulo (`angle`), el formato creativo (`format`: `ugc`, `viral`, `pixar`, `demo-manos`\u2026) y la duraci\xF3n del video (`videoFormat`) con que se public\xF3 (formatos `null` en una imagen); `tags` trae `"Ganador"` cuando la memoria del producto dice que el \xE1ngulo o el formato de ese anuncio gan\xF3 (solo la palabra; las cifras se ven aqu\xED y en `get_product_control`) y viene vac\xEDo si no. Un anuncio hecho por fuera de ProductMaker cuyo \xE1ngulo y formato puso la IA trae `"Etiquetado por IA"` en `tags`: dilo as\xED y, si la persona dice que est\xE1 mal, corr\xEDgelo con correct_product_ad_creative. `creative: null` significa que ProductMaker todav\xEDa no sabe qu\xE9 video lleva ese anuncio (no lo public\xF3 ProductMaker, su nombre no lo dice y el cierre de la noche a\xFAn no lo reconoci\xF3 ni lo etiquet\xF3): no lo adivines. Es READ-ONLY: nunca pausa ni modifica un anuncio; apagar lo decide y lo hace ella en Meta.',
44581
44658
  inputSchema: ProductAdsInput.shape,
44582
44659
  annotations: READS_EXTERNAL
44583
44660
  }, async (input) => {
@@ -44924,6 +45001,20 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
44924
45001
  throw translateError(error);
44925
45002
  }
44926
45003
  });
45004
+ server.registerTool("correct_product_ad_creative", {
45005
+ description: correctProductAdCreativeGuidance.summary + " Cambia el \xE1ngulo (`angle`) y el formato creativo (`format`) con que ProductMaker cuenta un anuncio en la memoria del producto, por ejemplo uno \xABEtiquetado por IA\xBB que la IA ley\xF3 mal. Manda SIEMPRE los dos (el que no cambia, con su valor de get_product_ads): la persona confirma el creativo entero. La correcci\xF3n queda como de la persona: ni la IA ni el reconocimiento autom\xE1tico la vuelven a pisar, y desde el pr\xF3ximo cierre de la noche cuenta en la memoria con ese \xE1ngulo. Solo cambia el registro de ProductMaker: NO toca nada en Meta (ni el anuncio, ni su nombre, ni su estado). El anuncio debe haber salido antes en get_product_ads; si no, responde que no lo encuentra. Confirma con la persona el \xE1ngulo y el formato antes de llamarla.",
45006
+ inputSchema: CorrectProductAdCreativeInput.shape,
45007
+ annotations: OVERWRITES_INTERNAL
45008
+ }, async ({ productControlId, adId, angle, format }) => {
45009
+ try {
45010
+ return asText(await api.putJson(`/v1/product-control/${encodeURIComponent(productControlId)}/ads/${encodeURIComponent(adId)}/creative`, {
45011
+ angle,
45012
+ format
45013
+ }));
45014
+ } catch (error) {
45015
+ throw translateError(error);
45016
+ }
45017
+ });
44927
45018
  server.registerTool("delete_monthly_expense", {
44928
45019
  description: deleteMonthlyExpenseGuidance.summary + " Borra por mes + etiqueta, los dos datos que la persona ve en su lista. Para cambiar el monto NO se borra: set_monthly_expense con el valor nuevo es la correcci\xF3n.",
44929
45020
  inputSchema: DeleteMonthlyExpenseInput.shape,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productmaker/mcp",
3
- "version": "12.34.0",
3
+ "version": "12.35.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "ProductMaker MCP server — cost products, generate landing pages, UGC videos, and ad creatives, and publish to Shopify, Meta Ads, and TikTok Ads.",
@@ -67,8 +67,8 @@
67
67
  "typescript": "^7.0.2",
68
68
  "vitest": "5.0.3",
69
69
  "@packages/product-economics": "0.1.0",
70
- "@packages/utils": "0.1.0",
71
- "@packages/types": "0.1.0"
70
+ "@packages/types": "0.1.0",
71
+ "@packages/utils": "0.1.0"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"