@ar-agents/treasury 0.2.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/LICENSE +21 -0
- package/README.md +36 -0
- package/dist/index.cjs +843 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +611 -0
- package/dist/index.d.ts +611 -0
- package/dist/index.js +808 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.cjs +278 -0
- package/dist/tools.cjs.map +1 -0
- package/dist/tools.d.cts +132 -0
- package/dist/tools.d.ts +132 -0
- package/dist/tools.js +274 -0
- package/dist/tools.js.map +1 -0
- package/package.json +102 -0
- package/tools.manifest.json +158 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/afip.ts","../src/index.ts","../src/tools.ts"],"names":[],"mappings":";;;;;;AA6CO,IAAM,2BAAA,GAA8B,YAAA;AAmBpC,IAAM,gBAAA,GAA8C;AAAA,EACzD,EAAE,QAAA,EAAU,GAAA,EAAK,YAAA,EAAc,aAAA,EAAe,gBAAgB,QAAA,EAAW,WAAA,EAAa,QAAA,EAAW,UAAA,EAAY,KAAA,EAAM;AAAA,EACnH,EAAE,QAAA,EAAU,GAAA,EAAK,YAAA,EAAc,aAAA,EAAe,gBAAgB,QAAA,EAAW,WAAA,EAAa,QAAA,EAAW,UAAA,EAAY,KAAA,EAAM;AAAA,EACnH,EAAE,QAAA,EAAU,GAAA,EAAK,YAAA,EAAc,aAAA,EAAe,gBAAgB,QAAA,EAAW,WAAA,EAAa,QAAA,EAAW,UAAA,EAAY,KAAA,EAAM;AAAA,EACnH,EAAE,QAAA,EAAU,GAAA,EAAK,YAAA,EAAc,aAAA,EAAe,gBAAgB,OAAA,EAAW,WAAA,EAAa,QAAA,EAAW,UAAA,EAAY,KAAA,EAAM;AAAA,EACnH,EAAE,QAAA,EAAU,GAAA,EAAK,YAAA,EAAc,aAAA,EAAe,gBAAgB,SAAA,EAAY,WAAA,EAAa,QAAA,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B,IAAA,CAAK;AAAA,MAC5B,WAAA,EACE,sPAAA;AAAA,MAGF,WAAA,EAAa,EAAE,MAAA,CAAO,EAAE,MAAM,CAAA,CAAE,MAAA,IAAU,CAAA;AAAA,MAC1C,OAAA,EAAS,OAAO,EAAE,IAAA,EAAK,KAAM;AAC3B,QAAA,IAAI,CAAC,SAAS,OAAO,SAAA;AACrB,QAAA,IAAI,CAAC,OAAA,CAAQ,SAAA;AACX,UAAA,OAAO,EAAE,SAAA,EAAW,KAAA,EAAgB,MAAA,EAAQ,2CAAA,EAA4C;AAC1F,QAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,SAAA,CAAU,IAAI,CAAA;AAC3C,QAAA,OAAO,EAAE,SAAA,EAAW,IAAA,EAAe,GAAG,MAAA,EAAO;AAAA,MAC/C;AAAA,KACD;AAAA,GACH;AACF","file":"tools.js","sourcesContent":["/**\n * The AFIP/ARCA fiscal layer of the treasury rail.\n *\n * (ARCA = Agencia de Recaudación y Control Aduanero, the continuator of AFIP per\n * Decreto 953/2024, eff. 5-nov-2024. afip.gob.ar URLs still resolve.)\n *\n * THE HONEST FINDING (verified jun-2026): there is NO fully-autonomous, official\n * channel for a private entity to pay its taxes at pay-time. So this module does\n * NOT pretend to \"pay AFIP.\" It does the parts that are real:\n * 1. Compute the obligation (monotributo cuota here; cedular lives in index.ts).\n * 2. Describe the settlement honestly — what is automatable vs. human-required.\n * The treasury brain (index.ts) sizes + funds the ARS buffer so that whatever\n * settlement rail the society configured can succeed on time.\n *\n * Why no autonomy (all verified against ARCA + MercadoPago official docs):\n * - WSCREATEVEP (create a VEP via web service) is enabled ONLY for public\n * organisms, not private taxpayers. Do not build on it.\n * - Monotributo débito automático CANNOT be enrolled via API — it is a one-time\n * portal/bank step. Once enrolled it runs PASSIVELY (the monthly cuota debits\n * itself). The agent cannot trigger it; it can only ensure the CVU is funded.\n * - There is NO MercadoPago API to pay a VEP — it is a manual in-app flow\n * (scan QR, or enter CUIT + VEP number).\n * Full sourcing: ../../TREASURY-FISCAL-RAIL.md §3.\n */\n\nimport type { Ars, Obligation } from \"./index\";\n\n/**\n * Guard constant: documents (so nobody re-adds it) why WSCREATEVEP is unusable.\n */\nexport const WSCREATEVEP_IS_GOV_ONLY =\n \"AFIP/ARCA WSCREATEVEP is enabled only for public organisms (organismos \" +\n \"recaudadores), not private taxpayers. Do not build VEP creation on it. \" +\n \"See TREASURY-FISCAL-RAIL.md §3.\";\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Monotributo — the cleanest automatable (passive) path for a small operator.\n// Values per ARCA \"Valores de aplicación desde el 1/02/2026\". IPC-indexed ~every\n// 6 months: re-verify against https://www.afip.gob.ar/monotributo/categorias.asp.\n// Categories I/J/K require venta de bienes; a servicios taxpayer caps at H.\n// NOTE: monotributo is for personas humanas. A SAS/SRL/SA is in the general\n// regime (Ganancias + IVA + IIBB) — compute those via @ar-agents/facturacion +\n// sicore; this table is for a monotributista operator.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const MONOTRIBUTO_TABLE_EFFECTIVE = \"2026-02-01\";\n\nexport type MonotributoCategory =\n | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\" | \"H\" | \"I\" | \"J\" | \"K\";\n\nexport type MonotributoActivity = \"servicios\" | \"bienes\";\n\nexport interface MonotributoRow {\n category: MonotributoCategory;\n /** Annual gross-income ceiling for the category, ARS. */\n annualCapArs: Ars;\n /** Monthly total cuota for a services taxpayer, ARS. */\n cuotaServicios: Ars;\n /** Monthly total cuota for a goods taxpayer, ARS. */\n cuotaBienes: Ars;\n /** I/J/K are only available when selling goods. */\n bienesOnly: boolean;\n}\n\nexport const MONOTRIBUTO_2026: readonly MonotributoRow[] = [\n { category: \"A\", annualCapArs: 10_277_988.13, cuotaServicios: 42_386.74, cuotaBienes: 42_386.74, bienesOnly: false },\n { category: \"B\", annualCapArs: 15_058_447.71, cuotaServicios: 48_250.78, cuotaBienes: 48_250.78, bienesOnly: false },\n { category: \"C\", annualCapArs: 21_113_696.52, cuotaServicios: 56_501.85, cuotaBienes: 55_227.06, bienesOnly: false },\n { category: \"D\", annualCapArs: 26_212_853.42, cuotaServicios: 72_414.10, cuotaBienes: 70_661.26, bienesOnly: false },\n { category: \"E\", annualCapArs: 30_833_964.37, cuotaServicios: 102_537.97, cuotaBienes: 92_658.35, bienesOnly: false },\n { category: \"F\", annualCapArs: 38_642_048.36, cuotaServicios: 129_045.32, cuotaBienes: 111_198.27, bienesOnly: false },\n { category: \"G\", annualCapArs: 46_211_109.37, cuotaServicios: 197_108.23, cuotaBienes: 135_918.34, bienesOnly: false },\n { category: \"H\", annualCapArs: 70_113_407.33, cuotaServicios: 447_346.93, cuotaBienes: 272_063.40, bienesOnly: false },\n { category: \"I\", annualCapArs: 78_479_211.62, cuotaServicios: 824_802.26, cuotaBienes: 406_512.05, bienesOnly: true },\n { category: \"J\", annualCapArs: 89_872_640.30, cuotaServicios: 999_007.65, cuotaBienes: 497_059.41, bienesOnly: true },\n { category: \"K\", annualCapArs: 108_357_084.05, cuotaServicios: 1_381_687.90, cuotaBienes: 600_879.51, bienesOnly: true },\n];\n\n/** Monthly monotributo cuota for a category + activity, ARS. */\nexport function monotributoCuota(\n category: MonotributoCategory,\n activity: MonotributoActivity,\n): Ars {\n const row = MONOTRIBUTO_2026.find((r) => r.category === category);\n if (!row) throw new Error(`unknown monotributo category: ${category}`);\n if (row.bienesOnly && activity === \"servicios\") {\n throw new Error(\n `category ${category} is only available for venta de bienes (servicios caps at H)`,\n );\n }\n return activity === \"servicios\" ? row.cuotaServicios : row.cuotaBienes;\n}\n\n/**\n * The category an annual gross income falls into, for the given activity. A\n * services taxpayer caps at H; returns null if income exceeds the regime ceiling\n * (the taxpayer must move to the general regime).\n */\nexport function categoryForAnnualIncome(\n annualArs: Ars,\n activity: MonotributoActivity,\n): MonotributoCategory | null {\n const rows = MONOTRIBUTO_2026.filter(\n (r) => activity === \"bienes\" || !r.bienesOnly,\n );\n for (const r of rows) {\n if (annualArs <= r.annualCapArs) return r.category;\n }\n return null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Settlement model — HOW an obligation actually gets paid. The honest core:\n// NO method lets the agent settle autonomously at pay-time (canAutoExecute is\n// the literal type `false`). They differ in whether a one-time human setup makes\n// payment PASSIVE thereafter, or whether a human is needed every time.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type SettlementMethod = \"debito_automatico\" | \"vep_manual\" | \"mp_manual\";\n\n/**\n * - `passive`: a one-time human enrolment makes future payments run themselves;\n * the agent only has to keep the CVU funded (débito automático).\n * - `human-required`: a human must act for THIS payment (generate + pay a VEP).\n */\nexport type SettlementAutonomy = \"passive\" | \"human-required\";\n\nexport interface SettlementPlan {\n method: SettlementMethod;\n autonomy: SettlementAutonomy;\n /**\n * Whether the agent can settle with zero human action at pay-time. Typed as the\n * literal `false`: in jun-2026 NO official channel allows fully-autonomous tax\n * payment by a private entity. The rail funds + instructs; it does not pay.\n */\n canAutoExecute: false;\n amountArs: Ars;\n /** Epoch ms the obligation is due. */\n dueAtMs: number;\n /** What must happen for this obligation to actually be paid. */\n instruction: string;\n /** One-time human setup this method needs (empty string if none). */\n oneTimeSetup: string;\n}\n\n/**\n * Describe how a given obligation gets settled under the chosen method. Pure +\n * honest: the agent's autonomous part is funding the CVU (see index.ts\n * fundTaxBuffer); the settlement itself is passive (débito) or human (VEP/MP).\n */\nexport function settlementPlan(\n obligation: Obligation,\n method: SettlementMethod,\n): SettlementPlan {\n const base = {\n amountArs: obligation.amountArs,\n dueAtMs: obligation.dueAtMs,\n canAutoExecute: false as const,\n };\n switch (method) {\n case \"debito_automatico\":\n return {\n ...base,\n method,\n autonomy: \"passive\",\n instruction:\n \"Mantené al menos ARS \" +\n obligation.amountArs.toFixed(2) +\n \" en el CVU antes del vencimiento; el débito automático cobra la cuota solo.\",\n oneTimeSetup:\n \"Adherí el CBU/CVU al débito automático en el Portal Monotributo de ARCA (paso único, no hay API; el alta debe estar antes del día 20 para el débito del día 7 siguiente).\",\n };\n case \"vep_manual\":\n return {\n ...base,\n method,\n autonomy: \"human-required\",\n instruction:\n \"Generá el VEP/QR en ARCA (Mis Aplicaciones) y pagalo escaneando el QR o ingresando CUIT + número de VEP en tu billetera. El agente no puede pagar el VEP por API.\",\n oneTimeSetup: \"\",\n };\n case \"mp_manual\":\n return {\n ...base,\n method,\n autonomy: \"human-required\",\n instruction:\n \"Generá el VEP en ARCA y pagalo en Mercado Pago (Cuentas y servicios → AFIP VEP, o escaneá el QR). No existe API de Mercado Pago para pagar un VEP.\",\n oneTimeSetup: \"\",\n };\n }\n}\n","/**\n * @ar-agents/treasury — the fiscal/treasury rail for a Sociedad Automatizada.\n *\n * The moat half of the crypto<->fiat bridge: an autonomous society earns in\n * crypto (USDC on Base) but must pay AFIP in pesos. This module is the pure,\n * deterministic BRAIN of that loop: track balances, size the peso tax buffer,\n * plan a just-in-time USDC->ARS conversion, and account for the Ganancias\n * cedular tax on each disposal. The actual off-ramp (USDC->ARS payout to a CVU)\n * is done by an OffRampAdapter wrapping a registered PSAV (Manteca / Ripio B2B);\n * we integrate one, we do not become one (CNV RG 1058/2025).\n *\n * Pure functions (clock + fx injected, never read) so they are unit-testable and\n * deterministic. Irreversible moves (convert, pay) must be gated by the agent's\n * requireConfirmation (RFC-001) and written to the signed audit log by the caller.\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Money + state\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** Stablecoin balance, USDC (the society earns here). */\nexport type Usd = number;\n/** Peso balance, ARS (held in a CVU; what AFIP is paid from). */\nexport type Ars = number;\n\nexport interface TreasuryState {\n /** USDC balance (on Base). */\n usd: Usd;\n /** ARS balance (in the society's CVU). */\n ars: Ars;\n /**\n * Average USD cost basis per USDC unit currently held. For USDC ~= 1, but the\n * society may have acquired crypto that appreciated; cedular is on the gain.\n */\n costBasisPerUsd: number;\n}\n\nexport const ZERO_STATE: TreasuryState = { usd: 0, ars: 0, costBasisPerUsd: 1 };\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Ganancias cedular on a crypto disposal (verified: 5% ARS / 15% foreign, on the\n// GAIN; crypto is IVA-exempt; holding + own-wallet transfers are not taxable).\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type Denomination = \"ARS\" | \"FOREIGN\";\nexport const CEDULAR_RATE: Record<Denomination, number> = { ARS: 0.05, FOREIGN: 0.15 };\n\n/**\n * Cedular tax owed (in ARS) on disposing `amountUsd` of crypto with the given\n * per-unit cost basis, at `fxRate` (ARS per USD). Taxed on the gain only; 0 if no gain.\n */\nexport function cedularTax(\n amountUsd: Usd,\n costBasisPerUsd: number,\n fxRate: number,\n denom: Denomination = \"ARS\",\n): Ars {\n const proceeds = amountUsd * fxRate;\n const cost = amountUsd * costBasisPerUsd * fxRate;\n const gain = Math.max(0, proceeds - cost);\n return gain * CEDULAR_RATE[denom];\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Obligations (what the society owes AFIP / fisco) + the peso buffer\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ObligationKind = \"monotributo\" | \"vep\" | \"iibb\" | \"cedular\";\n\nexport interface Obligation {\n id: string;\n kind: ObligationKind;\n amountArs: Ars;\n /** Epoch ms when it is due. */\n dueAtMs: number;\n}\n\n/** The next obligation due at/after `nowMs`, or null. */\nexport function nextObligation(obligations: Obligation[], nowMs: number): Obligation | null {\n const upcoming = obligations\n .filter((o) => o.dueAtMs >= nowMs)\n .sort((a, b) => a.dueAtMs - b.dueAtMs);\n return upcoming[0] ?? null;\n}\n\n/**\n * ARS needed to cover every obligation due within `horizonMs` from now, times a\n * safety multiple (default 1.1) so a small fx move does not leave AFIP short.\n */\nexport function requiredArsBuffer(\n obligations: Obligation[],\n nowMs: number,\n horizonMs: number,\n safety = 1.1,\n): Ars {\n const due = obligations.filter((o) => o.dueAtMs >= nowMs && o.dueAtMs <= nowMs + horizonMs);\n const total = due.reduce((sum, o) => sum + o.amountArs, 0);\n return total * safety;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Just-in-time conversion policy\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface ConversionPlan {\n /** How much USDC to convert now (0 = do nothing). */\n convertUsd: Usd;\n /** ARS expected from that conversion, net of spread. */\n expectedArs: Ars;\n reason: string;\n}\n\n/**\n * Plan a just-in-time conversion: if the ARS balance is below `requiredArs`,\n * convert only enough USDC (at `fxRate` net of `spread`) to top the buffer back\n * up, capped by available USDC. Never over-converts (minimizes taxable disposals\n * + fx exposure). Pure.\n */\nexport function planConversion(\n state: TreasuryState,\n requiredArs: Ars,\n fxRate: number,\n spread = 0.01,\n): ConversionPlan {\n const shortfall = requiredArs - state.ars;\n if (shortfall <= 0) {\n return { convertUsd: 0, expectedArs: 0, reason: \"ars buffer sufficient\" };\n }\n const effectiveRate = fxRate * (1 - spread);\n if (effectiveRate <= 0 || state.usd <= 0) {\n return { convertUsd: 0, expectedArs: 0, reason: \"no usd available or invalid rate\" };\n }\n const neededUsd = shortfall / effectiveRate;\n const convertUsd = Math.min(neededUsd, state.usd);\n const expectedArs = convertUsd * effectiveRate;\n return {\n convertUsd,\n expectedArs,\n reason: convertUsd < neededUsd ? \"partial: usd insufficient for full buffer\" : \"top up to buffer\",\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Pure state transitions (apply a conversion / a payment)\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface OffRampReceipt {\n amountUsd: Usd;\n arsReceived: Ars;\n /** ARS per USD actually realized (net of spread). */\n rate: number;\n txId: string;\n /**\n * Set by session-model PSAVs (Ripio): the on-chain address the society must\n * send `amountUsd` USDC to in order to complete the off-ramp. Manteca (which\n * sells from the platform balance) leaves it undefined.\n */\n depositAddress?: string;\n}\n\n/** Apply a completed off-ramp conversion to the state (USDC down, ARS up). */\nexport function applyConversion(state: TreasuryState, receipt: OffRampReceipt): TreasuryState {\n return {\n usd: state.usd - receipt.amountUsd,\n ars: state.ars + receipt.arsReceived,\n costBasisPerUsd: state.costBasisPerUsd,\n };\n}\n\n/** Apply a tax/obligation payment (ARS down). Throws if it would overdraw the CVU. */\nexport function applyPayment(state: TreasuryState, amountArs: Ars): TreasuryState {\n if (amountArs > state.ars) {\n throw new Error(\n `insufficient ARS: need ${amountArs.toFixed(2)}, have ${state.ars.toFixed(2)}`,\n );\n }\n return { ...state, ars: state.ars - amountArs };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// OffRampAdapter — integrate a registered PSAV (Manteca first, Ripio B2B alt).\n// We never custody the conversion ourselves; we orchestrate on top of a PSAV.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface OffRampQuote {\n amountUsd: Usd;\n arsOut: Ars;\n /** Gross ARS per USD before spread. */\n rate: number;\n spread: number;\n}\n\n/** Settlement state of an off-ramp, normalized across PSAVs. */\nexport type OffRampStatus =\n | \"PENDING\"\n | \"PROCESSING\"\n | \"COMPLETED\"\n | \"FAILED\"\n | \"UNKNOWN\";\n\nexport interface OffRampStatusReport {\n txId: string;\n status: OffRampStatus;\n /** ARS actually settled to the CVU once COMPLETED, if the PSAV reports it. */\n arsSettled?: Ars;\n /** Provider-native status string, kept for the signed audit log / forensics. */\n raw?: string;\n}\n\nexport interface OffRampAdapter {\n /** Quote a USDC->ARS conversion (net of spread). No side effects. */\n quote(amountUsd: Usd): Promise<OffRampQuote>;\n /**\n * Execute the conversion + payout of ARS to the society's CVU. IRREVERSIBLE:\n * the caller MUST gate this behind requireConfirmation (RFC-001) and log it.\n * `opts.externalId` is a REQUIRED idempotency key — a STABLE id derived from the\n * payment (e.g. obligation id + period + amount). Reuse the SAME key on retry so\n * the PSAV deduplicates it and a retried convert never double-spends.\n */\n convert(amountUsd: Usd, opts: { externalId: string }): Promise<OffRampReceipt>;\n /**\n * Poll the settlement of a prior convert(). A real off-ramp is ASYNCHRONOUS:\n * the PSAV sells the crypto, then settles ARS to the CVU over seconds-to-minutes\n * (Manteca models this as a multi-stage \"synthetic\"). Optional because the\n * in-memory adapter settles instantly.\n */\n getStatus?(txId: string): Promise<OffRampStatusReport>;\n}\n\n/**\n * Deterministic in-memory off-ramp for tests/dev (no network, no PSAV). A real\n * adapter wraps Manteca's API Cripto / API Rampa (or Ripio B2B): fund a wallet\n * with USDC -> POST a conversion -> ARS settles to the CVU -> webhook confirms.\n */\nexport class InMemoryOffRampAdapter implements OffRampAdapter {\n private readonly settled = new Map<string, OffRampReceipt>();\n constructor(\n private readonly rate: number,\n private readonly spread = 0.01,\n ) {}\n\n async quote(amountUsd: Usd): Promise<OffRampQuote> {\n return {\n amountUsd,\n arsOut: amountUsd * this.rate * (1 - this.spread),\n rate: this.rate,\n spread: this.spread,\n };\n }\n\n async convert(amountUsd: Usd, opts: { externalId: string }): Promise<OffRampReceipt> {\n if (!opts?.externalId)\n throw new Error(\"InMemoryOffRampAdapter.convert: externalId (idempotency key) is required\");\n const cached = this.settled.get(opts.externalId);\n if (cached) return cached; // idempotent: a retry with the same key returns the same receipt\n const q = await this.quote(amountUsd);\n const receipt = {\n amountUsd,\n arsReceived: q.arsOut,\n rate: this.rate * (1 - this.spread),\n txId: `mem-${opts.externalId}`,\n };\n this.settled.set(opts.externalId, receipt);\n return receipt;\n }\n\n /** The in-memory adapter settles instantly: any tx it issued is COMPLETED. */\n async getStatus(txId: string): Promise<OffRampStatusReport> {\n return { txId, status: \"COMPLETED\", raw: \"in-memory\" };\n }\n}\n\n/**\n * One-shot helper: given the current state, the obligations, and an off-ramp,\n * compute + (optionally) execute the conversion needed to fund the buffer. Returns\n * the plan; if `offramp` is provided it also performs the conversion and returns\n * the receipt + the resulting state. The convert() call is irreversible: only pass\n * `offramp` from a path already behind requireConfirmation.\n */\nexport async function fundTaxBuffer(args: {\n state: TreasuryState;\n obligations: Obligation[];\n nowMs: number;\n horizonMs: number;\n fxRate: number;\n spread?: number;\n safety?: number;\n offramp?: OffRampAdapter;\n /**\n * Idempotency key for the off-ramp convert. Defaults to a deterministic id from\n * the obligations being funded + the amount, so a retried fundTaxBuffer with the\n * same inputs is deduplicated by the PSAV and never double-spends. Pass an\n * explicit stable id to override.\n */\n externalId?: string;\n}): Promise<{ plan: ConversionPlan; receipt?: OffRampReceipt; state: TreasuryState }> {\n const required = requiredArsBuffer(args.obligations, args.nowMs, args.horizonMs, args.safety);\n const plan = planConversion(args.state, required, args.fxRate, args.spread);\n if (plan.convertUsd <= 0 || !args.offramp) {\n return { plan, state: args.state };\n }\n const externalId =\n args.externalId ??\n `fund-${args.obligations.map((o) => o.id).join(\"+\")}-${plan.convertUsd.toFixed(2)}`;\n const receipt = await args.offramp.convert(plan.convertUsd, { externalId });\n return { plan, receipt, state: applyConversion(args.state, receipt) };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Concrete PSAV adapter (Manteca) + the AFIP fiscal layer. Re-exported so the\n// pure core and the real-world rails share one import. These are still ai/zod-\n// free; only `@ar-agents/treasury/tools` pulls in the Vercel AI SDK.\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport {\n MantecaOffRampAdapter,\n type MantecaConfig,\n MantecaApiError,\n MantecaAuthError,\n MantecaRateLimitError,\n} from \"./manteca\";\n\nexport {\n RipioOffRampAdapter,\n type RipioConfig,\n RipioApiError,\n RipioAuthError,\n RipioRateLimitError,\n normalizeRipioStatus,\n RIPIO_SANDBOX,\n RIPIO_PROD,\n} from \"./ripio\";\n\nexport {\n MuralOffRampAdapter,\n type MuralConfig,\n MuralApiError,\n MuralAuthError,\n MuralRateLimitError,\n normalizeMuralStatus,\n MURAL_PROD,\n MURAL_SANDBOX,\n} from \"./mural\";\n\nexport {\n MONOTRIBUTO_2026,\n MONOTRIBUTO_TABLE_EFFECTIVE,\n type MonotributoCategory,\n type MonotributoActivity,\n type MonotributoRow,\n monotributoCuota,\n categoryForAnnualIncome,\n type SettlementMethod,\n type SettlementAutonomy,\n type SettlementPlan,\n settlementPlan,\n WSCREATEVEP_IS_GOV_ONLY,\n} from \"./afip\";\n","/**\n * @ar-agents/treasury/tools — Vercel AI SDK 6 tool wrappers for the treasury rail.\n *\n * Drop into an `Experimental_Agent` so a Sociedad Automatizada can reason about\n * its crypto<->peso treasury and its AFIP obligations. Eight tools:\n *\n * PURE (always available, no PSAV credentials needed):\n * treasury_tax_estimate cedular tax on a crypto disposal\n * treasury_monotributo monthly cuota + category for an income\n * treasury_buffer_status ARS buffer needed for upcoming obligations\n * treasury_plan_conversion how much USDC to convert to fund the buffer\n * treasury_settlement_plan HOW an obligation gets paid (honest autonomy)\n *\n * PSAV-BACKED (need an OffRampAdapter; degrade to {available:false} without one):\n * treasury_offramp_quote live USDC->ARS quote\n * treasury_offramp_convert execute the off-ramp — IRREVERSIBLE\n * treasury_offramp_status poll a prior convert\n *\n * The convert tool is irreversible. In the generated society it is wrapped by\n * guardTools (kill-switch) and the agent's requireConfirmation (RFC-001); the\n * tool itself just performs the call and returns the receipt for the audit log.\n *\n * This entry point needs the `ai` + `zod` peers. The package's main entry\n * (@ar-agents/treasury) is pure and pulls in neither.\n */\n\nimport { tool } from \"ai\";\nimport { z } from \"zod\";\nimport {\n cedularTax,\n nextObligation,\n planConversion,\n requiredArsBuffer,\n type Obligation,\n type OffRampAdapter,\n} from \"./index\";\nimport {\n categoryForAnnualIncome,\n monotributoCuota,\n MONOTRIBUTO_TABLE_EFFECTIVE,\n settlementPlan,\n type MonotributoCategory,\n} from \"./afip\";\n\nexport interface TreasuryToolsOptions {\n /**\n * The registered-PSAV off-ramp (e.g. MantecaOffRampAdapter). Omit to expose the\n * five pure tools only; the three off-ramp tools then return {available:false}.\n */\n offramp?: OffRampAdapter;\n /** Injectable clock for buffer math. Default Date.now. */\n now?: () => number;\n}\n\n/**\n * sideEffects classification for the treasury tools, for the host's\n * enforceRiskPolicy (@ar-agents/core) via its `sideEffectsFor` hook. Only\n * `treasury_offramp_convert` moves money (gated, needs human approval); the quote\n * + status hit the network (read); the rest are pure math. Without this the\n * calculators/quote would fail-closed to \"unknown\" and be needlessly gated.\n */\nexport const TREASURY_TOOL_SIDE_EFFECTS: Record<string, string> = {\n treasury_offramp_convert: \"irreversible\",\n treasury_offramp_quote: \"network read\",\n treasury_offramp_status: \"network read\",\n treasury_tax_estimate: \"none\",\n treasury_monotributo: \"none\",\n treasury_buffer_status: \"none\",\n treasury_plan_conversion: \"none\",\n treasury_settlement_plan: \"none\",\n};\n\n/** Pass as enforceRiskPolicy's `sideEffectsFor` so treasury tools classify right. */\nexport function treasurySideEffectsFor(toolName: string): string | undefined {\n return TREASURY_TOOL_SIDE_EFFECTS[toolName];\n}\n\nconst DAY_MS = 86_400_000;\n\nconst obligationSchema = z.object({\n id: z.string(),\n kind: z.enum([\"monotributo\", \"vep\", \"iibb\", \"cedular\"]),\n amountArs: z.number(),\n dueAtMs: z.number().describe(\"Epoch ms the obligation is due.\"),\n});\n\nexport function treasuryTools(options: TreasuryToolsOptions = {}) {\n const now = options.now ?? Date.now;\n const offramp = options.offramp;\n const noOfframp = {\n available: false as const,\n reason:\n \"No off-ramp configured. Set MANTECA_API_KEY (+ user/bank-account) to enable USDC->ARS conversion.\",\n };\n\n return {\n treasury_tax_estimate: tool({\n description:\n \"Estimate the Impuesto a las Ganancias cedular owed (in ARS) on disposing crypto. \" +\n \"Use before converting USDC->ARS so the society reserves the tax. Rate is 5% when sold \" +\n \"in pesos without adjustment clause, 15% in foreign currency, on the GAIN only (0 if no gain). \" +\n \"Crypto is IVA-exempt; holding + own-wallet transfers are not taxable. Pure, no side effects.\",\n inputSchema: z.object({\n amountUsd: z.number().positive(),\n costBasisPerUsd: z\n .number()\n .default(1)\n .describe(\"Acquisition cost per USDC unit (≈1 for stablecoins).\"),\n fxRate: z.number().positive().describe(\"ARS per USD at disposal.\"),\n denom: z\n .enum([\"ARS\", \"FOREIGN\"])\n .default(\"ARS\")\n .describe(\"Sale denominated in pesos (5%) or foreign currency (15%).\"),\n }),\n execute: async ({ amountUsd, costBasisPerUsd, fxRate, denom }) => {\n const taxArs = cedularTax(amountUsd, costBasisPerUsd, fxRate, denom);\n const proceeds = amountUsd * fxRate;\n const gainArs = Math.max(0, proceeds - amountUsd * costBasisPerUsd * fxRate);\n return {\n taxArs,\n gainArs,\n ratePct: denom === \"ARS\" ? 5 : 15,\n denom,\n note: \"Cedular sobre la ganancia. Cripto exento de IVA.\",\n };\n },\n }),\n\n treasury_monotributo: tool({\n description:\n \"Look up the monthly monotributo cuota (ARS) and/or the category for an annual income. \" +\n \"Pass `category` to get its cuota, or `annualIncomeArs` to resolve the category. \" +\n \"Values eff. \" +\n MONOTRIBUTO_TABLE_EFFECTIVE +\n \" (IPC-indexed ~6mo). Monotributo is for a persona-humana operator; a SAS/SRL is in the \" +\n \"general regime. Pure.\",\n inputSchema: z.object({\n activity: z.enum([\"servicios\", \"bienes\"]),\n category: z\n .enum([\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\"])\n .optional(),\n annualIncomeArs: z.number().nonnegative().optional(),\n }),\n execute: async ({ activity, category, annualIncomeArs }) => {\n let cat: MonotributoCategory | null = category ?? null;\n if (!cat && annualIncomeArs !== undefined) {\n cat = categoryForAnnualIncome(annualIncomeArs, activity);\n }\n if (!cat) {\n return {\n available: false as const,\n reason:\n annualIncomeArs !== undefined\n ? \"Income exceeds the monotributo ceiling; move to the general regime.\"\n : \"Provide `category` or `annualIncomeArs`.\",\n };\n }\n return {\n category: cat,\n activity,\n cuotaArs: monotributoCuota(cat, activity),\n tableEffective: MONOTRIBUTO_TABLE_EFFECTIVE,\n };\n },\n }),\n\n treasury_buffer_status: tool({\n description:\n \"Given the current ARS balance and upcoming AFIP obligations, compute the peso buffer \" +\n \"needed within a horizon (with a safety multiple) and any shortfall. Use to decide whether \" +\n \"to convert crypto. Pure (clock injected).\",\n inputSchema: z.object({\n arsBalance: z.number().nonnegative(),\n obligations: z.array(obligationSchema),\n horizonDays: z.number().positive().default(30),\n safety: z.number().min(1).default(1.1),\n }),\n execute: async ({ arsBalance, obligations, horizonDays, safety }) => {\n const t = now();\n const obs = obligations as Obligation[];\n const requiredArs = requiredArsBuffer(obs, t, horizonDays * DAY_MS, safety);\n const next = nextObligation(obs, t);\n return {\n requiredArs,\n arsBalance,\n shortfallArs: Math.max(0, requiredArs - arsBalance),\n funded: arsBalance >= requiredArs,\n horizonDays,\n nextObligation: next\n ? { id: next.id, kind: next.kind, amountArs: next.amountArs, dueAtMs: next.dueAtMs }\n : null,\n };\n },\n }),\n\n treasury_plan_conversion: tool({\n description:\n \"Plan a just-in-time USDC->ARS conversion: how much USDC to convert to top the ARS buffer \" +\n \"to `requiredArs`, net of spread, capped by available USDC. Never over-converts (minimizes \" +\n \"taxable disposals + fx exposure). Returns convertUsd=0 if the buffer is already met. Pure — \" +\n \"this PLANS, it does not execute (use treasury_offramp_convert for that).\",\n inputSchema: z.object({\n usd: z.number().nonnegative().describe(\"USDC available.\"),\n ars: z.number().nonnegative().describe(\"Current ARS balance.\"),\n costBasisPerUsd: z.number().default(1),\n requiredArs: z.number().nonnegative(),\n fxRate: z.number().positive(),\n spread: z.number().min(0).max(1).default(0.01),\n }),\n execute: async ({ usd, ars, costBasisPerUsd, requiredArs, fxRate, spread }) => {\n return planConversion({ usd, ars, costBasisPerUsd }, requiredArs, fxRate, spread);\n },\n }),\n\n treasury_settlement_plan: tool({\n description:\n \"Describe HOW a tax obligation actually gets paid under a chosen method, honestly. \" +\n \"IMPORTANT: no method lets the agent pay autonomously at pay-time (canAutoExecute is always \" +\n \"false). 'debito_automatico' is passive after a one-time human enrolment (the agent just keeps \" +\n \"the CVU funded); 'vep_manual'/'mp_manual' need a human each time. Use to tell the operator \" +\n \"exactly what to do. Pure.\",\n inputSchema: z.object({\n amountArs: z.number().nonnegative(),\n dueAtMs: z.number(),\n kind: z.enum([\"monotributo\", \"vep\", \"iibb\", \"cedular\"]).default(\"monotributo\"),\n method: z.enum([\"debito_automatico\", \"vep_manual\", \"mp_manual\"]),\n }),\n execute: async ({ amountArs, dueAtMs, kind, method }) => {\n return settlementPlan({ id: `${kind}-${dueAtMs}`, kind, amountArs, dueAtMs }, method);\n },\n }),\n\n treasury_offramp_quote: tool({\n description:\n \"Get a live USDC->ARS quote from the configured registered-PSAV off-ramp (e.g. Manteca). \" +\n \"Read-only, no side effects. Returns {available:false} if no off-ramp is configured.\",\n inputSchema: z.object({ amountUsd: z.number().positive() }),\n execute: async ({ amountUsd }) => {\n if (!offramp) return noOfframp;\n const q = await offramp.quote(amountUsd);\n return { available: true as const, ...q };\n },\n }),\n\n treasury_offramp_convert: tool({\n description:\n \"EXECUTE an off-ramp: sell USDC and pay out ARS to the society's CVU via the registered PSAV. \" +\n \"IRREVERSIBLE — moves real money. Only call after a human approval (RFC-001); the call is also \" +\n \"hard-gated by the kill-switch. Settlement is asynchronous; confirm with treasury_offramp_status. \" +\n \"Returns {available:false} if no off-ramp is configured.\",\n inputSchema: z.object({\n amountUsd: z.number().positive(),\n externalId: z\n .string()\n .min(1)\n .describe(\n \"REQUIRED stable idempotency key tied to the payment (e.g. the obligation id + \" +\n \"period). Reuse the EXACT same key on any retry, or the off-ramp will double-spend.\",\n ),\n }),\n execute: async ({ amountUsd, externalId }) => {\n if (!offramp) return noOfframp;\n const receipt = await offramp.convert(amountUsd, { externalId });\n return { available: true as const, ...receipt };\n },\n }),\n\n treasury_offramp_status: tool({\n description:\n \"Poll the settlement status of a prior treasury_offramp_convert by its txId. Use to confirm \" +\n \"the ARS actually landed in the CVU before marking an obligation funded. Returns \" +\n \"{available:false} if no off-ramp (or it does not support status polling).\",\n inputSchema: z.object({ txId: z.string() }),\n execute: async ({ txId }) => {\n if (!offramp) return noOfframp;\n if (!offramp.getStatus)\n return { available: false as const, reason: \"Off-ramp does not support status polling.\" };\n const report = await offramp.getStatus(txId);\n return { available: true as const, ...report };\n },\n }),\n };\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ar-agents/treasury",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Treasury + fiscal rail for an Argentine Sociedad Automatizada: pure-logic core (balances, tax buffer, just-in-time crypto->ARS conversion policy, Ganancias cedular accounting) plus an OffRampAdapter to a registered PSAV (Manteca / Ripio B2B) for USDC->ARS payout to a CVU. The moat half of the crypto<->fiat bridge: how an autonomous society gets pesos to pay AFIP.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ar-agents",
|
|
7
|
+
"argentina",
|
|
8
|
+
"treasury",
|
|
9
|
+
"off-ramp",
|
|
10
|
+
"stablecoin",
|
|
11
|
+
"usdc",
|
|
12
|
+
"afip",
|
|
13
|
+
"monotributo",
|
|
14
|
+
"cedular",
|
|
15
|
+
"psav",
|
|
16
|
+
"manteca",
|
|
17
|
+
"ai-sdk",
|
|
18
|
+
"agent",
|
|
19
|
+
"sociedad-automatizada"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Nazareno Clemente <naza@naza.ar>",
|
|
23
|
+
"funding": {
|
|
24
|
+
"type": "github",
|
|
25
|
+
"url": "https://github.com/sponsors/naza00000"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/ar-agents/ar-agents/tree/main/packages/treasury",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/ar-agents/ar-agents.git",
|
|
31
|
+
"directory": "packages/treasury"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/ar-agents/ar-agents/issues"
|
|
35
|
+
},
|
|
36
|
+
"type": "module",
|
|
37
|
+
"main": "./dist/index.cjs",
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"default": "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
"require": {
|
|
47
|
+
"types": "./dist/index.d.cts",
|
|
48
|
+
"default": "./dist/index.cjs"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"./tools": {
|
|
52
|
+
"import": {
|
|
53
|
+
"types": "./dist/tools.d.ts",
|
|
54
|
+
"default": "./dist/tools.js"
|
|
55
|
+
},
|
|
56
|
+
"require": {
|
|
57
|
+
"types": "./dist/tools.d.cts",
|
|
58
|
+
"default": "./dist/tools.cjs"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"./tools.manifest.json": "./tools.manifest.json"
|
|
62
|
+
},
|
|
63
|
+
"files": [
|
|
64
|
+
"dist",
|
|
65
|
+
"tools.manifest.json",
|
|
66
|
+
"README.md"
|
|
67
|
+
],
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"ai": ">=6.0.0",
|
|
70
|
+
"zod": ">=3.0.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"ai": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"zod": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@types/node": "^20.19.39",
|
|
82
|
+
"ai": "^6.0.0",
|
|
83
|
+
"tsup": "^8.3.5",
|
|
84
|
+
"typescript": "^5.9.3",
|
|
85
|
+
"vitest": "^2.1.8",
|
|
86
|
+
"zod": "^4.0.0"
|
|
87
|
+
},
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public",
|
|
90
|
+
"provenance": true
|
|
91
|
+
},
|
|
92
|
+
"engines": {
|
|
93
|
+
"node": ">=20.0.0"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"build": "tsup",
|
|
97
|
+
"test": "vitest run",
|
|
98
|
+
"test:watch": "vitest",
|
|
99
|
+
"typecheck": "tsc --noEmit",
|
|
100
|
+
"clean": "rm -rf dist"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/ar-agents/ar-agents/blob/main/tools-manifest.schema.json",
|
|
3
|
+
"package": "@ar-agents/treasury",
|
|
4
|
+
"name": "@ar-agents/treasury",
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"factory": "treasuryTools",
|
|
7
|
+
"tools": [
|
|
8
|
+
{
|
|
9
|
+
"name": "treasury_buffer_status",
|
|
10
|
+
"description": "Given the ARS balance and upcoming AFIP obligations, compute the peso buffer needed within a horizon (with a safety multiple) and any shortfall. Pure (clock injected).",
|
|
11
|
+
"input": {
|
|
12
|
+
"arsBalance": "number",
|
|
13
|
+
"obligations": "Array<{id,kind,amountArs,dueAtMs}>",
|
|
14
|
+
"horizonDays": "number (default 30)",
|
|
15
|
+
"safety": "number >=1 (default 1.1)"
|
|
16
|
+
},
|
|
17
|
+
"output": {
|
|
18
|
+
"requiredArs": "number",
|
|
19
|
+
"shortfallArs": "number",
|
|
20
|
+
"funded": "boolean",
|
|
21
|
+
"nextObligation": "object | null"
|
|
22
|
+
},
|
|
23
|
+
"idempotent": true,
|
|
24
|
+
"sideEffect": "none"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "treasury_monotributo",
|
|
28
|
+
"description": "Monthly monotributo cuota (ARS) and/or the category for an annual income. Values eff. 2026-02-01 (IPC-indexed). Monotributo is for a persona-humana operator; a SAS/SRL is in the general regime. Pure.",
|
|
29
|
+
"input": {
|
|
30
|
+
"activity": "'servicios' | 'bienes'",
|
|
31
|
+
"category": "'A'..'K'? (one of)",
|
|
32
|
+
"annualIncomeArs": "number?"
|
|
33
|
+
},
|
|
34
|
+
"output": {
|
|
35
|
+
"category": "string",
|
|
36
|
+
"cuotaArs": "number",
|
|
37
|
+
"tableEffective": "string"
|
|
38
|
+
},
|
|
39
|
+
"idempotent": true,
|
|
40
|
+
"sideEffect": "none"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "treasury_offramp_convert",
|
|
44
|
+
"description": "EXECUTE an off-ramp: sell USDC and pay out ARS to the society's CVU via the PSAV. IRREVERSIBLE. Requires human approval (RFC-001) and is kill-switch gated. Async settlement; confirm with treasury_offramp_status.",
|
|
45
|
+
"input": {
|
|
46
|
+
"amountUsd": "number positive",
|
|
47
|
+
"externalId": "string? (idempotency key)"
|
|
48
|
+
},
|
|
49
|
+
"output": {
|
|
50
|
+
"available": "boolean",
|
|
51
|
+
"amountUsd": "number",
|
|
52
|
+
"arsReceived": "number",
|
|
53
|
+
"rate": "number",
|
|
54
|
+
"txId": "string"
|
|
55
|
+
},
|
|
56
|
+
"idempotent": false,
|
|
57
|
+
"sideEffect": "IRREVERSIBLE: moves real money (crypto sale + ARS payout to CVU)"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "treasury_offramp_quote",
|
|
61
|
+
"description": "Live USDC->ARS quote from the configured registered-PSAV off-ramp (Manteca). Read-only. Returns {available:false} if no off-ramp is configured.",
|
|
62
|
+
"input": {
|
|
63
|
+
"amountUsd": "number positive"
|
|
64
|
+
},
|
|
65
|
+
"output": {
|
|
66
|
+
"available": "boolean",
|
|
67
|
+
"arsOut": "number",
|
|
68
|
+
"rate": "number",
|
|
69
|
+
"spread": "number"
|
|
70
|
+
},
|
|
71
|
+
"idempotent": true,
|
|
72
|
+
"sideEffect": "read-only (PSAV price call)"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "treasury_offramp_status",
|
|
76
|
+
"description": "Poll the settlement status of a prior treasury_offramp_convert by txId. Confirm the ARS landed in the CVU before marking an obligation funded. Returns {available:false} without an off-ramp.",
|
|
77
|
+
"input": {
|
|
78
|
+
"txId": "string"
|
|
79
|
+
},
|
|
80
|
+
"output": {
|
|
81
|
+
"available": "boolean",
|
|
82
|
+
"status": "'PENDING'|'PROCESSING'|'COMPLETED'|'FAILED'|'UNKNOWN'",
|
|
83
|
+
"arsSettled": "number?"
|
|
84
|
+
},
|
|
85
|
+
"idempotent": true,
|
|
86
|
+
"sideEffect": "read-only (PSAV status call)"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "treasury_plan_conversion",
|
|
90
|
+
"description": "Plan a just-in-time USDC->ARS conversion: how much USDC to convert to top the ARS buffer, net of spread, capped by available USDC. Never over-converts. Plans only; does not execute. Pure.",
|
|
91
|
+
"input": {
|
|
92
|
+
"usd": "number",
|
|
93
|
+
"ars": "number",
|
|
94
|
+
"costBasisPerUsd": "number (default 1)",
|
|
95
|
+
"requiredArs": "number",
|
|
96
|
+
"fxRate": "number positive",
|
|
97
|
+
"spread": "number 0..1 (default 0.01)"
|
|
98
|
+
},
|
|
99
|
+
"output": {
|
|
100
|
+
"convertUsd": "number",
|
|
101
|
+
"expectedArs": "number",
|
|
102
|
+
"reason": "string"
|
|
103
|
+
},
|
|
104
|
+
"idempotent": true,
|
|
105
|
+
"sideEffect": "none"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "treasury_settlement_plan",
|
|
109
|
+
"description": "How a tax obligation actually gets paid, honestly. No method pays autonomously at pay-time (canAutoExecute is always false); debito_automatico is passive after one-time enrolment, vep/mp need a human. Pure.",
|
|
110
|
+
"input": {
|
|
111
|
+
"amountArs": "number",
|
|
112
|
+
"dueAtMs": "number",
|
|
113
|
+
"kind": "'monotributo'|'vep'|'iibb'|'cedular' (default 'monotributo')",
|
|
114
|
+
"method": "'debito_automatico'|'vep_manual'|'mp_manual'"
|
|
115
|
+
},
|
|
116
|
+
"output": {
|
|
117
|
+
"method": "string",
|
|
118
|
+
"autonomy": "'passive'|'human-required'",
|
|
119
|
+
"canAutoExecute": "false",
|
|
120
|
+
"instruction": "string",
|
|
121
|
+
"oneTimeSetup": "string"
|
|
122
|
+
},
|
|
123
|
+
"idempotent": true,
|
|
124
|
+
"sideEffect": "none"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "treasury_tax_estimate",
|
|
128
|
+
"description": "Estimate the Ganancias cedular owed (ARS) on disposing crypto: 5% (sold in pesos, no adjustment clause) or 15% (foreign currency), on the GAIN only. Crypto is IVA-exempt. Pure.",
|
|
129
|
+
"input": {
|
|
130
|
+
"amountUsd": "number positive",
|
|
131
|
+
"costBasisPerUsd": "number (default 1)",
|
|
132
|
+
"fxRate": "number positive (ARS per USD)",
|
|
133
|
+
"denom": "'ARS' | 'FOREIGN' (default 'ARS')"
|
|
134
|
+
},
|
|
135
|
+
"output": {
|
|
136
|
+
"taxArs": "number",
|
|
137
|
+
"gainArs": "number",
|
|
138
|
+
"ratePct": "5 | 15",
|
|
139
|
+
"denom": "string"
|
|
140
|
+
},
|
|
141
|
+
"idempotent": true,
|
|
142
|
+
"sideEffect": "none"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"meta": {
|
|
146
|
+
"generated_by": "scripts/regen-manifests.mjs",
|
|
147
|
+
"tool_count": 8
|
|
148
|
+
},
|
|
149
|
+
"authorizedBy": {
|
|
150
|
+
"republic": "https://ar-panel-one.vercel.app/.well-known/republica.json",
|
|
151
|
+
"verify": "https://ar-panel-one.vercel.app/verify",
|
|
152
|
+
"rail": "rail-fiscal",
|
|
153
|
+
"articles": [
|
|
154
|
+
"art-14"
|
|
155
|
+
],
|
|
156
|
+
"normas": []
|
|
157
|
+
}
|
|
158
|
+
}
|