@productmaker/mcp 12.8.1 → 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 +365 -133
  2. package/dist/stdio.js +365 -133
  3. package/package.json +3 -3
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,
@@ -18599,6 +18689,95 @@ var MetaTrackingInspectionSchema = z76.object({
18599
18689
 
18600
18690
  // ../../packages/types/src/agent-memory.ts
18601
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
18602
18781
  var AGENT_PRODUCT_STAGES = [
18603
18782
  "researching",
18604
18783
  "testing",
@@ -18632,6 +18811,29 @@ var AGENT_MEMORY_SEARCH_SCOPES = [
18632
18811
  "pending",
18633
18812
  "playbook_history"
18634
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
+ ];
18635
18837
  var AGENT_MEMORY_LIMITS = {
18636
18838
  codeChars: 24,
18637
18839
  nameChars: 120,
@@ -18717,6 +18919,53 @@ var SaveAgentNoteSchema = z77.object({
18717
18919
  metrics: AgentMetricsSchema.optional(),
18718
18920
  refs: AgentRefsSchema.optional()
18719
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();
18720
18969
  var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18721
18970
  SaveAgentProductSchema,
18722
18971
  SaveAgentExperimentOpenSchema,
@@ -18724,7 +18973,11 @@ var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18724
18973
  SaveAgentPlaybookSchema,
18725
18974
  SaveAgentPendingAddSchema,
18726
18975
  SaveAgentPendingResolveSchema,
18727
- SaveAgentNoteSchema
18976
+ SaveAgentNoteSchema,
18977
+ SaveAgentSettingsSchema,
18978
+ SaveAgentSpendSchema,
18979
+ SaveAgentRunClaimSchema,
18980
+ SaveAgentRunCompleteSchema
18728
18981
  ]);
18729
18982
  var SaveAgentMemoryRequestSchema = z77.object({
18730
18983
  memory: SaveAgentMemorySchema
@@ -18808,7 +19061,69 @@ var AgentPlaybookSchema = z77.object({
18808
19061
  body: z77.string(),
18809
19062
  createdAt: z77.string()
18810
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
+ });
18811
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),
18812
19127
  playbook: AgentPlaybookSchema.nullable(),
18813
19128
  products: z77.array(AgentProductSchema),
18814
19129
  openExperiments: z77.array(AgentExperimentSchema),
@@ -18838,7 +19153,11 @@ var AgentMemorySaveResultSchema = z77.discriminatedUnion("type", [
18838
19153
  saved("playbook", AgentPlaybookSchema),
18839
19154
  saved("pending_add", AgentPendingItemSchema),
18840
19155
  saved("pending_resolve", AgentPendingItemSchema),
18841
- 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)
18842
19161
  ]);
18843
19162
 
18844
19163
  // ../../packages/types/src/video-edit.ts
@@ -22764,93 +23083,6 @@ var LinkableCampaignsResponseSchema = z97.object({
22764
23083
  // ../../packages/types/src/finance-operation.ts
22765
23084
  import { z as z98 } from "zod";
22766
23085
 
22767
- // ../../packages/types/src/dropi-countries.ts
22768
- var DROPI_COUNTRY_CODES = [
22769
- "CO",
22770
- "EC",
22771
- "VE",
22772
- "MX",
22773
- "PE",
22774
- "PA",
22775
- "PY",
22776
- "GT",
22777
- "CL",
22778
- "AR",
22779
- "CR"
22780
- ];
22781
- var DROPI_COUNTRIES = {
22782
- CO: {
22783
- name: "Colombia",
22784
- currency: "COP",
22785
- timeZone: "America/Bogota",
22786
- productionBaseUrl: "https://api.dropi.co/integrations"
22787
- },
22788
- EC: {
22789
- name: "Ecuador",
22790
- currency: "USD",
22791
- timeZone: "America/Guayaquil",
22792
- productionBaseUrl: "https://api.dropi.ec/integrations"
22793
- },
22794
- VE: {
22795
- name: "Venezuela",
22796
- currency: "USD",
22797
- timeZone: "America/Caracas",
22798
- productionBaseUrl: "https://api.dropi.com.ve/integrations"
22799
- },
22800
- MX: {
22801
- name: "M\xE9xico",
22802
- currency: "MXN",
22803
- timeZone: "America/Mexico_City",
22804
- productionBaseUrl: "https://api.dropi.mx/integrations"
22805
- },
22806
- PE: {
22807
- name: "Per\xFA",
22808
- currency: "PEN",
22809
- timeZone: "America/Lima",
22810
- productionBaseUrl: "https://api.dropi.pe/integrations"
22811
- },
22812
- PA: {
22813
- name: "Panam\xE1",
22814
- currency: "USD",
22815
- timeZone: "America/Panama",
22816
- productionBaseUrl: "https://api.dropi.pa/integrations"
22817
- },
22818
- PY: {
22819
- name: "Paraguay",
22820
- currency: "PYG",
22821
- timeZone: "America/Asuncion",
22822
- productionBaseUrl: "https://api.dropi.com.py/integrations"
22823
- },
22824
- GT: {
22825
- name: "Guatemala",
22826
- currency: "GTQ",
22827
- timeZone: "America/Guatemala",
22828
- productionBaseUrl: "https://api.dropi.gt/integrations"
22829
- },
22830
- CL: {
22831
- name: "Chile",
22832
- currency: "CLP",
22833
- timeZone: "America/Santiago",
22834
- productionBaseUrl: "https://api.dropi.cl/integrations"
22835
- },
22836
- AR: {
22837
- name: "Argentina",
22838
- currency: "ARS",
22839
- timeZone: "America/Argentina/Buenos_Aires",
22840
- productionBaseUrl: "https://api.dropi.ar/integrations"
22841
- },
22842
- CR: {
22843
- name: "Costa Rica",
22844
- currency: "CRC",
22845
- timeZone: "America/Costa_Rica",
22846
- productionBaseUrl: "https://api.dropi.cr/integrations"
22847
- }
22848
- };
22849
- function isDropiCountryCode(value) {
22850
- return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
22851
- }
22852
- __name(isDropiCountryCode, "isDropiCountryCode");
22853
-
22854
23086
  // ../../packages/types/src/finance-country-timezones.ts
22855
23087
  var FINANCE_COUNTRY_TIME_ZONES = Object.freeze({
22856
23088
  US: "America/New_York",
@@ -25915,7 +26147,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25915
26147
  ], MCP_ONLY_CHANNEL_EXPOSURE),
25916
26148
  defineCapability(
25917
26149
  "save_agent_memory",
25918
- "4199ce3debc7266b3db30b5d7e3424d2c698b78309d49d20959460ab2de283a8",
26150
+ "46ddddd8ae1475dd880215696499016bbec5f961891748b82095cbf7f7a49c0c",
25919
26151
  // La memoria es el cuaderno del propio agente: no toca nada que vea el
25920
26152
  // comprador ni cobra créditos, así que escribir no pide confirmación.
25921
26153
  "none",
@@ -31797,7 +32029,7 @@ var ApiClient = class {
31797
32029
  };
31798
32030
 
31799
32031
  // src/index.ts
31800
- var MCP_VERSION = "12.8.1";
32032
+ var MCP_VERSION = "12.9.0";
31801
32033
 
31802
32034
  // src/meta-upload-app.ts
31803
32035
  import { readFileSync } from "fs";
@@ -41871,7 +42103,7 @@ function queryString(values) {
41871
42103
  __name(queryString, "queryString");
41872
42104
  function registerAgentMemoryTools(server, api) {
41873
42105
  server.registerTool("get_agent_memory_brief", {
41874
- 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.",
41875
42107
  inputSchema: BriefInput.shape,
41876
42108
  annotations: READS_INTERNAL
41877
42109
  }, async (input) => {
@@ -41893,7 +42125,7 @@ function registerAgentMemoryTools(server, api) {
41893
42125
  }
41894
42126
  });
41895
42127
  server.registerTool("save_agent_memory", {
41896
- 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.',
41897
42129
  inputSchema: SaveInput.shape,
41898
42130
  annotations: OVERWRITES_INTERNAL
41899
42131
  }, async (input) => {