Bulk-create accounts from CSV text.
Parity with the web account-import flow, adapted for a chat agent: pass
the CSV as text (not a file). Columns are auto-detected (name + type are
required; balance, institution, interest_rate, credit_limit,
minimum_payment, term_months optional). Rows that can't be parsed are
skipped and reported; valid rows still import. Created atomically.
Account type accepts friendly strings (checking, savings, cash, credit
card, loan, mortgage, student loan, investment, other asset, other
debt). Respects the Free-plan account cap — if existing + new accounts
would exceed it, the whole import is rejected before any insert.
Args:
csv_text: CSV content as a string (header row + account rows). Max
1000 rows.
skip_duplicates: When True (default), skip rows whose name matches
an existing active account. When False, a duplicate name still
imports (creating a second account with that name).
Returns:
``{"success": True, "imported_count": N, "skipped_duplicates": K,
"error_count": M, "errors": [...up to 20...], "account_names":
[...]}`` on success, or ``{"error": "..."}`` (empty/invalid CSV, no
valid rows, all duplicates, or account-limit exceeded).