@stephendolan/ynab-cli 2.8.0 → 2.8.1
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/dist/cli.js +237 -273
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -438,338 +438,271 @@ var YnabClient = class {
|
|
|
438
438
|
}
|
|
439
439
|
return budgetId;
|
|
440
440
|
}
|
|
441
|
-
async withErrorHandling(fn) {
|
|
442
|
-
try {
|
|
443
|
-
return await fn();
|
|
444
|
-
} catch (error) {
|
|
445
|
-
handleYnabError(error);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
441
|
async getUser() {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
return response.data.user;
|
|
453
|
-
});
|
|
442
|
+
const api = await this.getApi();
|
|
443
|
+
const response = await api.user.getUser();
|
|
444
|
+
return response.data.user;
|
|
454
445
|
}
|
|
455
446
|
async getBudgets(includeAccounts = false) {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
};
|
|
463
|
-
});
|
|
447
|
+
const api = await this.getApi();
|
|
448
|
+
const response = await api.budgets.getBudgets(includeAccounts);
|
|
449
|
+
return {
|
|
450
|
+
budgets: response.data.budgets,
|
|
451
|
+
server_knowledge: 0
|
|
452
|
+
};
|
|
464
453
|
}
|
|
465
454
|
async getBudget(budgetId, lastKnowledgeOfServer) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
};
|
|
474
|
-
});
|
|
455
|
+
const api = await this.getApi();
|
|
456
|
+
const id = await this.getBudgetId(budgetId);
|
|
457
|
+
const response = await api.budgets.getBudgetById(id, lastKnowledgeOfServer);
|
|
458
|
+
return {
|
|
459
|
+
budget: response.data.budget,
|
|
460
|
+
server_knowledge: response.data.server_knowledge
|
|
461
|
+
};
|
|
475
462
|
}
|
|
476
463
|
async getBudgetSettings(budgetId) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
return response.data.settings;
|
|
482
|
-
});
|
|
464
|
+
const api = await this.getApi();
|
|
465
|
+
const id = await this.getBudgetId(budgetId);
|
|
466
|
+
const response = await api.budgets.getBudgetSettingsById(id);
|
|
467
|
+
return response.data.settings;
|
|
483
468
|
}
|
|
484
469
|
async getAccounts(budgetId, lastKnowledgeOfServer) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
};
|
|
493
|
-
});
|
|
470
|
+
const api = await this.getApi();
|
|
471
|
+
const id = await this.getBudgetId(budgetId);
|
|
472
|
+
const response = await api.accounts.getAccounts(id, lastKnowledgeOfServer);
|
|
473
|
+
return {
|
|
474
|
+
accounts: response.data.accounts,
|
|
475
|
+
server_knowledge: response.data.server_knowledge
|
|
476
|
+
};
|
|
494
477
|
}
|
|
495
478
|
async getAccount(accountId, budgetId) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
return response.data.account;
|
|
501
|
-
});
|
|
479
|
+
const api = await this.getApi();
|
|
480
|
+
const id = await this.getBudgetId(budgetId);
|
|
481
|
+
const response = await api.accounts.getAccountById(id, accountId);
|
|
482
|
+
return response.data.account;
|
|
502
483
|
}
|
|
503
484
|
async getCategories(budgetId, lastKnowledgeOfServer) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
};
|
|
512
|
-
});
|
|
485
|
+
const api = await this.getApi();
|
|
486
|
+
const id = await this.getBudgetId(budgetId);
|
|
487
|
+
const response = await api.categories.getCategories(id, lastKnowledgeOfServer);
|
|
488
|
+
return {
|
|
489
|
+
category_groups: response.data.category_groups,
|
|
490
|
+
server_knowledge: response.data.server_knowledge
|
|
491
|
+
};
|
|
513
492
|
}
|
|
514
493
|
async getCategory(categoryId, budgetId) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
return response.data.category;
|
|
520
|
-
});
|
|
494
|
+
const api = await this.getApi();
|
|
495
|
+
const id = await this.getBudgetId(budgetId);
|
|
496
|
+
const response = await api.categories.getCategoryById(id, categoryId);
|
|
497
|
+
return response.data.category;
|
|
521
498
|
}
|
|
522
499
|
async updateMonthCategory(month, categoryId, data, budgetId) {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
return response.data.category;
|
|
528
|
-
});
|
|
500
|
+
const api = await this.getApi();
|
|
501
|
+
const id = await this.getBudgetId(budgetId);
|
|
502
|
+
const response = await api.categories.updateMonthCategory(id, month, categoryId, data);
|
|
503
|
+
return response.data.category;
|
|
529
504
|
}
|
|
530
505
|
async updateCategory(categoryId, data, budgetId) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return response.data.category;
|
|
536
|
-
});
|
|
506
|
+
const api = await this.getApi();
|
|
507
|
+
const id = await this.getBudgetId(budgetId);
|
|
508
|
+
const response = await api.categories.updateCategory(id, categoryId, data);
|
|
509
|
+
return response.data.category;
|
|
537
510
|
}
|
|
538
511
|
async getPayees(budgetId, lastKnowledgeOfServer) {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
};
|
|
547
|
-
});
|
|
512
|
+
const api = await this.getApi();
|
|
513
|
+
const id = await this.getBudgetId(budgetId);
|
|
514
|
+
const response = await api.payees.getPayees(id, lastKnowledgeOfServer);
|
|
515
|
+
return {
|
|
516
|
+
payees: response.data.payees,
|
|
517
|
+
server_knowledge: response.data.server_knowledge
|
|
518
|
+
};
|
|
548
519
|
}
|
|
549
520
|
async getPayee(payeeId, budgetId) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return response.data.payee;
|
|
555
|
-
});
|
|
521
|
+
const api = await this.getApi();
|
|
522
|
+
const id = await this.getBudgetId(budgetId);
|
|
523
|
+
const response = await api.payees.getPayeeById(id, payeeId);
|
|
524
|
+
return response.data.payee;
|
|
556
525
|
}
|
|
557
526
|
async updatePayee(payeeId, data, budgetId) {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
return response.data.payee;
|
|
563
|
-
});
|
|
527
|
+
const api = await this.getApi();
|
|
528
|
+
const id = await this.getBudgetId(budgetId);
|
|
529
|
+
const response = await api.payees.updatePayee(id, payeeId, data);
|
|
530
|
+
return response.data.payee;
|
|
564
531
|
}
|
|
565
532
|
async getPayeeLocationsByPayee(payeeId, budgetId) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return response.data.payee_locations;
|
|
571
|
-
});
|
|
533
|
+
const api = await this.getApi();
|
|
534
|
+
const id = await this.getBudgetId(budgetId);
|
|
535
|
+
const response = await api.payeeLocations.getPayeeLocationsByPayee(id, payeeId);
|
|
536
|
+
return response.data.payee_locations;
|
|
572
537
|
}
|
|
573
538
|
async getBudgetMonths(budgetId, lastKnowledgeOfServer) {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
};
|
|
582
|
-
});
|
|
539
|
+
const api = await this.getApi();
|
|
540
|
+
const id = await this.getBudgetId(budgetId);
|
|
541
|
+
const response = await api.months.getBudgetMonths(id, lastKnowledgeOfServer);
|
|
542
|
+
return {
|
|
543
|
+
months: response.data.months,
|
|
544
|
+
server_knowledge: response.data.server_knowledge
|
|
545
|
+
};
|
|
583
546
|
}
|
|
584
547
|
async getBudgetMonth(month, budgetId) {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
return response.data.month;
|
|
590
|
-
});
|
|
548
|
+
const api = await this.getApi();
|
|
549
|
+
const id = await this.getBudgetId(budgetId);
|
|
550
|
+
const response = await api.months.getBudgetMonth(id, month);
|
|
551
|
+
return response.data.month;
|
|
591
552
|
}
|
|
592
553
|
async getTransactions(params) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
};
|
|
606
|
-
});
|
|
554
|
+
const api = await this.getApi();
|
|
555
|
+
const id = await this.getBudgetId(params.budgetId);
|
|
556
|
+
const response = await api.transactions.getTransactions(
|
|
557
|
+
id,
|
|
558
|
+
params.sinceDate,
|
|
559
|
+
params.type,
|
|
560
|
+
params.lastKnowledgeOfServer
|
|
561
|
+
);
|
|
562
|
+
return {
|
|
563
|
+
transactions: response.data.transactions,
|
|
564
|
+
server_knowledge: response.data.server_knowledge
|
|
565
|
+
};
|
|
607
566
|
}
|
|
608
567
|
async getTransactionsByAccount(accountId, params) {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
};
|
|
623
|
-
});
|
|
568
|
+
const api = await this.getApi();
|
|
569
|
+
const id = await this.getBudgetId(params.budgetId);
|
|
570
|
+
const response = await api.transactions.getTransactionsByAccount(
|
|
571
|
+
id,
|
|
572
|
+
accountId,
|
|
573
|
+
params.sinceDate,
|
|
574
|
+
params.type,
|
|
575
|
+
params.lastKnowledgeOfServer
|
|
576
|
+
);
|
|
577
|
+
return {
|
|
578
|
+
transactions: response.data.transactions,
|
|
579
|
+
server_knowledge: response.data.server_knowledge
|
|
580
|
+
};
|
|
624
581
|
}
|
|
625
582
|
async getTransactionsByCategory(categoryId, params) {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
};
|
|
640
|
-
});
|
|
583
|
+
const api = await this.getApi();
|
|
584
|
+
const id = await this.getBudgetId(params.budgetId);
|
|
585
|
+
const response = await api.transactions.getTransactionsByCategory(
|
|
586
|
+
id,
|
|
587
|
+
categoryId,
|
|
588
|
+
params.sinceDate,
|
|
589
|
+
params.type,
|
|
590
|
+
params.lastKnowledgeOfServer
|
|
591
|
+
);
|
|
592
|
+
return {
|
|
593
|
+
transactions: response.data.transactions,
|
|
594
|
+
server_knowledge: response.data.server_knowledge
|
|
595
|
+
};
|
|
641
596
|
}
|
|
642
597
|
async getTransactionsByPayee(payeeId, params) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
};
|
|
657
|
-
});
|
|
598
|
+
const api = await this.getApi();
|
|
599
|
+
const id = await this.getBudgetId(params.budgetId);
|
|
600
|
+
const response = await api.transactions.getTransactionsByPayee(
|
|
601
|
+
id,
|
|
602
|
+
payeeId,
|
|
603
|
+
params.sinceDate,
|
|
604
|
+
params.type,
|
|
605
|
+
params.lastKnowledgeOfServer
|
|
606
|
+
);
|
|
607
|
+
return {
|
|
608
|
+
transactions: response.data.transactions,
|
|
609
|
+
server_knowledge: response.data.server_knowledge
|
|
610
|
+
};
|
|
658
611
|
}
|
|
659
612
|
async getTransaction(transactionId, budgetId) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
return response.data.transaction;
|
|
665
|
-
});
|
|
613
|
+
const api = await this.getApi();
|
|
614
|
+
const id = await this.getBudgetId(budgetId);
|
|
615
|
+
const response = await api.transactions.getTransactionById(id, transactionId);
|
|
616
|
+
return response.data.transaction;
|
|
666
617
|
}
|
|
667
618
|
async createTransaction(transactionData, budgetId) {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
return response.data.transaction;
|
|
673
|
-
});
|
|
619
|
+
const api = await this.getApi();
|
|
620
|
+
const id = await this.getBudgetId(budgetId);
|
|
621
|
+
const response = await api.transactions.createTransaction(id, transactionData);
|
|
622
|
+
return response.data.transaction;
|
|
674
623
|
}
|
|
675
624
|
async updateTransaction(transactionId, transactionData, budgetId) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return response.data.transaction;
|
|
681
|
-
});
|
|
625
|
+
const api = await this.getApi();
|
|
626
|
+
const id = await this.getBudgetId(budgetId);
|
|
627
|
+
const response = await api.transactions.updateTransaction(id, transactionId, transactionData);
|
|
628
|
+
return response.data.transaction;
|
|
682
629
|
}
|
|
683
630
|
async updateTransactions(transactions, budgetId) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
};
|
|
693
|
-
});
|
|
631
|
+
const api = await this.getApi();
|
|
632
|
+
const id = await this.getBudgetId(budgetId);
|
|
633
|
+
const response = await api.transactions.updateTransactions(id, transactions);
|
|
634
|
+
return {
|
|
635
|
+
transactions: response.data.transactions,
|
|
636
|
+
transaction_ids: response.data.transaction_ids,
|
|
637
|
+
server_knowledge: response.data.server_knowledge
|
|
638
|
+
};
|
|
694
639
|
}
|
|
695
640
|
async deleteTransaction(transactionId, budgetId) {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
return response.data.transaction;
|
|
701
|
-
});
|
|
641
|
+
const api = await this.getApi();
|
|
642
|
+
const id = await this.getBudgetId(budgetId);
|
|
643
|
+
const response = await api.transactions.deleteTransaction(id, transactionId);
|
|
644
|
+
return response.data.transaction;
|
|
702
645
|
}
|
|
703
646
|
async importTransactions(budgetId) {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
return response.data.transaction_ids;
|
|
709
|
-
});
|
|
647
|
+
const api = await this.getApi();
|
|
648
|
+
const id = await this.getBudgetId(budgetId);
|
|
649
|
+
const response = await api.transactions.importTransactions(id);
|
|
650
|
+
return response.data.transaction_ids;
|
|
710
651
|
}
|
|
711
652
|
async getScheduledTransactions(budgetId, lastKnowledgeOfServer) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
};
|
|
723
|
-
});
|
|
653
|
+
const api = await this.getApi();
|
|
654
|
+
const id = await this.getBudgetId(budgetId);
|
|
655
|
+
const response = await api.scheduledTransactions.getScheduledTransactions(
|
|
656
|
+
id,
|
|
657
|
+
lastKnowledgeOfServer
|
|
658
|
+
);
|
|
659
|
+
return {
|
|
660
|
+
scheduled_transactions: response.data.scheduled_transactions,
|
|
661
|
+
server_knowledge: response.data.server_knowledge
|
|
662
|
+
};
|
|
724
663
|
}
|
|
725
664
|
async getScheduledTransaction(scheduledTransactionId, budgetId) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
return response.data.scheduled_transaction;
|
|
734
|
-
});
|
|
665
|
+
const api = await this.getApi();
|
|
666
|
+
const id = await this.getBudgetId(budgetId);
|
|
667
|
+
const response = await api.scheduledTransactions.getScheduledTransactionById(
|
|
668
|
+
id,
|
|
669
|
+
scheduledTransactionId
|
|
670
|
+
);
|
|
671
|
+
return response.data.scheduled_transaction;
|
|
735
672
|
}
|
|
736
673
|
async deleteScheduledTransaction(scheduledTransactionId, budgetId) {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
return response.data.scheduled_transaction;
|
|
745
|
-
});
|
|
674
|
+
const api = await this.getApi();
|
|
675
|
+
const id = await this.getBudgetId(budgetId);
|
|
676
|
+
const response = await api.scheduledTransactions.deleteScheduledTransaction(
|
|
677
|
+
id,
|
|
678
|
+
scheduledTransactionId
|
|
679
|
+
);
|
|
680
|
+
return response.data.scheduled_transaction;
|
|
746
681
|
}
|
|
747
682
|
async rawApiCall(method, path, data, budgetId) {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
...hasBody && { body: JSON.stringify(data) }
|
|
766
|
-
});
|
|
767
|
-
if (!response.ok) {
|
|
768
|
-
const errorData = await response.json();
|
|
769
|
-
throw { error: sanitizeApiError(errorData.error || errorData) };
|
|
770
|
-
}
|
|
771
|
-
return await response.json();
|
|
683
|
+
await this.getApi();
|
|
684
|
+
const fullPath = path.includes("{budget_id}") ? path.replace("{budget_id}", await this.getBudgetId(budgetId)) : path;
|
|
685
|
+
const url = `https://api.ynab.com/v1${fullPath}`;
|
|
686
|
+
const accessToken = await auth.getAccessToken() || process.env.YNAB_API_KEY;
|
|
687
|
+
const headers = {
|
|
688
|
+
Authorization: `Bearer ${accessToken}`,
|
|
689
|
+
"Content-Type": "application/json"
|
|
690
|
+
};
|
|
691
|
+
const httpMethod = method.toUpperCase();
|
|
692
|
+
const hasBody = ["POST", "PUT", "PATCH"].includes(httpMethod);
|
|
693
|
+
if (!["GET", "POST", "PUT", "PATCH", "DELETE"].includes(httpMethod)) {
|
|
694
|
+
throw new YnabCliError(`Unsupported HTTP method: ${method}`, 400);
|
|
695
|
+
}
|
|
696
|
+
const response = await fetch(url, {
|
|
697
|
+
method: httpMethod,
|
|
698
|
+
headers,
|
|
699
|
+
...hasBody && { body: JSON.stringify(data) }
|
|
772
700
|
});
|
|
701
|
+
if (!response.ok) {
|
|
702
|
+
const errorData = await response.json();
|
|
703
|
+
throw { error: sanitizeApiError(errorData.error || errorData) };
|
|
704
|
+
}
|
|
705
|
+
return await response.json();
|
|
773
706
|
}
|
|
774
707
|
};
|
|
775
708
|
var client = new YnabClient();
|
|
@@ -1635,6 +1568,37 @@ var server = new McpServer({
|
|
|
1635
1568
|
name: "ynab",
|
|
1636
1569
|
version: "1.0.0"
|
|
1637
1570
|
});
|
|
1571
|
+
function mcpErrorResult(error) {
|
|
1572
|
+
let errorBody;
|
|
1573
|
+
if (typeof error === "object" && error !== null && "error" in error) {
|
|
1574
|
+
const apiError = sanitizeApiError(error.error);
|
|
1575
|
+
errorBody = { name: apiError.name, detail: apiError.detail };
|
|
1576
|
+
} else if (error instanceof YnabCliError) {
|
|
1577
|
+
errorBody = { name: "cli_error", detail: sanitizeErrorMessage(error.message) };
|
|
1578
|
+
} else if (error instanceof Error) {
|
|
1579
|
+
errorBody = { name: error.name, detail: sanitizeErrorMessage(error.message) };
|
|
1580
|
+
} else {
|
|
1581
|
+
errorBody = { name: "unknown_error", detail: "An unexpected error occurred" };
|
|
1582
|
+
}
|
|
1583
|
+
return {
|
|
1584
|
+
content: [{ type: "text", text: JSON.stringify({ error: errorBody }) }],
|
|
1585
|
+
isError: true
|
|
1586
|
+
};
|
|
1587
|
+
}
|
|
1588
|
+
var _serverTool = server.tool.bind(server);
|
|
1589
|
+
server.tool = (...args) => {
|
|
1590
|
+
const handler = args[args.length - 1];
|
|
1591
|
+
if (typeof handler === "function") {
|
|
1592
|
+
args[args.length - 1] = async (...handlerArgs) => {
|
|
1593
|
+
try {
|
|
1594
|
+
return await handler(...handlerArgs);
|
|
1595
|
+
} catch (error) {
|
|
1596
|
+
return mcpErrorResult(error);
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
}
|
|
1600
|
+
return _serverTool.apply(null, args);
|
|
1601
|
+
};
|
|
1638
1602
|
function jsonResponse(data) {
|
|
1639
1603
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1640
1604
|
}
|
|
@@ -2080,7 +2044,7 @@ function createMcpCommand() {
|
|
|
2080
2044
|
|
|
2081
2045
|
// src/cli.ts
|
|
2082
2046
|
var program = new Command12();
|
|
2083
|
-
program.name("ynab").description("A command-line interface for You Need a Budget (YNAB)").version("2.8.
|
|
2047
|
+
program.name("ynab").description("A command-line interface for You Need a Budget (YNAB)").version("2.8.1").option("-c, --compact", "Minified JSON output (single line)").hook("preAction", (thisCommand) => {
|
|
2084
2048
|
const options = thisCommand.opts();
|
|
2085
2049
|
setOutputOptions({
|
|
2086
2050
|
compact: options.compact
|