import { ToolSet } from 'ai'; import { D as DomicilioAdapter, T as TramitesAdapter, I as IgjInscriptionPreflight, a as DomicilioInboxResult, M as MisTramitesResult } from './types-CdFYNI9c.cjs'; export { b as DomicilioNotification, c as TadEnv, d as Tramite, e as TramiteStatus } from './types-CdFYNI9c.cjs'; import { ArAgentsError } from '@ar-agents/core'; /** * Vercel AI SDK tool collection for `@ar-agents/gde-tad`. * * The 4 tools are split by mutability: * - **read-only** (`list_domicilio_inbox`, `list_mis_tramites`, * `get_critical_notifications`), safe to call repeatedly; results * drive the agent's situational awareness loop. * - **algorithm-only** (`validate_igj_inscription`), pure preflight, * no network. Use freely. * * Write operations (filing trámites) are intentionally NOT exposed yet - * the legal liability surface is too large until RFC-001 § 3.4 lands. * This is the moat: nobody else has even shipped this much. */ interface GdeTadToolsOptions { /** Domicilio Electrónico adapter. Falls back to the unconfigured shim. */ domicilio?: DomicilioAdapter; /** Mis Trámites adapter. Falls back to the unconfigured shim. */ tramites?: TramitesAdapter; } type GdeTadToolName = "list_domicilio_inbox" | "list_mis_tramites" | "get_critical_notifications" | "validate_igj_inscription"; declare function gdeTadTools(options?: GdeTadToolsOptions): ToolSet; /** * Pre-flight validator for IGJ inscription / SAS / SRL forms. * * IGJ (Inspección General de Justicia) rejects ~30% of inscription requests * on first submission for predictable, mechanical reasons (name conflicts, * missing required fields, malformed CUIT, out-of-range capital). Catching * those locally before TAD submit saves 5–10 working days per round-trip. * * This is not exhaustive — it's the rules we have hit ourselves or that * IGJ's public guidance documents call out. Findings with severity "error" * MUST be fixed; "warning" findings are likely-but-not-certain rejections. */ /** * Inputs we validate. Mirrors the IGJ "Constitución de Sociedad" form * surface but strips the parts that don't affect rejection probability. */ interface IgjInscriptionInput { /** Proposed corporate name. */ denominacion: string; /** Corporate type. */ type: "SAS" | "SRL" | "SA" | "SOCIEDAD-IA"; /** Sede social (legal address). */ sede: { calle: string; numero: string; ciudad: string; provincia: string; cpa: string; }; /** Capital social in ARS. */ capitalSocial: number; /** Objeto social — what the company does. */ objeto: string; /** * Constituyentes (founders). At least one human is currently required; * RFC-001 § 3.4 proposes lifting this for sociedades-IA. */ constituyentes: Array<{ cuit: string; razonSocial?: string; apellido?: string; nombre?: string; /** Aporte de capital in ARS for this constituyente. */ aporte: number; }>; /** * Optional flag: when true, runs the sociedad-IA-specific rule set * (RFC-001 § 3.4). Without the flag we apply standard SA/SRL/SAS rules. */ sociedadIa?: boolean; } declare function validateIgjInscription(input: IgjInscriptionInput): IgjInscriptionPreflight; /** * Severity heuristic for Domicilio Electrónico notifications. * * The DEC inbox is a noisy stream — courtesy notices, acuses de recibo, * actual binding notifications. The agent needs a triage signal so it can * prioritise responses to legally-binding deadlines and ignore informational * spam. * * The heuristic is intentionally conservative: when in doubt, escalate. * False positives (calling something critical when it's only important) * waste agent cycles; false negatives (missing a critical deadline) cost * the sociedad-IA real money or its registration. */ /** * Compute a severity given the issuing organism, subject, and (optionally) * an explicit response-due date. */ declare function computeSeverity(input: { organism: string; subject: string; responseDueBy: string | null; }): "critical" | "important" | "info"; /** * Default unconfigured adapters. Drop-in stand-ins so calling * `gdeTadTools()` without explicit adapters still returns something * actionable instead of throwing at construction time. * * Wire a real adapter when you have a TAD-issued cert + the agency- * specific contract live. Until then, every read returns * `available: false` with a helpful pointer. */ declare class UnconfiguredDomicilioAdapter implements DomicilioAdapter { list(cuit: string): Promise; } declare class UnconfiguredTramitesAdapter implements TramitesAdapter { list(cuit: string): Promise; } /** * Error hierarchy for `@ar-agents/gde-tad`. */ /** Base class — all errors thrown by this package extend this. */ declare class GdeTadError extends ArAgentsError { constructor(message: string, options?: ErrorOptions); } /** Adapter rejected for missing config (cert, token, env). */ declare class GdeTadNotConfiguredError extends GdeTadError { constructor(detail: string); } /** Authentication / authorization failure against TAD or GDE. */ declare class GdeTadAuthError extends GdeTadError { constructor(detail: string); } /** Pre-flight validation rejected the payload. */ declare class GdeTadValidationError extends GdeTadError { readonly findings: Array<{ code: string; field: string; message: string; }>; constructor(detail: string, findings: Array<{ code: string; field: string; message: string; }>); } /** Strip non-digits from a CUIT input ("20-12345678-9" → "20123456789"). */ declare function normalizeCuit(raw: string): string; export { DomicilioAdapter, DomicilioInboxResult, GdeTadAuthError, GdeTadError, GdeTadNotConfiguredError, type GdeTadToolName, type GdeTadToolsOptions, GdeTadValidationError, type IgjInscriptionInput, IgjInscriptionPreflight, MisTramitesResult, TramitesAdapter, UnconfiguredDomicilioAdapter, UnconfiguredTramitesAdapter, computeSeverity, gdeTadTools, normalizeCuit, validateIgjInscription };