@ar-agents/mercadopago 0.15.0 → 0.15.1

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/AGENTS.md CHANGED
@@ -1,7 +1,9 @@
1
- # @ar-agents/mercadopago — agent guide (v0.7)
1
+ # @ar-agents/mercadopago — agent guide
2
2
 
3
3
  This file is for AI agents using or recommending this package. Humans should start with [README.md](./README.md). Format follows the [agents.md convention](https://agents.md/).
4
4
 
5
+ `@ar-agents/mercadopago` is a Mercado Pago Agent Toolkit for the Vercel AI SDK 6. It exposes 87 typed tools spanning the agent-relevant Mercado Pago API surface (Subscriptions, Payments, Checkout Pro, Marketplace OAuth, Order Management, Customers, Cards, Cuotas, QR, 3DS, Point devices, Stores+POS, Account/Balance/Settlements, Webhooks, Disputes, Lookups, Bank Accounts). Opinionated for AR; ships with cross-LATAM tax-id helpers.
6
+
5
7
  ## Decision tree — pick the right tool
6
8
 
7
9
  | User intent | Tool to call |
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch — docs: positioning + scope clarity
6
+
7
+ - `package.json` description rewritten as the npm-tagline source of truth: "Mercado Pago Agent Toolkit for the Vercel AI SDK 6. 87 typed tools across the agent-relevant Mercado Pago API surface — Subscriptions, Payments, Checkout Pro, Marketplace OAuth, Order Management, Customers, Cards, Cuotas, QR, 3DS, Point devices, Webhooks, Stores+POS, Account/Balance/Settlements, Disputes, Lookups, Bank Accounts."
8
+ - `README.md` sub-headline now enumerates the 17 categories. Fixes the drift where the npm page implied subscriptions-only scope.
9
+ - `AGENTS.md` heading no longer carries a stale `(v0.7)` tag; opening paragraph spells out the full surface.
10
+ - Cookbook recipe 03 header: "Production-grade webhook handler" → "Webhook handler".
11
+ - "At a glance" table: tool count corrected (82 → 87), test count refreshed (223 → 303), cookbook count corrected (8 → 9), `Vercel-native` row clarified to `Vercel KV adapters`.
12
+ - `MIGRATION.md`: dropped marketing adjectives ("agent ergonomics", "production-grade").
13
+
14
+ No code changes. No new tools. No API changes.
15
+
3
16
  ## 0.15.0
4
17
 
5
18
  ### Minor — `requireConfirmation` opt-in HITL callback (closes /review CRITICAL)
@@ -221,8 +234,7 @@ partitions. This makes the safe default: safe.
221
234
 
222
235
  ### Minor Changes — Production hardening: circuit breaker, deadline propagation, property-based tests, real MP sandbox integration tests, benchmarks
223
236
 
224
- The "100/100, top-1 in the world" upgrade. Architectural production-grade
225
- features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
237
+ Architectural features for at-scale deployment.
226
238
 
227
239
  **Circuit Breaker (NEW)**
228
240
 
@@ -329,7 +341,7 @@ features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
329
341
 
330
342
  - `cookbook/01-checkout-pro-basic.ts` — first-time hosted checkout
331
343
  - `cookbook/02-saas-subscription.ts` — reusable plan + first payment + card swap on rejection
332
- - `cookbook/03-webhook-handler.ts` — production-grade Edge handler with HMAC verify
344
+ - `cookbook/03-webhook-handler.ts` — Edge handler with HMAC verify
333
345
  - `cookbook/04-marketplace-split.ts` — OAuth seller link → preference with fee → reconciliation
334
346
  - `cookbook/05-qr-in-store.ts` — QR generation → buyer scan → WhatsApp notify
335
347
  - `cookbook/06-3ds-challenge.ts` — detect → redirect → recover via webhook
@@ -346,7 +358,7 @@ features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
346
358
 
347
359
  ### Minor Changes
348
360
 
349
- - MP v0.7: completeness máxima — el agente de MP más completo posible. **+25 tools (81 total)**.
361
+ - MP v0.7: +25 new tools (81 total).
350
362
 
351
363
  **Cierre de gaps obvios (8 tools)**:
352
364
  - `get_customer`, `update_customer`, `create_customer_card`, `get_customer_card`
package/MIGRATION.md CHANGED
@@ -150,7 +150,7 @@ new MercadoPagoClient({
150
150
  - **Status detail explainer** (`explainPaymentStatus` — Spanish actionable guidance)
151
151
  - **Marketplace fee calculator** (`computeMarketplaceFee`)
152
152
  - **Vercel KV state adapters** (subscription state + OAuth tokens + idempotency cache + audit log)
153
- - **Cookbook** with 8 production-grade recipes
153
+ - **Cookbook** with 8 cookbook recipes
154
154
  - **Edge Runtime support** (Web Crypto, no `node:crypto`)
155
155
  - **Property-based testing** with fast-check (~1500 random scenarios)
156
156
  - **Failure injection tests** + integration tests vs MP sandbox
@@ -160,14 +160,14 @@ new MercadoPagoClient({
160
160
 
161
161
  - Your codebase is already deeply integrated with the official SDK
162
162
  - You don't need the agent layer (no Vercel AI SDK)
163
- - You operate primarily server-side with cron jobs and don't care about
164
- agent ergonomics, audit logs, circuit breakers, or status explainers
163
+ - You operate primarily server-side with cron jobs and don't need
164
+ AI-SDK-shaped tool schemas, audit logs, circuit breakers, or status explainers
165
165
 
166
166
  ## When to add `@ar-agents/mercadopago`
167
167
 
168
168
  - You're building anything with an AI agent (Claude, GPT, Gemini)
169
169
  - You're deploying to Vercel and want first-class KV adapters
170
- - You need **production-grade webhook handling** (HMAC + dedup + replay protection)
170
+ - You need **cookbook webhook handling** (HMAC + dedup + replay protection)
171
171
  - You operate a **marketplace** with per-seller OAuth flows
172
172
  - You need **compliance-grade audit logging** for refunds/payments
173
173
  - You want **AR-specific knowledge** (cuotas catalog, status_detail explainer in Spanish, AR landmines documented)
package/README.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # @ar-agents/mercadopago
2
2
 
3
- > Mercado Pago Subscriptions as drop-in tools for the [Vercel AI SDK](https://ai-sdk.dev/). Argentine-focused, agent-ready.
3
+ > Mercado Pago Agent Toolkit. Built on Vercel.
4
+ >
5
+ > 87 typed tools across the agent-relevant Mercado Pago API surface, for the
6
+ > [Vercel AI SDK](https://ai-sdk.dev/) 6 `Experimental_Agent`.
7
+ >
8
+ > _Payments · Subscriptions · Checkout Pro · Marketplace OAuth · Order Management ·
9
+ > Customers · Cards · Cuotas · QR · 3DS · Point devices · Stores+POS ·
10
+ > Account/Balance/Settlements · Webhooks · Disputes · Lookups · Bank Accounts_
4
11
 
5
12
  [![npm version](https://img.shields.io/npm/v/@ar-agents/mercadopago.svg)](https://www.npmjs.com/package/@ar-agents/mercadopago)
6
13
  [![npm downloads](https://img.shields.io/npm/dm/@ar-agents/mercadopago.svg)](https://www.npmjs.com/package/@ar-agents/mercadopago)
@@ -8,9 +15,9 @@
8
15
  [![CI](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml/badge.svg)](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml)
9
16
  [![bundle size](https://img.shields.io/bundlephobia/minzip/@ar-agents/mercadopago.svg)](https://bundlephobia.com/package/@ar-agents/mercadopago)
10
17
 
11
- Exposes Mercado Pago's recurring-billing API to AI agents through a typed,
12
- opinionated tool collection. Built for the Vercel AI SDK 6 `Experimental_Agent`.
13
- Compatible with any caller that uses `tool()`.
18
+ Wraps the Mercado Pago API as a typed tool collection for AI agents. Built for
19
+ the Vercel AI SDK 6 `Experimental_Agent`. Compatible with any caller that uses
20
+ `tool()`.
14
21
 
15
22
  > **Reading this as an agent?** Skip to [AGENTS.md](./AGENTS.md) — it's targeted at LLM consumption with explicit tool-selection rules and error-recovery patterns.
16
23
 
@@ -18,9 +25,9 @@ Compatible with any caller that uses `tool()`.
18
25
 
19
26
  | What | Value |
20
27
  | --- | --- |
21
- | Tools shipped | **82 tools** — covers the full agent-relevant MP API surface. Subscriptions, Payments, Refunds, Checkout Pro, Order Management, Customers, Saved Cards, Cuotas, QR in-store, Subscription Plans, Stores+POS, **Point Devices físicos**, **Merchant Orders**, **Bank Accounts**, Disputes, Lookups, Webhooks management, **handle_webhook combo**, **OAuth Marketplace flow**, **Account/Balance/Settlements**, **3DS analyzer**, **Test cards**, **mp_health_check**, plus pure helpers `compute_marketplace_fee` + `explain_payment_status`. |
22
- | Production hardening (v0.9) | **Circuit breaker** with state machine + rolling window, **deadline propagation** via parent AbortSignal, **W3C Trace Context** propagation (OpenTelemetry-compatible without peer dep), **replay-attack protection** on webhook signatures (5-min default tolerance), **health check** endpoint. |
23
- | Test coverage | **223 unit tests** + **14 property-based tests** (~1400 random scenarios via fast-check) + **11 failure injection tests** (network errors, timeouts, races, malformed responses) + **integration tests vs MP sandbox** (gated by env var) + **benchmarks** (`pnpm bench`). |
28
+ | Tools shipped | **87 tools** — covers the agent-relevant MP API surface. Subscriptions, Payments, Refunds, Checkout Pro, Order Management, Customers, Saved Cards, Cuotas, QR in-store, Subscription Plans, Stores+POS, Point Devices físicos, Merchant Orders, Bank Accounts, Disputes, Lookups, Webhooks management, `handle_webhook` combo, OAuth Marketplace flow, Account/Balance/Settlements, 3DS analyzer, Test cards, `mp_health_check`, plus pure helpers `compute_marketplace_fee` + `explain_payment_status`. |
29
+ | Production hardening | Circuit breaker with state machine + rolling window, deadline propagation via parent AbortSignal, W3C Trace Context propagation (OpenTelemetry-compatible without peer dep), replay-attack protection on webhook signatures (5-min default tolerance), `mp_health_check` endpoint. |
30
+ | Test coverage | **303 tests** — unit + property-based (~1400 random scenarios via fast-check) + failure injection (network errors, timeouts, races, malformed responses) + integration vs MP sandbox (gated by env var) + benchmarks (`pnpm bench`). |
24
31
  | External dependencies | Mercado Pago access token (TEST or APP_USR), state adapter (Upstash, Redis, Postgres, in-memory, etc.) |
25
32
  | Latency | 200–600ms per MP call; <1ms for state ops |
26
33
  | Cost | $0 — MP API is free; merchant pays per-transaction fees on auto-charges |
@@ -28,18 +35,17 @@ Compatible with any caller that uses `tool()`.
28
35
  | Agent safety | `cancel_subscription` description triggers confirm-before-call in Claude Sonnet 4.6+ |
29
36
  | Sites supported | MLA (Argentina) verified end-to-end. Other LATAM sites should work but aren't exercised by tests. |
30
37
  | Runtime | **Edge Runtime + Node 18+** — Web Crypto under the hood, no `node:crypto`. Drops into Vercel Edge Functions, Cloudflare Workers, Deno deploy, or any modern Node. |
31
- | Vercel-native | First-class adapters for **Vercel KV** (subscription state, OAuth tokens, idempotency cache) via `@ar-agents/mercadopago/vercel-kv` subpath. |
32
- | Cookbook | 8 production-grade recipes shipped in `cookbook/` — checkout, subscriptions, webhook handler, marketplace OAuth, QR in-store, 3DS challenge, auth-only Order, recovery patterns. |
38
+ | Vercel KV adapters | Subpath `@ar-agents/mercadopago/vercel-kv` ships adapters for subscription state, OAuth tokens, idempotency cache, audit log, and rate limiter. |
39
+ | Cookbook | 9 recipes shipped in `cookbook/` — checkout, subscriptions, webhook handler, marketplace OAuth, QR in-store, 3DS challenge, auth-only Order, recovery patterns, full OpenTelemetry wiring. |
33
40
 
34
41
  ## Why this exists
35
42
 
36
- Building an agent that operates a real Argentine business means integrating
37
- Mercado Pago. MP's API has a surface area of dozens of endpoints, a docs site
38
- that is partially translated to Spanish-from-the-90s, and at least 11
39
- non-obvious landmines that take days each to discover. This package encapsulates
40
- the subset of MP that an agent typically needs (recurring subscriptions: create,
41
- check status, pause/resume, cancel) and turns the documented gotchas into typed
42
- errors with actionable messages.
43
+ Building an agent that operates an Argentine business means integrating Mercado
44
+ Pago. The API surface is dozens of endpoints, the docs are partially translated,
45
+ and there are 11+ non-obvious landmines that take days each to discover the
46
+ first time around. This package wraps the agent-relevant surface (subscriptions,
47
+ payments, marketplace OAuth, cuotas, QR, 3DS, point devices, webhooks) and turns
48
+ the documented gotchas into typed errors with actionable messages.
43
49
 
44
50
  ## Install
45
51
 
@@ -21,7 +21,7 @@
21
21
  [![CI](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml/badge.svg)](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml)
22
22
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
23
23
 
24
- Mercado Pago Subscriptions, Payments, Checkout Pro, Marketplace, and Point as drop-in tools for the [Vercel AI SDK](https://ai-sdk.dev/). Argentine-focused, agent-ready, Edge-Runtime-safe.
24
+ Mercado Pago Agent Toolkit. Built on Vercel. 87 typed tools across the agent-relevant Mercado Pago API surface (Subscriptions, Payments, Checkout Pro, Marketplace OAuth, Order Management, Customers, Cards, Cuotas, QR, 3DS, Point devices, Stores+POS, Account/Balance/Settlements, Webhooks, Disputes, Lookups, Bank Accounts) for the [Vercel AI SDK](https://ai-sdk.dev/) 6 `Experimental_Agent`. Edge-Runtime-safe.
25
25
 
26
26
  > **Reading this as an agent?** Skip to [AGENTS.md](./AGENTS.md) — decision tree, result schemas to memorize, error patterns, latency table.
27
27
 
@@ -164,7 +164,7 @@ const limiter = new VercelKVRateLimiter({
164
164
 
165
165
  ### Cookbook
166
166
 
167
- 8 production-grade recipes in [`./cookbook`](./cookbook/) — Checkout Pro, SaaS subscription, webhook handler, marketplace split, QR in-store, 3DS challenge, manual capture, recovery patterns, full OpenTelemetry wiring.
167
+ 9 recipes in [`./cookbook`](./cookbook/) — Checkout Pro, SaaS subscription, webhook handler, marketplace split, QR in-store, 3DS challenge, manual capture, recovery patterns, full OpenTelemetry wiring.
168
168
 
169
169
  ## Comparison
170
170
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Recipe 03 — Production-grade webhook handler.
2
+ * Recipe 03 — Webhook handler.
3
3
  *
4
4
  * # The 3-line summary
5
5
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ar-agents/mercadopago",
3
- "version": "0.15.0",
4
- "description": "The most complete Mercado Pago agent toolkit for Vercel AI SDK 6+. 82 tools, Edge Runtime, Vercel KV adapters, circuit breaker + deadline propagation + W3C trace context, HMAC webhook verify with replay protection, OAuth Marketplace, Order Management, Point Devices, marketplace splits, status_detail explainer in Spanish, AR-specific knowledge baked in. Property-tested + integration-tested vs MP sandbox + benchmarked.",
3
+ "version": "0.15.1",
4
+ "description": "Mercado Pago Agent Toolkit for the Vercel AI SDK 6. 87 typed tools across the agent-relevant Mercado Pago API surface Subscriptions, Payments, Checkout Pro, Marketplace OAuth, Order Management, Customers, Cards, Cuotas, QR, 3DS, Point devices, Webhooks, Stores+POS, Account/Balance/Settlements, Disputes, Lookups, Bank Accounts. Edge Runtime. Vercel KV adapters. OpenTelemetry. Deterministic idempotency. Programmatic HITL on irreversible ops.",
5
5
  "keywords": [
6
6
  "mercadopago",
7
7
  "mp",
@@ -656,7 +656,6 @@
656
656
  ],
657
657
  "name": "@ar-agents/mercadopago",
658
658
  "meta": {
659
- "generated_at": "2026-05-06T20:54:56.481Z",
660
659
  "generated_by": "scripts/regen-manifests.mjs",
661
660
  "tool_count": 89
662
661
  }