@productmaker/mcp 12.14.1 → 12.16.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 +93 -11
  2. package/dist/stdio.js +93 -11
  3. package/package.json +1 -1
package/dist/http.js CHANGED
@@ -12629,9 +12629,21 @@ var LandingPixel = z41.object({
12629
12629
  /** Whether the next publish keeps it, from the saved choice or the default. */
12630
12630
  selected: z41.boolean()
12631
12631
  });
12632
+ var ShopifyAppPixel = z41.object({
12633
+ key: LandingPixelKey,
12634
+ provider: LandingPixelProvider,
12635
+ pixelId: z41.string(),
12636
+ /** The app's name as sellers know it, e.g. "Facebook & Instagram". */
12637
+ appName: z41.string().min(1).max(80)
12638
+ });
12632
12639
  var ShopifyLandingPixelsResponse = z41.object({
12633
12640
  shopDomain: z41.string(),
12634
12641
  pixels: z41.array(LandingPixel),
12642
+ /**
12643
+ * Pixels Shopify apps load on the whole store. Empty when the storefront
12644
+ * could not be read (password, timeout): the selection works the same.
12645
+ */
12646
+ appPixels: z41.array(ShopifyAppPixel).default([]),
12635
12647
  /** The theme holds tracking code we do not recognize and never copy. */
12636
12648
  unrecognizedCodeDetected: z41.boolean()
12637
12649
  });
@@ -12715,6 +12727,43 @@ var ShopifyPublicationMode = z42.enum([
12715
12727
  "existing",
12716
12728
  "new"
12717
12729
  ]);
12730
+ var ShopifyShippingCheckRequest = z42.object({
12731
+ shopDomain: z42.string().min(3).max(120),
12732
+ publicationMode: ShopifyPublicationMode,
12733
+ targetProductId: z42.string().min(1).max(300).optional()
12734
+ });
12735
+ var ShopifyShippingCheckResponse = z42.object({
12736
+ warning: z42.discriminatedUnion("code", [
12737
+ z42.object({
12738
+ code: z42.enum([
12739
+ "MARKET_INACTIVE",
12740
+ "NO_SHIPPING_RATE"
12741
+ ]),
12742
+ country: z42.string().regex(/^[A-Z]{2}$/),
12743
+ locationName: z42.string().optional(),
12744
+ settingsUrl: z42.string().url()
12745
+ }),
12746
+ z42.object({
12747
+ code: z42.literal("OFFER_UNAVAILABLE"),
12748
+ units: z42.number().int().positive(),
12749
+ settingsUrl: z42.string().url()
12750
+ })
12751
+ ]).nullable()
12752
+ });
12753
+ function shopifyPublishAdvisoryMessage(warning) {
12754
+ if (warning.code === "OFFER_UNAVAILABLE") {
12755
+ const unit = warning.units === 1 ? "unidad" : "unidades";
12756
+ return `La oferta de ${warning.units} ${unit} no est\xE1 disponible para comprar.`;
12757
+ }
12758
+ const country = new Intl.DisplayNames([
12759
+ "es"
12760
+ ], {
12761
+ type: "region"
12762
+ }).of(warning.country);
12763
+ if (warning.code === "MARKET_INACTIVE") return `${country} no tiene un mercado activo.`;
12764
+ return warning.locationName ? `Falta una tarifa de env\xEDo para ${country} en ${warning.locationName}.` : `Falta una tarifa de env\xEDo para ${country}.`;
12765
+ }
12766
+ __name(shopifyPublishAdvisoryMessage, "shopifyPublishAdvisoryMessage");
12718
12767
  var SHOPIFY_ANNOUNCEMENT_BAR_MAX_LENGTH = 160;
12719
12768
  var ShopifyPublishRequest = z42.object({
12720
12769
  /** Correlates a mutation with read-only recovery after a lost response. */
@@ -25333,7 +25382,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25333
25382
  ], [
25334
25383
  "landing_pixel"
25335
25384
  ]),
25336
- defineCapability("list_shopify_products", "c3daf527e345f737c8b23eb347b77fbf2290433257753122a8d55fdc65d58e78", "none", "read_only", [
25385
+ defineCapability("list_shopify_products", "9c0e51d1c0026539d635b043e1fa3a7903ffee31a13fd732578641104d085a8f", "none", "read_only", [
25337
25386
  "read"
25338
25387
  ], [
25339
25388
  slot("shop", true, [
@@ -25344,7 +25393,13 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25344
25393
  ]),
25345
25394
  slot("task", false, [
25346
25395
  "taskId"
25347
- ])
25396
+ ]),
25397
+ slot("publication_mode", false, [
25398
+ "publicationMode"
25399
+ ], []),
25400
+ slot("target_product", false, [
25401
+ "targetProductId"
25402
+ ], [])
25348
25403
  ], [
25349
25404
  "shop"
25350
25405
  ], [
@@ -31940,7 +31995,7 @@ var START_DROPSHIPPING_PROMPT = [
31940
31995
  "",
31941
31996
  "Use the existing creative/task tools for generation, preserve their estimate and confirmation gates, and keep polling get_task_status until the task is done, errored, or paused \u2014 a timed-out poll means it is still running, so call again. When it pauses, show me the draft and ask me; only answer it yourself through resolve_pending_action if I delegated that decision to you or the task runs with aiDecidesAll / reviewMode automatic. Verify actual outputs before calling the creative stage complete.",
31942
31997
  "",
31943
- "Before Shopify publication, call list_shopify_shops, check the real task readiness, ask whether the product has variants, show the intended publication, and wait for explicit approval before calling publish_to_shopify. Report the exact blocker when publication is not ready. If recovery is needs_input, show every typed issue and ask me for missing values. Only send commerceCorrection with confirmed:true after I confirm the exact currency, unit price and pack totals. Never invent prices, convert currency or erase the offer. If the context changed, review it again; open_editor means use the ProductMaker editor. Saved corrections do not prove publication: verify uncertain results before another attempt.",
31998
+ "Before Shopify publication, call list_shopify_shops, check the real task readiness and ask whether the product has variants. Call list_shopify_products with taskId and the intended publicationMode (and targetProductId for existing) to check the selected destination. Show any warning and its Shopify link with the intended publication, then wait for explicit approval before calling publish_to_shopify. Warnings do not block publication. Report the exact blocker when publication is not ready. If recovery is needs_input, show every typed issue and ask me for missing values. Only send commerceCorrection with confirmed:true after I confirm the exact currency, unit price and pack totals. Never invent prices, convert currency or erase the offer. If the context changed, review it again; open_editor means use the ProductMaker editor. Saved corrections do not prove publication: verify uncertain results before another attempt.",
31944
31999
  "",
31945
32000
  "Before Meta publication, call list_meta_destinations, show the available Business portfolios, ad accounts and Facebook Pages, and let me choose the exact portfolioId, adAccountId and pageId; never choose the first option silently. Then collect budget, country and optional tracking inputs, show the intended mutation, and wait for explicit approval. Use publish_to_meta for one task or publish_creatives_to_meta for selected assets across tasks/media. ProductMaker campaigns must remain PAUSED and require manual activation. Use get_meta_campaign_status only to verify the created campaign.",
31946
32001
  "",
@@ -32384,7 +32439,7 @@ var ApiClient = class {
32384
32439
  };
32385
32440
 
32386
32441
  // src/index.ts
32387
- var MCP_VERSION = "12.14.1";
32442
+ var MCP_VERSION = "12.16.0";
32388
32443
 
32389
32444
  // src/meta-upload-app.ts
32390
32445
  import { readFileSync } from "fs";
@@ -39667,28 +39722,55 @@ function registerConnectionTools(server, api) {
39667
39722
  }
39668
39723
  });
39669
39724
  server.registerTool("list_shopify_products", {
39670
- description: listShopifyProductsGuidance.summary + ' Usa el `id` devuelto junto con `publicationMode="existing"` en `publish_to_shopify`. Si `taskId` se proporciona, la respuesta tambi\xE9n indica el producto publicado actualmente para esa tarea y tienda. No modifica Shopify.',
39725
+ description: listShopifyProductsGuidance.summary + ' Usa el `id` devuelto junto con `publicationMode="existing"` en `publish_to_shopify`. Con `taskId` puedes ver el producto publicado actualmente. Antes de pedir confirmaci\xF3n para publicar, vuelve a llamar con `taskId` y el `publicationMode` elegido (`auto`, `new` o `existing` con `targetProductId`). Si tambi\xE9n pasas `query`, devuelve el cat\xE1logo junto al chequeo. Si devuelve `warning`, muestra su `message` y `settingsUrl`; el aviso permite continuar. No modifica Shopify.',
39671
39726
  inputSchema: z149.object({
39672
39727
  shopDomain: z149.string().min(3).max(120),
39673
39728
  query: z149.string().trim().max(120).optional(),
39674
- taskId: z149.string().guid().optional()
39729
+ taskId: z149.string().guid().optional(),
39730
+ publicationMode: ShopifyPublicationMode.optional(),
39731
+ targetProductId: z149.string().min(1).max(300).optional()
39675
39732
  }).shape,
39676
39733
  annotations: READS_EXTERNAL
39677
- }, async ({ shopDomain, query, taskId }) => {
39734
+ }, async ({ shopDomain, query, taskId, publicationMode, targetProductId }) => {
39678
39735
  try {
39736
+ if (publicationMode && (!taskId || publicationMode === "existing" && !targetProductId)) {
39737
+ return {
39738
+ isError: true,
39739
+ content: [
39740
+ {
39741
+ type: "text",
39742
+ text: "Indica taskId y, para existing, tambi\xE9n targetProductId."
39743
+ }
39744
+ ]
39745
+ };
39746
+ }
39679
39747
  const params = new URLSearchParams({
39680
39748
  shopDomain
39681
39749
  });
39682
39750
  if (query) params.set("query", query);
39683
39751
  if (taskId) params.set("taskId", taskId);
39684
- const r = await api.getJson(`/v1/shopify/products?${params.toString()}`);
39685
- return asText(r);
39752
+ const [catalog, advisory] = await Promise.all([
39753
+ !publicationMode || query ? api.getJson(`/v1/shopify/products?${params.toString()}`) : {},
39754
+ publicationMode && taskId ? api.postJson(`/v1/tasks/${encodeURIComponent(taskId)}/publish/shopify/shipping-check`, {
39755
+ shopDomain,
39756
+ publicationMode,
39757
+ targetProductId
39758
+ }).then((response) => ShopifyShippingCheckResponse.parse(response)) : null
39759
+ ]);
39760
+ const warning = advisory?.warning;
39761
+ return asText(warning ? {
39762
+ ...catalog,
39763
+ warning: {
39764
+ ...warning,
39765
+ message: shopifyPublishAdvisoryMessage(warning)
39766
+ }
39767
+ } : catalog);
39686
39768
  } catch (e) {
39687
39769
  throw translateError(e);
39688
39770
  }
39689
39771
  });
39690
39772
  server.registerTool("list_shopify_landing_pixels", {
39691
- description: listShopifyLandingPixelsGuidance.summary + ' Cada pixel trae `key`, `provider`, `pixelId`, `source` ("theme" = est\xE1 en el tema, "landing" = solo en la landing, "manual" = lo agreg\xF3 la persona) y `selected` (si quedar\xE1 en la landing). Mu\xE9straselos en lenguaje simple antes de `publish_to_shopify` y pregunta cu\xE1les quitar o si agrega uno nuevo; luego pasa la elecci\xF3n en `landingPixels`. Si `unrecognizedCodeDetected` es true, avisa que hay c\xF3digo de seguimiento que no se pudo leer y no se copia. No modifica Shopify.',
39773
+ description: listShopifyLandingPixelsGuidance.summary + ' Cada pixel trae `key`, `provider`, `pixelId`, `source` ("theme" = est\xE1 en el tema, "landing" = solo en la landing, "manual" = lo agreg\xF3 la persona) y `selected` (si quedar\xE1 en la landing). Mu\xE9straselos en lenguaje simple antes de `publish_to_shopify` y pregunta cu\xE1les quitar o si agrega uno nuevo; luego pasa la elecci\xF3n en `landingPixels`. `appPixels` son los p\xEDxeles que una app de Shopify carga en toda la tienda (`provider`, `pixelId`, `appName`): mu\xE9stralos como "viene de la app <appName>", sin ofrecer quitarlos (solo se quitan desde esa app) y nunca los pongas en `landingPixels`. Si `unrecognizedCodeDetected` es true, avisa que hay c\xF3digo de seguimiento que no se pudo leer y no se copia. No modifica Shopify.',
39692
39774
  inputSchema: z149.object({
39693
39775
  shopDomain: z149.string().min(3).max(120)
39694
39776
  }).shape,
@@ -40259,7 +40341,7 @@ var TikTokInput = z151.object({
40259
40341
  function registerPublishTools(server, api, opts = {}) {
40260
40342
  const transport = opts.transport ?? "http";
40261
40343
  server.registerTool("publish_to_shopify", {
40262
- description: publishToShopifyGuidance.summary + " Precondici\xF3n: la tarea debe estar en status='complete' \u2014 usa `get_task_status` antes. Por defecto `publicationMode=auto`: si esta tarea ya fue publicada en esa tienda, actualiza ESE MISMO producto y conserva URL, precio, variantes, inventario y SKU; si no, crea uno. Usa `existing` + `targetProductId` cuando el usuario elija otro producto y `new` s\xF3lo si pide crear uno nuevo. ANTES de llamar preg\xFAntale \"\xBFTu producto tiene variantes (talla, color, etc.)?\" y pasa `showVariantPicker: true` si responde que s\xED. Por defecto publica TODAS las im\xE1genes generadas; pasa `numLandingImages` s\xF3lo si el usuario pide menos. Tambi\xE9n publica el GIF de la landing si la tarea tiene uno aprobado por QA; pasa `includeLandingGif: false` s\xF3lo si el usuario no lo quiere. En code landings con una oferta expl\xEDcita de packs, ProductMaker s\xF3lo publica el selector si variantes reales de Shopify cobran los totales exactos; la respuesta explica si las cre\xF3, verific\xF3 o descart\xF3 por no existir ahorro. Si devuelve SHOPIFY_PUBLISH_INPUT_REQUIRED, muestra todos los problemas de recovery y solicita los importes faltantes. Solo env\xEDa commerceCorrection con su revisi\xF3n/huella y confirmed:true despu\xE9s de confirmar los valores exactos; nunca inventes importes, conviertas moneda ni elimines ofertas. Si adem\xE1s trae correctionRejected, lo que el vendedor confirm\xF3 fue rechazado: l\xE9ele `reason` ANTES de volver a pedir datos. Un contexto obsoleto requiere volver a revisar; open_editor (incluido SHOPIFY_PUBLISH_CORRECTION_NOT_CONVERGED) requiere el editor de ProductMaker y NO se reenv\xEDa la misma correcci\xF3n. SHOPIFY_PUBLISH_VERIFICATION_FAILED trae en `reason` el siguiente paso: reintenta una vez y si se repite sigue ese paso. P\xEDxeles (landing cl\xE1sica): antes de publicar llama `list_shopify_landing_pixels`, mu\xE9strale a la persona los p\xEDxeles que quedar\xE1n y preg\xFAntale si quiere quitar alguno o agregar uno nuevo de Meta o TikTok; pasa su respuesta en `landingPixels`. La elecci\xF3n se guarda por tienda y aplica a todas sus landings cl\xE1sicas de ProductMaker; el tema y las otras p\xE1ginas no cambian. Si devuelve SHOPIFY_THEME_SETUP_REQUIRED, el tema de la tienda no tiene el bloque Code Landing y nada se public\xF3: env\xEDa al usuario el themeEditorDeepLink del error para abrir el editor del tema de Shopify, p\xEDdele que agregue el bloque y pulse Guardar (una sola vez por tienda), y reintenta s\xF3lo despu\xE9s. Ante resultado incierto, verifica la tarea/tienda antes de volver a publicar, especialmente con new; commerceCorrectionSaved no prueba publicaci\xF3n. La respuesta es markdown con el link a la landing y al producto.",
40344
+ description: publishToShopifyGuidance.summary + " Antes de pedir confirmaci\xF3n, usa list_shopify_products con taskId y publicationMode para revisar el destino. Si devuelve un aviso, muestra el mensaje y el enlace de Shopify. El aviso permite continuar. Precondici\xF3n: la tarea debe estar en status='complete' \u2014 usa `get_task_status` antes. Por defecto `publicationMode=auto`: si esta tarea ya fue publicada en esa tienda, actualiza ESE MISMO producto y conserva URL, precio, variantes, inventario y SKU; si no, crea uno. Usa `existing` + `targetProductId` cuando el usuario elija otro producto y `new` s\xF3lo si pide crear uno nuevo. ANTES de llamar preg\xFAntale \"\xBFTu producto tiene variantes (talla, color, etc.)?\" y pasa `showVariantPicker: true` si responde que s\xED. Por defecto publica TODAS las im\xE1genes generadas; pasa `numLandingImages` s\xF3lo si el usuario pide menos. Tambi\xE9n publica el GIF de la landing si la tarea tiene uno aprobado por QA; pasa `includeLandingGif: false` s\xF3lo si el usuario no lo quiere. En code landings con una oferta expl\xEDcita de packs, ProductMaker s\xF3lo publica el selector si variantes reales de Shopify cobran los totales exactos; la respuesta explica si las cre\xF3, verific\xF3 o descart\xF3 por no existir ahorro. Si devuelve SHOPIFY_PUBLISH_INPUT_REQUIRED, muestra todos los problemas de recovery y solicita los importes faltantes. Solo env\xEDa commerceCorrection con su revisi\xF3n/huella y confirmed:true despu\xE9s de confirmar los valores exactos; nunca inventes importes, conviertas moneda ni elimines ofertas. Si adem\xE1s trae correctionRejected, lo que el vendedor confirm\xF3 fue rechazado: l\xE9ele `reason` ANTES de volver a pedir datos. Un contexto obsoleto requiere volver a revisar; open_editor (incluido SHOPIFY_PUBLISH_CORRECTION_NOT_CONVERGED) requiere el editor de ProductMaker y NO se reenv\xEDa la misma correcci\xF3n. SHOPIFY_PUBLISH_VERIFICATION_FAILED trae en `reason` el siguiente paso: reintenta una vez y si se repite sigue ese paso. P\xEDxeles (landing cl\xE1sica): antes de publicar llama `list_shopify_landing_pixels`, mu\xE9strale a la persona los p\xEDxeles que quedar\xE1n y preg\xFAntale si quiere quitar alguno o agregar uno nuevo de Meta o TikTok; pasa su respuesta en `landingPixels`. La elecci\xF3n se guarda por tienda y aplica a todas sus landings cl\xE1sicas de ProductMaker; el tema y las otras p\xE1ginas no cambian. Si devuelve SHOPIFY_THEME_SETUP_REQUIRED, el tema de la tienda no tiene el bloque Code Landing y nada se public\xF3: env\xEDa al usuario el themeEditorDeepLink del error para abrir el editor del tema de Shopify, p\xEDdele que agregue el bloque y pulse Guardar (una sola vez por tienda), y reintenta s\xF3lo despu\xE9s. Ante resultado incierto, verifica la tarea/tienda antes de volver a publicar, especialmente con new; commerceCorrectionSaved no prueba publicaci\xF3n. La respuesta es markdown con el link a la landing y al producto.",
40263
40345
  inputSchema: ShopifyInput.shape,
40264
40346
  // Publication reaches the public storefront, beyond private account data.
40265
40347
  annotations: {
package/dist/stdio.js CHANGED
@@ -12404,9 +12404,21 @@ var LandingPixel = z41.object({
12404
12404
  /** Whether the next publish keeps it, from the saved choice or the default. */
12405
12405
  selected: z41.boolean()
12406
12406
  });
12407
+ var ShopifyAppPixel = z41.object({
12408
+ key: LandingPixelKey,
12409
+ provider: LandingPixelProvider,
12410
+ pixelId: z41.string(),
12411
+ /** The app's name as sellers know it, e.g. "Facebook & Instagram". */
12412
+ appName: z41.string().min(1).max(80)
12413
+ });
12407
12414
  var ShopifyLandingPixelsResponse = z41.object({
12408
12415
  shopDomain: z41.string(),
12409
12416
  pixels: z41.array(LandingPixel),
12417
+ /**
12418
+ * Pixels Shopify apps load on the whole store. Empty when the storefront
12419
+ * could not be read (password, timeout): the selection works the same.
12420
+ */
12421
+ appPixels: z41.array(ShopifyAppPixel).default([]),
12410
12422
  /** The theme holds tracking code we do not recognize and never copy. */
12411
12423
  unrecognizedCodeDetected: z41.boolean()
12412
12424
  });
@@ -12490,6 +12502,43 @@ var ShopifyPublicationMode = z42.enum([
12490
12502
  "existing",
12491
12503
  "new"
12492
12504
  ]);
12505
+ var ShopifyShippingCheckRequest = z42.object({
12506
+ shopDomain: z42.string().min(3).max(120),
12507
+ publicationMode: ShopifyPublicationMode,
12508
+ targetProductId: z42.string().min(1).max(300).optional()
12509
+ });
12510
+ var ShopifyShippingCheckResponse = z42.object({
12511
+ warning: z42.discriminatedUnion("code", [
12512
+ z42.object({
12513
+ code: z42.enum([
12514
+ "MARKET_INACTIVE",
12515
+ "NO_SHIPPING_RATE"
12516
+ ]),
12517
+ country: z42.string().regex(/^[A-Z]{2}$/),
12518
+ locationName: z42.string().optional(),
12519
+ settingsUrl: z42.string().url()
12520
+ }),
12521
+ z42.object({
12522
+ code: z42.literal("OFFER_UNAVAILABLE"),
12523
+ units: z42.number().int().positive(),
12524
+ settingsUrl: z42.string().url()
12525
+ })
12526
+ ]).nullable()
12527
+ });
12528
+ function shopifyPublishAdvisoryMessage(warning) {
12529
+ if (warning.code === "OFFER_UNAVAILABLE") {
12530
+ const unit = warning.units === 1 ? "unidad" : "unidades";
12531
+ return `La oferta de ${warning.units} ${unit} no est\xE1 disponible para comprar.`;
12532
+ }
12533
+ const country = new Intl.DisplayNames([
12534
+ "es"
12535
+ ], {
12536
+ type: "region"
12537
+ }).of(warning.country);
12538
+ if (warning.code === "MARKET_INACTIVE") return `${country} no tiene un mercado activo.`;
12539
+ return warning.locationName ? `Falta una tarifa de env\xEDo para ${country} en ${warning.locationName}.` : `Falta una tarifa de env\xEDo para ${country}.`;
12540
+ }
12541
+ __name(shopifyPublishAdvisoryMessage, "shopifyPublishAdvisoryMessage");
12493
12542
  var SHOPIFY_ANNOUNCEMENT_BAR_MAX_LENGTH = 160;
12494
12543
  var ShopifyPublishRequest = z42.object({
12495
12544
  /** Correlates a mutation with read-only recovery after a lost response. */
@@ -25108,7 +25157,7 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25108
25157
  ], [
25109
25158
  "landing_pixel"
25110
25159
  ]),
25111
- defineCapability("list_shopify_products", "c3daf527e345f737c8b23eb347b77fbf2290433257753122a8d55fdc65d58e78", "none", "read_only", [
25160
+ defineCapability("list_shopify_products", "9c0e51d1c0026539d635b043e1fa3a7903ffee31a13fd732578641104d085a8f", "none", "read_only", [
25112
25161
  "read"
25113
25162
  ], [
25114
25163
  slot("shop", true, [
@@ -25119,7 +25168,13 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
25119
25168
  ]),
25120
25169
  slot("task", false, [
25121
25170
  "taskId"
25122
- ])
25171
+ ]),
25172
+ slot("publication_mode", false, [
25173
+ "publicationMode"
25174
+ ], []),
25175
+ slot("target_product", false, [
25176
+ "targetProductId"
25177
+ ], [])
25123
25178
  ], [
25124
25179
  "shop"
25125
25180
  ], [
@@ -30711,7 +30766,7 @@ var ApiClient = class {
30711
30766
  };
30712
30767
 
30713
30768
  // src/index.ts
30714
- var MCP_VERSION = "12.14.1";
30769
+ var MCP_VERSION = "12.16.0";
30715
30770
 
30716
30771
  // src/meta-upload-app.ts
30717
30772
  import { readFileSync } from "fs";
@@ -38152,28 +38207,55 @@ function registerConnectionTools(server, api) {
38152
38207
  }
38153
38208
  });
38154
38209
  server.registerTool("list_shopify_products", {
38155
- description: listShopifyProductsGuidance.summary + ' Usa el `id` devuelto junto con `publicationMode="existing"` en `publish_to_shopify`. Si `taskId` se proporciona, la respuesta tambi\xE9n indica el producto publicado actualmente para esa tarea y tienda. No modifica Shopify.',
38210
+ description: listShopifyProductsGuidance.summary + ' Usa el `id` devuelto junto con `publicationMode="existing"` en `publish_to_shopify`. Con `taskId` puedes ver el producto publicado actualmente. Antes de pedir confirmaci\xF3n para publicar, vuelve a llamar con `taskId` y el `publicationMode` elegido (`auto`, `new` o `existing` con `targetProductId`). Si tambi\xE9n pasas `query`, devuelve el cat\xE1logo junto al chequeo. Si devuelve `warning`, muestra su `message` y `settingsUrl`; el aviso permite continuar. No modifica Shopify.',
38156
38211
  inputSchema: z148.object({
38157
38212
  shopDomain: z148.string().min(3).max(120),
38158
38213
  query: z148.string().trim().max(120).optional(),
38159
- taskId: z148.string().guid().optional()
38214
+ taskId: z148.string().guid().optional(),
38215
+ publicationMode: ShopifyPublicationMode.optional(),
38216
+ targetProductId: z148.string().min(1).max(300).optional()
38160
38217
  }).shape,
38161
38218
  annotations: READS_EXTERNAL
38162
- }, async ({ shopDomain, query, taskId }) => {
38219
+ }, async ({ shopDomain, query, taskId, publicationMode, targetProductId }) => {
38163
38220
  try {
38221
+ if (publicationMode && (!taskId || publicationMode === "existing" && !targetProductId)) {
38222
+ return {
38223
+ isError: true,
38224
+ content: [
38225
+ {
38226
+ type: "text",
38227
+ text: "Indica taskId y, para existing, tambi\xE9n targetProductId."
38228
+ }
38229
+ ]
38230
+ };
38231
+ }
38164
38232
  const params = new URLSearchParams({
38165
38233
  shopDomain
38166
38234
  });
38167
38235
  if (query) params.set("query", query);
38168
38236
  if (taskId) params.set("taskId", taskId);
38169
- const r = await api.getJson(`/v1/shopify/products?${params.toString()}`);
38170
- return asText(r);
38237
+ const [catalog, advisory] = await Promise.all([
38238
+ !publicationMode || query ? api.getJson(`/v1/shopify/products?${params.toString()}`) : {},
38239
+ publicationMode && taskId ? api.postJson(`/v1/tasks/${encodeURIComponent(taskId)}/publish/shopify/shipping-check`, {
38240
+ shopDomain,
38241
+ publicationMode,
38242
+ targetProductId
38243
+ }).then((response) => ShopifyShippingCheckResponse.parse(response)) : null
38244
+ ]);
38245
+ const warning = advisory?.warning;
38246
+ return asText(warning ? {
38247
+ ...catalog,
38248
+ warning: {
38249
+ ...warning,
38250
+ message: shopifyPublishAdvisoryMessage(warning)
38251
+ }
38252
+ } : catalog);
38171
38253
  } catch (e) {
38172
38254
  throw translateError(e);
38173
38255
  }
38174
38256
  });
38175
38257
  server.registerTool("list_shopify_landing_pixels", {
38176
- description: listShopifyLandingPixelsGuidance.summary + ' Cada pixel trae `key`, `provider`, `pixelId`, `source` ("theme" = est\xE1 en el tema, "landing" = solo en la landing, "manual" = lo agreg\xF3 la persona) y `selected` (si quedar\xE1 en la landing). Mu\xE9straselos en lenguaje simple antes de `publish_to_shopify` y pregunta cu\xE1les quitar o si agrega uno nuevo; luego pasa la elecci\xF3n en `landingPixels`. Si `unrecognizedCodeDetected` es true, avisa que hay c\xF3digo de seguimiento que no se pudo leer y no se copia. No modifica Shopify.',
38258
+ description: listShopifyLandingPixelsGuidance.summary + ' Cada pixel trae `key`, `provider`, `pixelId`, `source` ("theme" = est\xE1 en el tema, "landing" = solo en la landing, "manual" = lo agreg\xF3 la persona) y `selected` (si quedar\xE1 en la landing). Mu\xE9straselos en lenguaje simple antes de `publish_to_shopify` y pregunta cu\xE1les quitar o si agrega uno nuevo; luego pasa la elecci\xF3n en `landingPixels`. `appPixels` son los p\xEDxeles que una app de Shopify carga en toda la tienda (`provider`, `pixelId`, `appName`): mu\xE9stralos como "viene de la app <appName>", sin ofrecer quitarlos (solo se quitan desde esa app) y nunca los pongas en `landingPixels`. Si `unrecognizedCodeDetected` es true, avisa que hay c\xF3digo de seguimiento que no se pudo leer y no se copia. No modifica Shopify.',
38177
38259
  inputSchema: z148.object({
38178
38260
  shopDomain: z148.string().min(3).max(120)
38179
38261
  }).shape,
@@ -38744,7 +38826,7 @@ var TikTokInput = z150.object({
38744
38826
  function registerPublishTools(server, api, opts = {}) {
38745
38827
  const transport = opts.transport ?? "http";
38746
38828
  server.registerTool("publish_to_shopify", {
38747
- description: publishToShopifyGuidance.summary + " Precondici\xF3n: la tarea debe estar en status='complete' \u2014 usa `get_task_status` antes. Por defecto `publicationMode=auto`: si esta tarea ya fue publicada en esa tienda, actualiza ESE MISMO producto y conserva URL, precio, variantes, inventario y SKU; si no, crea uno. Usa `existing` + `targetProductId` cuando el usuario elija otro producto y `new` s\xF3lo si pide crear uno nuevo. ANTES de llamar preg\xFAntale \"\xBFTu producto tiene variantes (talla, color, etc.)?\" y pasa `showVariantPicker: true` si responde que s\xED. Por defecto publica TODAS las im\xE1genes generadas; pasa `numLandingImages` s\xF3lo si el usuario pide menos. Tambi\xE9n publica el GIF de la landing si la tarea tiene uno aprobado por QA; pasa `includeLandingGif: false` s\xF3lo si el usuario no lo quiere. En code landings con una oferta expl\xEDcita de packs, ProductMaker s\xF3lo publica el selector si variantes reales de Shopify cobran los totales exactos; la respuesta explica si las cre\xF3, verific\xF3 o descart\xF3 por no existir ahorro. Si devuelve SHOPIFY_PUBLISH_INPUT_REQUIRED, muestra todos los problemas de recovery y solicita los importes faltantes. Solo env\xEDa commerceCorrection con su revisi\xF3n/huella y confirmed:true despu\xE9s de confirmar los valores exactos; nunca inventes importes, conviertas moneda ni elimines ofertas. Si adem\xE1s trae correctionRejected, lo que el vendedor confirm\xF3 fue rechazado: l\xE9ele `reason` ANTES de volver a pedir datos. Un contexto obsoleto requiere volver a revisar; open_editor (incluido SHOPIFY_PUBLISH_CORRECTION_NOT_CONVERGED) requiere el editor de ProductMaker y NO se reenv\xEDa la misma correcci\xF3n. SHOPIFY_PUBLISH_VERIFICATION_FAILED trae en `reason` el siguiente paso: reintenta una vez y si se repite sigue ese paso. P\xEDxeles (landing cl\xE1sica): antes de publicar llama `list_shopify_landing_pixels`, mu\xE9strale a la persona los p\xEDxeles que quedar\xE1n y preg\xFAntale si quiere quitar alguno o agregar uno nuevo de Meta o TikTok; pasa su respuesta en `landingPixels`. La elecci\xF3n se guarda por tienda y aplica a todas sus landings cl\xE1sicas de ProductMaker; el tema y las otras p\xE1ginas no cambian. Si devuelve SHOPIFY_THEME_SETUP_REQUIRED, el tema de la tienda no tiene el bloque Code Landing y nada se public\xF3: env\xEDa al usuario el themeEditorDeepLink del error para abrir el editor del tema de Shopify, p\xEDdele que agregue el bloque y pulse Guardar (una sola vez por tienda), y reintenta s\xF3lo despu\xE9s. Ante resultado incierto, verifica la tarea/tienda antes de volver a publicar, especialmente con new; commerceCorrectionSaved no prueba publicaci\xF3n. La respuesta es markdown con el link a la landing y al producto.",
38829
+ description: publishToShopifyGuidance.summary + " Antes de pedir confirmaci\xF3n, usa list_shopify_products con taskId y publicationMode para revisar el destino. Si devuelve un aviso, muestra el mensaje y el enlace de Shopify. El aviso permite continuar. Precondici\xF3n: la tarea debe estar en status='complete' \u2014 usa `get_task_status` antes. Por defecto `publicationMode=auto`: si esta tarea ya fue publicada en esa tienda, actualiza ESE MISMO producto y conserva URL, precio, variantes, inventario y SKU; si no, crea uno. Usa `existing` + `targetProductId` cuando el usuario elija otro producto y `new` s\xF3lo si pide crear uno nuevo. ANTES de llamar preg\xFAntale \"\xBFTu producto tiene variantes (talla, color, etc.)?\" y pasa `showVariantPicker: true` si responde que s\xED. Por defecto publica TODAS las im\xE1genes generadas; pasa `numLandingImages` s\xF3lo si el usuario pide menos. Tambi\xE9n publica el GIF de la landing si la tarea tiene uno aprobado por QA; pasa `includeLandingGif: false` s\xF3lo si el usuario no lo quiere. En code landings con una oferta expl\xEDcita de packs, ProductMaker s\xF3lo publica el selector si variantes reales de Shopify cobran los totales exactos; la respuesta explica si las cre\xF3, verific\xF3 o descart\xF3 por no existir ahorro. Si devuelve SHOPIFY_PUBLISH_INPUT_REQUIRED, muestra todos los problemas de recovery y solicita los importes faltantes. Solo env\xEDa commerceCorrection con su revisi\xF3n/huella y confirmed:true despu\xE9s de confirmar los valores exactos; nunca inventes importes, conviertas moneda ni elimines ofertas. Si adem\xE1s trae correctionRejected, lo que el vendedor confirm\xF3 fue rechazado: l\xE9ele `reason` ANTES de volver a pedir datos. Un contexto obsoleto requiere volver a revisar; open_editor (incluido SHOPIFY_PUBLISH_CORRECTION_NOT_CONVERGED) requiere el editor de ProductMaker y NO se reenv\xEDa la misma correcci\xF3n. SHOPIFY_PUBLISH_VERIFICATION_FAILED trae en `reason` el siguiente paso: reintenta una vez y si se repite sigue ese paso. P\xEDxeles (landing cl\xE1sica): antes de publicar llama `list_shopify_landing_pixels`, mu\xE9strale a la persona los p\xEDxeles que quedar\xE1n y preg\xFAntale si quiere quitar alguno o agregar uno nuevo de Meta o TikTok; pasa su respuesta en `landingPixels`. La elecci\xF3n se guarda por tienda y aplica a todas sus landings cl\xE1sicas de ProductMaker; el tema y las otras p\xE1ginas no cambian. Si devuelve SHOPIFY_THEME_SETUP_REQUIRED, el tema de la tienda no tiene el bloque Code Landing y nada se public\xF3: env\xEDa al usuario el themeEditorDeepLink del error para abrir el editor del tema de Shopify, p\xEDdele que agregue el bloque y pulse Guardar (una sola vez por tienda), y reintenta s\xF3lo despu\xE9s. Ante resultado incierto, verifica la tarea/tienda antes de volver a publicar, especialmente con new; commerceCorrectionSaved no prueba publicaci\xF3n. La respuesta es markdown con el link a la landing y al producto.",
38748
38830
  inputSchema: ShopifyInput.shape,
38749
38831
  // Publication reaches the public storefront, beyond private account data.
38750
38832
  annotations: {
@@ -41712,7 +41794,7 @@ var START_DROPSHIPPING_PROMPT = [
41712
41794
  "",
41713
41795
  "Use the existing creative/task tools for generation, preserve their estimate and confirmation gates, and keep polling get_task_status until the task is done, errored, or paused \u2014 a timed-out poll means it is still running, so call again. When it pauses, show me the draft and ask me; only answer it yourself through resolve_pending_action if I delegated that decision to you or the task runs with aiDecidesAll / reviewMode automatic. Verify actual outputs before calling the creative stage complete.",
41714
41796
  "",
41715
- "Before Shopify publication, call list_shopify_shops, check the real task readiness, ask whether the product has variants, show the intended publication, and wait for explicit approval before calling publish_to_shopify. Report the exact blocker when publication is not ready. If recovery is needs_input, show every typed issue and ask me for missing values. Only send commerceCorrection with confirmed:true after I confirm the exact currency, unit price and pack totals. Never invent prices, convert currency or erase the offer. If the context changed, review it again; open_editor means use the ProductMaker editor. Saved corrections do not prove publication: verify uncertain results before another attempt.",
41797
+ "Before Shopify publication, call list_shopify_shops, check the real task readiness and ask whether the product has variants. Call list_shopify_products with taskId and the intended publicationMode (and targetProductId for existing) to check the selected destination. Show any warning and its Shopify link with the intended publication, then wait for explicit approval before calling publish_to_shopify. Warnings do not block publication. Report the exact blocker when publication is not ready. If recovery is needs_input, show every typed issue and ask me for missing values. Only send commerceCorrection with confirmed:true after I confirm the exact currency, unit price and pack totals. Never invent prices, convert currency or erase the offer. If the context changed, review it again; open_editor means use the ProductMaker editor. Saved corrections do not prove publication: verify uncertain results before another attempt.",
41716
41798
  "",
41717
41799
  "Before Meta publication, call list_meta_destinations, show the available Business portfolios, ad accounts and Facebook Pages, and let me choose the exact portfolioId, adAccountId and pageId; never choose the first option silently. Then collect budget, country and optional tracking inputs, show the intended mutation, and wait for explicit approval. Use publish_to_meta for one task or publish_creatives_to_meta for selected assets across tasks/media. ProductMaker campaigns must remain PAUSED and require manual activation. Use get_meta_campaign_status only to verify the created campaign.",
41718
41800
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productmaker/mcp",
3
- "version": "12.14.1",
3
+ "version": "12.16.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "ProductMaker MCP server — cost products, generate landing pages, UGC videos, and ad creatives, and publish to Shopify, Meta Ads, and TikTok Ads.",