npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ar-agents/uala

v0.3.1

Published

Ualá Bis agent toolkit for the Vercel AI SDK 6. Typed tools for payment links, QR cobros, transaction history, payouts, balance + marketplace OAuth. Adapter pattern: pure types out of the box, real API behind a pluggable adapter so unit tests do not call

Readme

@ar-agents/uala

Ualá Bis agent toolkit for the Vercel AI SDK 6+. Typed tools for payment links, QR cobros, transaction history, payouts, balance, and marketplace OAuth. Adapter pattern: pure-types + validation out of the box, real API behind a pluggable adapter.

pnpm add @ar-agents/uala

Quick start

import { Experimental_Agent as Agent } from "ai";
import { ualaTools, UalaApiAdapter } from "@ar-agents/uala";
import { anthropic } from "@ai-sdk/anthropic";

const tools = ualaTools({
  adapter: new UalaApiAdapter({ apiKey: process.env.UALA_API_KEY! }),
});

const agent = new Agent({
  model: anthropic("claude-sonnet-4-7"),
  tools,
  system: "You are a billing assistant for an Argentine SaaS.",
});

const result = await agent.generate({
  prompt: "Crear un link de cobro por ARS 1.500 con descripción 'plan mensual'.",
});

What you get

Eight tools, all returning typed responses:

| Tool | What it does | | ----------------------------- | ----------------------------------------------------- | | uala_create_payment_link | Create a shareable payment link (with optional QR). | | uala_get_payment_link | Poll a link's status. | | uala_cancel_payment_link | Revoke an open link. | | uala_list_transactions | List account movements with pagination. | | uala_get_transaction | Fetch a single transaction. | | uala_get_balance | Current available + pending balance. | | uala_create_payout | Initiate a payout to a CBU. Idempotency-keyed. | | uala_get_payout | Track payout status to completion. |

Adapter pattern

The tool layer never touches the network directly. It calls an UalaAdapter. The default is UnconfiguredUalaAdapter, which throws UalaUnconfiguredError on every call — safe for unit tests, fails loud in production if you forgot to wire credentials.

import { UalaApiAdapter } from "@ar-agents/uala";

const adapter = new UalaApiAdapter({
  apiKey: process.env.UALA_API_KEY!,
  // Optional. Override for sandbox / staging:
  baseUrl: "https://api.uala.com.ar/v1",
  // Optional. Custom fetch for tests, OTel, or custom timeouts:
  fetchImpl: fetch,
  timeoutMs: 10_000,
});

You can also bring your own adapter by implementing the UalaAdapter interface. Examples: in-memory mock for integration tests, a fake that simulates timeouts, a metered proxy in front of the real API.

Marketplace OAuth

For multi-merchant integrations, use the OAuth helpers (pure functions, no agent tools — the OAuth dance is server-driven by the host):

import { buildAuthorizeUrl, exchangeCodeForToken } from "@ar-agents/uala";

// Step 1: redirect the merchant.
const authorizeUrl = buildAuthorizeUrl({
  clientId: process.env.UALA_OAUTH_CLIENT_ID!,
  redirectUri: "https://yourapp.com/uala/callback",
  scope: ["payments.read", "payouts.write"],
  state: randomCsrfToken,
});

// Step 2: exchange code for token in your callback handler.
const tokens = await exchangeCodeForToken({
  clientId: process.env.UALA_OAUTH_CLIENT_ID!,
  clientSecret: process.env.UALA_OAUTH_CLIENT_SECRET!,
  redirectUri: "https://yourapp.com/uala/callback",
  code,
});
// Store tokens.accessToken, tokens.refreshToken, tokens.expiresAt per merchant.

Errors

All errors inherit from UalaError:

import {
  UalaError,
  UalaUnconfiguredError,
  UalaAuthError,
  UalaApiError,
  UalaValidationError,
} from "@ar-agents/uala";

try {
  await tools.uala_create_payout.execute({
    amount: 100000,
    destinationCbu: "0".repeat(22),
  });
} catch (e) {
  if (e instanceof UalaAuthError) /* re-auth */;
  else if (e instanceof UalaValidationError) /* bad input, do not retry */;
  else if (e instanceof UalaApiError) /* check e.status */;
  else throw e;
}

Constraints (quick reference)

  • Amounts in centavos for ARS, cents for USD. No floats.
  • CBU is 22 digits exactly.
  • idempotencyKey honored for create_payment_link and create_payout.
  • Currency defaults to ARS.
  • 10-second hard timeout per request.

For LLM agents using these tools, see AGENTS.md.

License

MIT — Nazareno Clemente [email protected]