@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/stdio.js CHANGED
@@ -201,17 +201,84 @@ var GPT_IMAGE_2_5_TOKENS = {
201
201
  "2k": "gpt-image-2-5:2k",
202
202
  "4k": "gpt-image-2-5:4k"
203
203
  };
204
+ var GPT_IMAGE_2_6_TOKENS = {
205
+ "1k": "gpt-image-2-6:1k",
206
+ "2k": "gpt-image-2-6:2k",
207
+ "4k": "gpt-image-2-6:4k"
208
+ };
204
209
  var GPT_IMAGE_2_TOKENS = {
205
210
  "1k": "gpt-image-2:1k",
206
211
  "2k": "gpt-image-2:2k",
207
212
  "4k": "gpt-image-2:4k"
208
213
  };
214
+ var GPT_IMAGE_2_6 = {
215
+ id: "gpt-image-2.6",
216
+ status: "active",
217
+ renderedBy: "gpt-image-2.6",
218
+ tokens: GPT_IMAGE_2_6_TOKENS,
219
+ kie: {
220
+ quality: "low",
221
+ maxResolution: "1K",
222
+ imageToImage: [
223
+ "gpt-image-2-6/flare-image-to-image",
224
+ "gpt-image-2-6/sunburst-image-to-image"
225
+ ],
226
+ textToImage: [
227
+ "gpt-image-2-6/flare-text-to-image",
228
+ "gpt-image-2-6/sunburst-text-to-image"
229
+ ],
230
+ shorthands: [
231
+ "gpt-image-2-6"
232
+ ]
233
+ },
234
+ // Siempre 1K (decisión del dueño 2026-11-06): el failover Fal también va a
235
+ // `low` para cada tier, y todo tier se factura con la clave 1K. Fal publicó
236
+ // 2.6 flare el 2026-11-04 (probado real 2026-11-06: edit y text-to-image
237
+ // aceptan quality=low). Fal no devuelve el costo por request y cobra por
238
+ // tokens a la misma tarifa que KIE +11%; se toma el costo medido en KIE
239
+ // (4¢), cobrado al usuario a la paridad KIE de 8¢ (2x).
240
+ fal: {
241
+ edit: "openai/gpt-image-2.6/flare/edit",
242
+ textToImage: "openai/gpt-image-2.6/flare/text-to-image",
243
+ quality: {
244
+ "1k": "low",
245
+ "2k": "low",
246
+ "4k": "low"
247
+ },
248
+ ourCostCents: {
249
+ "1k": 4,
250
+ "2k": 4,
251
+ "4k": 4
252
+ }
253
+ },
254
+ ratiosBlockedAbove1k: [
255
+ "4:5",
256
+ "5:4",
257
+ "27:16",
258
+ "16:27",
259
+ "9:8",
260
+ "8:9"
261
+ ],
262
+ ledgerSuffix: {
263
+ "1k": "gpt-image-2",
264
+ "2k": "gpt-image-2",
265
+ "4k": "gpt-image-2"
266
+ },
267
+ falLedgerSuffix: {
268
+ "1k": "gpt-image-2:1k",
269
+ "2k": "gpt-image-2:2k",
270
+ "4k": "gpt-image-2:4k"
271
+ }
272
+ };
209
273
  var GPT_IMAGE_2_5 = {
274
+ ...GPT_IMAGE_2_6,
210
275
  id: "gpt-image-2.5",
211
- status: "active",
212
- renderedBy: "gpt-image-2.5",
276
+ status: "retired",
277
+ renderedBy: GPT_IMAGE_2_6.id,
213
278
  tokens: GPT_IMAGE_2_5_TOKENS,
214
279
  kie: {
280
+ quality: null,
281
+ maxResolution: "4K",
215
282
  imageToImage: [
216
283
  "gpt-image-2-5-sunburst-image-to-image",
217
284
  "gpt-image-2-5-flare-image-to-image"
@@ -238,6 +305,11 @@ var GPT_IMAGE_2_5 = {
238
305
  "4k": 17.8
239
306
  }
240
307
  },
308
+ ledgerSuffix: {
309
+ "1k": "gpt-image-2",
310
+ "2k": "gpt-image-2:medium",
311
+ "4k": "gpt-image-2:high"
312
+ },
241
313
  // Docs KIE de gpt-image-2-5 (sunburst/flare): 27:16, 16:27, 9:8, 8:9 solo 1K;
242
314
  // 4:5 y 5:4 también bloqueados por encima de 1K.
243
315
  ratiosBlockedAbove1k: [
@@ -247,25 +319,17 @@ var GPT_IMAGE_2_5 = {
247
319
  "16:27",
248
320
  "9:8",
249
321
  "8:9"
250
- ],
251
- ledgerSuffix: {
252
- "1k": "gpt-image-2",
253
- "2k": "gpt-image-2:medium",
254
- "4k": "gpt-image-2:high"
255
- },
256
- falLedgerSuffix: {
257
- "1k": "gpt-image-2:1k",
258
- "2k": "gpt-image-2:2k",
259
- "4k": "gpt-image-2:4k"
260
- }
322
+ ]
261
323
  };
262
324
  var GPT_IMAGE_2 = {
263
325
  ...GPT_IMAGE_2_5,
264
326
  id: "gpt-image-2",
265
327
  status: "retired",
266
- renderedBy: GPT_IMAGE_2_5.id,
328
+ renderedBy: GPT_IMAGE_2_6.id,
267
329
  tokens: GPT_IMAGE_2_TOKENS,
268
330
  kie: {
331
+ quality: null,
332
+ maxResolution: "4K",
269
333
  imageToImage: [
270
334
  "gpt-image-2-image-to-image"
271
335
  ],
@@ -282,10 +346,11 @@ var GPT_IMAGE_2 = {
282
346
  ]
283
347
  };
284
348
  var IMAGE_MODELS = [
349
+ GPT_IMAGE_2_6,
285
350
  GPT_IMAGE_2_5,
286
351
  GPT_IMAGE_2
287
352
  ];
288
- var ACTIVE_IMAGE_MODEL = GPT_IMAGE_2_5;
353
+ var ACTIVE_IMAGE_MODEL = GPT_IMAGE_2_6;
289
354
  var IMAGE_WRITE_TOKENS = GPT_IMAGE_2_5_TOKENS;
290
355
  var LEGACY_IMAGE_TOKENS = GPT_IMAGE_2_TOKENS;
291
356
  var PUBLIC_IMAGE_QUALITY_INPUTS = [
@@ -296,6 +361,10 @@ var PUBLIC_IMAGE_QUALITY_INPUTS = [
296
361
  "image:1k",
297
362
  "image:2k"
298
363
  ];
364
+ function isWrittenOrActiveEntry(entry) {
365
+ return entry.status === "active" || entry.tokens === IMAGE_WRITE_TOKENS;
366
+ }
367
+ __name(isWrittenOrActiveEntry, "isWrittenOrActiveEntry");
299
368
  function entryById(id6) {
300
369
  const found = IMAGE_MODELS.find((entry) => entry.id === id6);
301
370
  if (!found) throw new Error(`IMAGE_MODEL_UNKNOWN:${id6}`);
@@ -328,7 +397,7 @@ function resolveImageToken(raw) {
328
397
  resolution,
329
398
  model: entryById(entry.renderedBy),
330
399
  declared: entry,
331
- spelling: entry.status === "active" ? "current" : "retired",
400
+ spelling: isWrittenOrActiveEntry(entry) ? "current" : "retired",
332
401
  viaFal
333
402
  };
334
403
  }
@@ -348,8 +417,8 @@ function requireKieImageId(ids, index, label) {
348
417
  return id6;
349
418
  }
350
419
  __name(requireKieImageId, "requireKieImageId");
351
- var KIE_FLARE_IMAGE_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.imageToImage, 1, "flare-imageToImage");
352
- var KIE_FLARE_TEXT_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_5.kie.textToImage, 1, "flare-textToImage");
420
+ var KIE_FLARE_IMAGE_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_6.kie.imageToImage, 0, "flare-imageToImage");
421
+ var KIE_FLARE_TEXT_TO_IMAGE_MODEL = requireKieImageId(GPT_IMAGE_2_6.kie.textToImage, 0, "flare-textToImage");
353
422
  function canonicalImageModelInput(raw) {
354
423
  if (raw === void 0) return void 0;
355
424
  const token = resolveImageToken(raw);
@@ -1202,8 +1271,8 @@ var DEFAULT_PRICING = {
1202
1271
  userPriceCents: 8
1203
1272
  },
1204
1273
  "kie:image-generation:gpt-image-2": {
1205
- ourCostCents: 3,
1206
- userPriceCents: 6
1274
+ ourCostCents: 4,
1275
+ userPriceCents: 8
1207
1276
  },
1208
1277
  "kie:image-generation:gpt-image-2:medium": {
1209
1278
  ourCostCents: 5,
@@ -1214,8 +1283,8 @@ var DEFAULT_PRICING = {
1214
1283
  userPriceCents: 16
1215
1284
  },
1216
1285
  "kie:image-generation:gpt-image-2-5": {
1217
- ourCostCents: 3,
1218
- userPriceCents: 6
1286
+ ourCostCents: 4,
1287
+ userPriceCents: 8
1219
1288
  },
1220
1289
  "kie:image-generation:gpt-image-2-5:medium": {
1221
1290
  ourCostCents: 5,
@@ -1230,35 +1299,56 @@ var DEFAULT_PRICING = {
1230
1299
  userPriceCents: 6
1231
1300
  },
1232
1301
  "kie:image-generation:gpt-image-2-5-sunburst-image-to-image": {
1233
- ourCostCents: 3,
1234
- userPriceCents: 6
1302
+ ourCostCents: 4,
1303
+ userPriceCents: 8
1235
1304
  },
1236
1305
  "kie:image-generation:gpt-image-2-5-flare-text-to-image": {
1237
1306
  ourCostCents: 3,
1238
1307
  userPriceCents: 6
1239
1308
  },
1240
1309
  "kie:image-generation:gpt-image-2-5-flare-image-to-image": {
1310
+ ourCostCents: 4,
1311
+ userPriceCents: 8
1312
+ },
1313
+ // gpt-image-2.6 direct ids (Shopify variant/offer images, service-page and
1314
+ // motion-graphics people). KIE bills 2.6 by tokens; measured 2026-11-06 at
1315
+ // 1K quality=low: $0.034–0.047 image-to-image on prod prompts with 1–3 refs;
1316
+ // text-to-image is cheaper (no image-input tokens).
1317
+ "kie:image-generation:gpt-image-2-6/flare-text-to-image": {
1241
1318
  ourCostCents: 3,
1242
1319
  userPriceCents: 6
1243
1320
  },
1321
+ "kie:image-generation:gpt-image-2-6/flare-image-to-image": {
1322
+ ourCostCents: 4,
1323
+ userPriceCents: 8
1324
+ },
1325
+ "kie:image-generation:gpt-image-2-6/sunburst-text-to-image": {
1326
+ ourCostCents: 3,
1327
+ userPriceCents: 6
1328
+ },
1329
+ "kie:image-generation:gpt-image-2-6/sunburst-image-to-image": {
1330
+ ourCostCents: 4,
1331
+ userPriceCents: 8
1332
+ },
1244
1333
  // Mix pipeline (reference-padder) uses the gpt-image-2 text-to-image and
1245
1334
  // image-to-image variants, with seedream/5-lite as NSFW fallback. Both
1246
- // gpt-image-2 keys track the post-2026-04-24 1K-tier price drop above
1247
- // (3¢ / 6¢), and seedream stays at its own 3¢ / 6¢ rate.
1335
+ // gpt-image-2 keys track the 1K tier above: image-to-image 4¢ / 8¢ and
1336
+ // text-to-image 3¢ / 6¢ since 2026-11-06 (gpt-image-2.6 flare low), and
1337
+ // seedream stays at its own 3¢ / 6¢ rate.
1248
1338
  "kie:image-generation:gpt-image-2-text-to-image": {
1249
1339
  ourCostCents: 3,
1250
1340
  userPriceCents: 6
1251
1341
  },
1252
1342
  "kie:image-generation:gpt-image-2-image-to-image": {
1253
- ourCostCents: 3,
1254
- userPriceCents: 6
1343
+ ourCostCents: 4,
1344
+ userPriceCents: 8
1255
1345
  },
1256
1346
  // Custom actor identity photos (gpt-image-2 @ 1K, 4 candidates per attempt).
1257
1347
  // Recorded once per PRODUCED candidate. Without this row billingService.record
1258
1348
  // logs "No pricing rule found; skipping billing record" and the whole grid is free.
1259
1349
  "kie:image-generation:actor": {
1260
- ourCostCents: 3,
1261
- userPriceCents: 6
1350
+ ourCostCents: 4,
1351
+ userPriceCents: 8
1262
1352
  },
1263
1353
  "kie:image-generation:seedream-5-lite-text-to-image": {
1264
1354
  ourCostCents: 3,
@@ -1269,8 +1359,8 @@ var DEFAULT_PRICING = {
1269
1359
  userPriceCents: 6
1270
1360
  },
1271
1361
  "fal:image-generation:gpt-image-2:1k": {
1272
- ourCostCents: 1.5,
1273
- userPriceCents: 6
1362
+ ourCostCents: 4,
1363
+ userPriceCents: 8
1274
1364
  },
1275
1365
  // Video reference pricing varies by model:
1276
1366
  // - gpt-image-2 @ 2K (primary since 2026-04-24): $0.05 / $0.10
@@ -1282,8 +1372,8 @@ var DEFAULT_PRICING = {
1282
1372
  userPriceCents: 18
1283
1373
  },
1284
1374
  "kie:video-reference-generation:gpt-image-2": {
1285
- ourCostCents: 3,
1286
- userPriceCents: 6
1375
+ ourCostCents: 4,
1376
+ userPriceCents: 8
1287
1377
  },
1288
1378
  "kie:video-reference-generation:gpt-image-2:medium": {
1289
1379
  ourCostCents: 5,
@@ -1322,8 +1412,8 @@ var DEFAULT_PRICING = {
1322
1412
  userPriceCents: 18
1323
1413
  },
1324
1414
  "kie:video-scene-reference-generation:gpt-image-2": {
1325
- ourCostCents: 3,
1326
- userPriceCents: 6
1415
+ ourCostCents: 4,
1416
+ userPriceCents: 8
1327
1417
  },
1328
1418
  "kie:video-scene-reference-generation:gpt-image-2:medium": {
1329
1419
  ourCostCents: 5,
@@ -1374,8 +1464,8 @@ var DEFAULT_PRICING = {
1374
1464
  userPriceCents: 4
1375
1465
  },
1376
1466
  "kie:ad-creative-generation:gpt-image-2": {
1377
- ourCostCents: 3,
1378
- userPriceCents: 6
1467
+ ourCostCents: 4,
1468
+ userPriceCents: 8
1379
1469
  },
1380
1470
  "kie:ad-creative-generation:gpt-image-2:medium": {
1381
1471
  ourCostCents: 5,
@@ -1421,8 +1511,8 @@ var DEFAULT_PRICING = {
1421
1511
  userPriceCents: 8
1422
1512
  },
1423
1513
  "kie:ad-creative-edit:gpt-image-2": {
1424
- ourCostCents: 3,
1425
- userPriceCents: 6
1514
+ ourCostCents: 4,
1515
+ userPriceCents: 8
1426
1516
  },
1427
1517
  "kie:ad-creative-edit:gpt-image-2:medium": {
1428
1518
  ourCostCents: 5,
@@ -18210,6 +18300,47 @@ var LandingRegenerationStatusResponse = z75.object({
18210
18300
  updatedAt: z75.string().datetime()
18211
18301
  });
18212
18302
 
18303
+ // ../../packages/types/src/classic-landing-selection.ts
18304
+ function buildClassicLandingSelection(document, gifs, selectedIds, images) {
18305
+ const imageChoices = new Map(images.map((image2) => [
18306
+ classicLandingBlockId({
18307
+ kind: "image",
18308
+ ownerTaskId: image2.ownerTaskId,
18309
+ sourceIndex: image2.sourceIndex
18310
+ }),
18311
+ image2
18312
+ ]));
18313
+ let imageCount = 0;
18314
+ const blocks = document.blocks.filter((block) => {
18315
+ if (block.kind === "image") return Boolean(imageChoices.get(classicLandingBlockId(block))?.selected) && imageCount++ < SHOPIFY_MAX_LANDING_IMAGES;
18316
+ const gif = gifs.find((item) => item.gifId === block.gifId && item.ownerTaskId === block.ownerTaskId);
18317
+ return selectedIds.includes(classicLandingBlockId(block)) && Boolean(gif && isDeliverableLandingGif(gif));
18318
+ });
18319
+ return {
18320
+ documentRevision: document.revision,
18321
+ blocks,
18322
+ gifs: blocks.flatMap((block) => block.kind === "gif" ? [
18323
+ {
18324
+ ownerTaskId: block.ownerTaskId,
18325
+ gifId: block.gifId,
18326
+ gifRevision: gifs.find((item) => item.gifId === block.gifId).gifRevision
18327
+ }
18328
+ ] : []),
18329
+ images: blocks.flatMap((block) => {
18330
+ if (block.kind !== "image") return [];
18331
+ const choice = imageChoices.get(classicLandingBlockId(block));
18332
+ return [
18333
+ {
18334
+ ownerTaskId: choice.ownerTaskId,
18335
+ sourceIndex: choice.sourceIndex,
18336
+ variantIndex: choice.variantIndex
18337
+ }
18338
+ ];
18339
+ })
18340
+ };
18341
+ }
18342
+ __name(buildClassicLandingSelection, "buildClassicLandingSelection");
18343
+
18213
18344
  // ../../packages/types/src/shopify-meta-tracking.ts
18214
18345
  import * as z76 from "zod";
18215
18346
  var MetaTrackingOwnerSchema = z76.enum([
@@ -18333,6 +18464,95 @@ var MetaTrackingInspectionSchema = z76.object({
18333
18464
 
18334
18465
  // ../../packages/types/src/agent-memory.ts
18335
18466
  import { z as z77 } from "zod";
18467
+
18468
+ // ../../packages/types/src/dropi-countries.ts
18469
+ var DROPI_COUNTRY_CODES = [
18470
+ "CO",
18471
+ "EC",
18472
+ "VE",
18473
+ "MX",
18474
+ "PE",
18475
+ "PA",
18476
+ "PY",
18477
+ "GT",
18478
+ "CL",
18479
+ "AR",
18480
+ "CR"
18481
+ ];
18482
+ var DROPI_COUNTRIES = {
18483
+ CO: {
18484
+ name: "Colombia",
18485
+ currency: "COP",
18486
+ timeZone: "America/Bogota",
18487
+ productionBaseUrl: "https://api.dropi.co/integrations"
18488
+ },
18489
+ EC: {
18490
+ name: "Ecuador",
18491
+ currency: "USD",
18492
+ timeZone: "America/Guayaquil",
18493
+ productionBaseUrl: "https://api.dropi.ec/integrations"
18494
+ },
18495
+ VE: {
18496
+ name: "Venezuela",
18497
+ currency: "USD",
18498
+ timeZone: "America/Caracas",
18499
+ productionBaseUrl: "https://api.dropi.com.ve/integrations"
18500
+ },
18501
+ MX: {
18502
+ name: "M\xE9xico",
18503
+ currency: "MXN",
18504
+ timeZone: "America/Mexico_City",
18505
+ productionBaseUrl: "https://api.dropi.mx/integrations"
18506
+ },
18507
+ PE: {
18508
+ name: "Per\xFA",
18509
+ currency: "PEN",
18510
+ timeZone: "America/Lima",
18511
+ productionBaseUrl: "https://api.dropi.pe/integrations"
18512
+ },
18513
+ PA: {
18514
+ name: "Panam\xE1",
18515
+ currency: "USD",
18516
+ timeZone: "America/Panama",
18517
+ productionBaseUrl: "https://api.dropi.pa/integrations"
18518
+ },
18519
+ PY: {
18520
+ name: "Paraguay",
18521
+ currency: "PYG",
18522
+ timeZone: "America/Asuncion",
18523
+ productionBaseUrl: "https://api.dropi.com.py/integrations"
18524
+ },
18525
+ GT: {
18526
+ name: "Guatemala",
18527
+ currency: "GTQ",
18528
+ timeZone: "America/Guatemala",
18529
+ productionBaseUrl: "https://api.dropi.gt/integrations"
18530
+ },
18531
+ CL: {
18532
+ name: "Chile",
18533
+ currency: "CLP",
18534
+ timeZone: "America/Santiago",
18535
+ productionBaseUrl: "https://api.dropi.cl/integrations"
18536
+ },
18537
+ AR: {
18538
+ name: "Argentina",
18539
+ currency: "ARS",
18540
+ timeZone: "America/Argentina/Buenos_Aires",
18541
+ productionBaseUrl: "https://api.dropi.ar/integrations"
18542
+ },
18543
+ CR: {
18544
+ name: "Costa Rica",
18545
+ currency: "CRC",
18546
+ timeZone: "America/Costa_Rica",
18547
+ productionBaseUrl: "https://api.dropi.cr/integrations"
18548
+ }
18549
+ };
18550
+ function isDropiCountryCode(value) {
18551
+ return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
18552
+ }
18553
+ __name(isDropiCountryCode, "isDropiCountryCode");
18554
+
18555
+ // ../../packages/types/src/agent-memory.ts
18336
18556
  var AGENT_PRODUCT_STAGES = [
18337
18557
  "researching",
18338
18558
  "testing",
@@ -18366,6 +18586,29 @@ var AGENT_MEMORY_SEARCH_SCOPES = [
18366
18586
  "pending",
18367
18587
  "playbook_history"
18368
18588
  ];
18589
+ var AGENT_SPEND_KINDS = [
18590
+ "pm_credits",
18591
+ "ad_set"
18592
+ ];
18593
+ var AGENT_SPEND_MODES = [
18594
+ "check",
18595
+ "record"
18596
+ ];
18597
+ var AGENT_RUN_PHASES = [
18598
+ "launch",
18599
+ "review",
18600
+ "evening",
18601
+ "weekly"
18602
+ ];
18603
+ var AGENT_RUN_RUNNERS = [
18604
+ "mcp",
18605
+ "server"
18606
+ ];
18607
+ var AGENT_RUN_STATUSES = [
18608
+ "running",
18609
+ "done",
18610
+ "failed"
18611
+ ];
18369
18612
  var AGENT_MEMORY_LIMITS = {
18370
18613
  codeChars: 24,
18371
18614
  nameChars: 120,
@@ -18451,6 +18694,53 @@ var SaveAgentNoteSchema = z77.object({
18451
18694
  metrics: AgentMetricsSchema.optional(),
18452
18695
  refs: AgentRefsSchema.optional()
18453
18696
  }).strict();
18697
+ var isTimeZone = /* @__PURE__ */ __name((value) => {
18698
+ try {
18699
+ new Intl.DateTimeFormat("en-US", {
18700
+ timeZone: value
18701
+ });
18702
+ return true;
18703
+ } catch {
18704
+ return false;
18705
+ }
18706
+ }, "isTimeZone");
18707
+ var SaveAgentSettingsSchema = z77.object({
18708
+ type: z77.literal("settings"),
18709
+ shopDomain: z77.string().trim().toLowerCase().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/, "Use the *.myshopify.com domain").nullable().optional(),
18710
+ metaAdAccountId: z77.string().trim().regex(/^\d{5,30}$/, "Numeric ad account id, without act_").nullable().optional(),
18711
+ metaPixelId: z77.string().trim().regex(/^\d{5,30}$/, "Numeric pixel id").nullable().optional(),
18712
+ country: z77.string().trim().length(2).toUpperCase().nullable().optional(),
18713
+ timeZone: z77.string().trim().min(1).max(64).refine(isTimeZone, "Use an IANA time zone, e.g. America/Bogota").nullable().optional(),
18714
+ dailyCreditCap: z77.number().int().min(0).max(1e7).nullable().optional(),
18715
+ dailyNewAdSetCap: z77.number().int().min(0).max(100).nullable().optional(),
18716
+ /** Sugerido por campaña; el monto real lo acuerda el vendedor. */
18717
+ adSetDailyBudget: z77.number().int().min(0).max(1e9).nullable().optional(),
18718
+ budgetCurrency: z77.string().trim().length(3).toUpperCase().nullable().optional(),
18719
+ /** Prende o apaga los turnos cada 3 horas. */
18720
+ autopilot: z77.boolean().optional()
18721
+ }).strict();
18722
+ var SaveAgentSpendSchema = z77.object({
18723
+ type: z77.literal("spend"),
18724
+ mode: z77.enum(AGENT_SPEND_MODES),
18725
+ kind: z77.enum(AGENT_SPEND_KINDS),
18726
+ amount: z77.number().int().min(1).max(1e7),
18727
+ ref: z77.string().trim().min(1).max(200).optional(),
18728
+ note: z77.string().trim().max(AGENT_MEMORY_LIMITS.verdictChars).optional()
18729
+ }).strict();
18730
+ var SaveAgentRunClaimSchema = z77.object({
18731
+ type: z77.literal("run_claim"),
18732
+ // Por esta vía solo reclama el agente por MCP; el servidor reclama por dentro.
18733
+ runner: z77.literal("mcp").default("mcp")
18734
+ }).strict();
18735
+ var SaveAgentRunCompleteSchema = z77.object({
18736
+ type: z77.literal("run_complete"),
18737
+ runId: z77.string().uuid(),
18738
+ status: z77.enum([
18739
+ "done",
18740
+ "failed"
18741
+ ]),
18742
+ summary: z77.string().trim().min(1).max(AGENT_MEMORY_LIMITS.noteChars)
18743
+ }).strict();
18454
18744
  var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18455
18745
  SaveAgentProductSchema,
18456
18746
  SaveAgentExperimentOpenSchema,
@@ -18458,7 +18748,11 @@ var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18458
18748
  SaveAgentPlaybookSchema,
18459
18749
  SaveAgentPendingAddSchema,
18460
18750
  SaveAgentPendingResolveSchema,
18461
- SaveAgentNoteSchema
18751
+ SaveAgentNoteSchema,
18752
+ SaveAgentSettingsSchema,
18753
+ SaveAgentSpendSchema,
18754
+ SaveAgentRunClaimSchema,
18755
+ SaveAgentRunCompleteSchema
18462
18756
  ]);
18463
18757
  var SaveAgentMemoryRequestSchema = z77.object({
18464
18758
  memory: SaveAgentMemorySchema
@@ -18542,7 +18836,69 @@ var AgentPlaybookSchema = z77.object({
18542
18836
  body: z77.string(),
18543
18837
  createdAt: z77.string()
18544
18838
  });
18839
+ var AgentSettingsSchema = z77.object({
18840
+ shopDomain: z77.string().nullable(),
18841
+ metaAdAccountId: z77.string().nullable(),
18842
+ metaPixelId: z77.string().nullable(),
18843
+ /** Null hasta que el contexto del vendedor lo diga. */
18844
+ country: z77.string().nullable(),
18845
+ /** La zona con la que se cuenta «hoy»: la guardada, la del país o UTC. */
18846
+ timeZone: z77.string(),
18847
+ /** True si `timeZone` viene del país o de UTC y no de una elección guardada. */
18848
+ timeZoneDerived: z77.boolean(),
18849
+ /** Null = sin tope: solo existe si el vendedor lo pidió. */
18850
+ dailyCreditCap: z77.number().int().nullable(),
18851
+ dailyNewAdSetCap: z77.number().int().nullable(),
18852
+ /** Sugerido por campaña; null = se acuerda con el vendedor. Nunca un tope. */
18853
+ adSetDailyBudget: z77.number().int().nullable(),
18854
+ /** La guardada, la del país o COP si aún no se sabe. */
18855
+ budgetCurrency: z77.string(),
18856
+ autopilot: z77.boolean(),
18857
+ /** Null mientras la cuenta no ha guardado nada. */
18858
+ updatedAt: z77.string().nullable()
18859
+ });
18860
+ var AgentBudgetLineSchema = z77.object({
18861
+ used: z77.number().int(),
18862
+ /** Null = sin tope. */
18863
+ cap: z77.number().int().nullable(),
18864
+ remaining: z77.number().int().nullable()
18865
+ });
18866
+ var AgentBudgetSchema = z77.object({
18867
+ day: z77.string(),
18868
+ timeZone: z77.string(),
18869
+ pm_credits: AgentBudgetLineSchema,
18870
+ ad_set: AgentBudgetLineSchema
18871
+ });
18872
+ var AgentSpendResultSchema = z77.object({
18873
+ mode: z77.enum(AGENT_SPEND_MODES),
18874
+ kind: z77.enum(AGENT_SPEND_KINDS),
18875
+ amount: z77.number().int(),
18876
+ /** check: si el monto cabe en lo que queda hoy. record: siempre true. */
18877
+ fits: z77.boolean(),
18878
+ ref: z77.string().nullable(),
18879
+ budget: AgentBudgetSchema
18880
+ });
18881
+ var AgentRunSchema = z77.object({
18882
+ id: z77.string(),
18883
+ slot: z77.string(),
18884
+ phase: z77.enum(AGENT_RUN_PHASES),
18885
+ runner: z77.enum(AGENT_RUN_RUNNERS),
18886
+ status: z77.enum(AGENT_RUN_STATUSES),
18887
+ summary: z77.string().nullable(),
18888
+ startedAt: z77.string(),
18889
+ finishedAt: z77.string().nullable()
18890
+ });
18545
18891
  var AgentMemoryBriefSchema = z77.object({
18892
+ settings: AgentSettingsSchema,
18893
+ budget: AgentBudgetSchema,
18894
+ /** El turno de ahora (null fuera de horario) y si ya alguien lo corrió. */
18895
+ currentSlot: z77.object({
18896
+ slot: z77.string(),
18897
+ phase: z77.enum(AGENT_RUN_PHASES),
18898
+ run: AgentRunSchema.nullable()
18899
+ }).nullable(),
18900
+ /** Los últimos turnos, del más reciente al más viejo. */
18901
+ recentRuns: z77.array(AgentRunSchema),
18546
18902
  playbook: AgentPlaybookSchema.nullable(),
18547
18903
  products: z77.array(AgentProductSchema),
18548
18904
  openExperiments: z77.array(AgentExperimentSchema),
@@ -18572,7 +18928,11 @@ var AgentMemorySaveResultSchema = z77.discriminatedUnion("type", [
18572
18928
  saved("playbook", AgentPlaybookSchema),
18573
18929
  saved("pending_add", AgentPendingItemSchema),
18574
18930
  saved("pending_resolve", AgentPendingItemSchema),
18575
- saved("note", AgentNoteSchema)
18931
+ saved("note", AgentNoteSchema),
18932
+ saved("settings", AgentSettingsSchema),
18933
+ saved("spend", AgentSpendResultSchema),
18934
+ saved("run_claim", AgentRunSchema),
18935
+ saved("run_complete", AgentRunSchema)
18576
18936
  ]);
18577
18937
 
18578
18938
  // ../../packages/types/src/video-edit.ts
@@ -22498,93 +22858,6 @@ var LinkableCampaignsResponseSchema = z97.object({
22498
22858
  // ../../packages/types/src/finance-operation.ts
22499
22859
  import { z as z98 } from "zod";
22500
22860
 
22501
- // ../../packages/types/src/dropi-countries.ts
22502
- var DROPI_COUNTRY_CODES = [
22503
- "CO",
22504
- "EC",
22505
- "VE",
22506
- "MX",
22507
- "PE",
22508
- "PA",
22509
- "PY",
22510
- "GT",
22511
- "CL",
22512
- "AR",
22513
- "CR"
22514
- ];
22515
- var DROPI_COUNTRIES = {
22516
- CO: {
22517
- name: "Colombia",
22518
- currency: "COP",
22519
- timeZone: "America/Bogota",
22520
- productionBaseUrl: "https://api.dropi.co/integrations"
22521
- },
22522
- EC: {
22523
- name: "Ecuador",
22524
- currency: "USD",
22525
- timeZone: "America/Guayaquil",
22526
- productionBaseUrl: "https://api.dropi.ec/integrations"
22527
- },
22528
- VE: {
22529
- name: "Venezuela",
22530
- currency: "USD",
22531
- timeZone: "America/Caracas",
22532
- productionBaseUrl: "https://api.dropi.com.ve/integrations"
22533
- },
22534
- MX: {
22535
- name: "M\xE9xico",
22536
- currency: "MXN",
22537
- timeZone: "America/Mexico_City",
22538
- productionBaseUrl: "https://api.dropi.mx/integrations"
22539
- },
22540
- PE: {
22541
- name: "Per\xFA",
22542
- currency: "PEN",
22543
- timeZone: "America/Lima",
22544
- productionBaseUrl: "https://api.dropi.pe/integrations"
22545
- },
22546
- PA: {
22547
- name: "Panam\xE1",
22548
- currency: "USD",
22549
- timeZone: "America/Panama",
22550
- productionBaseUrl: "https://api.dropi.pa/integrations"
22551
- },
22552
- PY: {
22553
- name: "Paraguay",
22554
- currency: "PYG",
22555
- timeZone: "America/Asuncion",
22556
- productionBaseUrl: "https://api.dropi.com.py/integrations"
22557
- },
22558
- GT: {
22559
- name: "Guatemala",
22560
- currency: "GTQ",
22561
- timeZone: "America/Guatemala",
22562
- productionBaseUrl: "https://api.dropi.gt/integrations"
22563
- },
22564
- CL: {
22565
- name: "Chile",
22566
- currency: "CLP",
22567
- timeZone: "America/Santiago",
22568
- productionBaseUrl: "https://api.dropi.cl/integrations"
22569
- },
22570
- AR: {
22571
- name: "Argentina",
22572
- currency: "ARS",
22573
- timeZone: "America/Argentina/Buenos_Aires",
22574
- productionBaseUrl: "https://api.dropi.ar/integrations"
22575
- },
22576
- CR: {
22577
- name: "Costa Rica",
22578
- currency: "CRC",
22579
- timeZone: "America/Costa_Rica",
22580
- productionBaseUrl: "https://api.dropi.cr/integrations"
22581
- }
22582
- };
22583
- function isDropiCountryCode(value) {
22584
- return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
22585
- }
22586
- __name(isDropiCountryCode, "isDropiCountryCode");
22587
-
22588
22861
  // ../../packages/types/src/finance-country-timezones.ts
22589
22862
  var FINANCE_COUNTRY_TIME_ZONES = Object.freeze({
22590
22863
  US: "America/New_York",
@@ -25649,7 +25922,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25649
25922
  ], MCP_ONLY_CHANNEL_EXPOSURE),
25650
25923
  defineCapability(
25651
25924
  "save_agent_memory",
25652
- "4199ce3debc7266b3db30b5d7e3424d2c698b78309d49d20959460ab2de283a8",
25925
+ "46ddddd8ae1475dd880215696499016bbec5f961891748b82095cbf7f7a49c0c",
25653
25926
  // La memoria es el cuaderno del propio agente: no toca nada que vea el
25654
25927
  // comprador ni cobra créditos, así que escribir no pide confirmación.
25655
25928
  "none",
@@ -30083,7 +30356,7 @@ var ApiClient = class {
30083
30356
  };
30084
30357
 
30085
30358
  // src/index.ts
30086
- var MCP_VERSION = "12.8.0";
30359
+ var MCP_VERSION = "12.9.0";
30087
30360
 
30088
30361
  // src/meta-upload-app.ts
30089
30362
  import { readFileSync } from "fs";
@@ -38086,7 +38359,9 @@ function registerPublishTools(server, api, opts = {}) {
38086
38359
  const selectedLandingGif = includeLandingGif ? defaults?.gif ?? null : null;
38087
38360
  const effectiveAvailable = availableImages > 0 ? availableImages : 3;
38088
38361
  const numImages = Math.min(parsed.numLandingImages ?? effectiveAvailable, effectiveAvailable, SHOPIFY_MAX_LANDING_IMAGES);
38089
- const selectedLandingImages = Array.from({
38362
+ const classic = includeLandingGif && defaults && variantIndex === 0 ? buildMcpClassicSelection(defaults, numImages) : null;
38363
+ const classicSelection = classic?.selection ?? null;
38364
+ const selectedLandingImages = classic?.images ?? Array.from({
38090
38365
  length: numImages
38091
38366
  }, (_, i) => ({
38092
38367
  imageIndex: i,
@@ -38100,7 +38375,13 @@ function registerPublishTools(server, api, opts = {}) {
38100
38375
  }),
38101
38376
  shopDomain: parsed.shopDomain,
38102
38377
  selectedLandingImages,
38103
- ...selectedLandingGif ? {
38378
+ // Classic block landings publish their GIF blocks through the
38379
+ // ordered document, exactly like the web editor; the legacy
38380
+ // primary GIF only rides selectedLandingGif.
38381
+ ...classicSelection ? {
38382
+ classicSelection,
38383
+ selectedLandingGif: null
38384
+ } : selectedLandingGif ? {
38104
38385
  selectedLandingGif
38105
38386
  } : {},
38106
38387
  showVariantPicker: parsed.showVariantPicker,
@@ -38395,23 +38676,65 @@ async function fetchLandingPublishDefaults(api, taskId) {
38395
38676
  const r = await api.getJson(`/v1/results/${encodeURIComponent(taskId)}`);
38396
38677
  if (!isRecord3(r) || !isRecord3(r.landing)) return {
38397
38678
  imageCount: 0,
38398
- gif: null
38679
+ images: [],
38680
+ gif: null,
38681
+ classic: null
38399
38682
  };
38400
- const images = r.landing.images;
38683
+ const rawImages = Array.isArray(r.landing.images) ? r.landing.images : [];
38684
+ const images = rawImages.map((image2) => {
38685
+ const record = isRecord3(image2) ? image2 : {};
38686
+ return {
38687
+ ownerTaskId: typeof record.variantTaskId === "string" ? record.variantTaskId : taskId,
38688
+ sourceIndex: Number(record.sourceIndex ?? record.index)
38689
+ };
38690
+ });
38401
38691
  const demo = LandingGifReadableSchema.safeParse(r.landing.demoGif);
38402
38692
  const gif = demo.success && demo.data.ownerTaskId === taskId && demo.data.quality.verdict === "passed" ? {
38403
38693
  ownerTaskId: taskId,
38404
38694
  gifRevision: demo.data.gifRevision
38405
38695
  } : null;
38696
+ const document = ClassicLandingDocumentSchema.safeParse(r.landing.classicDocument);
38697
+ const gifs = (Array.isArray(r.landing.gifBlocks) ? r.landing.gifBlocks : []).flatMap((entry) => {
38698
+ const parsed = LandingGifItemSchema.safeParse(entry);
38699
+ return parsed.success ? [
38700
+ parsed.data
38701
+ ] : [];
38702
+ });
38406
38703
  return {
38407
- imageCount: Array.isArray(images) ? images.length : 0,
38408
- gif
38704
+ imageCount: rawImages.length,
38705
+ images,
38706
+ gif,
38707
+ classic: document.success ? {
38708
+ document: document.data,
38709
+ gifs
38710
+ } : null
38409
38711
  };
38410
38712
  } catch {
38411
38713
  return null;
38412
38714
  }
38413
38715
  }
38414
38716
  __name(fetchLandingPublishDefaults, "fetchLandingPublishDefaults");
38717
+ function buildMcpClassicSelection(defaults, numImages) {
38718
+ if (!defaults.classic) return null;
38719
+ const { document, gifs } = defaults.classic;
38720
+ const gifBlockIds = document.blocks.flatMap((block) => block.kind === "gif" && gifs.some((item) => item.gifId === block.gifId && item.ownerTaskId === block.ownerTaskId && isDeliverableLandingGif(item)) ? [
38721
+ classicLandingBlockId(block)
38722
+ ] : []);
38723
+ if (gifBlockIds.length === 0) return null;
38724
+ const selection = buildClassicLandingSelection(document, gifs, gifBlockIds, defaults.images.map((image2, arrayIndex) => ({
38725
+ ...image2,
38726
+ selected: arrayIndex < numImages,
38727
+ variantIndex: 0
38728
+ })));
38729
+ return {
38730
+ selection,
38731
+ images: (selection.images ?? []).map((selected) => ({
38732
+ imageIndex: defaults.images.findIndex((image2) => image2.ownerTaskId === selected.ownerTaskId && image2.sourceIndex === selected.sourceIndex),
38733
+ variantIndex: selected.variantIndex
38734
+ }))
38735
+ };
38736
+ }
38737
+ __name(buildMcpClassicSelection, "buildMcpClassicSelection");
38415
38738
  function toMetaCampaignOverrides(cfg) {
38416
38739
  const out = {};
38417
38740
  if (cfg.dailyBudgetUsd !== void 0) out.dailyBudgetUsd = cfg.dailyBudgetUsd;
@@ -40265,7 +40588,7 @@ function queryString(values) {
40265
40588
  __name(queryString, "queryString");
40266
40589
  function registerAgentMemoryTools(server, api) {
40267
40590
  server.registerTool("get_agent_memory_brief", {
40268
- 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.",
40591
+ 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.",
40269
40592
  inputSchema: BriefInput.shape,
40270
40593
  annotations: READS_INTERNAL
40271
40594
  }, async (input) => {
@@ -40287,7 +40610,7 @@ function registerAgentMemoryTools(server, api) {
40287
40610
  }
40288
40611
  });
40289
40612
  server.registerTool("save_agent_memory", {
40290
- 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.',
40613
+ 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.',
40291
40614
  inputSchema: SaveInput.shape,
40292
40615
  annotations: OVERWRITES_INTERNAL
40293
40616
  }, async (input) => {