@dizzlkheinz/ynab-mcpb 0.26.7 → 0.26.9

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 (82) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/CLAUDE.md +1 -1
  3. package/dist/bundle/index.cjs +127 -102
  4. package/dist/server/YNABMCPServer.d.ts +2 -0
  5. package/dist/server/YNABMCPServer.js +2 -1
  6. package/dist/server/completions.js +3 -2
  7. package/dist/server/config.d.ts +1 -1
  8. package/dist/server/rateLimiter.js +1 -2
  9. package/dist/server/resources.js +9 -8
  10. package/dist/server/securityMiddleware.d.ts +1 -0
  11. package/dist/tools/accountTools.js +2 -2
  12. package/dist/tools/budgetTools.js +5 -5
  13. package/dist/tools/compareTransactions/index.d.ts +1 -0
  14. package/dist/tools/compareTransactions/index.js +30 -14
  15. package/dist/tools/deltaFetcher.js +7 -10
  16. package/dist/tools/exportTransactions.js +45 -9
  17. package/dist/tools/monthTools.js +17 -10
  18. package/dist/tools/reconciliation/analyzer.js +5 -1
  19. package/dist/tools/reconciliation/balanceReconciliation.d.ts +2 -0
  20. package/dist/tools/reconciliation/balanceReconciliation.js +5 -4
  21. package/dist/tools/reconciliation/executor.d.ts +1 -0
  22. package/dist/tools/reconciliation/executor.js +14 -1
  23. package/dist/tools/reconciliation/executorHelpers.js +1 -1
  24. package/dist/tools/reconciliation/index.js +7 -5
  25. package/dist/tools/reconciliation/outputBuilder.js +9 -6
  26. package/dist/tools/schemas/outputs/reconciliationOutputs.d.ts +8 -0
  27. package/dist/tools/schemas/outputs/reconciliationOutputs.js +5 -0
  28. package/dist/tools/transactionUtils.js +3 -2
  29. package/dist/tools/transactionWriteTools.js +2 -2
  30. package/dist/utils/ynabApiCompat.d.ts +28 -0
  31. package/dist/utils/ynabApiCompat.js +64 -0
  32. package/package.json +3 -3
  33. package/src/server/YNABMCPServer.ts +2 -1
  34. package/src/server/__tests__/YNABMCPServer.integration.test.ts +7 -8
  35. package/src/server/__tests__/YNABMCPServer.test.ts +7 -6
  36. package/src/server/__tests__/rateLimiter.test.ts +15 -0
  37. package/src/server/__tests__/server-startup.integration.test.ts +6 -1
  38. package/src/server/completions.ts +3 -2
  39. package/src/server/rateLimiter.ts +3 -3
  40. package/src/server/resources.ts +14 -11
  41. package/src/tools/__tests__/accountTools.delta.integration.test.ts +3 -2
  42. package/src/tools/__tests__/accountTools.integration.test.ts +3 -2
  43. package/src/tools/__tests__/accountTools.test.ts +39 -0
  44. package/src/tools/__tests__/budgetTools.test.ts +27 -0
  45. package/src/tools/__tests__/categoryTools.delta.integration.test.ts +3 -2
  46. package/src/tools/__tests__/categoryTools.integration.test.ts +3 -2
  47. package/src/tools/__tests__/compareTransactions/index.test.ts +49 -2
  48. package/src/tools/__tests__/deltaFetcher.scheduled.integration.test.ts +3 -2
  49. package/src/tools/__tests__/exportTransactions.test.ts +16 -1
  50. package/src/tools/__tests__/monthTools.delta.integration.test.ts +3 -2
  51. package/src/tools/__tests__/monthTools.integration.test.ts +10 -6
  52. package/src/tools/__tests__/monthTools.test.ts +11 -10
  53. package/src/tools/__tests__/payeeTools.delta.integration.test.ts +3 -2
  54. package/src/tools/__tests__/payeeTools.integration.test.ts +3 -2
  55. package/src/tools/__tests__/transactionTools.integration.test.ts +5 -4
  56. package/src/tools/__tests__/transactionTools.test.ts +42 -38
  57. package/src/tools/accountTools.ts +7 -3
  58. package/src/tools/budgetTools.ts +6 -8
  59. package/src/tools/compareTransactions/index.ts +35 -14
  60. package/src/tools/deltaFetcher.ts +11 -12
  61. package/src/tools/exportTransactions.ts +58 -9
  62. package/src/tools/monthTools.ts +22 -14
  63. package/src/tools/reconciliation/__tests__/analyzer.test.ts +53 -0
  64. package/src/tools/reconciliation/__tests__/balanceReconciliation.test.ts +39 -0
  65. package/src/tools/reconciliation/__tests__/executor.integration.test.ts +3 -2
  66. package/src/tools/reconciliation/__tests__/executor.test.ts +137 -0
  67. package/src/tools/reconciliation/__tests__/executorHelpers.test.ts +41 -0
  68. package/src/tools/reconciliation/__tests__/index.statementBalance.test.ts +116 -0
  69. package/src/tools/reconciliation/__tests__/reconciliation.delta.integration.test.ts +3 -2
  70. package/src/tools/reconciliation/analyzer.ts +5 -1
  71. package/src/tools/reconciliation/balanceReconciliation.ts +13 -5
  72. package/src/tools/reconciliation/executor.ts +15 -0
  73. package/src/tools/reconciliation/executorHelpers.ts +1 -1
  74. package/src/tools/reconciliation/index.ts +11 -9
  75. package/src/tools/reconciliation/outputBuilder.ts +26 -15
  76. package/src/tools/schemas/outputs/__tests__/reconciliationOutputs.test.ts +14 -0
  77. package/src/tools/schemas/outputs/comparisonOutputs.ts +10 -11
  78. package/src/tools/schemas/outputs/reconciliationOutputs.ts +6 -0
  79. package/src/tools/transactionUtils.ts +5 -2
  80. package/src/tools/transactionWriteTools.ts +2 -2
  81. package/src/utils/ynabApiCompat.ts +172 -0
  82. package/tsconfig.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.26.9] - 2026-05-10
11
+
12
+ ### Fixed
13
+
14
+ - **`ynab_export_transactions` amounts in decimal units** — Exported transaction `amount` fields were raw YNAB milliunits; now converted to decimal currency units (e.g. `-25500` → `-25.5`) for user-facing readability in both minimal and full export modes
15
+ - **`ynab_export_transactions` path traversal guard** — Added filename sanitization (`sanitizeExportFilename`) and a path-traversal check (`buildExportFilePath`) to reject filenames with path separators, absolute paths, or control characters that could escape the export directory
16
+ - **Reconciliation statement balance sign** — `ynab_reconcile_account` no longer forces the statement balance negative for liability accounts; the caller-provided sign is preserved, allowing credit-balance statements (positive) to be reconciled correctly
17
+ - **Reconciliation currency decimal digits** — Balance verification amounts (`bank_statement_balance`, `ynab_calculated_balance`, `discrepancy`) now respect the budget's `currency_format.decimal_digits` field instead of always dividing by 1000, fixing display for currencies with non-standard decimal places
18
+ - **Reconciliation: only reconcile transactions cleared this run** — The bulk-reconcile step previously marked all already-cleared matched transactions as reconciled, including ones cleared before this session; it now only marks transactions that were explicitly cleared during the current reconciliation run
19
+ - **Reconciliation likely-cause detection** — Tightened "round amount" heuristic from `abs % 1000 === 0 || abs % 500 === 0` to `abs % 500 === 0`, reducing false positives for non-round discrepancies
20
+
21
+ ## [0.26.8] - 2026-05-10
22
+
23
+ ### Fixed
24
+
25
+ - **`ynab_get_month` goal amounts now in dollars** — Category goal fields (`goal_target`, `goal_under_funded`, `goal_overall_funded`, `goal_overall_left`) inside `get_month` responses were being returned in raw milliunits; now consistently converted to dollars to match `list_categories` and `get_category`
26
+ - **YNAB API compatibility** — Restored compatibility with current YNAB API response shapes for budgets, months, and completions; extracted `ynabApiCompat.ts` adapter layer to handle field differences without touching tool handlers
27
+
28
+ ### Changed
29
+
30
+ - **`ynab_list_months` returns newest-first** — Month list is now ordered most-recent first (was oldest-first, matching raw YNAB API order), making the default page 1 show the current and recent months
31
+ - **TypeScript upgraded to v6** — Bumped `typescript` from `^5.9.3` to `^6.0.3` and `esbuild` from `^0.27.3` to `^0.28.0`; switched `moduleResolution` to `"bundler"` for TypeScript 6 compatibility
32
+ - **`ynab_create_account`** — Removed `lineOfCredit` account type (no longer present in YNAB API's `SaveAccountType`)
33
+
10
34
  ## [0.26.7] - 2026-04-03
11
35
 
12
36
  ### Changed
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  This is a Model Context Protocol (MCP) server for YNAB (You Need A Budget) integration, enabling AI assistants to interact with YNAB budgets, accounts, transactions, and categories. The codebase uses TypeScript with a modular, service-oriented architecture.
8
8
 
9
- **Current Version:** 0.26.7
9
+ **Current Version:** 0.26.9
10
10
 
11
11
  ## Essential Commands
12
12