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/iva-percepciones

v0.2.5

Published

IVA perception agent toolkit for the Vercel AI SDK 6. Federal value-added tax perceptions per RG 2408/08 (general regime) and the most common sub-regimes. Pure calculator + DDJJ assembly: per-invoice perception math with minimum thresholds, agente-de-perc

Readme

@ar-agents/iva-percepciones

IVA perceptions agent toolkit for the Vercel AI SDK 6+. Federal value-added tax perceptions per RG 2408/08 and the most common sub-regimes: per-invoice math (rate × neto, with mínimo + waiver checks) plus monthly SIRE DDJJ assembly.

pnpm add @ar-agents/iva-percepciones

What this package does

  • Pure math for IVA perceptions. No network. Unit-testable.
  • RG 2408/08 régimen general out of the box with current (2024-Q4) rates: 1.5% RI, 3% no-categorizado, 0% monotributista / exento / consumidor final.
  • Buyer-condition gates — automatic 0 with waiverReason for monotributistas, exentos, consumidores finales, and buyers with a non-perception certificate.
  • Mínimo support — bring your own rate-table for sub-regimes (RG 3337 combustibles, RG 2126 servicios) that have a non-zero threshold.
  • DDJJ assemblybuildPerceptionDdjj rolls a list of perception results into per-regime + per-buyer breakdowns ready for SIRE.

What this package does NOT do (v0.1)

  • Submit SIRE DDJJ to AFIP/ARCA. Adapter contract only; ship your own credentialed adapter for actual submission.
  • Sub-regime rates baked-in. RG 3337 (combustibles) and RG 2126 (servicios) get a stub regime code but no default table. Pass your own rateTable.
  • Provincial perceptions. Those are IIBB perceptions — use @ar-agents/iibb.
  • Customs-stage IVA. Régimen de pagos a cuenta en aduana is a different beast.

Quick start

import { calculatePerception } from "@ar-agents/iva-percepciones";

const r = calculatePerception({
  regime: "rg_2408_general",
  buyerCondition: "responsable_inscripto",
  buyerCuit: "20-12345678-9",
  netCentavos: 10_000_000, // ARS 100.000
  operationDate: "2026-01-15",
});
console.log(r.perceptionCentavos); // 150_000 = ARS 1.500

Wired as agent tools:

import { Experimental_Agent as Agent } from "ai";
import { ivaPerceptionTools } from "@ar-agents/iva-percepciones";
import { anthropic } from "@ai-sdk/anthropic";

const agent = new Agent({
  model: anthropic("claude-sonnet-4-7"),
  tools: ivaPerceptionTools(), // 3 tools
  system: "Eres un contador asistente.",
});

Monthly SIRE DDJJ

import {
  calculatePerception,
  asEntry,
  buildPerceptionDdjj,
} from "@ar-agents/iva-percepciones";

const r1 = calculatePerception({ /* ... */ });
const r2 = calculatePerception({ /* ... */ });

const ddjj = buildPerceptionDdjj({
  period: "2026-01",
  agentCuit: "20-12345678-6",
  entries: [asEntry("FA-A-001", r1), asEntry("FA-A-002", r2)],
});
// ddjj.totals: { netCentavos, perceptionCentavos, entryCount }
// ddjj.byRegime
// ddjj.byBuyer (sorted by perception desc)

Errors

import {
  IvaPerceptionError,
  IvaPerceptionValidationError,
  IvaPerceptionRateNotFoundError,
  IvaPerceptionUnconfiguredError,
} from "@ar-agents/iva-percepciones";

Constraints

  • Centavos for all amounts. No floats.
  • Rates are fractions (0.015 = 1.5%).
  • operationDate is YYYY-MM-DD, period is YYYY-MM.
  • CUIT is 11 digits (hyphens optional).

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

License

MIT — Nazareno Clemente [email protected]