@agentforge/tools 0.6.4 → 0.7.0

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/index.d.cts CHANGED
@@ -162,16 +162,14 @@ declare const extractImages: _agentforge_core.Tool<{
162
162
  * URL validation result
163
163
  */
164
164
  interface UrlValidationResult {
165
- valid: boolean;
166
- url?: string;
167
- protocol?: string;
168
- hostname?: string;
169
- port?: string;
170
- pathname?: string;
171
- search?: string;
172
- hash?: string;
173
- origin?: string;
174
- error?: string;
165
+ url: string;
166
+ protocol: string;
167
+ hostname: string;
168
+ port: string;
169
+ pathname: string;
170
+ search: string;
171
+ hash: string;
172
+ origin: string;
175
173
  }
176
174
  /**
177
175
  * URL validator tool
@@ -185,7 +183,11 @@ interface UrlValidationResult {
185
183
  */
186
184
  declare const urlValidator: _agentforge_core.Tool<{
187
185
  url: string;
188
- }, UrlValidationResult>;
186
+ }, {
187
+ success: boolean;
188
+ data?: UrlValidationResult | undefined;
189
+ error?: string;
190
+ }>;
189
191
  /**
190
192
  * URL builder tool
191
193
  */
@@ -359,8 +361,8 @@ declare const webSearchOutputSchema: z.ZodObject<{
359
361
  query: string;
360
362
  success: boolean;
361
363
  source: "duckduckgo" | "serper";
362
- error?: string | undefined;
363
364
  totalResults?: number | undefined;
365
+ error?: string | undefined;
364
366
  metadata?: {
365
367
  responseTime?: number | undefined;
366
368
  fallbackUsed?: boolean | undefined;
@@ -375,8 +377,8 @@ declare const webSearchOutputSchema: z.ZodObject<{
375
377
  query: string;
376
378
  success: boolean;
377
379
  source: "duckduckgo" | "serper";
378
- error?: string | undefined;
379
380
  totalResults?: number | undefined;
381
+ error?: string | undefined;
380
382
  metadata?: {
381
383
  responseTime?: number | undefined;
382
384
  fallbackUsed?: boolean | undefined;
@@ -477,14 +479,11 @@ declare const jsonParser: _agentforge_core.Tool<{
477
479
  strict?: boolean | undefined;
478
480
  }, {
479
481
  success: boolean;
480
- data: any;
481
- type: string;
482
- error?: undefined;
483
- } | {
484
- success: boolean;
485
- error: string;
486
- data?: undefined;
487
- type?: undefined;
482
+ data?: {
483
+ data: any;
484
+ type: string;
485
+ } | undefined;
486
+ error?: string;
488
487
  }>;
489
488
  /**
490
489
  * JSON stringifier tool
@@ -495,14 +494,11 @@ declare const jsonStringify: _agentforge_core.Tool<{
495
494
  indent?: number | undefined;
496
495
  }, {
497
496
  success: boolean;
498
- json: string;
499
- length: number;
500
- error?: undefined;
501
- } | {
502
- success: boolean;
503
- error: string;
504
- json?: undefined;
505
- length?: undefined;
497
+ data?: {
498
+ json: string;
499
+ length: number;
500
+ } | undefined;
501
+ error?: string;
506
502
  }>;
507
503
  /**
508
504
  * JSON query tool (using JSONPath-like syntax)
@@ -512,14 +508,11 @@ declare const jsonQuery: _agentforge_core.Tool<{
512
508
  data?: any;
513
509
  }, {
514
510
  success: boolean;
515
- error: string;
516
- value?: undefined;
517
- type?: undefined;
518
- } | {
519
- success: boolean;
520
- value: any;
521
- type: string;
522
- error?: undefined;
511
+ data?: {
512
+ value: any;
513
+ type: string;
514
+ } | undefined;
515
+ error?: string;
523
516
  }>;
524
517
  /**
525
518
  * JSON validator tool
@@ -527,13 +520,12 @@ declare const jsonQuery: _agentforge_core.Tool<{
527
520
  declare const jsonValidator: _agentforge_core.Tool<{
528
521
  json: string;
529
522
  }, {
530
- valid: boolean;
531
- message: string;
532
- error?: undefined;
533
- } | {
534
- valid: boolean;
535
- error: string;
536
- message?: undefined;
523
+ success: boolean;
524
+ data?: {
525
+ valid: boolean;
526
+ message: string;
527
+ } | undefined;
528
+ error?: string;
537
529
  }>;
538
530
  /**
539
531
  * JSON merge tool
@@ -775,18 +767,13 @@ declare const fileReader: _agentforge_core.Tool<{
775
767
  encoding?: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
776
768
  }, {
777
769
  success: boolean;
778
- content: string;
779
- size: number;
780
- path: string;
781
- encoding: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
782
- error?: undefined;
783
- } | {
784
- success: boolean;
785
- error: string;
786
- path: string;
787
- content?: undefined;
788
- size?: undefined;
789
- encoding?: undefined;
770
+ data?: {
771
+ content: string;
772
+ size: number;
773
+ path: string;
774
+ encoding: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
775
+ } | undefined;
776
+ error?: string;
790
777
  }>;
791
778
  /**
792
779
  * File writer tool
@@ -798,16 +785,12 @@ declare const fileWriter: _agentforge_core.Tool<{
798
785
  createDirs?: boolean | undefined;
799
786
  }, {
800
787
  success: boolean;
801
- path: string;
802
- size: number;
803
- encoding: "ascii" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
804
- error?: undefined;
805
- } | {
806
- success: boolean;
807
- error: string;
808
- path: string;
809
- size?: undefined;
810
- encoding?: undefined;
788
+ data?: {
789
+ path: string;
790
+ size: number;
791
+ encoding: "ascii" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
792
+ } | undefined;
793
+ error?: string;
811
794
  }>;
812
795
  /**
813
796
  * File append tool
@@ -818,14 +801,11 @@ declare const fileAppend: _agentforge_core.Tool<{
818
801
  encoding?: "ascii" | "utf-8" | "utf8" | undefined;
819
802
  }, {
820
803
  success: boolean;
821
- path: string;
822
- size: number;
823
- error?: undefined;
824
- } | {
825
- success: boolean;
826
- error: string;
827
- path: string;
828
- size?: undefined;
804
+ data?: {
805
+ path: string;
806
+ size: number;
807
+ } | undefined;
808
+ error?: string;
829
809
  }>;
830
810
  /**
831
811
  * File delete tool
@@ -834,14 +814,11 @@ declare const fileDelete: _agentforge_core.Tool<{
834
814
  path: string;
835
815
  }, {
836
816
  success: boolean;
837
- path: string;
838
- message: string;
839
- error?: undefined;
840
- } | {
841
- success: boolean;
842
- error: string;
843
- path: string;
844
- message?: undefined;
817
+ data?: {
818
+ path: string;
819
+ message: string;
820
+ } | undefined;
821
+ error?: string;
845
822
  }>;
846
823
  /**
847
824
  * File exists tool
@@ -879,16 +856,12 @@ declare const directoryList: _agentforge_core.Tool<{
879
856
  extension?: string | undefined;
880
857
  }, {
881
858
  success: boolean;
882
- path: string;
883
- files: any[];
884
- count: number;
885
- error?: undefined;
886
- } | {
887
- success: boolean;
888
- error: string;
889
- path: string;
890
- files?: undefined;
891
- count?: undefined;
859
+ data?: {
860
+ path: string;
861
+ files: any[];
862
+ count: number;
863
+ } | undefined;
864
+ error?: string;
892
865
  }>;
893
866
  /**
894
867
  * Directory create tool
@@ -898,14 +871,11 @@ declare const directoryCreate: _agentforge_core.Tool<{
898
871
  recursive?: boolean | undefined;
899
872
  }, {
900
873
  success: boolean;
901
- path: string;
902
- message: string;
903
- error?: undefined;
904
- } | {
905
- success: boolean;
906
- error: string;
907
- path: string;
908
- message?: undefined;
874
+ data?: {
875
+ path: string;
876
+ message: string;
877
+ } | undefined;
878
+ error?: string;
909
879
  }>;
910
880
  /**
911
881
  * Directory delete tool
@@ -915,14 +885,11 @@ declare const directoryDelete: _agentforge_core.Tool<{
915
885
  recursive?: boolean | undefined;
916
886
  }, {
917
887
  success: boolean;
918
- path: string;
919
- message: string;
920
- error?: undefined;
921
- } | {
922
- success: boolean;
923
- error: string;
924
- path: string;
925
- message?: undefined;
888
+ data?: {
889
+ path: string;
890
+ message: string;
891
+ } | undefined;
892
+ error?: string;
926
893
  }>;
927
894
  /**
928
895
  * File search tool
@@ -934,18 +901,13 @@ declare const fileSearch: _agentforge_core.Tool<{
934
901
  caseSensitive?: boolean | undefined;
935
902
  }, {
936
903
  success: boolean;
937
- directory: string;
938
- pattern: string;
939
- matches: string[];
940
- count: number;
941
- error?: undefined;
942
- } | {
943
- success: boolean;
944
- error: string;
945
- directory: string;
946
- pattern?: undefined;
947
- matches?: undefined;
948
- count?: undefined;
904
+ data?: {
905
+ directory: string;
906
+ pattern: string;
907
+ matches: string[];
908
+ count: number;
909
+ } | undefined;
910
+ error?: string;
949
911
  }>;
950
912
 
951
913
  /**
package/dist/index.d.ts CHANGED
@@ -162,16 +162,14 @@ declare const extractImages: _agentforge_core.Tool<{
162
162
  * URL validation result
163
163
  */
164
164
  interface UrlValidationResult {
165
- valid: boolean;
166
- url?: string;
167
- protocol?: string;
168
- hostname?: string;
169
- port?: string;
170
- pathname?: string;
171
- search?: string;
172
- hash?: string;
173
- origin?: string;
174
- error?: string;
165
+ url: string;
166
+ protocol: string;
167
+ hostname: string;
168
+ port: string;
169
+ pathname: string;
170
+ search: string;
171
+ hash: string;
172
+ origin: string;
175
173
  }
176
174
  /**
177
175
  * URL validator tool
@@ -185,7 +183,11 @@ interface UrlValidationResult {
185
183
  */
186
184
  declare const urlValidator: _agentforge_core.Tool<{
187
185
  url: string;
188
- }, UrlValidationResult>;
186
+ }, {
187
+ success: boolean;
188
+ data?: UrlValidationResult | undefined;
189
+ error?: string;
190
+ }>;
189
191
  /**
190
192
  * URL builder tool
191
193
  */
@@ -359,8 +361,8 @@ declare const webSearchOutputSchema: z.ZodObject<{
359
361
  query: string;
360
362
  success: boolean;
361
363
  source: "duckduckgo" | "serper";
362
- error?: string | undefined;
363
364
  totalResults?: number | undefined;
365
+ error?: string | undefined;
364
366
  metadata?: {
365
367
  responseTime?: number | undefined;
366
368
  fallbackUsed?: boolean | undefined;
@@ -375,8 +377,8 @@ declare const webSearchOutputSchema: z.ZodObject<{
375
377
  query: string;
376
378
  success: boolean;
377
379
  source: "duckduckgo" | "serper";
378
- error?: string | undefined;
379
380
  totalResults?: number | undefined;
381
+ error?: string | undefined;
380
382
  metadata?: {
381
383
  responseTime?: number | undefined;
382
384
  fallbackUsed?: boolean | undefined;
@@ -477,14 +479,11 @@ declare const jsonParser: _agentforge_core.Tool<{
477
479
  strict?: boolean | undefined;
478
480
  }, {
479
481
  success: boolean;
480
- data: any;
481
- type: string;
482
- error?: undefined;
483
- } | {
484
- success: boolean;
485
- error: string;
486
- data?: undefined;
487
- type?: undefined;
482
+ data?: {
483
+ data: any;
484
+ type: string;
485
+ } | undefined;
486
+ error?: string;
488
487
  }>;
489
488
  /**
490
489
  * JSON stringifier tool
@@ -495,14 +494,11 @@ declare const jsonStringify: _agentforge_core.Tool<{
495
494
  indent?: number | undefined;
496
495
  }, {
497
496
  success: boolean;
498
- json: string;
499
- length: number;
500
- error?: undefined;
501
- } | {
502
- success: boolean;
503
- error: string;
504
- json?: undefined;
505
- length?: undefined;
497
+ data?: {
498
+ json: string;
499
+ length: number;
500
+ } | undefined;
501
+ error?: string;
506
502
  }>;
507
503
  /**
508
504
  * JSON query tool (using JSONPath-like syntax)
@@ -512,14 +508,11 @@ declare const jsonQuery: _agentforge_core.Tool<{
512
508
  data?: any;
513
509
  }, {
514
510
  success: boolean;
515
- error: string;
516
- value?: undefined;
517
- type?: undefined;
518
- } | {
519
- success: boolean;
520
- value: any;
521
- type: string;
522
- error?: undefined;
511
+ data?: {
512
+ value: any;
513
+ type: string;
514
+ } | undefined;
515
+ error?: string;
523
516
  }>;
524
517
  /**
525
518
  * JSON validator tool
@@ -527,13 +520,12 @@ declare const jsonQuery: _agentforge_core.Tool<{
527
520
  declare const jsonValidator: _agentforge_core.Tool<{
528
521
  json: string;
529
522
  }, {
530
- valid: boolean;
531
- message: string;
532
- error?: undefined;
533
- } | {
534
- valid: boolean;
535
- error: string;
536
- message?: undefined;
523
+ success: boolean;
524
+ data?: {
525
+ valid: boolean;
526
+ message: string;
527
+ } | undefined;
528
+ error?: string;
537
529
  }>;
538
530
  /**
539
531
  * JSON merge tool
@@ -775,18 +767,13 @@ declare const fileReader: _agentforge_core.Tool<{
775
767
  encoding?: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
776
768
  }, {
777
769
  success: boolean;
778
- content: string;
779
- size: number;
780
- path: string;
781
- encoding: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
782
- error?: undefined;
783
- } | {
784
- success: boolean;
785
- error: string;
786
- path: string;
787
- content?: undefined;
788
- size?: undefined;
789
- encoding?: undefined;
770
+ data?: {
771
+ content: string;
772
+ size: number;
773
+ path: string;
774
+ encoding: "ascii" | "binary" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
775
+ } | undefined;
776
+ error?: string;
790
777
  }>;
791
778
  /**
792
779
  * File writer tool
@@ -798,16 +785,12 @@ declare const fileWriter: _agentforge_core.Tool<{
798
785
  createDirs?: boolean | undefined;
799
786
  }, {
800
787
  success: boolean;
801
- path: string;
802
- size: number;
803
- encoding: "ascii" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
804
- error?: undefined;
805
- } | {
806
- success: boolean;
807
- error: string;
808
- path: string;
809
- size?: undefined;
810
- encoding?: undefined;
788
+ data?: {
789
+ path: string;
790
+ size: number;
791
+ encoding: "ascii" | "base64" | "hex" | "utf-8" | "utf8" | undefined;
792
+ } | undefined;
793
+ error?: string;
811
794
  }>;
812
795
  /**
813
796
  * File append tool
@@ -818,14 +801,11 @@ declare const fileAppend: _agentforge_core.Tool<{
818
801
  encoding?: "ascii" | "utf-8" | "utf8" | undefined;
819
802
  }, {
820
803
  success: boolean;
821
- path: string;
822
- size: number;
823
- error?: undefined;
824
- } | {
825
- success: boolean;
826
- error: string;
827
- path: string;
828
- size?: undefined;
804
+ data?: {
805
+ path: string;
806
+ size: number;
807
+ } | undefined;
808
+ error?: string;
829
809
  }>;
830
810
  /**
831
811
  * File delete tool
@@ -834,14 +814,11 @@ declare const fileDelete: _agentforge_core.Tool<{
834
814
  path: string;
835
815
  }, {
836
816
  success: boolean;
837
- path: string;
838
- message: string;
839
- error?: undefined;
840
- } | {
841
- success: boolean;
842
- error: string;
843
- path: string;
844
- message?: undefined;
817
+ data?: {
818
+ path: string;
819
+ message: string;
820
+ } | undefined;
821
+ error?: string;
845
822
  }>;
846
823
  /**
847
824
  * File exists tool
@@ -879,16 +856,12 @@ declare const directoryList: _agentforge_core.Tool<{
879
856
  extension?: string | undefined;
880
857
  }, {
881
858
  success: boolean;
882
- path: string;
883
- files: any[];
884
- count: number;
885
- error?: undefined;
886
- } | {
887
- success: boolean;
888
- error: string;
889
- path: string;
890
- files?: undefined;
891
- count?: undefined;
859
+ data?: {
860
+ path: string;
861
+ files: any[];
862
+ count: number;
863
+ } | undefined;
864
+ error?: string;
892
865
  }>;
893
866
  /**
894
867
  * Directory create tool
@@ -898,14 +871,11 @@ declare const directoryCreate: _agentforge_core.Tool<{
898
871
  recursive?: boolean | undefined;
899
872
  }, {
900
873
  success: boolean;
901
- path: string;
902
- message: string;
903
- error?: undefined;
904
- } | {
905
- success: boolean;
906
- error: string;
907
- path: string;
908
- message?: undefined;
874
+ data?: {
875
+ path: string;
876
+ message: string;
877
+ } | undefined;
878
+ error?: string;
909
879
  }>;
910
880
  /**
911
881
  * Directory delete tool
@@ -915,14 +885,11 @@ declare const directoryDelete: _agentforge_core.Tool<{
915
885
  recursive?: boolean | undefined;
916
886
  }, {
917
887
  success: boolean;
918
- path: string;
919
- message: string;
920
- error?: undefined;
921
- } | {
922
- success: boolean;
923
- error: string;
924
- path: string;
925
- message?: undefined;
888
+ data?: {
889
+ path: string;
890
+ message: string;
891
+ } | undefined;
892
+ error?: string;
926
893
  }>;
927
894
  /**
928
895
  * File search tool
@@ -934,18 +901,13 @@ declare const fileSearch: _agentforge_core.Tool<{
934
901
  caseSensitive?: boolean | undefined;
935
902
  }, {
936
903
  success: boolean;
937
- directory: string;
938
- pattern: string;
939
- matches: string[];
940
- count: number;
941
- error?: undefined;
942
- } | {
943
- success: boolean;
944
- error: string;
945
- directory: string;
946
- pattern?: undefined;
947
- matches?: undefined;
948
- count?: undefined;
904
+ data?: {
905
+ directory: string;
906
+ pattern: string;
907
+ matches: string[];
908
+ count: number;
909
+ } | undefined;
910
+ error?: string;
949
911
  }>;
950
912
 
951
913
  /**