@productmaker/mcp 12.8.0 → 12.9.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.
Files changed (3) hide show
  1. package/dist/http.js +462 -139
  2. package/dist/stdio.js +462 -139
  3. package/package.json +1 -1
package/dist/http.js CHANGED
@@ -179,17 +179,84 @@ var GPT_IMAGE_2_5_TOKENS = {
179
179
  "2k": "gpt-image-2-5:2k",
180
180
  "4k": "gpt-image-2-5:4k"
181
181
  };
182
+ var GPT_IMAGE_2_6_TOKENS = {
183
+ "1k": "gpt-image-2-6:1k",
184
+ "2k": "gpt-image-2-6:2k",
185
+ "4k": "gpt-image-2-6:4k"
186
+ };
182
187
  var GPT_IMAGE_2_TOKENS = {
183
188
  "1k": "gpt-image-2:1k",
184
189
  "2k": "gpt-image-2:2k",
185
190
  "4k": "gpt-image-2:4k"
186
191
  };
192
+ var GPT_IMAGE_2_6 = {
193
+ id: "gpt-image-2.6",
194
+ status: "active",
195
+ renderedBy: "gpt-image-2.6",
196
+ tokens: GPT_IMAGE_2_6_TOKENS,
197
+ kie: {
198
+ quality: "low",
199
+ maxResolution: "1K",
200
+ imageToImage: [
201
+ "gpt-image-2-6/flare-image-to-image",
202
+ "gpt-image-2-6/sunburst-image-to-image"
203
+ ],
204
+ textToImage: [
205
+ "gpt-image-2-6/flare-text-to-image",
206
+ "gpt-image-2-6/sunburst-text-to-image"
207
+ ],
208
+ shorthands: [
209
+ "gpt-image-2-6"
210
+ ]
211
+ },
212
+ // Siempre 1K (decisión del dueño 2026-11-06): el failover Fal también va a
213
+ // `low` para cada tier, y todo tier se factura con la clave 1K. Fal publicó
214
+ // 2.6 flare el 2026-11-04 (probado real 2026-11-06: edit y text-to-image
215
+ // aceptan quality=low). Fal no devuelve el costo por request y cobra por
216
+ // tokens a la misma tarifa que KIE +11%; se toma el costo medido en KIE
217
+ // (4¢), cobrado al usuario a la paridad KIE de 8¢ (2x).
218
+ fal: {
219
+ edit: "openai/gpt-image-2.6/flare/edit",
220
+ textToImage: "openai/gpt-image-2.6/flare/text-to-image",
221
+ quality: {
222
+ "1k": "low",
223
+ "2k": "low",
224
+ "4k": "low"
225
+ },
226
+ ourCostCents: {
227
+ "1k": 4,
228
+ "2k": 4,
229
+ "4k": 4
230
+ }
231
+ },
232
+ ratiosBlockedAbove1k: [
233
+ "4:5",
234
+ "5:4",
235
+ "27:16",
236
+ "16:27",
237
+ "9:8",
238
+ "8:9"
239
+ ],
240
+ ledgerSuffix: {
241
+ "1k": "gpt-image-2",
242
+ "2k": "gpt-image-2",
243
+ "4k": "gpt-image-2"
244
+ },
245
+ falLedgerSuffix: {
246
+ "1k": "gpt-image-2:1k",
247
+ "2k": "gpt-image-2:2k",
248
+ "4k": "gpt-image-2:4k"
249
+ }
250
+ };
187
251
  var GPT_IMAGE_2_5 = {
252
+ ...GPT_IMAGE_2_6,
188
253
  id: "gpt-image-2.5",
189
- status: "active",
190
- renderedBy: "gpt-image-2.5",
254
+ status: "retired",
255
+ renderedBy: GPT_IMAGE_2_6.id,
191
256
  tokens: GPT_IMAGE_2_5_TOKENS,
192
257
  kie: {
258
+ quality: null,
259
+ maxResolution: "4K",
193
260
  imageToImage: [
194
261
  "gpt-image-2-5-sunburst-image-to-image",
195
262
  "gpt-image-2-5-flare-image-to-image"
@@ -216,6 +283,11 @@ var GPT_IMAGE_2_5 = {
216
283
  "4k": 17.8
217
284
  }
218
285
  },
286
+ ledgerSuffix: {
287
+ "1k": "gpt-image-2",
288
+ "2k": "gpt-image-2:medium",
289
+ "4k": "gpt-image-2:high"
290
+ },
219
291
  // Docs KIE de gpt-image-2-5 (sunburst/flare): 27:16, 16:27, 9:8, 8:9 solo 1K;
220
292
  // 4:5 y 5:4 también bloqueados por encima de 1K.
221
293
  ratiosBlockedAbove1k: [
@@ -225,25 +297,17 @@ var GPT_IMAGE_2_5 = {
225
297
  "16:27",
226
298
  "9:8",
227
299
  "8:9"
228
- ],
229
- ledgerSuffix: {
230
- "1k": "gpt-image-2",
231
- "2k": "gpt-image-2:medium",
232
- "4k": "gpt-image-2:high"
233
- },
234
- falLedgerSuffix: {
235
- "1k": "gpt-image-2:1k",
236
- "2k": "gpt-image-2:2k",
237
- "4k": "gpt-image-2:4k"
238
- }
300
+ ]
239
301
  };
240
302
  var GPT_IMAGE_2 = {
241
303
  ...GPT_IMAGE_2_5,
242
304
  id: "gpt-image-2",
243
305
  status: "retired",
244
- renderedBy: GPT_IMAGE_2_5.id,
306
+ renderedBy: GPT_IMAGE_2_6.id,
245
307
  tokens: GPT_IMAGE_2_TOKENS,
246
308
  kie: {
309
+ quality: null,
310
+ maxResolution: "4K",
247
311
  imageToImage: [
248
312
  "gpt-image-2-image-to-image"
249
313
  ],
@@ -260,10 +324,11 @@ var GPT_IMAGE_2 = {
260
324
  ]
261
325
  };
262
326
  var IMAGE_MODELS = [
327
+ GPT_IMAGE_2_6,
263
328
  GPT_IMAGE_2_5,
264
329
  GPT_IMAGE_2
265
330
  ];
266
- var ACTIVE_IMAGE_MODEL = GPT_IMAGE_2_5;
331
+ var ACTIVE_IMAGE_MODEL = GPT_IMAGE_2_6;
267
332
  var IMAGE_WRITE_TOKENS = GPT_IMAGE_2_5_TOKENS;
268
333
  var LEGACY_IMAGE_TOKENS = GPT_IMAGE_2_TOKENS;
269
334
  var PUBLIC_IMAGE_QUALITY_INPUTS = [
@@ -274,6 +339,10 @@ var PUBLIC_IMAGE_QUALITY_INPUTS = [
274
339
  "image:1k",
275
340
  "image:2k"
276
341
  ];
342
+ function isWrittenOrActiveEntry(entry) {
343
+ return entry.status === "active" || entry.tokens === IMAGE_WRITE_TOKENS;
344
+ }
345
+ __name(isWrittenOrActiveEntry, "isWrittenOrActiveEntry");
277
346
  function entryById(id6) {
278
347
  const found = IMAGE_MODELS.find((entry) => entry.id === id6);
279
348
  if (!found) throw new Error(`IMAGE_MODEL_UNKNOWN:${id6}`);
@@ -306,7 +375,7 @@ function resolveImageToken(raw) {
306
375
  resolution,
307
376
  model: entryById(entry.renderedBy),
308
377
  declared: entry,
309
- spelling: entry.status === "active" ? "current" : "retired",
378
+ spelling: isWrittenOrActiveEntry(entry) ? "current" : "retired",
310
379
  viaFal
311
380
  };
312
381
  }
@@ -326,8 +395,8 @@ function requireKieImageId(ids, index, label) {
326
395
  return id6;
327
396
  }
328
397
  __name(requireKieImageId, "requireKieImageId");
329
- var KIE_FLARE_IMAGE_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.imageToImage, 1, "flare-imageToImage");
330
- var KIE_FLARE_TEXT_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.textToImage, 1, "flare-textToImage");
398
+ var KIE_FLARE_IMAGE_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_6.kie.imageToImage, 0, "flare-imageToImage");
399
+ var KIE_FLARE_TEXT_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_6.kie.textToImage, 0, "flare-textToImage");
331
400
  function canonicalImageModelInput(raw) {
332
401
  if (raw === void 0) return void 0;
333
402
  const token = resolveImageToken(raw);
@@ -1427,8 +1496,8 @@ var DEFAULT_PRICING = {
1427
1496
  userPriceCents: 8
1428
1497
  },
1429
1498
  "kie:image-generation:gpt-image-2": {
1430
- ourCostCents: 3,
1431
- userPriceCents: 6
1499
+ ourCostCents: 4,
1500
+ userPriceCents: 8
1432
1501
  },
1433
1502
  "kie:image-generation:gpt-image-2:medium": {
1434
1503
  ourCostCents: 5,
@@ -1439,8 +1508,8 @@ var DEFAULT_PRICING = {
1439
1508
  userPriceCents: 16
1440
1509
  },
1441
1510
  "kie:image-generation:gpt-image-2-5": {
1442
- ourCostCents: 3,
1443
- userPriceCents: 6
1511
+ ourCostCents: 4,
1512
+ userPriceCents: 8
1444
1513
  },
1445
1514
  "kie:image-generation:gpt-image-2-5:medium": {
1446
1515
  ourCostCents: 5,
@@ -1455,35 +1524,56 @@ var DEFAULT_PRICING = {
1455
1524
  userPriceCents: 6
1456
1525
  },
1457
1526
  "kie:image-generation:gpt-image-2-5-sunburst-image-to-image": {
1458
- ourCostCents: 3,
1459
- userPriceCents: 6
1527
+ ourCostCents: 4,
1528
+ userPriceCents: 8
1460
1529
  },
1461
1530
  "kie:image-generation:gpt-image-2-5-flare-text-to-image": {
1462
1531
  ourCostCents: 3,
1463
1532
  userPriceCents: 6
1464
1533
  },
1465
1534
  "kie:image-generation:gpt-image-2-5-flare-image-to-image": {
1535
+ ourCostCents: 4,
1536
+ userPriceCents: 8
1537
+ },
1538
+ // gpt-image-2.6 direct ids (Shopify variant/offer images, service-page and
1539
+ // motion-graphics people). KIE bills 2.6 by tokens; measured 2026-11-06 at
1540
+ // 1K quality=low: $0.034–0.047 image-to-image on prod prompts with 1–3 refs;
1541
+ // text-to-image is cheaper (no image-input tokens).
1542
+ "kie:image-generation:gpt-image-2-6/flare-text-to-image": {
1466
1543
  ourCostCents: 3,
1467
1544
  userPriceCents: 6
1468
1545
  },
1546
+ "kie:image-generation:gpt-image-2-6/flare-image-to-image": {
1547
+ ourCostCents: 4,
1548
+ userPriceCents: 8
1549
+ },
1550
+ "kie:image-generation:gpt-image-2-6/sunburst-text-to-image": {
1551
+ ourCostCents: 3,
1552
+ userPriceCents: 6
1553
+ },
1554
+ "kie:image-generation:gpt-image-2-6/sunburst-image-to-image": {
1555
+ ourCostCents: 4,
1556
+ userPriceCents: 8
1557
+ },
1469
1558
  // Mix pipeline (reference-padder) uses the gpt-image-2 text-to-image and
1470
1559
  // image-to-image variants, with seedream/5-lite as NSFW fallback. Both
1471
- // gpt-image-2 keys track the post-2026-04-24 1K-tier price drop above
1472
- // (3¢ / 6¢), and seedream stays at its own 3¢ / 6¢ rate.
1560
+ // gpt-image-2 keys track the 1K tier above: image-to-image 4¢ / 8¢ and
1561
+ // text-to-image 3¢ / 6¢ since 2026-11-06 (gpt-image-2.6 flare low), and
1562
+ // seedream stays at its own 3¢ / 6¢ rate.
1473
1563
  "kie:image-generation:gpt-image-2-text-to-image": {
1474
1564
  ourCostCents: 3,
1475
1565
  userPriceCents: 6
1476
1566
  },
1477
1567
  "kie:image-generation:gpt-image-2-image-to-image": {
1478
- ourCostCents: 3,
1479
- userPriceCents: 6
1568
+ ourCostCents: 4,
1569
+ userPriceCents: 8
1480
1570
  },
1481
1571
  // Custom actor identity photos (gpt-image-2 @ 1K, 4 candidates per attempt).
1482
1572
  // Recorded once per PRODUCED candidate. Without this row billingService.record
1483
1573
  // logs "No pricing rule found; skipping billing record" and the whole grid is free.
1484
1574
  "kie:image-generation:actor": {
1485
- ourCostCents: 3,
1486
- userPriceCents: 6
1575
+ ourCostCents: 4,
1576
+ userPriceCents: 8
1487
1577
  },
1488
1578
  "kie:image-generation:seedream-5-lite-text-to-image": {
1489
1579
  ourCostCents: 3,
@@ -1494,8 +1584,8 @@ var DEFAULT_PRICING = {
1494
1584
  userPriceCents: 6
1495
1585
  },
1496
1586
  "fal:image-generation:gpt-image-2:1k": {
1497
- ourCostCents: 1.5,
1498
- userPriceCents: 6
1587
+ ourCostCents: 4,
1588
+ userPriceCents: 8
1499
1589
  },
1500
1590
  // Video reference pricing varies by model:
1501
1591
  // - gpt-image-2 @ 2K (primary since 2026-04-24): $0.05 / $0.10
@@ -1507,8 +1597,8 @@ var DEFAULT_PRICING = {
1507
1597
  userPriceCents: 18
1508
1598
  },
1509
1599
  "kie:video-reference-generation:gpt-image-2": {
1510
- ourCostCents: 3,
1511
- userPriceCents: 6
1600
+ ourCostCents: 4,
1601
+ userPriceCents: 8
1512
1602
  },
1513
1603
  "kie:video-reference-generation:gpt-image-2:medium": {
1514
1604
  ourCostCents: 5,
@@ -1547,8 +1637,8 @@ var DEFAULT_PRICING = {
1547
1637
  userPriceCents: 18
1548
1638
  },
1549
1639
  "kie:video-scene-reference-generation:gpt-image-2": {
1550
- ourCostCents: 3,
1551
- userPriceCents: 6
1640
+ ourCostCents: 4,
1641
+ userPriceCents: 8
1552
1642
  },
1553
1643
  "kie:video-scene-reference-generation:gpt-image-2:medium": {
1554
1644
  ourCostCents: 5,
@@ -1599,8 +1689,8 @@ var DEFAULT_PRICING = {
1599
1689
  userPriceCents: 4
1600
1690
  },
1601
1691
  "kie:ad-creative-generation:gpt-image-2": {
1602
- ourCostCents: 3,
1603
- userPriceCents: 6
1692
+ ourCostCents: 4,
1693
+ userPriceCents: 8
1604
1694
  },
1605
1695
  "kie:ad-creative-generation:gpt-image-2:medium": {
1606
1696
  ourCostCents: 5,
@@ -1646,8 +1736,8 @@ var DEFAULT_PRICING = {
1646
1736
  userPriceCents: 8
1647
1737
  },
1648
1738
  "kie:ad-creative-edit:gpt-image-2": {
1649
- ourCostCents: 3,
1650
- userPriceCents: 6
1739
+ ourCostCents: 4,
1740
+ userPriceCents: 8
1651
1741
  },
1652
1742
  "kie:ad-creative-edit:gpt-image-2:medium": {
1653
1743
  ourCostCents: 5,
@@ -18435,6 +18525,47 @@ var LandingRegenerationStatusResponse = z75.object({
18435
18525
  updatedAt: z75.string().datetime()
18436
18526
  });
18437
18527
 
18528
+ // ../../packages/types/src/classic-landing-selection.ts
18529
+ function buildClassicLandingSelection(document, gifs, selectedIds, images) {
18530
+ const imageChoices = new Map(images.map((image2) => [
18531
+ classicLandingBlockId({
18532
+ kind: "image",
18533
+ ownerTaskId: image2.ownerTaskId,
18534
+ sourceIndex: image2.sourceIndex
18535
+ }),
18536
+ image2
18537
+ ]));
18538
+ let imageCount = 0;
18539
+ const blocks = document.blocks.filter((block) => {
18540
+ if (block.kind === "image") return Boolean(imageChoices.get(classicLandingBlockId(block))?.selected) && imageCount++ < SHOPIFY_MAX_LANDING_IMAGES;
18541
+ const gif = gifs.find((item) => item.gifId === block.gifId && item.ownerTaskId === block.ownerTaskId);
18542
+ return selectedIds.includes(classicLandingBlockId(block)) && Boolean(gif && isDeliverableLandingGif(gif));
18543
+ });
18544
+ return {
18545
+ documentRevision: document.revision,
18546
+ blocks,
18547
+ gifs: blocks.flatMap((block) => block.kind === "gif" ? [
18548
+ {
18549
+ ownerTaskId: block.ownerTaskId,
18550
+ gifId: block.gifId,
18551
+ gifRevision: gifs.find((item) => item.gifId === block.gifId).gifRevision
18552
+ }
18553
+ ] : []),
18554
+ images: blocks.flatMap((block) => {
18555
+ if (block.kind !== "image") return [];
18556
+ const choice = imageChoices.get(classicLandingBlockId(block));
18557
+ return [
18558
+ {
18559
+ ownerTaskId: choice.ownerTaskId,
18560
+ sourceIndex: choice.sourceIndex,
18561
+ variantIndex: choice.variantIndex
18562
+ }
18563
+ ];
18564
+ })
18565
+ };
18566
+ }
18567
+ __name(buildClassicLandingSelection, "buildClassicLandingSelection");
18568
+
18438
18569
  // ../../packages/types/src/shopify-meta-tracking.ts
18439
18570
  import * as z76 from "zod";
18440
18571
  var MetaTrackingOwnerSchema = z76.enum([
@@ -18558,6 +18689,95 @@ var MetaTrackingInspectionSchema = z76.object({
18558
18689
 
18559
18690
  // ../../packages/types/src/agent-memory.ts
18560
18691
  import { z as z77 } from "zod";
18692
+
18693
+ // ../../packages/types/src/dropi-countries.ts
18694
+ var DROPI_COUNTRY_CODES = [
18695
+ "CO",
18696
+ "EC",
18697
+ "VE",
18698
+ "MX",
18699
+ "PE",
18700
+ "PA",
18701
+ "PY",
18702
+ "GT",
18703
+ "CL",
18704
+ "AR",
18705
+ "CR"
18706
+ ];
18707
+ var DROPI_COUNTRIES = {
18708
+ CO: {
18709
+ name: "Colombia",
18710
+ currency: "COP",
18711
+ timeZone: "America/Bogota",
18712
+ productionBaseUrl: "https://api.dropi.co/integrations"
18713
+ },
18714
+ EC: {
18715
+ name: "Ecuador",
18716
+ currency: "USD",
18717
+ timeZone: "America/Guayaquil",
18718
+ productionBaseUrl: "https://api.dropi.ec/integrations"
18719
+ },
18720
+ VE: {
18721
+ name: "Venezuela",
18722
+ currency: "USD",
18723
+ timeZone: "America/Caracas",
18724
+ productionBaseUrl: "https://api.dropi.com.ve/integrations"
18725
+ },
18726
+ MX: {
18727
+ name: "M\xE9xico",
18728
+ currency: "MXN",
18729
+ timeZone: "America/Mexico_City",
18730
+ productionBaseUrl: "https://api.dropi.mx/integrations"
18731
+ },
18732
+ PE: {
18733
+ name: "Per\xFA",
18734
+ currency: "PEN",
18735
+ timeZone: "America/Lima",
18736
+ productionBaseUrl: "https://api.dropi.pe/integrations"
18737
+ },
18738
+ PA: {
18739
+ name: "Panam\xE1",
18740
+ currency: "USD",
18741
+ timeZone: "America/Panama",
18742
+ productionBaseUrl: "https://api.dropi.pa/integrations"
18743
+ },
18744
+ PY: {
18745
+ name: "Paraguay",
18746
+ currency: "PYG",
18747
+ timeZone: "America/Asuncion",
18748
+ productionBaseUrl: "https://api.dropi.com.py/integrations"
18749
+ },
18750
+ GT: {
18751
+ name: "Guatemala",
18752
+ currency: "GTQ",
18753
+ timeZone: "America/Guatemala",
18754
+ productionBaseUrl: "https://api.dropi.gt/integrations"
18755
+ },
18756
+ CL: {
18757
+ name: "Chile",
18758
+ currency: "CLP",
18759
+ timeZone: "America/Santiago",
18760
+ productionBaseUrl: "https://api.dropi.cl/integrations"
18761
+ },
18762
+ AR: {
18763
+ name: "Argentina",
18764
+ currency: "ARS",
18765
+ timeZone: "America/Argentina/Buenos_Aires",
18766
+ productionBaseUrl: "https://api.dropi.ar/integrations"
18767
+ },
18768
+ CR: {
18769
+ name: "Costa Rica",
18770
+ currency: "CRC",
18771
+ timeZone: "America/Costa_Rica",
18772
+ productionBaseUrl: "https://api.dropi.cr/integrations"
18773
+ }
18774
+ };
18775
+ function isDropiCountryCode(value) {
18776
+ return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
18777
+ }
18778
+ __name(isDropiCountryCode, "isDropiCountryCode");
18779
+
18780
+ // ../../packages/types/src/agent-memory.ts
18561
18781
  var AGENT_PRODUCT_STAGES = [
18562
18782
  "researching",
18563
18783
  "testing",
@@ -18591,6 +18811,29 @@ var AGENT_MEMORY_SEARCH_SCOPES = [
18591
18811
  "pending",
18592
18812
  "playbook_history"
18593
18813
  ];
18814
+ var AGENT_SPEND_KINDS = [
18815
+ "pm_credits",
18816
+ "ad_set"
18817
+ ];
18818
+ var AGENT_SPEND_MODES = [
18819
+ "check",
18820
+ "record"
18821
+ ];
18822
+ var AGENT_RUN_PHASES = [
18823
+ "launch",
18824
+ "review",
18825
+ "evening",
18826
+ "weekly"
18827
+ ];
18828
+ var AGENT_RUN_RUNNERS = [
18829
+ "mcp",
18830
+ "server"
18831
+ ];
18832
+ var AGENT_RUN_STATUSES = [
18833
+ "running",
18834
+ "done",
18835
+ "failed"
18836
+ ];
18594
18837
  var AGENT_MEMORY_LIMITS = {
18595
18838
  codeChars: 24,
18596
18839
  nameChars: 120,
@@ -18676,6 +18919,53 @@ var SaveAgentNoteSchema = z77.object({
18676
18919
  metrics: AgentMetricsSchema.optional(),
18677
18920
  refs: AgentRefsSchema.optional()
18678
18921
  }).strict();
18922
+ var isTimeZone = /* @__PURE__ */ __name((value) => {
18923
+ try {
18924
+ new Intl.DateTimeFormat("en-US", {
18925
+ timeZone: value
18926
+ });
18927
+ return true;
18928
+ } catch {
18929
+ return false;
18930
+ }
18931
+ }, "isTimeZone");
18932
+ var SaveAgentSettingsSchema = z77.object({
18933
+ type: z77.literal("settings"),
18934
+ shopDomain: z77.string().trim().toLowerCase().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/, "Use the *.myshopify.com domain").nullable().optional(),
18935
+ metaAdAccountId: z77.string().trim().regex(/^\d{5,30}$/, "Numeric ad account id, without act_").nullable().optional(),
18936
+ metaPixelId: z77.string().trim().regex(/^\d{5,30}$/, "Numeric pixel id").nullable().optional(),
18937
+ country: z77.string().trim().length(2).toUpperCase().nullable().optional(),
18938
+ timeZone: z77.string().trim().min(1).max(64).refine(isTimeZone, "Use an IANA time zone, e.g. America/Bogota").nullable().optional(),
18939
+ dailyCreditCap: z77.number().int().min(0).max(1e7).nullable().optional(),
18940
+ dailyNewAdSetCap: z77.number().int().min(0).max(100).nullable().optional(),
18941
+ /** Sugerido por campaña; el monto real lo acuerda el vendedor. */
18942
+ adSetDailyBudget: z77.number().int().min(0).max(1e9).nullable().optional(),
18943
+ budgetCurrency: z77.string().trim().length(3).toUpperCase().nullable().optional(),
18944
+ /** Prende o apaga los turnos cada 3 horas. */
18945
+ autopilot: z77.boolean().optional()
18946
+ }).strict();
18947
+ var SaveAgentSpendSchema = z77.object({
18948
+ type: z77.literal("spend"),
18949
+ mode: z77.enum(AGENT_SPEND_MODES),
18950
+ kind: z77.enum(AGENT_SPEND_KINDS),
18951
+ amount: z77.number().int().min(1).max(1e7),
18952
+ ref: z77.string().trim().min(1).max(200).optional(),
18953
+ note: z77.string().trim().max(AGENT_MEMORY_LIMITS.verdictChars).optional()
18954
+ }).strict();
18955
+ var SaveAgentRunClaimSchema = z77.object({
18956
+ type: z77.literal("run_claim"),
18957
+ // Por esta vía solo reclama el agente por MCP; el servidor reclama por dentro.
18958
+ runner: z77.literal("mcp").default("mcp")
18959
+ }).strict();
18960
+ var SaveAgentRunCompleteSchema = z77.object({
18961
+ type: z77.literal("run_complete"),
18962
+ runId: z77.string().uuid(),
18963
+ status: z77.enum([
18964
+ "done",
18965
+ "failed"
18966
+ ]),
18967
+ summary: z77.string().trim().min(1).max(AGENT_MEMORY_LIMITS.noteChars)
18968
+ }).strict();
18679
18969
  var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18680
18970
  SaveAgentProductSchema,
18681
18971
  SaveAgentExperimentOpenSchema,
@@ -18683,7 +18973,11 @@ var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18683
18973
  SaveAgentPlaybookSchema,
18684
18974
  SaveAgentPendingAddSchema,
18685
18975
  SaveAgentPendingResolveSchema,
18686
- SaveAgentNoteSchema
18976
+ SaveAgentNoteSchema,
18977
+ SaveAgentSettingsSchema,
18978
+ SaveAgentSpendSchema,
18979
+ SaveAgentRunClaimSchema,
18980
+ SaveAgentRunCompleteSchema
18687
18981
  ]);
18688
18982
  var SaveAgentMemoryRequestSchema = z77.object({
18689
18983
  memory: SaveAgentMemorySchema
@@ -18767,7 +19061,69 @@ var AgentPlaybookSchema = z77.object({
18767
19061
  body: z77.string(),
18768
19062
  createdAt: z77.string()
18769
19063
  });
19064
+ var AgentSettingsSchema = z77.object({
19065
+ shopDomain: z77.string().nullable(),
19066
+ metaAdAccountId: z77.string().nullable(),
19067
+ metaPixelId: z77.string().nullable(),
19068
+ /** Null hasta que el contexto del vendedor lo diga. */
19069
+ country: z77.string().nullable(),
19070
+ /** La zona con la que se cuenta «hoy»: la guardada, la del país o UTC. */
19071
+ timeZone: z77.string(),
19072
+ /** True si `timeZone` viene del país o de UTC y no de una elección guardada. */
19073
+ timeZoneDerived: z77.boolean(),
19074
+ /** Null = sin tope: solo existe si el vendedor lo pidió. */
19075
+ dailyCreditCap: z77.number().int().nullable(),
19076
+ dailyNewAdSetCap: z77.number().int().nullable(),
19077
+ /** Sugerido por campaña; null = se acuerda con el vendedor. Nunca un tope. */
19078
+ adSetDailyBudget: z77.number().int().nullable(),
19079
+ /** La guardada, la del país o COP si aún no se sabe. */
19080
+ budgetCurrency: z77.string(),
19081
+ autopilot: z77.boolean(),
19082
+ /** Null mientras la cuenta no ha guardado nada. */
19083
+ updatedAt: z77.string().nullable()
19084
+ });
19085
+ var AgentBudgetLineSchema = z77.object({
19086
+ used: z77.number().int(),
19087
+ /** Null = sin tope. */
19088
+ cap: z77.number().int().nullable(),
19089
+ remaining: z77.number().int().nullable()
19090
+ });
19091
+ var AgentBudgetSchema = z77.object({
19092
+ day: z77.string(),
19093
+ timeZone: z77.string(),
19094
+ pm_credits: AgentBudgetLineSchema,
19095
+ ad_set: AgentBudgetLineSchema
19096
+ });
19097
+ var AgentSpendResultSchema = z77.object({
19098
+ mode: z77.enum(AGENT_SPEND_MODES),
19099
+ kind: z77.enum(AGENT_SPEND_KINDS),
19100
+ amount: z77.number().int(),
19101
+ /** check: si el monto cabe en lo que queda hoy. record: siempre true. */
19102
+ fits: z77.boolean(),
19103
+ ref: z77.string().nullable(),
19104
+ budget: AgentBudgetSchema
19105
+ });
19106
+ var AgentRunSchema = z77.object({
19107
+ id: z77.string(),
19108
+ slot: z77.string(),
19109
+ phase: z77.enum(AGENT_RUN_PHASES),
19110
+ runner: z77.enum(AGENT_RUN_RUNNERS),
19111
+ status: z77.enum(AGENT_RUN_STATUSES),
19112
+ summary: z77.string().nullable(),
19113
+ startedAt: z77.string(),
19114
+ finishedAt: z77.string().nullable()
19115
+ });
18770
19116
  var AgentMemoryBriefSchema = z77.object({
19117
+ settings: AgentSettingsSchema,
19118
+ budget: AgentBudgetSchema,
19119
+ /** El turno de ahora (null fuera de horario) y si ya alguien lo corrió. */
19120
+ currentSlot: z77.object({
19121
+ slot: z77.string(),
19122
+ phase: z77.enum(AGENT_RUN_PHASES),
19123
+ run: AgentRunSchema.nullable()
19124
+ }).nullable(),
19125
+ /** Los últimos turnos, del más reciente al más viejo. */
19126
+ recentRuns: z77.array(AgentRunSchema),
18771
19127
  playbook: AgentPlaybookSchema.nullable(),
18772
19128
  products: z77.array(AgentProductSchema),
18773
19129
  openExperiments: z77.array(AgentExperimentSchema),
@@ -18797,7 +19153,11 @@ var AgentMemorySaveResultSchema = z77.discriminatedUnion("type", [
18797
19153
  saved("playbook", AgentPlaybookSchema),
18798
19154
  saved("pending_add", AgentPendingItemSchema),
18799
19155
  saved("pending_resolve", AgentPendingItemSchema),
18800
- saved("note", AgentNoteSchema)
19156
+ saved("note", AgentNoteSchema),
19157
+ saved("settings", AgentSettingsSchema),
19158
+ saved("spend", AgentSpendResultSchema),
19159
+ saved("run_claim", AgentRunSchema),
19160
+ saved("run_complete", AgentRunSchema)
18801
19161
  ]);
18802
19162
 
18803
19163
  // ../../packages/types/src/video-edit.ts
@@ -22723,93 +23083,6 @@ var LinkableCampaignsResponseSchema = z97.object({
22723
23083
  // ../../packages/types/src/finance-operation.ts
22724
23084
  import { z as z98 } from "zod";
22725
23085
 
22726
- // ../../packages/types/src/dropi-countries.ts
22727
- var DROPI_COUNTRY_CODES = [
22728
- "CO",
22729
- "EC",
22730
- "VE",
22731
- "MX",
22732
- "PE",
22733
- "PA",
22734
- "PY",
22735
- "GT",
22736
- "CL",
22737
- "AR",
22738
- "CR"
22739
- ];
22740
- var DROPI_COUNTRIES = {
22741
- CO: {
22742
- name: "Colombia",
22743
- currency: "COP",
22744
- timeZone: "America/Bogota",
22745
- productionBaseUrl: "https://api.dropi.co/integrations"
22746
- },
22747
- EC: {
22748
- name: "Ecuador",
22749
- currency: "USD",
22750
- timeZone: "America/Guayaquil",
22751
- productionBaseUrl: "https://api.dropi.ec/integrations"
22752
- },
22753
- VE: {
22754
- name: "Venezuela",
22755
- currency: "USD",
22756
- timeZone: "America/Caracas",
22757
- productionBaseUrl: "https://api.dropi.com.ve/integrations"
22758
- },
22759
- MX: {
22760
- name: "M\xE9xico",
22761
- currency: "MXN",
22762
- timeZone: "America/Mexico_City",
22763
- productionBaseUrl: "https://api.dropi.mx/integrations"
22764
- },
22765
- PE: {
22766
- name: "Per\xFA",
22767
- currency: "PEN",
22768
- timeZone: "America/Lima",
22769
- productionBaseUrl: "https://api.dropi.pe/integrations"
22770
- },
22771
- PA: {
22772
- name: "Panam\xE1",
22773
- currency: "USD",
22774
- timeZone: "America/Panama",
22775
- productionBaseUrl: "https://api.dropi.pa/integrations"
22776
- },
22777
- PY: {
22778
- name: "Paraguay",
22779
- currency: "PYG",
22780
- timeZone: "America/Asuncion",
22781
- productionBaseUrl: "https://api.dropi.com.py/integrations"
22782
- },
22783
- GT: {
22784
- name: "Guatemala",
22785
- currency: "GTQ",
22786
- timeZone: "America/Guatemala",
22787
- productionBaseUrl: "https://api.dropi.gt/integrations"
22788
- },
22789
- CL: {
22790
- name: "Chile",
22791
- currency: "CLP",
22792
- timeZone: "America/Santiago",
22793
- productionBaseUrl: "https://api.dropi.cl/integrations"
22794
- },
22795
- AR: {
22796
- name: "Argentina",
22797
- currency: "ARS",
22798
- timeZone: "America/Argentina/Buenos_Aires",
22799
- productionBaseUrl: "https://api.dropi.ar/integrations"
22800
- },
22801
- CR: {
22802
- name: "Costa Rica",
22803
- currency: "CRC",
22804
- timeZone: "America/Costa_Rica",
22805
- productionBaseUrl: "https://api.dropi.cr/integrations"
22806
- }
22807
- };
22808
- function isDropiCountryCode(value) {
22809
- return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
22810
- }
22811
- __name(isDropiCountryCode, "isDropiCountryCode");
22812
-
22813
23086
  // ../../packages/types/src/finance-country-timezones.ts
22814
23087
  var FINANCE_COUNTRY_TIME_ZONES = Object.freeze({
22815
23088
  US: "America/New_York",
@@ -25874,7 +26147,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25874
26147
  ], MCP_ONLY_CHANNEL_EXPOSURE),
25875
26148
  defineCapability(
25876
26149
  "save_agent_memory",
25877
- "4199ce3debc7266b3db30b5d7e3424d2c698b78309d49d20959460ab2de283a8",
26150
+ "46ddddd8ae1475dd880215696499016bbec5f961891748b82095cbf7f7a49c0c",
25878
26151
  // La memoria es el cuaderno del propio agente: no toca nada que vea el
25879
26152
  // comprador ni cobra créditos, así que escribir no pide confirmación.
25880
26153
  "none",
@@ -31756,7 +32029,7 @@ var ApiClient = class {
31756
32029
  };
31757
32030
 
31758
32031
  // src/index.ts
31759
- var MCP_VERSION = "12.8.0";
32032
+ var MCP_VERSION = "12.9.0";
31760
32033
 
31761
32034
  // src/meta-upload-app.ts
31762
32035
  import { readFileSync } from "fs";
@@ -39601,7 +39874,9 @@ function registerPublishTools(server, api, opts = {}) {
39601
39874
  const selectedLandingGif = includeLandingGif ? defaults?.gif ?? null : null;
39602
39875
  const effectiveAvailable = availableImages > 0 ? availableImages : 3;
39603
39876
  const numImages = Math.min(parsed.numLandingImages ?? effectiveAvailable, effectiveAvailable, SHOPIFY_MAX_LANDING_IMAGES);
39604
- const selectedLandingImages = Array.from({
39877
+ const classic = includeLandingGif && defaults && variantIndex === 0 ? buildMcpClassicSelection(defaults, numImages) : null;
39878
+ const classicSelection = classic?.selection ?? null;
39879
+ const selectedLandingImages = classic?.images ?? Array.from({
39605
39880
  length: numImages
39606
39881
  }, (_, i) => ({
39607
39882
  imageIndex: i,
@@ -39615,7 +39890,13 @@ function registerPublishTools(server, api, opts = {}) {
39615
39890
  }),
39616
39891
  shopDomain: parsed.shopDomain,
39617
39892
  selectedLandingImages,
39618
- ...selectedLandingGif ? {
39893
+ // Classic block landings publish their GIF blocks through the
39894
+ // ordered document, exactly like the web editor; the legacy
39895
+ // primary GIF only rides selectedLandingGif.
39896
+ ...classicSelection ? {
39897
+ classicSelection,
39898
+ selectedLandingGif: null
39899
+ } : selectedLandingGif ? {
39619
39900
  selectedLandingGif
39620
39901
  } : {},
39621
39902
  showVariantPicker: parsed.showVariantPicker,
@@ -39910,23 +40191,65 @@ async function fetchLandingPublishDefaults(api, taskId) {
39910
40191
  const r = await api.getJson(`/v1/results/${encodeURIComponent(taskId)}`);
39911
40192
  if (!isRecord3(r) || !isRecord3(r.landing)) return {
39912
40193
  imageCount: 0,
39913
- gif: null
40194
+ images: [],
40195
+ gif: null,
40196
+ classic: null
39914
40197
  };
39915
- const images = r.landing.images;
40198
+ const rawImages = Array.isArray(r.landing.images) ? r.landing.images : [];
40199
+ const images = rawImages.map((image2) => {
40200
+ const record = isRecord3(image2) ? image2 : {};
40201
+ return {
40202
+ ownerTaskId: typeof record.variantTaskId === "string" ? record.variantTaskId : taskId,
40203
+ sourceIndex: Number(record.sourceIndex ?? record.index)
40204
+ };
40205
+ });
39916
40206
  const demo = LandingGifReadableSchema.safeParse(r.landing.demoGif);
39917
40207
  const gif = demo.success && demo.data.ownerTaskId === taskId && demo.data.quality.verdict === "passed" ? {
39918
40208
  ownerTaskId: taskId,
39919
40209
  gifRevision: demo.data.gifRevision
39920
40210
  } : null;
40211
+ const document = ClassicLandingDocumentSchema.safeParse(r.landing.classicDocument);
40212
+ const gifs = (Array.isArray(r.landing.gifBlocks) ? r.landing.gifBlocks : []).flatMap((entry) => {
40213
+ const parsed = LandingGifItemSchema.safeParse(entry);
40214
+ return parsed.success ? [
40215
+ parsed.data
40216
+ ] : [];
40217
+ });
39921
40218
  return {
39922
- imageCount: Array.isArray(images) ? images.length : 0,
39923
- gif
40219
+ imageCount: rawImages.length,
40220
+ images,
40221
+ gif,
40222
+ classic: document.success ? {
40223
+ document: document.data,
40224
+ gifs
40225
+ } : null
39924
40226
  };
39925
40227
  } catch {
39926
40228
  return null;
39927
40229
  }
39928
40230
  }
39929
40231
  __name(fetchLandingPublishDefaults, "fetchLandingPublishDefaults");
40232
+ function buildMcpClassicSelection(defaults, numImages) {
40233
+ if (!defaults.classic) return null;
40234
+ const { document, gifs } = defaults.classic;
40235
+ const gifBlockIds = document.blocks.flatMap((block) => block.kind === "gif" && gifs.some((item) => item.gifId === block.gifId && item.ownerTaskId === block.ownerTaskId && isDeliverableLandingGif(item)) ? [
40236
+ classicLandingBlockId(block)
40237
+ ] : []);
40238
+ if (gifBlockIds.length === 0) return null;
40239
+ const selection = buildClassicLandingSelection(document, gifs, gifBlockIds, defaults.images.map((image2, arrayIndex) => ({
40240
+ ...image2,
40241
+ selected: arrayIndex < numImages,
40242
+ variantIndex: 0
40243
+ })));
40244
+ return {
40245
+ selection,
40246
+ images: (selection.images ?? []).map((selected) => ({
40247
+ imageIndex: defaults.images.findIndex((image2) => image2.ownerTaskId === selected.ownerTaskId && image2.sourceIndex === selected.sourceIndex),
40248
+ variantIndex: selected.variantIndex
40249
+ }))
40250
+ };
40251
+ }
40252
+ __name(buildMcpClassicSelection, "buildMcpClassicSelection");
39930
40253
  function toMetaCampaignOverrides(cfg) {
39931
40254
  const out = {};
39932
40255
  if (cfg.dailyBudgetUsd !== void 0) out.dailyBudgetUsd = cfg.dailyBudgetUsd;
@@ -41780,7 +42103,7 @@ function queryString(values) {
41780
42103
  __name(queryString, "queryString");
41781
42104
  function registerAgentMemoryTools(server, api) {
41782
42105
  server.registerTool("get_agent_memory_brief", {
41783
- description: briefGuidance.summary + " Ll\xE1mala UNA vez al empezar cada corrida, antes de decidir nada: devuelve la \xFAltima versi\xF3n del playbook, la ficha de cada producto (c\xF3digo, etapa, CPA objetivo, veredicto y sus enlaces productControlId/projectId), los experimentos abiertos, los pendientes abiertos (aprobaciones del due\xF1o y seguimientos) y las notas m\xE1s recientes. Una cuenta nueva recibe todo vac\xEDo, no un error. Los n\xFAmeros de negocio (ventas, costo por venta, gasto) NO est\xE1n aqu\xED: l\xE9elos con get_daily_control / get_product_control usando los enlaces de cada ficha.",
42106
+ description: briefGuidance.summary + " Ll\xE1mala UNA vez al empezar cada corrida, antes de decidir nada: devuelve la \xFAltima versi\xF3n del playbook, la ficha de cada producto (c\xF3digo, etapa, CPA objetivo, veredicto y sus enlaces productControlId/projectId), los experimentos abiertos, los pendientes abiertos (aprobaciones del due\xF1o y seguimientos), las notas m\xE1s recientes, `settings` (tienda, cuenta de Meta, pa\xEDs, zona horaria, moneda, presupuesto sugerido por campa\xF1a, topes diarios si el vendedor pidi\xF3 alguno y si el piloto autom\xE1tico est\xE1 prendido; lo que no se ha acordado viene en null: nada trae un valor fijo, s\xE1calo del contexto del vendedor y su producto o preg\xFAntale), `budget` (lo gastado HOY en esa zona: cr\xE9ditos de ProductMaker y conjuntos nuevos, contra su tope solo si existe), `currentSlot` (el turno de ahora del piloto autom\xE1tico y su fase, con `run` si alguien ya lo corri\xF3; null fuera de horario) y `recentRuns` (los \xFAltimos turnos con su reporte). Una cuenta nueva recibe todo vac\xEDo, no un error. Los n\xFAmeros de negocio (ventas, costo por venta, gasto) NO est\xE1n aqu\xED: l\xE9elos con get_daily_control / get_product_control usando los enlaces de cada ficha.",
41784
42107
  inputSchema: BriefInput.shape,
41785
42108
  annotations: READS_INTERNAL
41786
42109
  }, async (input) => {
@@ -41802,7 +42125,7 @@ function registerAgentMemoryTools(server, api) {
41802
42125
  }
41803
42126
  });
41804
42127
  server.registerTool("save_agent_memory", {
41805
- description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
42128
+ description: saveGuidance.summary + ' Un solo punto de escritura; `memory.type` dice qu\xE9 se guarda: "product" crea o actualiza la ficha por `code` (la primera vez exige `name`; solo cambia los campos enviados; `verdict: ""` lo borra; productControlId/projectId deben ser de esta cuenta), "experiment_open" abre un experimento con hip\xF3tesis y montaje, "experiment_close" lo cierra UNA vez con outcome y conclusi\xF3n (cerrado no se reabre: 409, abre otro), "playbook" guarda una versi\xF3n NUEVA completa del playbook (no un parche; las anteriores quedan en el historial), "pending_add" deja una aprobaci\xF3n o seguimiento abierto, "pending_resolve" lo resuelve UNA vez (409 si ya estaba resuelto), "note" escribe en la bit\xE1cora, "settings" guarda la configuraci\xF3n del agente (solo los campos enviados; `null` borra un valor; pa\xEDs, moneda, presupuesto y topes salen del contexto o de lo que diga el vendedor, nunca de un n\xFAmero por defecto; prender `autopilot` exige pa\xEDs o zona: 400 AGENT_COUNTRY_REQUIRED) y "spend" lleva el gasto del d\xEDa: `mode: "check"` ANTES de cada gasto (cr\xE9ditos cotizados o 1 conjunto nuevo) dice si cabe (`fits`) en el tope del vendedor, sin escribir (sin tope, siempre cabe); si no cabe, pide OK al vendedor. `mode: "record"` DESPU\xC9S registra el costo real con una `ref` por cobro (`<taskId>:<tool>`, runId o adSetId): repetirlo con el mismo monto no suma dos veces y otro monto con la misma ref es 409 AGENT_SPEND_REF_CONFLICT. "run_claim" reclama el turno vigente del piloto autom\xE1tico ANTES de correr una fase programada (turnos a las 9, 12, 15, 18 y 21 en la zona del agente; devuelve `phase`: launch, review, evening o weekly): 409 AGENT_RUN_ALREADY_CLAIMED si ya lo corri\xF3 otro (no lo corras), 409 AGENT_RUN_NO_SLOT fuera de horario. "run_complete" cierra ese turno UNA vez con `status` done o failed y el reporte corto en `summary`. `productCode` debe existir (404 AGENT_PRODUCT_NOT_FOUND: guarda primero el producto). Para reintentar sin duplicar, manda el mismo `requestId` (UUID): la respuesta trae `replayed: true`. Nunca guardes datos personales de compradores, contrase\xF1as ni llaves.',
41806
42129
  inputSchema: SaveInput.shape,
41807
42130
  annotations: OVERWRITES_INTERNAL
41808
42131
  }, async (input) => {