@ar-agents/mercadopago 0.18.2 → 0.18.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e73be19`](https://github.com/ar-agents/ar-agents/commit/e73be1945206b3f2ebce0eed13a74ada238b6c22) Thanks [@naza00000](https://github.com/naza00000)! - Make `VercelKVRateLimiter` token acquisition atomic (DeepSec MEDIUM, `rate-limit-bypass`).
8
+
9
+ `acquire()` / `tryAcquire()` previously did a non-atomic read → refill → check → decrement → write across separate KV calls, so concurrent callers could all observe the same lone token and each succeed — bypassing the global limit. Acquisition now runs a single server-side Upstash Lua `EVAL` script, so the refill-and-consume is atomic across all serverless instances and the limit holds exactly (no over-spend window). `learnFromHeaders` uses the same atomic primitive for its adaptive clamp. Behavior and the public API are unchanged.
10
+
11
+ ## 0.18.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Rebuild and republish from PII-scrubbed source. Versions published before the 2026-06-17 fixture scrub shipped a real CUIT and address in their README/AGENTS/cookbook/dist; this rebuild from the now-clean source removes them. No API changes. The earlier contaminated versions are deprecated on npm.
16
+
3
17
  ## 0.18.2
4
18
 
5
19
  ### Patch Changes
@@ -21,7 +21,7 @@
21
21
  * as a Vercel Edge Function for sub-100ms global cold starts.
22
22
  */
23
23
 
24
- import { Experimental_Agent as Agent, stepCountIs } from "ai";
24
+ import { Experimental_Agent as Agent, isStepCount } from "ai";
25
25
  import {
26
26
  InMemoryStateAdapter,
27
27
  MercadoPagoClient,
@@ -50,7 +50,7 @@ Cuando el cliente quiere comprar:
50
50
  backUrl: "https://yourapp.com/payment-result",
51
51
  notificationUrl: "https://yourapp.com/api/mp/webhook",
52
52
  }),
53
- stopWhen: stepCountIs(5),
53
+ stopWhen: isStepCount(5),
54
54
  });
55
55
 
56
56
  // In a Next.js route handler:
@@ -51,7 +51,7 @@
51
51
  */
52
52
 
53
53
  import { trace, context as otelContext } from "@opentelemetry/api";
54
- import { Experimental_Agent as Agent, stepCountIs } from "ai";
54
+ import { Experimental_Agent as Agent, isStepCount } from "ai";
55
55
  import {
56
56
  MercadoPagoClient,
57
57
  mercadoPagoTools,
@@ -108,7 +108,7 @@ export const agent = new Agent({
108
108
  model: "anthropic/claude-sonnet-4-6",
109
109
  instructions: "You are a billing assistant for a SaaS in Argentina.",
110
110
  tools,
111
- stopWhen: stepCountIs(8),
111
+ stopWhen: isStepCount(8),
112
112
  });
113
113
 
114
114
  /**
@@ -22,7 +22,7 @@
22
22
  * ATTESTATION_HMAC_SECRET
23
23
  */
24
24
 
25
- import { Experimental_Agent as Agent, stepCountIs, type ToolSet } from "ai";
25
+ import { Experimental_Agent as Agent, isStepCount, type ToolSet } from "ai";
26
26
 
27
27
  // 1. Mercado Pago — always present, the headline package.
28
28
  import {
@@ -135,7 +135,7 @@ export async function buildBillingAgent() {
135
135
  "comprobante por WhatsApp con `send_text`. Respondé en castellano " +
136
136
  "rioplatense, breve, sin emojis.",
137
137
  tools,
138
- stopWhen: stepCountIs(15), // higher than usual — multi-package flows take steps
138
+ stopWhen: isStepCount(15), // higher than usual — multi-package flows take steps
139
139
  });
140
140
  }
141
141
 
@@ -59,7 +59,7 @@
59
59
  * # Sample agent loop (USA-LLC side, using Vercel AI SDK 6 + MCP client)
60
60
  */
61
61
 
62
- import { Experimental_Agent as Agent, stepCountIs } from "ai";
62
+ import { Experimental_Agent as Agent, isStepCount } from "ai";
63
63
  // In a USA agent's project, you'd use the MCP client from `ai` v6 (or `@modelcontextprotocol/sdk`)
64
64
  // to connect to the locally-spawned ar-agents MCP server. The agent then sees
65
65
  // every @ar-agents/* tool in its tool list.
@@ -86,7 +86,7 @@ async function exampleAgentLoop() {
86
86
  "yourself.",
87
87
  // tools, // injected from MCP client
88
88
  tools: {} as Record<string, unknown>,
89
- stopWhen: stepCountIs(10),
89
+ stopWhen: isStepCount(10),
90
90
  });
91
91
 
92
92
  // What the agent does behind this prompt:
@@ -125,7 +125,7 @@ export async function POST(req: Request) {
125
125
  try {
126
126
  const result = streamText({
127
127
  model: "anthropic/claude-sonnet-4-6",
128
- system: SYSTEM,
128
+ instructions: SYSTEM,
129
129
  messages: modelMessages,
130
130
  tools,
131
131
  stopWhen: ({ steps }) => steps.length >= 8,
@@ -503,7 +503,7 @@ export async function generateQuarterlyComplianceReport(
503
503
  // {
504
504
  // "sociedad": {
505
505
  // "denominacion": "Sociedad-IA Demo SAS",
506
- // "operatorCuit": "20-41758101-5",
506
+ // "operatorCuit": "20-12345678-6",
507
507
  // "jurisdiction": "AR",
508
508
  // "rfcConformance": ["rfc-001-v1", "rfc-004-draft"],
509
509
  // "auditBaseUrl": "https://ar-agents.ar"
package/dist/index.cjs CHANGED
@@ -5174,7 +5174,7 @@ function buildAllTools(client, options, desc) {
5174
5174
  description: desc("validate_tax_id"),
5175
5175
  inputSchema: zod.z.object({
5176
5176
  tax_id: zod.z.string().min(1).describe(
5177
- "The tax ID to validate. Accepts any format with or without separators (20-41758101-5, 20.41758101.5, 20417581015 all work for AR CUIT)."
5177
+ "The tax ID to validate. Accepts any format with or without separators (20-12345678-6, 20.12345678.6, 20123456786 all work for AR CUIT)."
5178
5178
  ),
5179
5179
  type: zod.z.enum([
5180
5180
  "DNI",