@ar-agents/mercadopago 0.15.0 → 0.15.2
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 +3 -1
- package/CHANGELOG.md +33 -4
- package/MIGRATION.md +4 -4
- package/README.md +29 -16
- package/README.skeleton.md +2 -2
- package/cookbook/03-webhook-handler.ts +1 -1
- package/package.json +2 -2
- package/tools.manifest.json +1 -2
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
# @ar-agents/mercadopago — agent guide
|
|
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 89 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,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.2
|
|
4
|
+
|
|
5
|
+
### Patch — docs: tool-count accuracy (87 → 89)
|
|
6
|
+
|
|
7
|
+
The 0.15.1 docs pass under-counted the public tool surface as 87 due to a
|
|
8
|
+
grep mismatch on `tools.ts`. The actual exported count is 89 (verified by
|
|
9
|
+
`tools.manifest.json` regeneration and the `tools.test.ts` array assertion).
|
|
10
|
+
This patch updates the count everywhere it appears: package.json description
|
|
11
|
+
(npm tagline), README sub-headline, README "At a glance" row, AGENTS.md,
|
|
12
|
+
landing comparison table, layout meta description, OG image, root README.
|
|
13
|
+
|
|
14
|
+
No code changes. No new tools — this is purely a counting correction.
|
|
15
|
+
|
|
16
|
+
The CI manifest-drift gate also caught a stale `tools.manifest.json` version
|
|
17
|
+
field (still pointing at 0.15.0); the regenerated manifest now matches the
|
|
18
|
+
package version.
|
|
19
|
+
|
|
20
|
+
## 0.15.1
|
|
21
|
+
|
|
22
|
+
### Patch — docs: positioning + scope clarity
|
|
23
|
+
|
|
24
|
+
- `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."
|
|
25
|
+
- `README.md` sub-headline now enumerates the 17 categories. Fixes the drift where the npm page implied subscriptions-only scope.
|
|
26
|
+
- `AGENTS.md` heading no longer carries a stale `(v0.7)` tag; opening paragraph spells out the full surface.
|
|
27
|
+
- Cookbook recipe 03 header: "Production-grade webhook handler" → "Webhook handler".
|
|
28
|
+
- "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`.
|
|
29
|
+
- `MIGRATION.md`: dropped marketing adjectives ("agent ergonomics", "production-grade").
|
|
30
|
+
|
|
31
|
+
No code changes. No new tools. No API changes.
|
|
32
|
+
|
|
3
33
|
## 0.15.0
|
|
4
34
|
|
|
5
35
|
### Minor — `requireConfirmation` opt-in HITL callback (closes /review CRITICAL)
|
|
@@ -221,8 +251,7 @@ partitions. This makes the safe default: safe.
|
|
|
221
251
|
|
|
222
252
|
### Minor Changes — Production hardening: circuit breaker, deadline propagation, property-based tests, real MP sandbox integration tests, benchmarks
|
|
223
253
|
|
|
224
|
-
|
|
225
|
-
features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
|
|
254
|
+
Architectural features for at-scale deployment.
|
|
226
255
|
|
|
227
256
|
**Circuit Breaker (NEW)**
|
|
228
257
|
|
|
@@ -329,7 +358,7 @@ features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
|
|
|
329
358
|
|
|
330
359
|
- `cookbook/01-checkout-pro-basic.ts` — first-time hosted checkout
|
|
331
360
|
- `cookbook/02-saas-subscription.ts` — reusable plan + first payment + card swap on rejection
|
|
332
|
-
- `cookbook/03-webhook-handler.ts` —
|
|
361
|
+
- `cookbook/03-webhook-handler.ts` — Edge handler with HMAC verify
|
|
333
362
|
- `cookbook/04-marketplace-split.ts` — OAuth seller link → preference with fee → reconciliation
|
|
334
363
|
- `cookbook/05-qr-in-store.ts` — QR generation → buyer scan → WhatsApp notify
|
|
335
364
|
- `cookbook/06-3ds-challenge.ts` — detect → redirect → recover via webhook
|
|
@@ -346,7 +375,7 @@ features that separate a toolkit-with-tests from a toolkit-deployed-at-scale.
|
|
|
346
375
|
|
|
347
376
|
### Minor Changes
|
|
348
377
|
|
|
349
|
-
- MP v0.7:
|
|
378
|
+
- MP v0.7: +25 new tools (81 total).
|
|
350
379
|
|
|
351
380
|
**Cierre de gaps obvios (8 tools)**:
|
|
352
381
|
- `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
|
|
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
|
|
164
|
-
|
|
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 **
|
|
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
|
|
3
|
+
> Mercado Pago Agent Toolkit. Built on Vercel.
|
|
4
|
+
>
|
|
5
|
+
> 89 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
|
[](https://www.npmjs.com/package/@ar-agents/mercadopago)
|
|
6
13
|
[](https://www.npmjs.com/package/@ar-agents/mercadopago)
|
|
@@ -8,9 +15,9 @@
|
|
|
8
15
|
[](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml)
|
|
9
16
|
[](https://bundlephobia.com/package/@ar-agents/mercadopago)
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 | **
|
|
22
|
-
| Production hardening
|
|
23
|
-
| Test coverage | **
|
|
28
|
+
| Tools shipped | **89 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,24 @@ 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
|
|
32
|
-
| Cookbook |
|
|
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
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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.
|
|
49
|
+
|
|
50
|
+
## Deploy a runnable example
|
|
51
|
+
|
|
52
|
+
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Far-agents%2Far-agents&root-directory=apps%2Fmp-hello&env=MP_ACCESS_TOKEN%2CANTHROPIC_API_KEY%2CUPSTASH_REDIS_REST_URL%2CUPSTASH_REDIS_REST_TOKEN&envDescription=Mercado%20Pago%20access%20token%2C%20Anthropic%20API%20key%2C%20and%20Upstash%20Redis%20credentials%20for%20subscription%20state.&envLink=https%3A%2F%2Fgithub.com%2Far-agents%2Far-agents%2Ftree%2Fmain%2Fapps%2Fmp-hello%23setup&project-name=mp-hello&repository-name=mp-hello)
|
|
53
|
+
|
|
54
|
+
`apps/mp-hello` ships as a clonable Vercel template — Edge Runtime API routes,
|
|
55
|
+
MP webhook handler with HMAC verify, Upstash-backed subscription state.
|
|
43
56
|
|
|
44
57
|
## Install
|
|
45
58
|
|
package/README.skeleton.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
[](https://github.com/ar-agents/ar-agents/actions/workflows/ci.yml)
|
|
22
22
|
[](./LICENSE)
|
|
23
23
|
|
|
24
|
-
Mercado Pago Subscriptions, Payments, Checkout Pro, Marketplace,
|
|
24
|
+
Mercado Pago Agent Toolkit. Built on Vercel. 89 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
|
-
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ar-agents/mercadopago",
|
|
3
|
-
"version": "0.15.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.15.2",
|
|
4
|
+
"description": "Mercado Pago Agent Toolkit for the Vercel AI SDK 6. 89 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",
|
package/tools.manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://github.com/ar-agents/ar-agents/blob/main/tools-manifest.schema.json",
|
|
3
3
|
"package": "@ar-agents/mercadopago",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.2",
|
|
5
5
|
"factory": "mercadoPagoTools",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
@@ -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
|
}
|