@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/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,
@@ -18374,6 +18464,95 @@ var MetaTrackingInspectionSchema = z76.object({
18374
18464
 
18375
18465
  // ../../packages/types/src/agent-memory.ts
18376
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
18377
18556
  var AGENT_PRODUCT_STAGES = [
18378
18557
  "researching",
18379
18558
  "testing",
@@ -18407,6 +18586,29 @@ var AGENT_MEMORY_SEARCH_SCOPES = [
18407
18586
  "pending",
18408
18587
  "playbook_history"
18409
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
+ ];
18410
18612
  var AGENT_MEMORY_LIMITS = {
18411
18613
  codeChars: 24,
18412
18614
  nameChars: 120,
@@ -18492,6 +18694,53 @@ var SaveAgentNoteSchema = z77.object({
18492
18694
  metrics: AgentMetricsSchema.optional(),
18493
18695
  refs: AgentRefsSchema.optional()
18494
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();
18495
18744
  var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18496
18745
  SaveAgentProductSchema,
18497
18746
  SaveAgentExperimentOpenSchema,
@@ -18499,7 +18748,11 @@ var SaveAgentMemorySchema = z77.discriminatedUnion("type", [
18499
18748
  SaveAgentPlaybookSchema,
18500
18749
  SaveAgentPendingAddSchema,
18501
18750
  SaveAgentPendingResolveSchema,
18502
- SaveAgentNoteSchema
18751
+ SaveAgentNoteSchema,
18752
+ SaveAgentSettingsSchema,
18753
+ SaveAgentSpendSchema,
18754
+ SaveAgentRunClaimSchema,
18755
+ SaveAgentRunCompleteSchema
18503
18756
  ]);
18504
18757
  var SaveAgentMemoryRequestSchema = z77.object({
18505
18758
  memory: SaveAgentMemorySchema
@@ -18583,7 +18836,69 @@ var AgentPlaybookSchema = z77.object({
18583
18836
  body: z77.string(),
18584
18837
  createdAt: z77.string()
18585
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
+ });
18586
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),
18587
18902
  playbook: AgentPlaybookSchema.nullable(),
18588
18903
  products: z77.array(AgentProductSchema),
18589
18904
  openExperiments: z77.array(AgentExperimentSchema),
@@ -18613,7 +18928,11 @@ var AgentMemorySaveResultSchema = z77.discriminatedUnion("type", [
18613
18928
  saved("playbook", AgentPlaybookSchema),
18614
18929
  saved("pending_add", AgentPendingItemSchema),
18615
18930
  saved("pending_resolve", AgentPendingItemSchema),
18616
- 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)
18617
18936
  ]);
18618
18937
 
18619
18938
  // ../../packages/types/src/video-edit.ts
@@ -22539,93 +22858,6 @@ var LinkableCampaignsResponseSchema = z97.object({
22539
22858
  // ../../packages/types/src/finance-operation.ts
22540
22859
  import { z as z98 } from "zod";
22541
22860
 
22542
- // ../../packages/types/src/dropi-countries.ts
22543
- var DROPI_COUNTRY_CODES = [
22544
- "CO",
22545
- "EC",
22546
- "VE",
22547
- "MX",
22548
- "PE",
22549
- "PA",
22550
- "PY",
22551
- "GT",
22552
- "CL",
22553
- "AR",
22554
- "CR"
22555
- ];
22556
- var DROPI_COUNTRIES = {
22557
- CO: {
22558
- name: "Colombia",
22559
- currency: "COP",
22560
- timeZone: "America/Bogota",
22561
- productionBaseUrl: "https://api.dropi.co/integrations"
22562
- },
22563
- EC: {
22564
- name: "Ecuador",
22565
- currency: "USD",
22566
- timeZone: "America/Guayaquil",
22567
- productionBaseUrl: "https://api.dropi.ec/integrations"
22568
- },
22569
- VE: {
22570
- name: "Venezuela",
22571
- currency: "USD",
22572
- timeZone: "America/Caracas",
22573
- productionBaseUrl: "https://api.dropi.com.ve/integrations"
22574
- },
22575
- MX: {
22576
- name: "M\xE9xico",
22577
- currency: "MXN",
22578
- timeZone: "America/Mexico_City",
22579
- productionBaseUrl: "https://api.dropi.mx/integrations"
22580
- },
22581
- PE: {
22582
- name: "Per\xFA",
22583
- currency: "PEN",
22584
- timeZone: "America/Lima",
22585
- productionBaseUrl: "https://api.dropi.pe/integrations"
22586
- },
22587
- PA: {
22588
- name: "Panam\xE1",
22589
- currency: "USD",
22590
- timeZone: "America/Panama",
22591
- productionBaseUrl: "https://api.dropi.pa/integrations"
22592
- },
22593
- PY: {
22594
- name: "Paraguay",
22595
- currency: "PYG",
22596
- timeZone: "America/Asuncion",
22597
- productionBaseUrl: "https://api.dropi.com.py/integrations"
22598
- },
22599
- GT: {
22600
- name: "Guatemala",
22601
- currency: "GTQ",
22602
- timeZone: "America/Guatemala",
22603
- productionBaseUrl: "https://api.dropi.gt/integrations"
22604
- },
22605
- CL: {
22606
- name: "Chile",
22607
- currency: "CLP",
22608
- timeZone: "America/Santiago",
22609
- productionBaseUrl: "https://api.dropi.cl/integrations"
22610
- },
22611
- AR: {
22612
- name: "Argentina",
22613
- currency: "ARS",
22614
- timeZone: "America/Argentina/Buenos_Aires",
22615
- productionBaseUrl: "https://api.dropi.ar/integrations"
22616
- },
22617
- CR: {
22618
- name: "Costa Rica",
22619
- currency: "CRC",
22620
- timeZone: "America/Costa_Rica",
22621
- productionBaseUrl: "https://api.dropi.cr/integrations"
22622
- }
22623
- };
22624
- function isDropiCountryCode(value) {
22625
- return typeof value === "string" && DROPI_COUNTRY_CODES.some((code) => code === value);
22626
- }
22627
- __name(isDropiCountryCode, "isDropiCountryCode");
22628
-
22629
22861
  // ../../packages/types/src/finance-country-timezones.ts
22630
22862
  var FINANCE_COUNTRY_TIME_ZONES = Object.freeze({
22631
22863
  US: "America/New_York",
@@ -25690,7 +25922,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25690
25922
  ], MCP_ONLY_CHANNEL_EXPOSURE),
25691
25923
  defineCapability(
25692
25924
  "save_agent_memory",
25693
- "4199ce3debc7266b3db30b5d7e3424d2c698b78309d49d20959460ab2de283a8",
25925
+ "46ddddd8ae1475dd880215696499016bbec5f961891748b82095cbf7f7a49c0c",
25694
25926
  // La memoria es el cuaderno del propio agente: no toca nada que vea el
25695
25927
  // comprador ni cobra créditos, así que escribir no pide confirmación.
25696
25928
  "none",
@@ -30124,7 +30356,7 @@ var ApiClient = class {
30124
30356
  };
30125
30357
 
30126
30358
  // src/index.ts
30127
- var MCP_VERSION = "12.8.1";
30359
+ var MCP_VERSION = "12.9.0";
30128
30360
 
30129
30361
  // src/meta-upload-app.ts
30130
30362
  import { readFileSync } from "fs";
@@ -40356,7 +40588,7 @@ function queryString(values) {
40356
40588
  __name(queryString, "queryString");
40357
40589
  function registerAgentMemoryTools(server, api) {
40358
40590
  server.registerTool("get_agent_memory_brief", {
40359
- 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.",
40360
40592
  inputSchema: BriefInput.shape,
40361
40593
  annotations: READS_INTERNAL
40362
40594
  }, async (input) => {
@@ -40378,7 +40610,7 @@ function registerAgentMemoryTools(server, api) {
40378
40610
  }
40379
40611
  });
40380
40612
  server.registerTool("save_agent_memory", {
40381
- 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.',
40382
40614
  inputSchema: SaveInput.shape,
40383
40615
  annotations: OVERWRITES_INTERNAL
40384
40616
  }, async (input) => {