e-arveldaja-mcp 0.14.0 → 0.14.2

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.
Files changed (61) hide show
  1. package/.claude/commands/book-invoice.md +17 -3
  2. package/.claude/commands/classify-unmatched.md +16 -2
  3. package/.claude/commands/company-overview.md +18 -0
  4. package/.claude/commands/import-camt.md +15 -1
  5. package/.claude/commands/import-wise.md +13 -0
  6. package/.claude/commands/lightyear-booking.md +9 -0
  7. package/.claude/commands/month-end.md +6 -0
  8. package/.claude/commands/new-supplier.md +14 -2
  9. package/.claude/commands/receipt-batch.md +16 -1
  10. package/.claude/commands/reconcile-bank.md +12 -4
  11. package/.claude/commands/setup-e-arveldaja.md +2 -0
  12. package/CHANGELOG.md +17 -0
  13. package/README.md +1 -1
  14. package/dist/accounting-rules.d.ts +36 -47
  15. package/dist/accounting-rules.d.ts.map +1 -1
  16. package/dist/document-parser.d.ts.map +1 -1
  17. package/dist/document-parser.js +1 -2
  18. package/dist/document-parser.js.map +1 -1
  19. package/dist/index.js +1 -25
  20. package/dist/index.js.map +1 -1
  21. package/dist/list-views.d.ts +4 -1
  22. package/dist/list-views.d.ts.map +1 -1
  23. package/dist/mcp-json.d.ts +2 -2
  24. package/dist/mcp-json.d.ts.map +1 -1
  25. package/dist/mcp-json.js +23 -5
  26. package/dist/mcp-json.js.map +1 -1
  27. package/dist/prompts.d.ts.map +1 -1
  28. package/dist/prompts.js +1 -0
  29. package/dist/prompts.js.map +1 -1
  30. package/dist/tools/camt-import.d.ts.map +1 -1
  31. package/dist/tools/camt-import.js +227 -25
  32. package/dist/tools/camt-import.js.map +1 -1
  33. package/dist/tools/crud/shared.d.ts +7 -17
  34. package/dist/tools/crud/shared.d.ts.map +1 -1
  35. package/dist/tools/crud/shared.js +4 -4
  36. package/dist/tools/crud/shared.js.map +1 -1
  37. package/dist/tools/pdf-workflow.js +1 -1
  38. package/dist/tools/pdf-workflow.js.map +1 -1
  39. package/dist/tools/workflow-recommendations.d.ts.map +1 -1
  40. package/dist/tools/workflow-recommendations.js +203 -19
  41. package/dist/tools/workflow-recommendations.js.map +1 -1
  42. package/dist/workflow-prompt-source.d.ts +1 -0
  43. package/dist/workflow-prompt-source.d.ts.map +1 -1
  44. package/dist/workflow-prompt-source.js +10 -1
  45. package/dist/workflow-prompt-source.js.map +1 -1
  46. package/dist/workflow-response.d.ts.map +1 -1
  47. package/dist/workflow-response.js +146 -3
  48. package/dist/workflow-response.js.map +1 -1
  49. package/package.json +12 -11
  50. package/server.json +2 -2
  51. package/workflows/book-invoice.md +17 -3
  52. package/workflows/classify-unmatched.md +16 -2
  53. package/workflows/company-overview.md +18 -0
  54. package/workflows/import-camt.md +15 -1
  55. package/workflows/import-wise.md +13 -0
  56. package/workflows/lightyear-booking.md +9 -0
  57. package/workflows/month-end.md +6 -0
  58. package/workflows/new-supplier.md +14 -2
  59. package/workflows/receipt-batch.md +16 -1
  60. package/workflows/reconcile-bank.md +12 -4
  61. package/workflows/setup-e-arveldaja.md +2 -0
@@ -6,6 +6,17 @@ Book a purchase invoice from a source document. Extract the data, validate it, r
6
6
 
7
7
  **Input:** Absolute path to the invoice document (`.pdf`, `.jpg`, `.jpeg`, `.png`).
8
8
 
9
+ ## User-facing flow
10
+
11
+ Think in five phases, even though the tool work below is more detailed:
12
+ 1. Read the document.
13
+ 2. Validate amounts and supplier identity.
14
+ 3. Check duplicate risk and reuse a safe booking basis.
15
+ 4. Show one approval card.
16
+ 5. Create, upload, confirm, and report only after approval.
17
+
18
+ Keep the user's view compact. Do not show every extracted field unless it changes the booking decision.
19
+
9
20
  ## Step 1: Check VAT registration
10
21
 
11
22
  Call `get_vat_info` first to confirm whether this company is currently VAT-registered.
@@ -108,12 +119,15 @@ If there is no suitable history, call `list_purchase_articles` or ask the user i
108
119
 
109
120
  ## Step 10: Preview the booking and ask for approval before creating anything
110
121
 
111
- Before creating anything, present:
112
- - Supplier name and supplier client ID
122
+ Before creating anything, present one approval card:
123
+ - Supplier name and supplier client ID — explicitly flag when this is a newly created supplier record (auto-created in step 6) so the user sees the new client before approving the booking
113
124
  - Invoice number, invoice date, due date, journal date, and term days
114
125
  - Net / VAT / gross amounts
115
126
  - The exact item-level booking you intend to send, including article IDs, account IDs, `purchase_accounts_dimensions_id`, VAT fields, `vat_accounts_dimensions_id`, and any `reversed_vat_id`
116
127
  - The booking basis used and any assumptions
128
+ - Duplicate-check result
129
+ - Source document path
130
+ - Side effects after approval: create purchase invoice, upload the source document, and confirm the invoice
117
131
 
118
132
  If the user has not explicitly approved the preview, stop here and wait.
119
133
 
@@ -130,7 +144,7 @@ Call `create_purchase_invoice_from_pdf`:
130
144
  - `gross_price`: exact value from the invoice
131
145
  - `ref_number`
132
146
  - `bank_account_no`
133
- - `notes`: source filename and any assumptions
147
+ - `notes`: leave empty by default; use it only for genuinely useful context such as assumptions made or manual adjustments. Do NOT put the source document filename here — the document is auto-uploaded and attached via `file_path` below.
134
148
  - `file_path`: the original file path (auto-uploads the source document)
135
149
 
136
150
  Use the exact `vat_price` and `gross_price` from the invoice. Do not recalculate them.
@@ -4,6 +4,13 @@
4
4
 
5
5
  Classify unmatched bank transactions, preview the auto-bookable purchase-invoice groups, and only apply them after approval.
6
6
 
7
+ User-facing phases:
8
+ 1. Classify unmatched rows.
9
+ 2. Explain which groups can be auto-booked and which need review.
10
+ 3. Preview the approved groups.
11
+ 4. Ask for one apply approval.
12
+ 5. Apply and report created invoices/linked transactions.
13
+
7
14
  ## Arguments
8
15
 
9
16
  - `accounts_dimensions_id`: bank account dimension ID
@@ -20,7 +27,7 @@ Call `classify_bank_transactions`:
20
27
  - `accounts_dimensions_id`: the provided dimension ID
21
28
  - include `date_from` / `date_to` when provided
22
29
 
23
- `classify_unmatched_transactions` remains available as a compatibility primitive.
30
+ Fallback compatibility primitive: `classify_unmatched_transactions` remains available, but prefer `classify_bank_transactions`. Do not mention fallback tool names to the user.
24
31
 
25
32
  Show:
26
33
  - `result.total_unconfirmed`
@@ -50,7 +57,7 @@ Call `classify_bank_transactions`:
50
57
  - mode: "dry_run_apply"
51
58
  - `classifications_json`: `JSON.stringify(the result payload from step 1)`
52
59
 
53
- `apply_transaction_classifications` remains available as a compatibility primitive.
60
+ Fallback compatibility primitive: `apply_transaction_classifications` remains available, but prefer `classify_bank_transactions` when it supports the requested mode.
54
61
 
55
62
  Group the result by status:
56
63
  - Treat `result.execution` as the canonical batch payload when present.
@@ -68,6 +75,13 @@ If the user wants only some groups applied:
68
75
  ### Step 4: Approval gate
69
76
 
70
77
  Ask for approval before executing.
78
+ The approval card must include:
79
+ - transaction groups that would be applied
80
+ - purchase invoices that would be created
81
+ - bank transactions that would be linked or confirmed
82
+ - review-only groups that will remain untouched
83
+ - failed/skipped rows from the dry run
84
+ - side effects and audit reference
71
85
 
72
86
  If the user does not explicitly approve, stop.
73
87
 
@@ -4,6 +4,16 @@
4
4
 
5
5
  Prepare a compact financial overview for the active e-arveldaja connection.
6
6
 
7
+ This workflow is read-only. It should feel like a dashboard, not a ledger export.
8
+
9
+ ## Period selection
10
+
11
+ - If the user asks for a specific date, use it as `as_of_date`.
12
+ - If no date is requested, use today's date.
13
+ - If the user asks for a specific period, use its first day as `date_from`.
14
+ - If no period is requested, use the first day of the current year as `date_from`.
15
+ - State the chosen `date_from` and `as_of_date` in the summary.
16
+
7
17
  Follow these steps:
8
18
 
9
19
  1. Call `compute_balance_sheet` with date_to: the selected as_of_date (or today's date when no date is requested).
@@ -18,4 +28,12 @@ Follow these steps:
18
28
  - overdue payables
19
29
  - any visible blockers or follow-up checks
20
30
 
31
+ Use this output shape:
32
+ - Reporting period
33
+ - Balance sheet status
34
+ - Profit/loss for the period
35
+ - Receivables needing attention
36
+ - Payables needing attention
37
+ - Next recommended check
38
+
21
39
  Do not create, update, confirm, send, or delete records in this workflow.
@@ -4,6 +4,12 @@
4
4
 
5
5
  Parse a CAMT.053 statement, preview the import, and only create bank transactions after approval.
6
6
 
7
+ User-facing phases:
8
+ 1. Parse the statement.
9
+ 2. Preview creates, skips, and possible duplicates.
10
+ 3. Ask for one approval decision.
11
+ 4. Import and offer reconciliation.
12
+
7
13
  ## Arguments
8
14
 
9
15
  - `file_path`: absolute path to the CAMT.053 XML file
@@ -37,7 +43,8 @@ Call `process_camt053`:
37
43
  - include `date_from` / `date_to` when provided
38
44
 
39
45
  Review:
40
- - `process_camt053` is the preferred merged workflow tool; `parse_camt053` and `import_camt053` remain compatibility primitives.
46
+ - `process_camt053` is the preferred merged workflow tool.
47
+ - Fallback compatibility primitives: `parse_camt053` and `import_camt053` remain available, but only use them if the preferred tool is unavailable. Do not mention fallback tool names to the user.
41
48
  - Use `result` as the delegated `import_camt053` payload.
42
49
  - Treat `execution` as the canonical batch payload when present.
43
50
  - Prefer `execution.summary.total_statement_entries`, `execution.summary.eligible_entries`, `execution.summary.filtered_out`, `execution.summary.created_count`, `execution.summary.skipped_count`, `execution.summary.error_count`, `execution.results`, `execution.skipped`, `execution.errors`, and `execution.audit_reference`.
@@ -61,6 +68,13 @@ Do not suggest overwriting curated manual fields like description or reference w
61
68
  ### Step 3: Approval gate
62
69
 
63
70
  Ask for approval before creating anything.
71
+ The approval card must include:
72
+ - source CAMT file
73
+ - number of bank transactions that would be created
74
+ - rows skipped as exact duplicates
75
+ - possible duplicate review items
76
+ - side effect: PROJECT bank transactions created in e-arveldaja
77
+ - audit reference when available
64
78
 
65
79
  If the user does not explicitly approve, stop.
66
80
 
@@ -4,6 +4,12 @@
4
4
 
5
5
  Preview Wise transaction import results, including fee rows and skipped duplicates, before creating anything.
6
6
 
7
+ User-facing phases:
8
+ 1. Preview the Wise CSV import.
9
+ 2. Resolve fee-dimension or transfer questions only when needed.
10
+ 3. Ask for one approval decision.
11
+ 4. Import and offer reconciliation/confirmation follow-up.
12
+
7
13
  ## Arguments
8
14
 
9
15
  - `file_path`: absolute path to the regular Wise `transaction-history.csv`
@@ -52,6 +58,13 @@ Show:
52
58
  Do not disable Jar skipping unless the user explicitly wants those internal Wise movements imported.
53
59
 
54
60
  Ask for approval before running with `execute: true`.
61
+ The approval card must include:
62
+ - source Wise CSV
63
+ - number of main transactions and fee rows that would be created
64
+ - skipped duplicates and Jar-transfer handling
65
+ - selected fee account dimension, if any
66
+ - side effect: PROJECT bank transactions created in e-arveldaja
67
+ - audit reference when available
55
68
 
56
69
  If the user does not explicitly approve, stop.
57
70
 
@@ -4,6 +4,13 @@
4
4
 
5
5
  Book Lightyear investment activity from CSV exports after explicit dry-run review.
6
6
 
7
+ User-facing phases:
8
+ 1. Parse statements and required capital-gains files.
9
+ 2. Show accounting carrying value / cost basis.
10
+ 3. Preview trade bookings.
11
+ 4. Preview distribution bookings after required accounts are known.
12
+ 5. Book only approved categories.
13
+
7
14
  ## Arguments
8
15
 
9
16
  - `statement_path`: absolute path to the Lightyear AccountStatement CSV
@@ -42,6 +49,7 @@ Call `book_lightyear_trades` with `dry_run: true`.
42
49
  - Include `capital_gains_file`, `gain_loss_account`, `loss_account`, `fee_account`, `investment_dimension_id`, and `broker_dimension_id` when available.
43
50
  - Present trades that would be booked, skipped entries, duplicate-detection basis, and warnings.
44
51
  - Ask for explicit approval before re-running with `dry_run: false`.
52
+ - The trade approval card must include source CSV, journals that would be created, skipped duplicates, gain/loss account choices, dimensions, and side effects.
45
53
 
46
54
  ### Step 5: Preview distributions only after required accounts are known
47
55
 
@@ -54,6 +62,7 @@ When the required accounts are known, call `book_lightyear_distributions` with `
54
62
  - The tool defaults `reward_account` to 8600 ("Muud äritulud") for platform rewards. Only pass `reward_account` explicitly when the user wants to override the default.
55
63
  - Present dividends, interest, platform rewards, withheld tax, skipped entries, duplicate-detection basis, and warnings.
56
64
  - Ask for explicit approval before re-running with `dry_run: false`.
65
+ - The distribution approval card must include source CSV, income/tax/reward accounts, journals that would be created, skipped duplicates, and side effects.
57
66
 
58
67
  ### Step 6: Execute after approval
59
68
 
@@ -6,6 +6,12 @@ Run the month-end close checklist, compute financial statements, and flag issues
6
6
 
7
7
  **Input:** Month in YYYY-MM format (e.g. `2026-02`).
8
8
 
9
+ User-facing phases:
10
+ 1. Identify close blockers.
11
+ 2. Check missing documents and duplicate invoices.
12
+ 3. Compute statements.
13
+ 4. Show READY TO CLOSE or HAS BLOCKERS with concrete inline next actions.
14
+
9
15
  ## Step 1: Run the checklist
10
16
 
11
17
  Call `month_end_close_checklist`:
@@ -44,7 +44,19 @@ Ask the user for any details to add:
44
44
  - Phone number
45
45
  - Address (if not found from registry)
46
46
 
47
- ## Step 5: Create the supplier
47
+ ## Step 5: Preview and ask for approval
48
+
49
+ Before creating anything, present one approval card:
50
+ - supplier name
51
+ - registry code and country
52
+ - duplicate-check result
53
+ - registry/address data being used
54
+ - bank account, VAT number, email, phone, and address fields that will be stored
55
+ - side effect: create one supplier client record in e-arveldaja
56
+
57
+ If the user does not explicitly approve, stop.
58
+
59
+ ## Step 6: Create the supplier
48
60
 
49
61
  Call `create_client`:
50
62
  - `name`: official name from registry, or user-provided name
@@ -59,7 +71,7 @@ Call `create_client`:
59
71
  - `telephone`: (if provided)
60
72
  - `address_text`: from registry or user input
61
73
 
62
- ## Step 6: Report
74
+ ## Step 7: Report
63
75
 
64
76
  Show created supplier: client ID, name, registry code, country, and any additional fields set.
65
77
 
@@ -4,6 +4,13 @@
4
4
 
5
5
  Scan a folder of receipts, preview what can be auto-booked, and only create purchase invoices after approval.
6
6
 
7
+ User-facing phases:
8
+ 1. Scan the folder.
9
+ 2. Preview auto-bookable receipts, duplicates, review items, and errors.
10
+ 3. Ask for one create approval.
11
+ 4. Create/upload PROJECT invoices.
12
+ 5. Offer confirmation and bank-linking as separate follow-up approvals.
13
+
7
14
  ## Arguments
8
15
 
9
16
  - `folder_path`: absolute path to the receipt folder
@@ -35,7 +42,8 @@ Call `receipt_batch`:
35
42
  - include `date_from` / `date_to` when provided
36
43
 
37
44
  Review:
38
- - `receipt_batch` is the preferred merged workflow tool; `scan_receipt_folder` and `process_receipt_batch` remain compatibility primitives.
45
+ - `receipt_batch` is the preferred merged workflow tool.
46
+ - Fallback compatibility primitives: `scan_receipt_folder` and `process_receipt_batch` remain available, but only use them if the preferred tool is unavailable. Do not mention fallback tool names to the user.
39
47
  - Use `result` as the delegated `process_receipt_batch` payload.
40
48
  - Treat `execution` as the canonical batch payload when present.
41
49
  - Prefer `execution.summary`, `execution.results`, `execution.skipped`, `execution.needs_review`, `execution.errors`, and `execution.audit_reference`.
@@ -56,6 +64,13 @@ Recurring `needs_review` reasons to recognize and explain plainly:
56
64
  State clearly that `mode: "dry_run"` is only a preview.
57
65
 
58
66
  Ask for approval before running `receipt_batch` with `mode: "create"`.
67
+ The approval card must include:
68
+ - source folder
69
+ - files that would create PROJECT purchase invoices
70
+ - skipped duplicates
71
+ - files still needing review or failed OCR
72
+ - side effect: create and upload PROJECT purchase invoices only
73
+ - what is explicitly not included yet: invoice confirmation and bank transaction confirmation
59
74
 
60
75
  `mode: "create"` creates and uploads PROJECT purchase invoices, but leaves them unconfirmed for review. Do not use `mode: "create_and_confirm"` unless the user separately approves confirming the created invoices after reviewing them.
61
76
 
@@ -4,6 +4,8 @@
4
4
 
5
5
  Match unconfirmed bank transactions to open invoices and confirm the matches.
6
6
 
7
+ Start by showing matches. Nothing is confirmed, deleted, or journalized until the user approves the exact action.
8
+
7
9
  **Input:** One of:
8
10
  - `auto` or empty — dry run first, then confirm high-confidence matches with user approval
9
11
  - `review` — show all matches for manual review without confirming
@@ -11,11 +13,11 @@ Match unconfirmed bank transactions to open invoices and confirm the matches.
11
13
 
12
14
  ## Step 1: Get matches
13
15
 
14
- - Preferred: call `reconcile_bank_transactions`:
16
+ Preferred: call `reconcile_bank_transactions`:
15
17
  - mode: "suggest"
16
18
  - min_confidence: 30 (to see all potential matches including low-confidence ones)
17
19
 
18
- `reconcile_transactions` remains available as a compatibility primitive.
20
+ Fallback compatibility primitive: `reconcile_transactions` remains available, but only use it if the preferred mode-based tool is unavailable. Do not mention fallback tool names to the user.
19
21
 
20
22
  Review the output:
21
23
  - `result.total_unconfirmed`: bank transactions needing attention
@@ -51,11 +53,17 @@ Call `reconcile_bank_transactions`:
51
53
  - mode: "dry_run_auto_confirm"
52
54
  - min_confidence: 90
53
55
 
54
- `auto_confirm_exact_matches` remains available as a compatibility primitive.
56
+ Fallback compatibility primitive: `auto_confirm_exact_matches` remains available, but prefer `reconcile_bank_transactions`.
55
57
 
56
58
  Treat `result.execution` as the canonical batch payload when present. Prefer `result.execution.summary`, `result.execution.results`, `result.execution.errors`, and `result.execution.audit_reference`.
57
59
 
58
60
  Show what would be confirmed. Ask user for approval.
61
+ The approval card must include:
62
+ - how many bank transactions would be confirmed
63
+ - invoice numbers and counterparties
64
+ - source confidence and match reasons
65
+ - side effect: confirmed bank transaction distributions
66
+ - audit reference when available
59
67
 
60
68
  If approved, call again with `mode: "execute_auto_confirm"`.
61
69
 
@@ -88,7 +96,7 @@ For transfers between your own bank accounts (counterparty matches company name
88
96
  Call `reconcile_bank_transactions`:
89
97
  - mode: "inter_account_dry_run" (dry run first)
90
98
 
91
- `reconcile_inter_account_transfers` remains available as a compatibility primitive.
99
+ Fallback compatibility primitive: `reconcile_inter_account_transfers` remains available, but prefer the mode-based dry run through `reconcile_bank_transactions` before execution.
92
100
 
93
101
  Review the results:
94
102
  - Treat `result.execution.summary` as the canonical source for counts, and use `result.pairs`, `result.one_sided`, `result.already_handled`, and `result.ambiguous_pairs` for detailed breakdown.
@@ -4,6 +4,8 @@
4
4
 
5
5
  Explain how to configure e-arveldaja MCP credentials for the current working directory.
6
6
 
7
+ For actual importing, prefer the `setup-credentials` workflow because it covers storage scope, append/overwrite behavior, removal, and restart verification.
8
+
7
9
  Follow these steps:
8
10
 
9
11
  1. Call `get_setup_instructions`.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.14.2] - 2026-05-31
6
+
7
+ ### Fixed
8
+ - **CAMT duplicate detection survives dropped bank metadata** — `import_camt053` now stores a compact CAMT metadata marker in the writable transaction description when the e-arveldaja API drops `bank_ref_number` or `bank_account_no`. Long bank references are stored as a stable SHA-256 lookup key, and the marker preserves the counterparty IBAN when both full values cannot fit inside the API's 150-character description limit. Re-importing the same CAMT statement now skips the prior transaction instead of creating a duplicate.
9
+ - **CAMT possible-duplicate review keeps marker-only candidates visible** — marker metadata is no longer treated as a broad bank-reference duplicate on its own. If a marker-bearing existing transaction fails the exact CAMT duplicate key, it remains in `needs_review` when amount/date/counterparty signals still match, so operators can link or clean it up instead of silently creating a second PROJECT row.
10
+ - **TOON 2.3 response compatibility** — MCP responses still prefer TOON for compact output, but now fall back to JSON when the current TOON encoder produces text its decoder rejects, such as sandboxed multiline OCR/CAMT marker strings. This keeps downstream wrappers and tests parseable while preserving untrusted OCR delimiters verbatim.
11
+ - **Purchase-invoice notes no longer default to the source filename** — the `book-invoice` workflow prompt and the `create_purchase_invoice_from_pdf` `notes` parameter no longer suggest storing the source document filename in the notes field. The document is already uploaded and attached to the invoice, so the notes field is left empty by default and reserved for genuinely useful context such as assumptions or manual adjustments. The booking approval card now also explicitly flags when a new supplier record was auto-created during the flow.
12
+
13
+ ### Changed
14
+ - **Dependency refresh for the release** — updated direct runtime and dev dependencies, including LiteParse 2.0.4, MCP SDK 1.29.0, TOON 2.3.0, Zod 4.4.3, TypeScript 6.0.3, dotenv 17.4.2, fast-xml-parser 5.8.0, and tsx 4.22.4. The Vitest/Vite test stack is pinned to Node-18-compatible versions (Vitest 3.2.4, Vite 6.4.2) so the locked toolchain honours the advertised `engines.node >=18.0.0` instead of silently requiring Node 20. LiteParse parsing now uses the v2 single-argument `parse(input)` API, and Zod record schemas use the v4 two-argument form.
15
+
16
+ ## [0.14.1] - 2026-05-09
17
+
18
+ ### Changed
19
+ - **Workflow prompt UX** — expanded `recommend_workflow` to cover all 15 workflow prompts, including setup, review continuation, month-end, supplier creation, company overview, and Lightyear booking. Workflow action labels now use accounting-language next steps instead of generic `Run <tool>` labels, and MCP workflow prompts include a shared user-facing response contract for done items, approval cards, one-decision questions, accountant-review items, and next recommended actions.
20
+ - **Prompt approval guidance** — refreshed the shipped workflow prompts and generated Claude commands with clearer user-facing phases, approval-card contents, fallback-tool wording, and an explicit approval gate before creating new supplier records. `setup-e-arveldaja` now comes from the same canonical workflow prompt source as the other shipped prompts.
21
+
5
22
  ## [0.14.0] - 2026-05-09
6
23
 
7
24
  ### Added
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  MCP server for the Estonian e-arveldaja (RIK e-Financials) REST API. 121 tools, 15 workflow prompts, 12 resources. Works with any MCP client — Claude Code, Codex CLI, Gemini CLI, Cursor, Windsurf, Cline, and others.
6
6
 
7
- > **v0.14.0Wise card-payment FX rate lock and currency rounding.** Foreign-currency purchase invoices paid via Wise card no longer drift into `PARTIALLY_PAID`: `import_wise_transactions` matches eligible Wise rows to unpaid invoices and patches `base_gross_price` / `currency_rate` to the actual settlement (idempotent re-import safe). The new `reconcile_currency_rounding` tool sweeps any remaining sub-1.00 EUR diffs patched in place under 0.10 EUR, booked as kursivahe journals between 0.10 and 1.00 EUR, surfaced for review beyond that. Several receipt-inbox safeguards land in this version too: foreign-currency receipts now require an explicit conversion rate before auto-booking, tied bank-match candidates are no longer auto-picked at random, and partial-success classification groups now report which rows were already booked. See the [changelog](CHANGELOG.md) for full details.
7
+ > **v0.14.2safer CAMT re-imports.** `import_camt053` now preserves CAMT bank-reference and counterparty-account metadata in the writable transaction description when the e-arveldaja API drops the dedicated fields. Long bank references are stored as stable hashes, marker-only prior imports still surface in duplicate review when the exact key does not match, and repeated CAMT imports are less likely to create duplicate PROJECT rows. See the [changelog](CHANGELOG.md) for full details.
8
8
  >
9
9
  > **Guided workflow actions.** `recommend_workflow` suggests the safest accounting flow for a natural-language goal, and key workflow/batch tools return a `workflow_action_v1` envelope with `recommended_next_action`, review questions, and approval previews. `accounting_inbox` is the preferred merged entry point for workspace triage, `continue_accounting_workflow` is the preferred merged continuation tool, `receipt_batch` and `process_camt053` are the preferred mode-based import/batch entry points, and bank work has `reconcile_bank_transactions` plus `classify_bank_transactions` as mode-based entry points. Older focused tools such as `run_accounting_inbox_dry_runs`, `resolve_accounting_review_item`, `prepare_accounting_review_action`, `scan_receipt_folder`, `process_receipt_batch`, `parse_camt053`, `import_camt053`, `reconcile_transactions`, and `apply_transaction_classifications` remain available as compatibility primitives. See the [changelog](CHANGELOG.md) for full details.
10
10
  >
@@ -1,11 +1,40 @@
1
1
  import { z } from "zod";
2
- declare const liabilityClassificationSchema: z.ZodEnum<["current", "non_current"]>;
3
- declare const cashFlowCategorySchema: z.ZodEnum<["operating", "investing", "financing"]>;
4
- declare const vatDeductionModeSchema: z.ZodEnum<["none", "full", "partial"]>;
5
- declare const transactionCategorySchema: z.ZodEnum<["saas_subscriptions", "bank_fees", "tax_payments", "salary_payroll", "owner_transfers", "card_purchases", "revenue_without_invoice", "unknown"]>;
6
- declare const autoBookingRuleSchema: z.ZodEffects<z.ZodObject<{
2
+ declare const liabilityClassificationSchema: z.ZodEnum<{
3
+ current: "current";
4
+ non_current: "non_current";
5
+ }>;
6
+ declare const cashFlowCategorySchema: z.ZodEnum<{
7
+ operating: "operating";
8
+ investing: "investing";
9
+ financing: "financing";
10
+ }>;
11
+ declare const vatDeductionModeSchema: z.ZodEnum<{
12
+ none: "none";
13
+ full: "full";
14
+ partial: "partial";
15
+ }>;
16
+ declare const transactionCategorySchema: z.ZodEnum<{
17
+ saas_subscriptions: "saas_subscriptions";
18
+ bank_fees: "bank_fees";
19
+ tax_payments: "tax_payments";
20
+ salary_payroll: "salary_payroll";
21
+ owner_transfers: "owner_transfers";
22
+ card_purchases: "card_purchases";
23
+ revenue_without_invoice: "revenue_without_invoice";
24
+ unknown: "unknown";
25
+ }>;
26
+ declare const autoBookingRuleSchema: z.ZodObject<{
7
27
  match: z.ZodString;
8
- category: z.ZodOptional<z.ZodEnum<["saas_subscriptions", "bank_fees", "tax_payments", "salary_payroll", "owner_transfers", "card_purchases", "revenue_without_invoice", "unknown"]>>;
28
+ category: z.ZodOptional<z.ZodEnum<{
29
+ saas_subscriptions: "saas_subscriptions";
30
+ bank_fees: "bank_fees";
31
+ tax_payments: "tax_payments";
32
+ salary_payroll: "salary_payroll";
33
+ owner_transfers: "owner_transfers";
34
+ card_purchases: "card_purchases";
35
+ revenue_without_invoice: "revenue_without_invoice";
36
+ unknown: "unknown";
37
+ }>>;
9
38
  purchase_article_id: z.ZodOptional<z.ZodNumber>;
10
39
  purchase_account_id: z.ZodOptional<z.ZodNumber>;
11
40
  purchase_account_dimensions_id: z.ZodOptional<z.ZodNumber>;
@@ -13,47 +42,7 @@ declare const autoBookingRuleSchema: z.ZodEffects<z.ZodObject<{
13
42
  vat_rate_dropdown: z.ZodOptional<z.ZodString>;
14
43
  reversed_vat_id: z.ZodOptional<z.ZodNumber>;
15
44
  reason: z.ZodOptional<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- match: string;
18
- category?: "saas_subscriptions" | "bank_fees" | "tax_payments" | "salary_payroll" | "owner_transfers" | "card_purchases" | "revenue_without_invoice" | "unknown" | undefined;
19
- purchase_article_id?: number | undefined;
20
- purchase_account_id?: number | undefined;
21
- purchase_account_dimensions_id?: number | undefined;
22
- liability_account_id?: number | undefined;
23
- vat_rate_dropdown?: string | undefined;
24
- reversed_vat_id?: number | undefined;
25
- reason?: string | undefined;
26
- }, {
27
- match: string;
28
- category?: "saas_subscriptions" | "bank_fees" | "tax_payments" | "salary_payroll" | "owner_transfers" | "card_purchases" | "revenue_without_invoice" | "unknown" | undefined;
29
- purchase_article_id?: number | undefined;
30
- purchase_account_id?: number | undefined;
31
- purchase_account_dimensions_id?: number | undefined;
32
- liability_account_id?: number | undefined;
33
- vat_rate_dropdown?: string | undefined;
34
- reversed_vat_id?: number | undefined;
35
- reason?: string | undefined;
36
- }>, {
37
- match: string;
38
- category?: "saas_subscriptions" | "bank_fees" | "tax_payments" | "salary_payroll" | "owner_transfers" | "card_purchases" | "revenue_without_invoice" | "unknown" | undefined;
39
- purchase_article_id?: number | undefined;
40
- purchase_account_id?: number | undefined;
41
- purchase_account_dimensions_id?: number | undefined;
42
- liability_account_id?: number | undefined;
43
- vat_rate_dropdown?: string | undefined;
44
- reversed_vat_id?: number | undefined;
45
- reason?: string | undefined;
46
- }, {
47
- match: string;
48
- category?: "saas_subscriptions" | "bank_fees" | "tax_payments" | "salary_payroll" | "owner_transfers" | "card_purchases" | "revenue_without_invoice" | "unknown" | undefined;
49
- purchase_article_id?: number | undefined;
50
- purchase_account_id?: number | undefined;
51
- purchase_account_dimensions_id?: number | undefined;
52
- liability_account_id?: number | undefined;
53
- vat_rate_dropdown?: string | undefined;
54
- reversed_vat_id?: number | undefined;
55
- reason?: string | undefined;
56
- }>;
45
+ }, z.core.$strip>;
57
46
  export type LiabilityClassificationRule = z.infer<typeof liabilityClassificationSchema>;
58
47
  export type CashFlowCategoryRule = z.infer<typeof cashFlowCategorySchema>;
59
48
  export type OwnerExpenseVatDeductionModeRule = z.infer<typeof vatDeductionModeSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"accounting-rules.d.ts","sourceRoot":"","sources":["../src/accounting-rules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,6BAA6B,uCAAqC,CAAC;AACzE,QAAA,MAAM,sBAAsB,oDAAkD,CAAC;AAC/E,QAAA,MAAM,sBAAsB,wCAAsC,CAAC;AAEnE,QAAA,MAAM,yBAAyB,6JAS7B,CAAC;AAcH,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQzB,CAAC;AA+BH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACxF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC1E,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAA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,OAAO,yBAAyB,CAAC,GACnD,yBAAyB,GAAG,SAAS,CAcvC;AAED,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS,CAEzG;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE3F;AAED,wBAAgB,+BAA+B,IAAI,MAAM,GAAG,SAAS,CAEpE;AAED,wBAAgB,sCAAsC,IAAI,gCAAgC,GAAG,SAAS,CAErG;AAED,wBAAgB,uCAAuC,IAAI,MAAM,GAAG,SAAS,CAE5E;AAED,wBAAgB,yCAAyC,CACvD,cAAc,EAAE,MAAM,GACrB,gCAAgC,GAAG,SAAS,CAE9C;AAED,wBAAgB,0CAA0C,CACxD,cAAc,EAAE,MAAM,GACrB,MAAM,GAAG,SAAS,CAEpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"document-parser.d.ts","sourceRoot":"","sources":["../src/document-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAkC1F,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;CACrB;AAeD,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,eAAe,CAAC,CAmBpE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,CAG7C;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAO7E"}
1
+ {"version":3,"file":"document-parser.d.ts","sourceRoot":"","sources":["../src/document-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAkC1F,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;CACrB;AAeD,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,eAAe,CAAC,CAkBpE;AAID,wBAAgB,iBAAiB,IAAI,SAAS,CAG7C;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAO7E"}
@@ -48,7 +48,6 @@ export function buildDocumentParserConfig() {
48
48
  ocrLanguage: process.env.EARVELDAJA_LITEPARSE_OCR_LANGUAGE ?? "eng+est",
49
49
  ocrServerUrl: validateOcrUrl(process.env.EARVELDAJA_LITEPARSE_OCR_SERVER_URL),
50
50
  outputFormat: "text",
51
- preciseBoundingBox: false,
52
51
  preserveVerySmallText: true,
53
52
  };
54
53
  const numWorkers = readNumberEnv("EARVELDAJA_LITEPARSE_NUM_WORKERS");
@@ -65,7 +64,7 @@ export function getDocumentParser() {
65
64
  return parser;
66
65
  }
67
66
  export async function parseDocument(filePath) {
68
- const result = await getDocumentParser().parse(filePath, true);
67
+ const result = await getDocumentParser().parse(filePath);
69
68
  return {
70
69
  text: result.text,
71
70
  pageCount: result.pages.length,
@@ -1 +1 @@
1
- {"version":3,"file":"document-parser.js","sourceRoot":"","sources":["../src/document-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0C,MAAM,uBAAuB,CAAC;AAE1F,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC7E,OAAO,UAAU,KAAK,WAAW;QAC/B,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC;QACjC,UAAU,KAAK,KAAK;QACpB,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,cAAc,CAAC,GAAuB;IAC7C,IAAI,CAAC,GAAG;QAAE,OAAO,SA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CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzD,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;QAC9B,MAAM;KACP,CAAC;AACJ,CAAC"}
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { createRequire } from "node:module";
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
9
  import { z } from "zod";
10
- import { registerPrompt, registerTool } from "./mcp-compat.js";
10
+ import { registerTool } from "./mcp-compat.js";
11
11
  import { loadDotenvFiles, loadAllConfigs, listStoredCredentials, removeStoredCredential, NO_API_CREDENTIALS_FOUND_MESSAGE, getCredentialSetupInfo, findImportableApiKeyFiles, importApiKeyCredentials, } from "./config.js";
12
12
  import { runWithExtra } from "./progress.js";
13
13
  import { HttpClient } from "./http-client.js";
@@ -831,30 +831,6 @@ Reporting:
831
831
  registerDynamicResources(scopedServer, api);
832
832
  // Register prompts
833
833
  registerPrompts(server, { setupInfo: setupMode ? setupInfo : undefined });
834
- registerPrompt(server, "setup-e-arveldaja", "Explain how to configure e-arveldaja API credentials when the MCP server is running in setup mode.", async () => ({
835
- messages: [{
836
- role: "user",
837
- content: {
838
- type: "text",
839
- text: `Explain how to configure e-arveldaja MCP credentials using this exact guidance:
840
- - Working directory: ${setupInfo.working_directory}
841
- - Searched directories: ${setupInfo.searched_directories.join(", ")}
842
- - Shared config directory used when the configuration should work from any folder: ${setupInfo.global_config_directory}
843
- - Shared env file: ${setupInfo.global_env_file}
844
- - Import tool: import_apikey_credentials
845
- - Required environment variables: ${setupInfo.env_vars.join(", ")}
846
- - Optional direct credential file env var: ${setupInfo.credential_file_env_var}
847
- - Alternatively, place ${setupInfo.credential_file_pattern} in this folder and run import_apikey_credentials to verify it and choose whether it should work only in this folder or whenever the MCP server is started from any folder.
848
- - File format:
849
- ${setupInfo.file_format_example.join("\n ")}
850
- - ${setupInfo.next_steps.join("\n- ")}
851
-
852
- Current server mode: ${setupMode ? "setup" : "configured"}.
853
- If the server is currently in setup mode, say so explicitly and tell the user to restart the MCP server after adding credentials.
854
- If the server is already configured, say that explicitly and treat this as reconfiguration guidance only.`,
855
- },
856
- }],
857
- }));
858
834
  // Start server
859
835
  const transport = new StdioServerTransport();
860
836
  await server.connect(transport);