Commit 6091646
committed
feat: Enhance tools with improved context handling and logging
- Added a new `gitToolContextSchema` to define optional properties for Git tools, including `defaultBranch`, `allowForce`, `allowAmend`, `maxCommits`, and `timeout`.
- Updated the `cwd` assignment in multiple Git tools to use nullish coalescing (`??`) for better handling of undefined values.
- Improved timeout handling in the `gitBranchTool` to use a default value if not provided.
- Refactored the `jsonToCsvTool` to introduce a new `JsonToCsvRequestContext` interface, allowing for better context management.
- Removed redundant logging hooks in `jsonToCsvTool` and restructured the execution method for clarity.
- Updated the `randomGeneratorTool` to use a more structured `RandomToolContext` interface, enhancing type safety and clarity.
- Added detailed logging hooks for input and output events in `randomGeneratorTool`.
- Introduced a new `ScraperToolContext` interface in `web-scraper-tool.ts` to manage context more effectively, including properties like `allowedDomains`, `userAgent`, and `timeout`.
- Enhanced logging for various scraping tools, including detailed input and output logging for better traceability.
- Added logging hooks for input and output events across multiple tools, including `htmlToMarkdownTool`, `linkExtractorTool`, and `dataExporterTool`, to improve monitoring and debugging capabilities.1 parent 48b5949 commit 6091646
17 files changed
Lines changed: 2124 additions & 1071 deletions
File tree
- src/mastra/tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| |||
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| 95 | + | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| |||
103 | 113 | | |
104 | 114 | | |
105 | 115 | | |
106 | | - | |
| 116 | + | |
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
| |||
313 | 323 | | |
314 | 324 | | |
315 | 325 | | |
316 | | - | |
| 326 | + | |
317 | 327 | | |
318 | 328 | | |
319 | 329 | | |
| |||
412 | 422 | | |
413 | 423 | | |
414 | 424 | | |
| 425 | + | |
415 | 426 | | |
416 | 427 | | |
417 | 428 | | |
| |||
431 | 442 | | |
432 | 443 | | |
433 | 444 | | |
434 | | - | |
| 445 | + | |
435 | 446 | | |
436 | 447 | | |
437 | 448 | | |
| |||
674 | 685 | | |
675 | 686 | | |
676 | 687 | | |
677 | | - | |
| 688 | + | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
| |||
804 | 815 | | |
805 | 816 | | |
806 | 817 | | |
| 818 | + | |
807 | 819 | | |
808 | 820 | | |
809 | 821 | | |
| |||
823 | 835 | | |
824 | 836 | | |
825 | 837 | | |
826 | | - | |
| 838 | + | |
827 | 839 | | |
828 | 840 | | |
829 | 841 | | |
| |||
0 commit comments