@credal/actions 0.2.127 → 0.2.128

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.
@@ -299,24 +299,28 @@ export const slackUserSearchSlackOutputSchema = z.object({
299
299
  query: z.string().describe("The exact query string sent to Slack’s search API after resolving inputs."),
300
300
  results: z
301
301
  .array(z.object({
302
- channelId: z.string().describe("Slack channel/conversation ID (C…/G…/D… or name)."),
303
- ts: z.string().describe("Slack message timestamp of the hit (or thread root when hydrated as thread)."),
304
- text: z.string().describe("Message text of the anchor (hit or thread root).").optional(),
305
- userEmail: z.string().describe("User email of the anchor message’s author (if available).").optional(),
306
- userName: z.string().describe("User name of the anchor message’s author (if available).").optional(),
307
- permalink: z
308
- .string()
309
- .describe("A Slack permalink to the anchor (message or thread root), if resolvable.")
310
- .optional(),
311
- context: z
312
- .array(z.object({
313
- ts: z.string().describe("Timestamp of the contextual message."),
314
- text: z.string().describe("Text of the contextual message.").optional(),
315
- userEmail: z.string().describe("Author user email of the contextual message.").optional(),
316
- userName: z.string().describe("Author user name of the contextual message.").optional(),
317
- }))
318
- .describe("When a hit is in a thread, this is the full thread (root first). Otherwise, a small surrounding context window (~3 before, 5 after).")
319
- .optional(),
302
+ name: z.string().describe("The name of the result"),
303
+ url: z.string().describe("The URL of the result"),
304
+ contents: z.object({
305
+ channelId: z.string().describe("Slack channel/conversation ID (C…/G…/D… or name)."),
306
+ ts: z.string().describe("Slack message timestamp of the hit (or thread root when hydrated as thread)."),
307
+ text: z.string().describe("Message text of the anchor (hit or thread root).").optional(),
308
+ userEmail: z.string().describe("User email of the anchor message’s author (if available).").optional(),
309
+ userName: z.string().describe("User name of the anchor message’s author (if available).").optional(),
310
+ permalink: z
311
+ .string()
312
+ .describe("A Slack permalink to the anchor (message or thread root), if resolvable.")
313
+ .optional(),
314
+ context: z
315
+ .array(z.object({
316
+ ts: z.string().describe("Timestamp of the contextual message."),
317
+ text: z.string().describe("Text of the contextual message.").optional(),
318
+ userEmail: z.string().describe("Author user email of the contextual message.").optional(),
319
+ userName: z.string().describe("Author user name of the contextual message.").optional(),
320
+ }))
321
+ .describe("When a hit is in a thread, this is the full thread (root first). Otherwise, a small surrounding context window (~3 before, 5 after).")
322
+ .optional(),
323
+ }),
320
324
  }))
321
325
  .describe("Hydrated search results (threads or small context windows), sorted by ts desc."),
322
326
  });
@@ -452,7 +456,14 @@ export const jiraGetJiraTicketDetailsParamsSchema = z.object({
452
456
  export const jiraGetJiraTicketDetailsOutputSchema = z.object({
453
457
  success: z.boolean().describe("Whether the status was updated successfully"),
454
458
  error: z.string().describe("The error that occurred if the retrieval was unsuccessful").optional(),
455
- data: z.object({}).catchall(z.any()).describe("The data of the Jira ticket").optional(),
459
+ results: z
460
+ .array(z.object({
461
+ name: z.string().describe("The name of the result"),
462
+ url: z.string().describe("The URL of the result"),
463
+ contents: z.object({}).catchall(z.any()).describe("The data of the Jira ticket"),
464
+ }))
465
+ .describe("The results of the Jira ticket")
466
+ .optional(),
456
467
  });
457
468
  export const jiraGetJiraTicketHistoryParamsSchema = z.object({
458
469
  projectKey: z.string().describe("The key for the project"),
@@ -495,10 +506,12 @@ export const jiraGetJiraIssuesByQueryParamsSchema = z.object({
495
506
  });
496
507
  export const jiraGetJiraIssuesByQueryOutputSchema = z.object({
497
508
  success: z.boolean().describe("Whether the records were successfully retrieved"),
498
- records: z
499
- .object({
500
- issues: z
501
- .array(z.object({
509
+ results: z
510
+ .array(z.object({
511
+ name: z.string().describe("The name of the result"),
512
+ url: z.string().describe("The URL of the result"),
513
+ contents: z
514
+ .object({
502
515
  id: z.string().describe("Internal Jira issue ID"),
503
516
  key: z.string().describe("Human-readable issue key (e.g. SSPR-123)"),
504
517
  summary: z.string().describe("Summary of the issue"),
@@ -518,11 +531,10 @@ export const jiraGetJiraIssuesByQueryOutputSchema = z.object({
518
531
  updated: z.string().datetime({ offset: true }),
519
532
  resolution: z.string().nullable().optional(),
520
533
  dueDate: z.string().date().nullable().optional(),
521
- }))
522
- .describe("The retrieved Jira issues")
523
- .optional(),
524
- })
525
- .describe("The result object containing issues")
534
+ })
535
+ .describe("The result object containing issues"),
536
+ }))
537
+ .describe("The results of the Jira issues")
526
538
  .optional(),
527
539
  error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
528
540
  });
@@ -630,7 +642,14 @@ export const jiraOrgGetJiraTicketDetailsParamsSchema = z.object({
630
642
  export const jiraOrgGetJiraTicketDetailsOutputSchema = z.object({
631
643
  success: z.boolean().describe("Whether the status was updated successfully"),
632
644
  error: z.string().describe("The error that occurred if the retrieval was unsuccessful").optional(),
633
- data: z.object({}).catchall(z.any()).describe("The data of the Jira ticket").optional(),
645
+ results: z
646
+ .array(z.object({
647
+ name: z.string().describe("The name of the result"),
648
+ url: z.string().describe("The URL of the result"),
649
+ contents: z.object({}).catchall(z.any()).describe("The data of the Jira ticket"),
650
+ }))
651
+ .describe("The results of the Jira ticket")
652
+ .optional(),
634
653
  });
635
654
  export const jiraOrgGetJiraTicketHistoryParamsSchema = z.object({
636
655
  projectKey: z.string().describe("The key for the project"),
@@ -673,10 +692,12 @@ export const jiraOrgGetJiraIssuesByQueryParamsSchema = z.object({
673
692
  });
674
693
  export const jiraOrgGetJiraIssuesByQueryOutputSchema = z.object({
675
694
  success: z.boolean().describe("Whether the records were successfully retrieved"),
676
- records: z
677
- .object({
678
- issues: z
679
- .array(z.object({
695
+ results: z
696
+ .array(z.object({
697
+ name: z.string().describe("The name of the result"),
698
+ url: z.string().describe("The URL of the result"),
699
+ contents: z
700
+ .object({
680
701
  id: z.string().describe("Internal Jira issue ID"),
681
702
  key: z.string().describe("Human-readable issue key (e.g. SSPR-123)"),
682
703
  summary: z.string().describe("Summary of the issue"),
@@ -696,11 +717,10 @@ export const jiraOrgGetJiraIssuesByQueryOutputSchema = z.object({
696
717
  updated: z.string().datetime({ offset: true }),
697
718
  resolution: z.string().nullable().optional(),
698
719
  dueDate: z.string().date().nullable().optional(),
699
- }))
700
- .describe("The retrieved Jira issues")
701
- .optional(),
702
- })
703
- .describe("The result object containing issues")
720
+ })
721
+ .describe("The result object containing issues"),
722
+ }))
723
+ .describe("The results of the Jira issues")
704
724
  .optional(),
705
725
  error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
706
726
  });
@@ -992,7 +1012,18 @@ export const firecrawlScrapeUrlParamsSchema = z.object({
992
1012
  .describe("Array of formats to return")
993
1013
  .optional(),
994
1014
  });
995
- export const firecrawlScrapeUrlOutputSchema = z.object({ content: z.string().describe("The content of the URL") });
1015
+ export const firecrawlScrapeUrlOutputSchema = z.object({
1016
+ success: z.boolean().describe("Whether the operation was successful"),
1017
+ error: z.string().describe("Error message if the operation failed").optional(),
1018
+ results: z
1019
+ .array(z.object({
1020
+ name: z.string().describe("The name of the result"),
1021
+ url: z.string().describe("The URL of the result"),
1022
+ contents: z.string().describe("The content of the URL"),
1023
+ }))
1024
+ .describe("The results of the scrape")
1025
+ .optional(),
1026
+ });
996
1027
  export const firecrawlSearchAndScrapeParamsSchema = z.object({
997
1028
  query: z.string().describe("The query to search for"),
998
1029
  count: z.number().describe("The number of results to return. Default is 5.").optional(),
@@ -2724,13 +2755,19 @@ export const googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema = z.o
2724
2755
  });
2725
2756
  export const googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema = z.object({
2726
2757
  success: z.boolean().describe("Whether the search was successful"),
2727
- files: z
2758
+ results: z
2728
2759
  .array(z.object({
2729
- id: z.string().describe("The file ID"),
2730
- name: z.string().describe("The file name"),
2731
- mimeType: z.string().describe("The MIME type of the file"),
2732
- url: z.string().describe("The web link to view the file"),
2733
- content: z.string().describe("The data returned from the file, subject to fileSizeLimit").optional(),
2760
+ name: z.string().describe("The name of the file"),
2761
+ url: z.string().describe("The URL of the file"),
2762
+ contents: z
2763
+ .object({
2764
+ id: z.string().describe("The file ID"),
2765
+ name: z.string().describe("The file name"),
2766
+ mimeType: z.string().describe("The MIME type of the file"),
2767
+ url: z.string().describe("The web link to view the file"),
2768
+ content: z.string().describe("The data returned from the file, subject to fileSizeLimit").optional(),
2769
+ })
2770
+ .describe("The contents of the file"),
2734
2771
  }))
2735
2772
  .describe("List of files matching the search")
2736
2773
  .optional(),
@@ -2771,9 +2808,20 @@ export const googleOauthGetDriveFileContentByIdParamsSchema = z.object({
2771
2808
  });
2772
2809
  export const googleOauthGetDriveFileContentByIdOutputSchema = z.object({
2773
2810
  success: z.boolean().describe("Whether the file content was retrieved successfully"),
2774
- content: z.string().describe("The content of the file").optional(),
2775
- fileName: z.string().describe("The name of the file").optional(),
2776
- fileLength: z.number().describe("The length of the file content prior to truncating").optional(),
2811
+ results: z
2812
+ .array(z.object({
2813
+ name: z.string().describe("The name of the file"),
2814
+ url: z.string().describe("The URL of the file"),
2815
+ contents: z
2816
+ .object({
2817
+ content: z.string().describe("The content of the file").optional(),
2818
+ fileName: z.string().describe("The name of the file").optional(),
2819
+ fileLength: z.number().describe("The length of the file content prior to truncating").optional(),
2820
+ })
2821
+ .describe("The contents of the file"),
2822
+ }))
2823
+ .describe("The results of the file content")
2824
+ .optional(),
2777
2825
  error: z.string().describe("Error message if file content retrieval failed").optional(),
2778
2826
  });
2779
2827
  export const googleOauthListGroupsParamsSchema = z.object({
@@ -3554,17 +3602,24 @@ export const salesforceSearchSalesforceRecordsParamsSchema = z.object({
3554
3602
  });
3555
3603
  export const salesforceSearchSalesforceRecordsOutputSchema = z.object({
3556
3604
  success: z.boolean().describe("Whether the records were successfully retrieved"),
3557
- searchRecords: z
3605
+ results: z
3558
3606
  .array(z
3559
3607
  .object({
3560
- id: z.string().describe("The Salesforce record ID").optional(),
3561
- attributes: z
3608
+ name: z.string().describe("The name of the record").optional(),
3609
+ url: z.string().describe("The URL of the record").optional(),
3610
+ contents: z
3562
3611
  .object({
3563
- type: z.string().describe("The Salesforce object type"),
3564
- url: z.string().describe("The Salesforce record URL"),
3612
+ id: z.string().describe("The Salesforce record ID").optional(),
3613
+ attributes: z
3614
+ .object({
3615
+ type: z.string().describe("The Salesforce object type"),
3616
+ url: z.string().describe("The Salesforce record URL"),
3617
+ })
3618
+ .catchall(z.any())
3619
+ .describe("Metadata about the Salesforce record")
3620
+ .optional(),
3565
3621
  })
3566
- .catchall(z.any())
3567
- .describe("Metadata about the Salesforce record")
3622
+ .describe("The contents of the record")
3568
3623
  .optional(),
3569
3624
  })
3570
3625
  .describe("A record from Salesforce"))
@@ -3578,10 +3633,7 @@ export const salesforceGetSalesforceRecordsByQueryParamsSchema = z.object({
3578
3633
  });
3579
3634
  export const salesforceGetSalesforceRecordsByQueryOutputSchema = z.object({
3580
3635
  success: z.boolean().describe("Whether the records were successfully retrieved"),
3581
- records: z
3582
- .array(z.record(z.string()).describe("A record from Salesforce"))
3583
- .describe("The retrieved records")
3584
- .optional(),
3636
+ results: z.array(z.any()).describe("Array of standardized results objects").optional(),
3585
3637
  error: z.string().describe("The error that occurred if the records were not successfully retrieved").optional(),
3586
3638
  });
3587
3639
  export const salesforceGetRecordParamsSchema = z.object({
@@ -3710,20 +3762,31 @@ export const githubListPullRequestsParamsSchema = z.object({
3710
3762
  state: z.string().describe("The state of the pull requests to list (e.g., open, closed)").optional(),
3711
3763
  });
3712
3764
  export const githubListPullRequestsOutputSchema = z.object({
3713
- pullRequests: z
3765
+ success: z.boolean().describe("Whether the operation was successful"),
3766
+ error: z.string().describe("The error that occurred if the operation was not successful").optional(),
3767
+ results: z
3714
3768
  .array(z.object({
3715
- number: z.number().describe("The number of the pull request").optional(),
3716
- title: z.string().describe("The title of the pull request").optional(),
3717
- state: z.string().describe("The state of the pull request (e.g., open, closed)").optional(),
3769
+ name: z.string().describe("The title of the pull request").optional(),
3718
3770
  url: z.string().describe("The URL of the pull request").optional(),
3719
- createdAt: z.string().describe("The date and time when the pull request was created").optional(),
3720
- updatedAt: z.string().describe("The date and time when the pull request was last updated").optional(),
3721
- user: z
3722
- .object({ login: z.string().describe("The username of the user who created the pull request").optional() })
3771
+ contents: z
3772
+ .object({
3773
+ number: z.number().describe("The number of the pull request").optional(),
3774
+ title: z.string().describe("The title of the pull request").optional(),
3775
+ state: z.string().describe("The state of the pull request (e.g., open, closed)").optional(),
3776
+ url: z.string().describe("The URL of the pull request").optional(),
3777
+ createdAt: z.string().describe("The date and time when the pull request was created").optional(),
3778
+ updatedAt: z.string().describe("The date and time when the pull request was last updated").optional(),
3779
+ user: z
3780
+ .object({
3781
+ login: z.string().describe("The username of the user who created the pull request").optional(),
3782
+ })
3783
+ .optional(),
3784
+ description: z.string().describe("The description of the pull request").optional(),
3785
+ })
3723
3786
  .optional(),
3724
- description: z.string().describe("The description of the pull request").optional(),
3725
3787
  }))
3726
- .describe("A list of pull requests in the repository"),
3788
+ .describe("A list of pull requests in the repository")
3789
+ .optional(),
3727
3790
  });
3728
3791
  export const githubGetPullRequestDetailsParamsSchema = z.object({
3729
3792
  repositoryOwner: z.string().describe("The owner of the repository"),
@@ -3827,10 +3890,21 @@ export const githubGetFileContentParamsSchema = z.object({
3827
3890
  export const githubGetFileContentOutputSchema = z.object({
3828
3891
  success: z.boolean().describe("Whether the operation was successful"),
3829
3892
  error: z.string().describe("The error that occurred if the operation was not successful").optional(),
3830
- content: z.string().describe("The decoded file content as a string").optional(),
3831
- size: z.number().describe("The size of the file in bytes").optional(),
3832
- name: z.string().describe("The name of the file").optional(),
3833
- htmlUrl: z.string().describe("The URL of the file in the Github UI").optional(),
3893
+ results: z
3894
+ .array(z.object({
3895
+ name: z.string().describe("The name of the file").optional(),
3896
+ url: z.string().describe("The URL of the file in the Github UI").optional(),
3897
+ contents: z
3898
+ .object({
3899
+ content: z.string().describe("The decoded file content as a string").optional(),
3900
+ size: z.number().describe("The size of the file in bytes").optional(),
3901
+ name: z.string().describe("The name of the file").optional(),
3902
+ htmlUrl: z.string().describe("The URL of the file in the Github UI").optional(),
3903
+ })
3904
+ .optional(),
3905
+ }))
3906
+ .describe("A list of Github files")
3907
+ .optional(),
3834
3908
  });
3835
3909
  export const githubListDirectoryParamsSchema = z.object({
3836
3910
  organization: z.string().describe("The organization that owns the repository"),
@@ -3840,13 +3914,17 @@ export const githubListDirectoryParamsSchema = z.object({
3840
3914
  export const githubListDirectoryOutputSchema = z.object({
3841
3915
  success: z.boolean().describe("Whether the operation was successful"),
3842
3916
  error: z.string().describe("Error message if the operation failed").optional(),
3843
- content: z
3917
+ results: z
3844
3918
  .array(z.object({
3845
3919
  name: z.string().describe("The name of the file"),
3846
- path: z.string().describe("The path of the file"),
3847
- type: z.string().describe("The type of the file"),
3848
- size: z.number().describe("The size of the file in bytes"),
3849
- htmlUrl: z.string().describe("The URL of the file in the Github UI"),
3920
+ url: z.string().describe("The URL of the file in the Github UI"),
3921
+ contents: z
3922
+ .object({
3923
+ path: z.string().describe("The path of the file"),
3924
+ type: z.string().describe("The type of the file"),
3925
+ size: z.number().describe("The size of the file in bytes"),
3926
+ })
3927
+ .describe("The contents of the file"),
3850
3928
  }))
3851
3929
  .describe("Array of directory contents")
3852
3930
  .optional(),
@@ -3921,63 +3999,89 @@ export const githubSearchOrganizationParamsSchema = z.object({
3921
3999
  repository: z.string().describe("The repository to search for data in").optional(),
3922
4000
  });
3923
4001
  export const githubSearchOrganizationOutputSchema = z.object({
3924
- code: z
3925
- .array(z.object({
3926
- name: z.string().describe("The name of the file that had a match"),
3927
- path: z.string().describe("The path of the file that had a match"),
3928
- sha: z.string().describe("The SHA of the commit that had a match"),
3929
- url: z.string().describe("The URL of the file that had a match"),
3930
- score: z.number().describe("The similarity score of the match"),
3931
- textMatches: z
3932
- .array(z.object({
3933
- object_url: z.string().describe("The URL of the object that had a match").optional(),
3934
- object_type: z.string().describe("The type of the object that had a match").optional(),
3935
- fragment: z.string().describe("The fragment of the text that had a match").optional(),
3936
- matches: z
3937
- .array(z.object({
3938
- text: z.string().describe("The text that had a match").optional(),
3939
- indices: z.array(z.number()).describe("The indices of the text that had a match").optional(),
3940
- }))
3941
- .describe("A list of matches that match the query"),
3942
- }))
3943
- .describe("A list of text matches that match the query"),
3944
- }))
3945
- .describe("A list of code results that match the query"),
3946
- commits: z
3947
- .array(z.object({
3948
- sha: z.string().describe("The SHA of the commit that had a match"),
3949
- url: z.string().describe("The URL of the commit that had a match"),
3950
- commit: z
3951
- .object({
3952
- author: z.object({
3953
- name: z.string().describe("The name of the author"),
3954
- email: z.string().describe("The email of the author"),
3955
- date: z.string().describe("The date of the commit"),
3956
- }),
3957
- message: z.string().describe("The message of the commit"),
3958
- })
3959
- .optional(),
3960
- }))
3961
- .describe("A list of commits that match the query"),
3962
- issuesAndPullRequests: z
4002
+ success: z.boolean().describe("Whether the operation was successful"),
4003
+ error: z.string().describe("Error message if the operation failed").optional(),
4004
+ results: z
3963
4005
  .array(z.object({
3964
- number: z.number().describe("The number of the issue or pull request").optional(),
3965
- title: z.string().describe("The title of the issue or pull request"),
3966
- html_url: z.string().describe("The URL of the issue or pull request").optional(),
3967
- state: z.enum(["open", "closed"]).describe("The state of the issue or pull request"),
3968
- isPullRequest: z.boolean().describe("Whether the issue or pull request is a pull request").optional(),
3969
- body: z.string().describe("The body of the issue or pull request").optional(),
3970
- score: z.number().describe("The score of the issue or pull request").optional(),
3971
- files: z
3972
- .array(z.object({
3973
- filename: z.string().describe("The filename of the file"),
3974
- status: z.string().describe("The status of the file"),
3975
- patch: z.string().describe("The patch of the file").optional(),
3976
- }))
3977
- .describe("A list of files that match the query")
3978
- .optional(),
4006
+ name: z.string().describe("The name of the result (file name, commit SHA, or issue/PR title)"),
4007
+ url: z.string().describe("The URL of the result"),
4008
+ type: z.enum(["code", "commit", "issueOrPullRequest"]).describe("The type of the result"),
4009
+ content: z.any().superRefine((x, ctx) => {
4010
+ const schemas = [
4011
+ z
4012
+ .object({
4013
+ name: z.string().describe("The name of the file that had a match"),
4014
+ path: z.string().describe("The path of the file that had a match"),
4015
+ sha: z.string().describe("The SHA of the commit that had a match"),
4016
+ url: z.string().describe("The URL of the file that had a match"),
4017
+ score: z.number().describe("The similarity score of the match"),
4018
+ textMatches: z
4019
+ .array(z.object({
4020
+ object_url: z.string().describe("The URL of the object that had a match").optional(),
4021
+ object_type: z.string().describe("The type of the object that had a match").optional(),
4022
+ fragment: z.string().describe("The fragment of the text that had a match").optional(),
4023
+ matches: z
4024
+ .array(z.object({
4025
+ text: z.string().describe("The text that had a match").optional(),
4026
+ indices: z
4027
+ .array(z.number())
4028
+ .describe("The indices of the text that had a match")
4029
+ .optional(),
4030
+ }))
4031
+ .describe("A list of matches that match the query"),
4032
+ }))
4033
+ .describe("A list of text matches that match the query"),
4034
+ })
4035
+ .describe("Code result content"),
4036
+ z
4037
+ .object({
4038
+ sha: z.string().describe("The SHA of the commit that had a match"),
4039
+ url: z.string().describe("The URL of the commit that had a match"),
4040
+ commit: z
4041
+ .object({
4042
+ author: z.object({
4043
+ name: z.string().describe("The name of the author"),
4044
+ email: z.string().describe("The email of the author"),
4045
+ date: z.string().describe("The date of the commit"),
4046
+ }),
4047
+ message: z.string().describe("The message of the commit"),
4048
+ })
4049
+ .optional(),
4050
+ })
4051
+ .describe("Commit result content"),
4052
+ z
4053
+ .object({
4054
+ number: z.number().describe("The number of the issue or pull request").optional(),
4055
+ title: z.string().describe("The title of the issue or pull request"),
4056
+ html_url: z.string().describe("The URL of the issue or pull request").optional(),
4057
+ state: z.enum(["open", "closed"]).describe("The state of the issue or pull request"),
4058
+ isPullRequest: z.boolean().describe("Whether the issue or pull request is a pull request").optional(),
4059
+ body: z.string().describe("The body of the issue or pull request").optional(),
4060
+ score: z.number().describe("The score of the issue or pull request").optional(),
4061
+ files: z
4062
+ .array(z.object({
4063
+ filename: z.string().describe("The filename of the file"),
4064
+ status: z.string().describe("The status of the file"),
4065
+ patch: z.string().describe("The patch of the file").optional(),
4066
+ }))
4067
+ .describe("A list of files that match the query")
4068
+ .optional(),
4069
+ })
4070
+ .describe("Issue or pull request result content"),
4071
+ ];
4072
+ const errors = schemas.reduce((errors, schema) => (result => (result.error ? [...errors, result.error] : errors))(schema.safeParse(x)), []);
4073
+ if (schemas.length - errors.length !== 1) {
4074
+ ctx.addIssue({
4075
+ path: ctx.path,
4076
+ code: "invalid_union",
4077
+ unionErrors: errors,
4078
+ message: "Invalid input: Should pass single schema",
4079
+ });
4080
+ }
4081
+ }),
3979
4082
  }))
3980
- .describe("A list of issues and pull requests that match the query"),
4083
+ .describe("Array of search results")
4084
+ .optional(),
3981
4085
  });
3982
4086
  export const githubGetBranchParamsSchema = z.object({
3983
4087
  repositoryOwner: z.string().describe("The owner of the repository"),
@@ -4191,78 +4295,99 @@ export const gitlabSearchGroupParamsSchema = z.object({
4191
4295
  project: z.string().describe("The name of the project to search in").optional(),
4192
4296
  });
4193
4297
  export const gitlabSearchGroupOutputSchema = z.object({
4194
- mergeRequests: z
4195
- .array(z.object({
4196
- metadata: z
4197
- .object({
4198
- id: z.number().describe("The ID of the merge request"),
4199
- iid: z.number().describe("The internal ID of the merge request"),
4200
- project_id: z.number().describe("The ID of the project the merge request belongs to"),
4201
- title: z.string().describe("The title of the merge request"),
4202
- web_url: z.string().describe("The URL of the merge request"),
4203
- description: z.string().describe("The description of the merge request").optional(),
4204
- author: z
4205
- .object({ name: z.string().describe("The name of the author").optional() })
4206
- .describe("The author of the merge request")
4207
- .optional(),
4208
- merged_at: z.string().describe("The date and time the merge request was merged").optional(),
4209
- })
4210
- .describe("The metadata of the merge request"),
4211
- diffs: z
4212
- .array(z.object({
4213
- old_path: z.string().describe("The old path of the diff"),
4214
- new_path: z.string().describe("The new path of the diff"),
4215
- diff: z.string().describe("The contents of the diff"),
4216
- new_file: z.boolean().describe("Whether the diff is a new file"),
4217
- renamed_file: z.boolean().describe("Whether the diff is a renamed file"),
4218
- deleted_file: z.boolean().describe("Whether the diff is a deleted file"),
4219
- too_large: z.boolean().describe("Whether the diff is too large").optional(),
4220
- }))
4221
- .describe("A list of diffs that match the query"),
4222
- }))
4223
- .describe("A list of merge requests that match the query"),
4224
- blobs: z
4225
- .array(z.object({
4226
- metadata: z.object({
4227
- path: z.string().describe("The path of the blob"),
4228
- basename: z.string().describe("The basename of the blob"),
4229
- data: z.string().describe("The data of the blob"),
4230
- project_id: z.number().describe("The ID of the project the blob belongs to"),
4231
- ref: z.string().describe("The ref of the blob"),
4232
- startline: z.number().describe("The start line of the blob"),
4233
- filename: z.string().describe("The filename of the blob"),
4234
- web_url: z.string().describe("The URL of the blob"),
4235
- }),
4236
- matchedMergeRequests: z
4237
- .array(z.object({
4238
- title: z.string().describe("The title of the merge request"),
4239
- web_url: z.string().describe("The URL of the merge request"),
4240
- author: z.object({}).catchall(z.any()).describe("The author of the merge request").optional(),
4241
- merged_at: z.string().describe("The date and time the merge request was merged").optional(),
4242
- }))
4243
- .describe("A list of merge requests that match the blob")
4244
- .optional(),
4245
- }))
4246
- .describe("A list of blobs that match the query"),
4247
- commits: z
4298
+ success: z.boolean().describe("Whether the search operation was successful"),
4299
+ error: z.string().describe("Error message if the search operation failed").optional(),
4300
+ results: z
4248
4301
  .array(z.object({
4249
- sha: z.string().describe("The commit SHA"),
4250
- web_url: z.string().describe("The URL to view the commit in GitLab"),
4251
- message: z.string().describe("The full commit message"),
4252
- author: z.object({
4253
- name: z.string().describe("The name of the commit author"),
4254
- email: z.string().describe("The email of the commit author"),
4302
+ name: z.string().describe("The name/title of the search result"),
4303
+ url: z.string().describe("The URL to view the result in GitLab"),
4304
+ type: z.enum(["mergeRequest", "blob", "commit"]).describe("The type of search result"),
4305
+ contents: z.any().superRefine((x, ctx) => {
4306
+ const schemas = [
4307
+ z
4308
+ .object({
4309
+ metadata: z
4310
+ .object({
4311
+ id: z.number().describe("The ID of the merge request"),
4312
+ iid: z.number().describe("The internal ID of the merge request"),
4313
+ project_id: z.number().describe("The ID of the project the merge request belongs to"),
4314
+ title: z.string().describe("The title of the merge request"),
4315
+ web_url: z.string().describe("The URL of the merge request"),
4316
+ description: z.string().describe("The description of the merge request").optional(),
4317
+ author: z
4318
+ .object({ name: z.string().describe("The name of the author").optional() })
4319
+ .describe("The author of the merge request")
4320
+ .optional(),
4321
+ merged_at: z.string().describe("The date and time the merge request was merged").optional(),
4322
+ })
4323
+ .describe("The metadata of the merge request"),
4324
+ diffs: z
4325
+ .array(z.object({
4326
+ old_path: z.string().describe("The old path of the diff"),
4327
+ new_path: z.string().describe("The new path of the diff"),
4328
+ diff: z.string().describe("The contents of the diff"),
4329
+ new_file: z.boolean().describe("Whether the diff is a new file"),
4330
+ renamed_file: z.boolean().describe("Whether the diff is a renamed file"),
4331
+ deleted_file: z.boolean().describe("Whether the diff is a deleted file"),
4332
+ too_large: z.boolean().describe("Whether the diff is too large").optional(),
4333
+ }))
4334
+ .describe("A list of diffs that match the query"),
4335
+ })
4336
+ .describe("Merge request contents"),
4337
+ z
4338
+ .object({
4339
+ metadata: z.object({
4340
+ path: z.string().describe("The path of the blob"),
4341
+ basename: z.string().describe("The basename of the blob"),
4342
+ data: z.string().describe("The data of the blob"),
4343
+ project_id: z.number().describe("The ID of the project the blob belongs to"),
4344
+ ref: z.string().describe("The ref of the blob"),
4345
+ startline: z.number().describe("The start line of the blob"),
4346
+ filename: z.string().describe("The filename of the blob"),
4347
+ web_url: z.string().describe("The URL of the blob"),
4348
+ }),
4349
+ matchedMergeRequests: z
4350
+ .array(z.object({
4351
+ title: z.string().describe("The title of the merge request"),
4352
+ web_url: z.string().describe("The URL of the merge request"),
4353
+ author: z.object({}).catchall(z.any()).describe("The author of the merge request").optional(),
4354
+ merged_at: z.string().describe("The date and time the merge request was merged").optional(),
4355
+ }))
4356
+ .describe("A list of merge requests that match the blob"),
4357
+ })
4358
+ .describe("Blob contents"),
4359
+ z
4360
+ .object({
4361
+ sha: z.string().describe("The commit SHA"),
4362
+ web_url: z.string().describe("The URL to view the commit in GitLab"),
4363
+ message: z.string().describe("The full commit message"),
4364
+ author: z.object({
4365
+ name: z.string().describe("The name of the commit author"),
4366
+ email: z.string().describe("The email of the commit author"),
4367
+ }),
4368
+ created_at: z.string().describe("The date/time the commit was created"),
4369
+ files: z
4370
+ .array(z.object({
4371
+ old_path: z.string().describe("The old path of the file"),
4372
+ new_path: z.string().describe("The new path of the file"),
4373
+ diff: z.string().describe("The diff contents for the file"),
4374
+ }))
4375
+ .describe("A list of files changed in the commit"),
4376
+ })
4377
+ .describe("Commit contents"),
4378
+ ];
4379
+ const errors = schemas.reduce((errors, schema) => (result => (result.error ? [...errors, result.error] : errors))(schema.safeParse(x)), []);
4380
+ if (schemas.length - errors.length !== 1) {
4381
+ ctx.addIssue({
4382
+ path: ctx.path,
4383
+ code: "invalid_union",
4384
+ unionErrors: errors,
4385
+ message: "Invalid input: Should pass single schema",
4386
+ });
4387
+ }
4255
4388
  }),
4256
- created_at: z.string().describe("The date/time the commit was created"),
4257
- files: z
4258
- .array(z.object({
4259
- old_path: z.string().describe("The old path of the file"),
4260
- new_path: z.string().describe("The new path of the file"),
4261
- diff: z.string().describe("The diff contents for the file"),
4262
- }))
4263
- .describe("A list of files changed in the commit"),
4264
4389
  }))
4265
- .describe("A list of commits that match the query")
4390
+ .describe("A list of search results that match the query")
4266
4391
  .optional(),
4267
4392
  });
4268
4393
  export const gitlabGetFileContentParamsSchema = z.object({
@@ -4276,10 +4401,19 @@ export const gitlabGetFileContentParamsSchema = z.object({
4276
4401
  export const gitlabGetFileContentOutputSchema = z.object({
4277
4402
  success: z.boolean().describe("Whether the operation was successful"),
4278
4403
  error: z.string().describe("The error that occurred if the operation was not successful").optional(),
4279
- content: z.string().describe("The decoded file content as a string").optional(),
4280
- size: z.number().describe("The size of the file in bytes").optional(),
4281
- name: z.string().describe("The name of the file").optional(),
4282
- htmlUrl: z.string().describe("The URL of the file in the GitLab UI").optional(),
4404
+ results: z
4405
+ .array(z.object({
4406
+ name: z.string().describe("The name of the file"),
4407
+ url: z.string().describe("The url of the file"),
4408
+ contents: z.object({
4409
+ content: z.string().describe("The decoded file content as a string"),
4410
+ size: z.number().describe("The size of the file in bytes"),
4411
+ name: z.string().describe("The name of the file"),
4412
+ htmlUrl: z.string().describe("The URL of the file in the GitLab UI"),
4413
+ }),
4414
+ }))
4415
+ .describe("The results of the file content")
4416
+ .optional(),
4283
4417
  });
4284
4418
  export const gitlabListDirectoryParamsSchema = z.object({
4285
4419
  group: z.string().describe('The group or namespace that owns the project (e.g., "my-group" or "org/subgroup")'),
@@ -4288,15 +4422,27 @@ export const gitlabListDirectoryParamsSchema = z.object({
4288
4422
  ref: z.string().describe('The branch, tag, or commit (defaults to "main")').optional(),
4289
4423
  });
4290
4424
  export const gitlabListDirectoryOutputSchema = z.object({
4291
- content: z
4425
+ success: z.boolean().describe("Whether the operation was successful"),
4426
+ error: z.string().describe("Error message if the operation failed").optional(),
4427
+ results: z
4292
4428
  .array(z.object({
4293
4429
  name: z.string().describe("The name of the file or directory"),
4294
- path: z.string().describe("The path of the file or directory"),
4295
- type: z.string().describe('The type of the entry (either "blob" for file or "tree" for directory)'),
4296
- size: z.number().describe("The size of the file in bytes (only for blobs; omitted or 0 for trees)").optional(),
4297
- htmlUrl: z.string().describe("The URL of the file or folder in the GitLab UI"),
4430
+ url: z.string().describe("The URL of the file or directory"),
4431
+ contents: z
4432
+ .object({
4433
+ name: z.string().describe("The name of the file or directory"),
4434
+ path: z.string().describe("The path of the file or directory"),
4435
+ type: z.string().describe('The type of the entry (either "blob" for file or "tree" for directory)'),
4436
+ size: z
4437
+ .number()
4438
+ .describe("The size of the file in bytes (only for blobs; omitted or 0 for trees)")
4439
+ .optional(),
4440
+ htmlUrl: z.string().describe("The URL of the file or folder in the GitLab UI"),
4441
+ })
4442
+ .describe("The contents of the directory"),
4298
4443
  }))
4299
- .describe("Array of directory contents"),
4444
+ .describe("Array of directory contents")
4445
+ .optional(),
4300
4446
  });
4301
4447
  export const linearGetIssuesParamsSchema = z.object({
4302
4448
  query: z.string().describe("Optional query string to filter issues").optional(),