1414// approvalDate: 9/22
1515
1616import { AISpanType , InternalSpans } from '@mastra/core/ai-tracing'
17- import { createTool } from ' @mastra/core/tools'
17+ import { InferUITool , createTool } from " @mastra/core/tools" ;
1818import * as fs from 'fs/promises'
1919import * as path from 'path'
2020import { pipeline } from 'stream/promises'
@@ -91,6 +91,8 @@ export const readDataFileTool = createTool({
9191 } ,
9292} )
9393
94+ export type ReadDataFileUITool = InferUITool < typeof readDataFileTool > ;
95+
9496export const writeDataFileTool = createTool ( {
9597 id : 'write-data-file' ,
9698 description :
@@ -150,6 +152,8 @@ export const writeDataFileTool = createTool({
150152 } ,
151153} )
152154
155+ export type WriteDataFileUITool = InferUITool < typeof writeDataFileTool > ;
156+
153157export const deleteDataFileTool = createTool ( {
154158 id : 'delete-data-file' ,
155159 description : 'Deletes a file within the data directory.' ,
@@ -195,6 +199,8 @@ export const deleteDataFileTool = createTool({
195199 } ,
196200} )
197201
202+ export type DeleteDataFileUITool = InferUITool < typeof deleteDataFileTool > ;
203+
198204export const listDataDirTool = createTool ( {
199205 id : 'list-data-directory' ,
200206 description :
@@ -241,6 +247,9 @@ export const listDataDirTool = createTool({
241247 }
242248 } ,
243249} )
250+
251+ export type ListDataDirUITool = InferUITool < typeof listDataDirTool > ;
252+
244253export const copyDataFileTool = createTool ( {
245254 id : 'copy-data-file' ,
246255 description : 'Copies a file within the data directory to a new location.' ,
@@ -300,6 +309,8 @@ export const copyDataFileTool = createTool({
300309 } ,
301310} )
302311
312+ export type CopyDataFileUITool = InferUITool < typeof copyDataFileTool > ;
313+
303314export const moveDataFileTool = createTool ( {
304315 id : 'move-data-file' ,
305316 description : 'Moves or renames a file within the data directory.' ,
@@ -359,6 +370,8 @@ export const moveDataFileTool = createTool({
359370 } ,
360371} )
361372
373+ export type MoveDataFileUITool = InferUITool < typeof moveDataFileTool > ;
374+
362375export const searchDataFilesTool = createTool ( {
363376 id : 'search-data-files' ,
364377 description :
@@ -463,6 +476,8 @@ export const searchDataFilesTool = createTool({
463476 } ,
464477} )
465478
479+ export type SearchDataFilesUITool = InferUITool < typeof searchDataFilesTool > ;
480+
466481export const getDataFileInfoTool = createTool ( {
467482 id : 'get-data-file-info' ,
468483 description :
@@ -525,6 +540,7 @@ export const getDataFileInfoTool = createTool({
525540 } ,
526541} )
527542
543+ export type GetDataFileInfoUITool = InferUITool < typeof getDataFileInfoTool > ;
528544export const createDataDirTool = createTool ( {
529545 id : 'create-data-directory' ,
530546 description : 'Creates a new directory within the data directory.' ,
@@ -568,6 +584,8 @@ export const createDataDirTool = createTool({
568584 } ,
569585} )
570586
587+ export type CreateDataDirUITool = InferUITool < typeof createDataDirTool > ;
588+
571589export const removeDataDirTool = createTool ( {
572590 id : 'remove-data-directory' ,
573591 description : 'Removes an empty directory within the data directory.' ,
@@ -617,6 +635,8 @@ export const removeDataDirTool = createTool({
617635 } ,
618636} )
619637
638+ export type RemoveDataDirUITool = InferUITool < typeof removeDataDirTool > ;
639+
620640export const archiveDataTool = createTool ( {
621641 id : 'archive-data' ,
622642 description :
@@ -682,6 +702,8 @@ export const archiveDataTool = createTool({
682702 } ,
683703} )
684704
705+ export type ArchiveDataUITool = InferUITool < typeof archiveDataTool > ;
706+
685707export const backupDataTool = createTool ( {
686708 id : 'backup-data' ,
687709 description :
@@ -749,3 +771,5 @@ export const backupDataTool = createTool({
749771 }
750772 } ,
751773} )
774+
775+ export type BackupDataUITool = InferUITool < typeof backupDataTool > ;
0 commit comments