@ar-agents/mercadopago 0.3.0 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar-agents/mercadopago",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Mercado Pago Subscriptions as drop-in tools for the Vercel AI SDK. Argentine-focused, agent-ready.",
5
5
  "keywords": [
6
6
  "mercadopago",
@@ -61,7 +61,7 @@
61
61
  {
62
62
  "name": "ESM",
63
63
  "path": "dist/index.js",
64
- "limit": "22 KB",
64
+ "limit": "32 KB",
65
65
  "ignore": [
66
66
  "node:crypto",
67
67
  "crypto"
@@ -70,7 +70,7 @@
70
70
  {
71
71
  "name": "CJS",
72
72
  "path": "dist/index.cjs",
73
- "limit": "22 KB",
73
+ "limit": "32 KB",
74
74
  "ignore": [
75
75
  "node:crypto",
76
76
  "crypto"
@@ -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.2.0",
4
+ "version": "0.5.0",
5
5
  "factory": "mercadoPagoTools",
6
6
  "tools": [
7
7
  {
@@ -341,6 +341,75 @@
341
341
  "purity": "io", "sideEffects": [],
342
342
  "input": {},
343
343
  "output": { "account_id": "string", "email": "string|null", "nickname": "string|null", "country_id": "string|null (AR for Argentina)", "site_id": "string|null (MLA for Argentina)", "user_type": "string|null" }
344
+ },
345
+ {
346
+ "name": "handle_webhook",
347
+ "summary": "v0.5 — Verify HMAC + parse + auto-fetch webhook in ONE call. THE recommended way to handle MP webhooks in production.",
348
+ "purity": "io", "sideEffects": ["Fetches Payment / Preapproval AS the configured client when auto_fetch=true"],
349
+ "constraints": { "latencyMs": "150-700", "envVars": ["webhookSecret in tools options"] },
350
+ "input": { "raw_body": "string (raw JSON body — do NOT re-stringify)", "signature_header": "string|null (x-signature)", "request_id_header": "string|null (x-request-id)", "auto_fetch": "boolean? default true" },
351
+ "output": { "verified": "boolean", "event": "{ topic, dataId, action, raw } | null", "resource": "Payment | Preapproval | null", "resource_error": "string | null", "error": "string | null" },
352
+ "whenToUse": ["Always in webhook endpoints — REJECT (HTTP 401) when verified=false"]
353
+ },
354
+ {
355
+ "name": "oauth_authorize_url",
356
+ "summary": "v0.5 — Build the URL the SELLER visits to authorize your marketplace app. Pure function.",
357
+ "purity": "pure", "sideEffects": [],
358
+ "constraints": { "latencyMs": "<1" },
359
+ "input": { "redirect_uri": "string (must be whitelisted in MP dev panel)", "state": "string (CSRF token, bind to user session)" },
360
+ "output": { "available": "boolean", "url": "string|null", "next_step": "string" }
361
+ },
362
+ {
363
+ "name": "oauth_exchange_code",
364
+ "summary": "v0.5 — Exchange the OAuth code (from redirect) for OAuthToken { access_token, refresh_token, user_id, expires_in }.",
365
+ "purity": "io", "sideEffects": [],
366
+ "constraints": { "latencyMs": "200-500", "envVars": ["oauth.clientId + oauth.clientSecret in tools options"] },
367
+ "input": { "code": "string", "redirect_uri": "string (must EXACTLY match the URL used in oauth_authorize_url)" },
368
+ "output": { "available": "boolean", "token": "OAuthToken | null", "error": "string | null", "next_step": "string" }
369
+ },
370
+ {
371
+ "name": "oauth_refresh_token",
372
+ "summary": "v0.5 — Refresh a per-seller access_token. Always persist the new refresh_token (it may rotate).",
373
+ "purity": "io", "sideEffects": [],
374
+ "constraints": { "latencyMs": "150-400" },
375
+ "input": { "refresh_token": "string" },
376
+ "output": { "available": "boolean", "token": "OAuthToken | null", "error": "string | null" }
377
+ },
378
+ {
379
+ "name": "create_order",
380
+ "summary": "v0.5 — Create an Order (modern API). Supports manual capture (auth-only) and marketplace splits.",
381
+ "purity": "io", "sideEffects": ["Creates an Order in MP"],
382
+ "constraints": { "latencyMs": "200-500" },
383
+ "input": { "type": "'online' | 'in_store'", "currency_id": "string? (default ARS)", "external_reference": "string?", "total_amount": "number?", "items": "array?", "payer_email": "string?", "capture_mode": "'automatic' | 'manual'?", "notification_url": "string?", "marketplace": "string?", "marketplace_fee": "number? (ARS)", "collector_id": "string|number? (seller MP user_id)" },
384
+ "output": { "order_id": "string", "status": "string", "capture_mode": "string", "total_amount": "number" }
385
+ },
386
+ {
387
+ "name": "get_order",
388
+ "summary": "v0.5 — Fetch an Order by id.",
389
+ "purity": "io", "sideEffects": [],
390
+ "input": { "order_id": "string" },
391
+ "output": "Order"
392
+ },
393
+ {
394
+ "name": "update_order",
395
+ "summary": "v0.5 — Patch an Order (external_reference, total_amount).",
396
+ "purity": "io", "sideEffects": ["Mutates Order"],
397
+ "input": { "order_id": "string", "external_reference": "string?", "total_amount": "number?" },
398
+ "output": "Order"
399
+ },
400
+ {
401
+ "name": "capture_order",
402
+ "summary": "v0.5 — Capture an authorized Order (capture_mode='manual'). Optional partial-capture amount.",
403
+ "purity": "io", "sideEffects": ["Captures funds — IRREVERSIBLE"],
404
+ "input": { "order_id": "string", "amount": "number?" },
405
+ "output": { "order_id": "string", "status": "string", "captured_amount": "number" }
406
+ },
407
+ {
408
+ "name": "cancel_order",
409
+ "summary": "v0.5 — Cancel a non-captured Order. Releases auth-holds. For captured orders, use refund_payment.",
410
+ "purity": "io", "sideEffects": ["Cancels Order"],
411
+ "input": { "order_id": "string" },
412
+ "output": { "order_id": "string", "status": "string" }
344
413
  }
345
414
  ]
346
415
  }