@productmaker/mcp 12.30.0 → 12.31.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.
package/README.md CHANGED
@@ -243,6 +243,7 @@ its service-page editor, including its generation progress.
243
243
  | `get_dropi_status` | Read whether the seller's Dropi account is connected and how far its order read got. Connecting or disconnecting is NOT done here — the Dropi key is pasted in Integrations, and saying so is part of the answer when `connected: false` comes back |
244
244
  | `sync_dropi_orders` | Pull real orders from the seller's connected Dropi account into the ledger. Idempotent: re-reading the same window updates lines instead of duplicating them. If the answer stays `pending`, the read continues in the background — say so and offer `get_dropi_status` again instead of claiming a total that has not finished |
245
245
  | `cancel_dropi_order` | Cancel in Dropi an order that has no guide yet (PENDIENTE CONFIRMACION or PENDIENTE). Reads the order before writing: `already_cancelled` without a write, `not_cancellable` with `blockedBy: has_guide | status`(with a guide the path is the novedad «devolver al remitente»). Destructive, cannot be undone;`financial-control` gate |
246
+ | `save_order_amounts` | Save the real money of Dropi orders already in the ledger, as read in the order's «Información de la Orden» panel (supplier, shipping, return shipping, commission, Dropi «monto a ganar»; the sale total stays from the API). Never creates an order or changes its status; a missing amount keeps the stored one. Returns `updated`, `notFound` (run `sync_dropi_orders` first) and `multiProduct` (amounts are not split across products). `financial-control` gate |
246
247
  | `create_manual_product` | Create a product by hand in financial control: no store, no file, no task. Ask for ALL the data first — supplier cost and freight without inventing (a zero would make it infinitely profitable); the two rates are 0–1 proportions and the seller's estimate. Retrying with the same data returns the same product; the derived `requestId` never duplicates |
247
248
  | `list_unmatched_products` | Read the products an import brought that still have no owner in the ledger. Their orders are already stored — this lists who needs `resolve_unmatched_product` next |
248
249
  | `resolve_unmatched_product` | Give an owner to an unrecognized imported product: with `productControlId` the alias hangs off that record and its orders move there; without it a new record is created under `label`. Neither path discards orders — there is no "not mine" route because the information already came in |
package/dist/http.js CHANGED
@@ -23941,6 +23941,21 @@ var CAPABILITY_MODEL_GUIDANCE = {
23941
23941
  "autoridad expl\xEDcita del comprador o vendedor; no se deshace"
23942
23942
  ]
23943
23943
  },
23944
+ save_order_amounts: {
23945
+ summary: "Guarda los montos reales de pedidos Dropi que ya est\xE1n en el libro.",
23946
+ useWhen: [
23947
+ "le\xEDste los montos de un pedido en el panel de Dropi"
23948
+ ],
23949
+ avoidWhen: [
23950
+ "el pedido no est\xE1 en el libro: primero sync_dropi_orders"
23951
+ ],
23952
+ defaults: [
23953
+ "proveedor dropi"
23954
+ ],
23955
+ disclosures: [
23956
+ "autoridad expl\xEDcita del vendedor; solo cifras, no crea pedidos"
23957
+ ]
23958
+ },
23944
23959
  sync_dropi_orders: {
23945
23960
  summary: "Trae los pedidos reales de su cuenta Dropi al libro de cuentas.",
23946
23961
  useWhen: [
@@ -24766,6 +24781,44 @@ var SyncShopifyOrdersSchema = z105.object({
24766
24781
  since: z105.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
24767
24782
  until: z105.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
24768
24783
  }).strict();
24784
+ var ORDER_AMOUNTS_BATCH_MAX = 200;
24785
+ var OrderAmountsSchema = z105.object({
24786
+ externalOrderId: z105.string().trim().min(1).max(64),
24787
+ supplierAmount: z105.number().finite().min(0).optional(),
24788
+ shippingAmount: z105.number().finite().min(0).optional(),
24789
+ returnShippingAmount: z105.number().finite().min(0).optional(),
24790
+ commissionAmount: z105.number().finite().min(0).optional(),
24791
+ providerProfitAmount: z105.number().finite().optional()
24792
+ }).strict().refine((order) => [
24793
+ order.supplierAmount,
24794
+ order.shippingAmount,
24795
+ order.returnShippingAmount,
24796
+ order.commissionAmount,
24797
+ order.providerProfitAmount
24798
+ ].some((amount) => amount !== void 0), {
24799
+ message: "order_amounts_empty",
24800
+ path: [
24801
+ "externalOrderId"
24802
+ ]
24803
+ });
24804
+ var SaveOrderAmountsSchema = z105.object({
24805
+ operationId: z105.string().guid().optional(),
24806
+ provider: z105.literal("dropi").default("dropi"),
24807
+ orders: z105.array(OrderAmountsSchema).min(1).max(ORDER_AMOUNTS_BATCH_MAX)
24808
+ }).strict().refine((input) => new Set(input.orders.map((order) => order.externalOrderId)).size === input.orders.length, {
24809
+ message: "order_amounts_duplicate_order",
24810
+ path: [
24811
+ "orders"
24812
+ ]
24813
+ });
24814
+ var SaveOrderAmountsResultSchema = z105.object({
24815
+ /** Pedidos cuyos montos quedaron guardados. */
24816
+ updated: z105.array(z105.string()),
24817
+ /** No están en el libro: primero hay que sincronizar el proveedor. */
24818
+ notFound: z105.array(z105.string()),
24819
+ /** Tienen varios productos y la lupa da montos del pedido entero. */
24820
+ multiProduct: z105.array(z105.string())
24821
+ });
24769
24822
 
24770
24823
  // ../../packages/types/src/product-control.ts
24771
24824
  import { z as z106 } from "zod";
@@ -27473,6 +27526,31 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
27473
27526
  ],
27474
27527
  MCP_ONLY_CHANNEL_EXPOSURE
27475
27528
  ),
27529
+ defineCapability(
27530
+ "save_order_amounts",
27531
+ // Filled by the MCP schema fingerprint test.
27532
+ "6a98473ad145a9e3f18487333cbf348e6a4bc4dab78f1f59639518a183c2f4a5",
27533
+ "state_change",
27534
+ "business",
27535
+ [
27536
+ "state_change"
27537
+ ],
27538
+ [
27539
+ slot("order_amounts", true, [
27540
+ "orders"
27541
+ ]),
27542
+ slot("operation", false, [
27543
+ "operationId"
27544
+ ])
27545
+ ],
27546
+ [
27547
+ "product_order_line"
27548
+ ],
27549
+ [
27550
+ "product_order_line"
27551
+ ],
27552
+ MCP_ONLY_CHANNEL_EXPOSURE
27553
+ ),
27476
27554
  defineCapability(
27477
27555
  "create_manual_product",
27478
27556
  // Filled by the MCP schema fingerprint test.
@@ -35010,7 +35088,7 @@ var ApiClient = class {
35010
35088
  };
35011
35089
 
35012
35090
  // src/index.ts
35013
- var MCP_VERSION = "12.30.0";
35091
+ var MCP_VERSION = "12.31.0";
35014
35092
 
35015
35093
  // src/meta-upload-app.ts
35016
35094
  import { readFileSync } from "fs";
@@ -45697,6 +45775,7 @@ var importOrdersFileGuidance = getProductMakerCapabilityModelGuidance("import_or
45697
45775
  var getDropiStatusGuidance = getProductMakerCapabilityModelGuidance("get_dropi_status");
45698
45776
  var syncDropiOrdersGuidance = getProductMakerCapabilityModelGuidance("sync_dropi_orders");
45699
45777
  var cancelDropiOrderGuidance = getProductMakerCapabilityModelGuidance("cancel_dropi_order");
45778
+ var saveOrderAmountsGuidance = getProductMakerCapabilityModelGuidance("save_order_amounts");
45700
45779
  var createManualProductGuidance = getProductMakerCapabilityModelGuidance("create_manual_product");
45701
45780
  var listUnmatchedGuidance = getProductMakerCapabilityModelGuidance("list_unmatched_products");
45702
45781
  var resolveUnmatchedGuidance = getProductMakerCapabilityModelGuidance("resolve_unmatched_product");
@@ -45800,6 +45879,18 @@ var CancelDropiOrderInput = z173.strictObject({
45800
45879
  dropiOrderId: DropiOrderIdSchema.describe("N\xFAmero del pedido en Dropi (solo d\xEDgitos), el que muestra \xABMis pedidos\xBB."),
45801
45880
  ...CancelDropiOrderSchema.shape
45802
45881
  });
45882
+ var Amount = z173.number().finite().min(0);
45883
+ var SaveOrderAmountsInput = z173.strictObject({
45884
+ operationId: z173.string().uuid().optional().describe("Solo si tiene m\xE1s de una operaci\xF3n (pa\xEDs)."),
45885
+ orders: z173.array(z173.strictObject({
45886
+ externalOrderId: z173.string().trim().min(1).max(64).describe("N\xFAmero del pedido en Dropi, tal como sale en \xABMis pedidos\xBB."),
45887
+ supplierAmount: Amount.optional().describe("Precio del proveedor."),
45888
+ shippingAmount: Amount.optional().describe("Costo del env\xEDo."),
45889
+ returnShippingAmount: Amount.optional().describe("Flete de devoluci\xF3n, si lo hubo."),
45890
+ commissionAmount: Amount.optional().describe("Comisi\xF3n de la plataforma."),
45891
+ providerProfitAmount: z173.number().finite().optional().describe("\xABMonto a ganar\xBB que muestra Dropi.")
45892
+ })).min(1).max(ORDER_AMOUNTS_BATCH_MAX)
45893
+ });
45803
45894
  var CreateManualProductInput = z173.strictObject(CreateManualProductControlSchema.shape).omit({
45804
45895
  requestId: true
45805
45896
  });
@@ -46100,6 +46191,20 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
46100
46191
  throw translateError(error);
46101
46192
  }
46102
46193
  });
46194
+ server.registerTool("save_order_amounts", {
46195
+ description: saveOrderAmountsGuidance.summary + " \xDAsala con las cifras que le\xEDste en la lupa \xABInformaci\xF3n de la Orden\xBB de Dropi, en unidades de la moneda (79000, no 7900000). Solo completa pedidos que ya est\xE1n en el libro: nunca crea uno ni cambia su estado. Un monto que no mandas no borra el que hab\xEDa. Responde `updated`, `notFound` (sincroniza con sync_dropi_orders y vuelve a intentar) y `multiProduct` (pedidos con varios productos: no se reparten montos).",
46196
+ inputSchema: SaveOrderAmountsInput.shape,
46197
+ annotations: OVERWRITES_INTERNAL
46198
+ }, async (input) => {
46199
+ try {
46200
+ return asText(await api.postJson("/v1/product-control/order-lines/amounts", {
46201
+ ...input,
46202
+ provider: "dropi"
46203
+ }));
46204
+ } catch (error) {
46205
+ throw translateError(error);
46206
+ }
46207
+ });
46103
46208
  server.registerTool("create_manual_product", {
46104
46209
  description: createManualProductGuidance.summary + " Pide TODOS los datos antes de llamarla: el costo del proveedor y el flete sin inventar \u2014 un cero volver\xEDa infinitamente rentable el producto. Las dos tasas son proporciones 0\u20131 y SU estimaci\xF3n, no una medici\xF3n. Reintentar con los mismos datos devuelve el mismo producto; no duplica.",
46105
46210
  inputSchema: CreateManualProductInput.shape,
package/dist/stdio.js CHANGED
@@ -23716,6 +23716,21 @@ var CAPABILITY_MODEL_GUIDANCE = {
23716
23716
  "autoridad expl\xEDcita del comprador o vendedor; no se deshace"
23717
23717
  ]
23718
23718
  },
23719
+ save_order_amounts: {
23720
+ summary: "Guarda los montos reales de pedidos Dropi que ya est\xE1n en el libro.",
23721
+ useWhen: [
23722
+ "le\xEDste los montos de un pedido en el panel de Dropi"
23723
+ ],
23724
+ avoidWhen: [
23725
+ "el pedido no est\xE1 en el libro: primero sync_dropi_orders"
23726
+ ],
23727
+ defaults: [
23728
+ "proveedor dropi"
23729
+ ],
23730
+ disclosures: [
23731
+ "autoridad expl\xEDcita del vendedor; solo cifras, no crea pedidos"
23732
+ ]
23733
+ },
23719
23734
  sync_dropi_orders: {
23720
23735
  summary: "Trae los pedidos reales de su cuenta Dropi al libro de cuentas.",
23721
23736
  useWhen: [
@@ -24541,6 +24556,44 @@ var SyncShopifyOrdersSchema = z105.object({
24541
24556
  since: z105.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
24542
24557
  until: z105.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
24543
24558
  }).strict();
24559
+ var ORDER_AMOUNTS_BATCH_MAX = 200;
24560
+ var OrderAmountsSchema = z105.object({
24561
+ externalOrderId: z105.string().trim().min(1).max(64),
24562
+ supplierAmount: z105.number().finite().min(0).optional(),
24563
+ shippingAmount: z105.number().finite().min(0).optional(),
24564
+ returnShippingAmount: z105.number().finite().min(0).optional(),
24565
+ commissionAmount: z105.number().finite().min(0).optional(),
24566
+ providerProfitAmount: z105.number().finite().optional()
24567
+ }).strict().refine((order) => [
24568
+ order.supplierAmount,
24569
+ order.shippingAmount,
24570
+ order.returnShippingAmount,
24571
+ order.commissionAmount,
24572
+ order.providerProfitAmount
24573
+ ].some((amount) => amount !== void 0), {
24574
+ message: "order_amounts_empty",
24575
+ path: [
24576
+ "externalOrderId"
24577
+ ]
24578
+ });
24579
+ var SaveOrderAmountsSchema = z105.object({
24580
+ operationId: z105.string().guid().optional(),
24581
+ provider: z105.literal("dropi").default("dropi"),
24582
+ orders: z105.array(OrderAmountsSchema).min(1).max(ORDER_AMOUNTS_BATCH_MAX)
24583
+ }).strict().refine((input) => new Set(input.orders.map((order) => order.externalOrderId)).size === input.orders.length, {
24584
+ message: "order_amounts_duplicate_order",
24585
+ path: [
24586
+ "orders"
24587
+ ]
24588
+ });
24589
+ var SaveOrderAmountsResultSchema = z105.object({
24590
+ /** Pedidos cuyos montos quedaron guardados. */
24591
+ updated: z105.array(z105.string()),
24592
+ /** No están en el libro: primero hay que sincronizar el proveedor. */
24593
+ notFound: z105.array(z105.string()),
24594
+ /** Tienen varios productos y la lupa da montos del pedido entero. */
24595
+ multiProduct: z105.array(z105.string())
24596
+ });
24544
24597
 
24545
24598
  // ../../packages/types/src/product-control.ts
24546
24599
  import { z as z106 } from "zod";
@@ -27248,6 +27301,31 @@ var PRODUCTMAKER_CAPABILITY_REGISTRY = deepFreeze([
27248
27301
  ],
27249
27302
  MCP_ONLY_CHANNEL_EXPOSURE
27250
27303
  ),
27304
+ defineCapability(
27305
+ "save_order_amounts",
27306
+ // Filled by the MCP schema fingerprint test.
27307
+ "6a98473ad145a9e3f18487333cbf348e6a4bc4dab78f1f59639518a183c2f4a5",
27308
+ "state_change",
27309
+ "business",
27310
+ [
27311
+ "state_change"
27312
+ ],
27313
+ [
27314
+ slot("order_amounts", true, [
27315
+ "orders"
27316
+ ]),
27317
+ slot("operation", false, [
27318
+ "operationId"
27319
+ ])
27320
+ ],
27321
+ [
27322
+ "product_order_line"
27323
+ ],
27324
+ [
27325
+ "product_order_line"
27326
+ ],
27327
+ MCP_ONLY_CHANNEL_EXPOSURE
27328
+ ),
27251
27329
  defineCapability(
27252
27330
  "create_manual_product",
27253
27331
  // Filled by the MCP schema fingerprint test.
@@ -33337,7 +33415,7 @@ var ApiClient = class {
33337
33415
  };
33338
33416
 
33339
33417
  // src/index.ts
33340
- var MCP_VERSION = "12.30.0";
33418
+ var MCP_VERSION = "12.31.0";
33341
33419
 
33342
33420
  // src/meta-upload-app.ts
33343
33421
  import { readFileSync } from "fs";
@@ -44182,6 +44260,7 @@ var importOrdersFileGuidance = getProductMakerCapabilityModelGuidance("import_or
44182
44260
  var getDropiStatusGuidance = getProductMakerCapabilityModelGuidance("get_dropi_status");
44183
44261
  var syncDropiOrdersGuidance = getProductMakerCapabilityModelGuidance("sync_dropi_orders");
44184
44262
  var cancelDropiOrderGuidance = getProductMakerCapabilityModelGuidance("cancel_dropi_order");
44263
+ var saveOrderAmountsGuidance = getProductMakerCapabilityModelGuidance("save_order_amounts");
44185
44264
  var createManualProductGuidance = getProductMakerCapabilityModelGuidance("create_manual_product");
44186
44265
  var listUnmatchedGuidance = getProductMakerCapabilityModelGuidance("list_unmatched_products");
44187
44266
  var resolveUnmatchedGuidance = getProductMakerCapabilityModelGuidance("resolve_unmatched_product");
@@ -44285,6 +44364,18 @@ var CancelDropiOrderInput = z172.strictObject({
44285
44364
  dropiOrderId: DropiOrderIdSchema.describe("N\xFAmero del pedido en Dropi (solo d\xEDgitos), el que muestra \xABMis pedidos\xBB."),
44286
44365
  ...CancelDropiOrderSchema.shape
44287
44366
  });
44367
+ var Amount = z172.number().finite().min(0);
44368
+ var SaveOrderAmountsInput = z172.strictObject({
44369
+ operationId: z172.string().uuid().optional().describe("Solo si tiene m\xE1s de una operaci\xF3n (pa\xEDs)."),
44370
+ orders: z172.array(z172.strictObject({
44371
+ externalOrderId: z172.string().trim().min(1).max(64).describe("N\xFAmero del pedido en Dropi, tal como sale en \xABMis pedidos\xBB."),
44372
+ supplierAmount: Amount.optional().describe("Precio del proveedor."),
44373
+ shippingAmount: Amount.optional().describe("Costo del env\xEDo."),
44374
+ returnShippingAmount: Amount.optional().describe("Flete de devoluci\xF3n, si lo hubo."),
44375
+ commissionAmount: Amount.optional().describe("Comisi\xF3n de la plataforma."),
44376
+ providerProfitAmount: z172.number().finite().optional().describe("\xABMonto a ganar\xBB que muestra Dropi.")
44377
+ })).min(1).max(ORDER_AMOUNTS_BATCH_MAX)
44378
+ });
44288
44379
  var CreateManualProductInput = z172.strictObject(CreateManualProductControlSchema.shape).omit({
44289
44380
  requestId: true
44290
44381
  });
@@ -44585,6 +44676,20 @@ function registerProductControlTools(server, api, { transport = "http" } = {}) {
44585
44676
  throw translateError(error);
44586
44677
  }
44587
44678
  });
44679
+ server.registerTool("save_order_amounts", {
44680
+ description: saveOrderAmountsGuidance.summary + " \xDAsala con las cifras que le\xEDste en la lupa \xABInformaci\xF3n de la Orden\xBB de Dropi, en unidades de la moneda (79000, no 7900000). Solo completa pedidos que ya est\xE1n en el libro: nunca crea uno ni cambia su estado. Un monto que no mandas no borra el que hab\xEDa. Responde `updated`, `notFound` (sincroniza con sync_dropi_orders y vuelve a intentar) y `multiProduct` (pedidos con varios productos: no se reparten montos).",
44681
+ inputSchema: SaveOrderAmountsInput.shape,
44682
+ annotations: OVERWRITES_INTERNAL
44683
+ }, async (input) => {
44684
+ try {
44685
+ return asText(await api.postJson("/v1/product-control/order-lines/amounts", {
44686
+ ...input,
44687
+ provider: "dropi"
44688
+ }));
44689
+ } catch (error) {
44690
+ throw translateError(error);
44691
+ }
44692
+ });
44588
44693
  server.registerTool("create_manual_product", {
44589
44694
  description: createManualProductGuidance.summary + " Pide TODOS los datos antes de llamarla: el costo del proveedor y el flete sin inventar \u2014 un cero volver\xEDa infinitamente rentable el producto. Las dos tasas son proporciones 0\u20131 y SU estimaci\xF3n, no una medici\xF3n. Reintentar con los mismos datos devuelve el mismo producto; no duplica.",
44590
44695
  inputSchema: CreateManualProductInput.shape,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productmaker/mcp",
3
- "version": "12.30.0",
3
+ "version": "12.31.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.",