@credal/actions 0.2.175 → 0.2.179

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.
@@ -312,6 +312,16 @@ export const slackGetChannelMessagesOutputSchema = z.object({
312
312
  .describe("Cursor to use for fetching the next page of results. Only present when hasMore is true.")
313
313
  .optional(),
314
314
  });
315
+ export const slackGetChannelMembersParamsSchema = z.object({
316
+ channelId: z.string().describe("The ID of the channel to get members from").optional(),
317
+ channelName: z.string().describe("The name of the channel to get members from").optional(),
318
+ });
319
+ export const slackGetChannelMembersOutputSchema = z.object({
320
+ success: z.boolean().describe("Whether the members were retrieved successfully"),
321
+ members: z
322
+ .array(z.object({ id: z.string(), name: z.string(), email: z.string() }).describe("A member of the channel"))
323
+ .describe("The members of the channel"),
324
+ });
315
325
  export const slackUserSearchSlackParamsSchema = z.object({
316
326
  emails: z
317
327
  .array(z.string().email())
@@ -464,37 +474,6 @@ export const jiraCreateJiraTicketOutputSchema = z.object({
464
474
  .describe("Error message if the ticket creation failed (only present if success is false)")
465
475
  .optional(),
466
476
  });
467
- export const jiraGetServiceDesksParamsSchema = z.object({});
468
- export const jiraGetServiceDesksOutputSchema = z.object({
469
- success: z.boolean().describe("Whether the service desks were retrieved successfully"),
470
- error: z.string().describe("The error that occurred if the service desks were not retrieved successfully").optional(),
471
- serviceDesks: z
472
- .array(z
473
- .object({
474
- id: z.string().describe("The ID of the service desk").optional(),
475
- projectId: z.string().describe("The ID of the project").optional(),
476
- projectKey: z.string().describe("The key of the project").optional(),
477
- projectName: z.string().describe("The name of the service desk").optional(),
478
- requestTypes: z
479
- .array(z
480
- .object({
481
- id: z.string().describe("The ID of the request type").optional(),
482
- name: z.string().describe("The name of the request type").optional(),
483
- description: z.string().describe("The description of the request type").optional(),
484
- issueTypeId: z.string().describe("The ID of the issue type").optional(),
485
- portalId: z.string().describe("The ID of the customer portal").optional(),
486
- helpText: z.string().describe("The help text for the request type").optional(),
487
- serviceDeskId: z.string().describe("The ID of the service desk").optional(),
488
- canCreateRequest: z.boolean().describe("Whether the request type can be created").optional(),
489
- })
490
- .describe("A request type"))
491
- .describe("The list of request types")
492
- .optional(),
493
- })
494
- .describe("A service desk"))
495
- .describe("The list of service desks")
496
- .optional(),
497
- });
498
477
  export const jiraCreateServiceDeskRequestParamsSchema = z.object({
499
478
  serviceDeskId: z.string().describe("The ID of the service desk to create the request in"),
500
479
  requestTypeId: z.string().describe("The ID of the request type to use for the new request"),
@@ -680,37 +659,6 @@ export const jiraOrgCreateJiraTicketOutputSchema = z.object({
680
659
  .describe("Error message if the ticket creation failed (only present if success is false)")
681
660
  .optional(),
682
661
  });
683
- export const jiraOrgGetServiceDesksParamsSchema = z.object({});
684
- export const jiraOrgGetServiceDesksOutputSchema = z.object({
685
- success: z.boolean().describe("Whether the service desks were retrieved successfully"),
686
- error: z.string().describe("The error that occurred if the service desks were not retrieved successfully").optional(),
687
- serviceDesks: z
688
- .array(z
689
- .object({
690
- id: z.string().describe("The ID of the service desk").optional(),
691
- projectId: z.string().describe("The ID of the project").optional(),
692
- projectKey: z.string().describe("The key of the project").optional(),
693
- projectName: z.string().describe("The name of the service desk").optional(),
694
- requestTypes: z
695
- .array(z
696
- .object({
697
- id: z.string().describe("The ID of the request type").optional(),
698
- name: z.string().describe("The name of the request type").optional(),
699
- description: z.string().describe("The description of the request type").optional(),
700
- issueTypeId: z.string().describe("The ID of the issue type").optional(),
701
- portalId: z.string().describe("The ID of the customer portal").optional(),
702
- helpText: z.string().describe("The help text for the request type").optional(),
703
- serviceDeskId: z.string().describe("The ID of the service desk").optional(),
704
- canCreateRequest: z.boolean().describe("Whether the request type can be created").optional(),
705
- })
706
- .describe("A request type"))
707
- .describe("The list of request types")
708
- .optional(),
709
- })
710
- .describe("A service desk"))
711
- .describe("The list of service desks")
712
- .optional(),
713
- });
714
662
  export const jiraOrgCreateServiceDeskRequestParamsSchema = z.object({
715
663
  serviceDeskId: z.string().describe("The ID of the service desk to create the request in"),
716
664
  requestTypeId: z.string().describe("The ID of the request type to use for the new request"),
@@ -896,37 +844,6 @@ export const jiraDataCenterCreateJiraTicketOutputSchema = z.object({
896
844
  .describe("Error message if the ticket creation failed (only present if success is false)")
897
845
  .optional(),
898
846
  });
899
- export const jiraDataCenterGetServiceDesksParamsSchema = z.object({});
900
- export const jiraDataCenterGetServiceDesksOutputSchema = z.object({
901
- success: z.boolean().describe("Whether the service desks were retrieved successfully"),
902
- error: z.string().describe("The error that occurred if the service desks were not retrieved successfully").optional(),
903
- serviceDesks: z
904
- .array(z
905
- .object({
906
- id: z.string().describe("The ID of the service desk").optional(),
907
- projectId: z.string().describe("The ID of the project").optional(),
908
- projectKey: z.string().describe("The key of the project").optional(),
909
- projectName: z.string().describe("The name of the service desk").optional(),
910
- requestTypes: z
911
- .array(z
912
- .object({
913
- id: z.string().describe("The ID of the request type").optional(),
914
- name: z.string().describe("The name of the request type").optional(),
915
- description: z.string().describe("The description of the request type").optional(),
916
- issueTypeId: z.string().describe("The ID of the issue type").optional(),
917
- portalId: z.string().describe("The ID of the customer portal").optional(),
918
- helpText: z.string().describe("The help text for the request type").optional(),
919
- serviceDeskId: z.string().describe("The ID of the service desk").optional(),
920
- canCreateRequest: z.boolean().describe("Whether the request type can be created").optional(),
921
- })
922
- .describe("A request type"))
923
- .describe("The list of request types")
924
- .optional(),
925
- })
926
- .describe("A service desk"))
927
- .describe("The list of service desks")
928
- .optional(),
929
- });
930
847
  export const jiraDataCenterCreateServiceDeskRequestParamsSchema = z.object({
931
848
  serviceDeskId: z.string().describe("The ID of the service desk to create the request in"),
932
849
  requestTypeId: z.string().describe("The ID of the request type to use for the new request"),
@@ -2052,6 +1969,23 @@ export const googleOauthListCalendarEventsOutputSchema = z.object({
2052
1969
  hangoutLink: z.string().describe("Google Meet link for the event, if available").optional(),
2053
1970
  created: z.string().describe("Creation time of the event (RFC3339 timestamp)").optional(),
2054
1971
  updated: z.string().describe("Last modification time of the event (RFC3339 timestamp)").optional(),
1972
+ attachments: z
1973
+ .array(z.object({
1974
+ fileId: z.string().describe("ID of the attached file").optional(),
1975
+ fileUrl: z.string().describe("URL link to the attachment").optional(),
1976
+ title: z.string().describe("Attachment title").optional(),
1977
+ mimeType: z.string().describe("Internet media type (MIME type) of the attachment").optional(),
1978
+ }))
1979
+ .describe("List of file attachments for the event")
1980
+ .optional(),
1981
+ eventType: z
1982
+ .string()
1983
+ .describe('Differentiate "workingLocation" events, which simply specify a location, from real meetings')
1984
+ .optional(),
1985
+ transparency: z
1986
+ .string()
1987
+ .describe('Whether the event blocks time on the calendar and is considered a "busy" time. Populated when transparent.')
1988
+ .optional(),
2055
1989
  })
2056
1990
  .describe("A calendar event"))
2057
1991
  .describe("List of events"),
@@ -3855,70 +3789,6 @@ export const githubListDirectoryOutputSchema = z.object({
3855
3789
  .describe("Array of directory contents")
3856
3790
  .optional(),
3857
3791
  });
3858
- export const githubSearchRepositoryParamsSchema = z.object({
3859
- organization: z.string().describe("The organization to search for data in"),
3860
- repository: z.string().describe("The repository to search for data in"),
3861
- query: z.string().describe("The query to search for in the repository"),
3862
- });
3863
- export const githubSearchRepositoryOutputSchema = z.object({
3864
- code: z
3865
- .array(z.object({
3866
- name: z.string().describe("The name of the file that had a match"),
3867
- path: z.string().describe("The path of the file that had a match"),
3868
- sha: z.string().describe("The SHA of the commit that had a match"),
3869
- url: z.string().describe("The URL of the file that had a match"),
3870
- score: z.number().describe("The similarity score of the match"),
3871
- textMatches: z
3872
- .array(z.object({
3873
- object_url: z.string().describe("The URL of the object that had a match").optional(),
3874
- object_type: z.string().describe("The type of the object that had a match").optional(),
3875
- fragment: z.string().describe("The fragment of the text that had a match").optional(),
3876
- matches: z
3877
- .array(z.object({
3878
- text: z.string().describe("The text that had a match").optional(),
3879
- indices: z.array(z.number()).describe("The indices of the text that had a match").optional(),
3880
- }))
3881
- .describe("A list of matches that match the query"),
3882
- }))
3883
- .describe("A list of text matches that match the query"),
3884
- }))
3885
- .describe("A list of code results that match the query"),
3886
- commits: z
3887
- .array(z.object({
3888
- sha: z.string().describe("The SHA of the commit that had a match"),
3889
- url: z.string().describe("The URL of the commit that had a match"),
3890
- commit: z
3891
- .object({
3892
- author: z.object({
3893
- name: z.string().describe("The name of the author"),
3894
- email: z.string().describe("The email of the author"),
3895
- date: z.string().describe("The date of the commit"),
3896
- }),
3897
- message: z.string().describe("The message of the commit"),
3898
- })
3899
- .optional(),
3900
- }))
3901
- .describe("A list of commits that match the query"),
3902
- issuesAndPullRequests: z
3903
- .array(z.object({
3904
- number: z.number().describe("The number of the issue or pull request").optional(),
3905
- title: z.string().describe("The title of the issue or pull request"),
3906
- html_url: z.string().describe("The URL of the issue or pull request").optional(),
3907
- state: z.enum(["open", "closed"]).describe("The state of the issue or pull request"),
3908
- isPullRequest: z.boolean().describe("Whether the issue or pull request is a pull request").optional(),
3909
- body: z.string().describe("The body of the issue or pull request").optional(),
3910
- score: z.number().describe("The score of the issue or pull request").optional(),
3911
- files: z
3912
- .array(z.object({
3913
- filename: z.string().describe("The filename of the file"),
3914
- status: z.string().describe("The status of the file"),
3915
- patch: z.string().describe("The patch of the file").optional(),
3916
- }))
3917
- .describe("A list of files that match the query")
3918
- .optional(),
3919
- }))
3920
- .describe("A list of issues and pull requests that match the query"),
3921
- });
3922
3792
  export const githubSearchOrganizationParamsSchema = z.object({
3923
3793
  organization: z.string().describe("The organization to search for data in"),
3924
3794
  query: z.string().describe("The query to search for within the organization"),
@@ -1,4 +1,4 @@
1
- import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
1
+ import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } from "./autogen/templates.js";
2
2
  export const ACTION_GROUPS = {
3
3
  GENERIC: {
4
4
  description: "Generic utility actions",
@@ -47,6 +47,7 @@ export const ACTION_GROUPS = {
47
47
  googleOauthUpdatePresentationDefinition,
48
48
  googleOauthSearchDriveByKeywordsDefinition,
49
49
  googleOauthSearchDriveByQueryDefinition,
50
+ googleOauthSearchDriveByQueryAndGetFileContentDefinition,
50
51
  googleOauthGetDriveFileContentByIdDefinition,
51
52
  ],
52
53
  },
@@ -198,6 +199,8 @@ export const ACTION_GROUPS = {
198
199
  githubCreateBranchDefinition,
199
200
  githubCreatePullRequestDefinition,
200
201
  githubListPullRequestsDefinition,
202
+ githubGetFileContentDefinition,
203
+ githubListDirectoryDefinition,
201
204
  ],
202
205
  },
203
206
  ASHBY: {
@@ -0,0 +1,3 @@
1
+ import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
+ declare const searchRepository: githubSearchRepositoryFunction;
3
+ export default searchRepository;
@@ -0,0 +1,131 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
11
+ // Limits on the number of results to return
12
+ const MAX_CODE_RESULTS = 15;
13
+ const MAX_COMMITS = 10;
14
+ const MAX_FILES_PER_COMMIT = 5;
15
+ const MAX_ISSUES_OR_PRS = 10;
16
+ const MAX_FILES_PER_PR = 5;
17
+ const MAX_PATCH_LINES = 20;
18
+ const MAX_FRAGMENT_LINES = 20;
19
+ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
+ const { Octokit } = yield import("octokit");
21
+ if (!authParams.authToken) {
22
+ throw new Error(MISSING_AUTH_TOKEN);
23
+ }
24
+ const octokit = new Octokit({ auth: authParams.authToken });
25
+ const { organization, repository, query } = params;
26
+ // Search CODE with text match metadata
27
+ const codeResultsResponse = yield octokit.rest.search.code({
28
+ q: `${query} in:file,path repo:${organization}/${repository}`,
29
+ text_match: true,
30
+ headers: {
31
+ accept: "application/vnd.github.v3.text-match+json",
32
+ },
33
+ });
34
+ const codeResults = codeResultsResponse.data.items.slice(0, MAX_CODE_RESULTS).map(item => ({
35
+ name: item.name,
36
+ path: item.path,
37
+ sha: item.sha,
38
+ url: item.url,
39
+ repository: {
40
+ full_name: item.repository.full_name,
41
+ html_url: item.repository.html_url,
42
+ },
43
+ score: item.score,
44
+ textMatches: item.text_matches
45
+ ? item.text_matches.map(match => {
46
+ var _a, _b, _c, _d;
47
+ return ({
48
+ object_url: (_a = match.object_url) !== null && _a !== void 0 ? _a : undefined,
49
+ object_type: (_b = match.object_type) !== null && _b !== void 0 ? _b : undefined,
50
+ fragment: (_c = match.fragment) === null || _c === void 0 ? void 0 : _c.split("\n").slice(0, MAX_FRAGMENT_LINES).join("\n"),
51
+ matches: (_d = match.matches) !== null && _d !== void 0 ? _d : [],
52
+ });
53
+ })
54
+ : [],
55
+ }));
56
+ // Search COMMITS
57
+ const commitResults = yield octokit.rest.search.commits({
58
+ q: `${query} repo:${organization}/${repository}`,
59
+ headers: {
60
+ accept: "application/vnd.github.cloak-preview+json",
61
+ },
62
+ });
63
+ const commitSHAs = commitResults.data.items.slice(0, MAX_COMMITS).map(item => item.sha);
64
+ const commitDetails = yield Promise.all(commitSHAs.map(sha => octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha })));
65
+ const enrichedCommits = commitResults.data.items.slice(0, MAX_COMMITS).map(item => {
66
+ var _a, _b;
67
+ const full = commitDetails.find(c => c.data.sha === item.sha);
68
+ return {
69
+ sha: item.sha,
70
+ url: item.url,
71
+ commit: {
72
+ message: item.commit.message,
73
+ author: item.commit.author,
74
+ },
75
+ score: item.score,
76
+ author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
77
+ files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
78
+ var _a;
79
+ return ({
80
+ filename: f.filename,
81
+ status: f.status,
82
+ patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
83
+ });
84
+ })) || [],
85
+ };
86
+ });
87
+ // Search ISSUES & PRs
88
+ const issueResults = yield octokit.rest.search.issuesAndPullRequests({
89
+ q: `${query} repo:${organization}/${repository}`,
90
+ });
91
+ const prItems = issueResults.data.items.filter(item => item.pull_request).slice(0, MAX_ISSUES_OR_PRS);
92
+ const prNumbers = prItems.map(item => item.number);
93
+ const prFiles = yield Promise.all(prNumbers.map(number => octokit.rest.pulls.listFiles({ owner: organization, repo: repository, pull_number: number })));
94
+ const issuesAndPRs = issueResults.data.items
95
+ .slice(0, MAX_ISSUES_OR_PRS)
96
+ .map(item => {
97
+ var _a, _b, _c, _d;
98
+ const isPR = !!item.pull_request;
99
+ const prIndex = prNumbers.indexOf(item.number);
100
+ const files = isPR && prIndex !== -1
101
+ ? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
102
+ var _a;
103
+ return ({
104
+ filename: f.filename,
105
+ status: f.status,
106
+ patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
107
+ });
108
+ })
109
+ : undefined;
110
+ return {
111
+ number: item.number,
112
+ title: item.title,
113
+ html_url: item.html_url,
114
+ state: item.state,
115
+ isPullRequest: isPR,
116
+ body: item.body,
117
+ user: {
118
+ email: (_b = (_a = item.user) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : undefined,
119
+ name: (_d = (_c = item.user) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined,
120
+ },
121
+ score: item.score,
122
+ files,
123
+ };
124
+ });
125
+ return {
126
+ code: codeResults,
127
+ commits: enrichedCommits,
128
+ issuesAndPullRequests: issuesAndPRs,
129
+ };
130
+ });
131
+ export default searchRepository;
@@ -0,0 +1,3 @@
1
+ import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
+ declare const searchRepository: githubSearchRepositoryFunction;
3
+ export default searchRepository;
@@ -0,0 +1,41 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
11
+ // Limits on the number of results to return
12
+ const MAX_CODE_RESULTS = 15;
13
+ const MAX_COMMITS = 10;
14
+ const MAX_FILES_PER_COMMIT = 5;
15
+ const MAX_ISSUES_OR_PRS = 10;
16
+ const MAX_FILES_PER_PR = 5;
17
+ const MAX_PATCH_LINES = 20;
18
+ const MAX_FRAGMENT_LINES = 20;
19
+ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
+ const { Octokit } = yield import("octokit");
21
+ if (!authParams.authToken) {
22
+ throw new Error(MISSING_AUTH_TOKEN);
23
+ }
24
+ const octokit = new Octokit({ auth: authParams.authToken });
25
+ const { organization, repository, query } = params;
26
+ // Search CODE with text match metadata
27
+ const codeResultsResponse = yield octokit.rest.search.code({
28
+ q: `${query} in:file,path repo:${organization}/${repository}`,
29
+ text_match: true,
30
+ headers: {
31
+ accept: "application/vnd.github.v3.text-match+json",
32
+ },
33
+ });
34
+ const commitResults = yield octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha });
35
+ return {
36
+ code: codeResults,
37
+ commits: enrichedCommits,
38
+ issuesAndPullRequests: issuesAndPRs,
39
+ };
40
+ });
41
+ export default searchRepository;
@@ -50,42 +50,29 @@ const listCalendarEvents = (_a) => __awaiter(void 0, [_a], void 0, function* ({
50
50
  if (!Array.isArray(items) || items.length <= 0)
51
51
  break;
52
52
  const batch = items.slice(0, max - fetchedCount);
53
- allEvents.push(...batch.map(({ id, status, htmlLink, summary, description, location, start, end, attendees, organizer, hangoutLink, created, updated, attachments, }) => ({
54
- id,
55
- status,
56
- url: htmlLink,
57
- title: summary,
58
- description,
59
- location,
60
- start: (start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || "",
61
- startDayOfWeek: getDayOfWeek((start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || ""),
62
- end: (end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || "",
63
- endDayOfWeek: getDayOfWeek((end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || ""),
64
- attendees: Array.isArray(attendees)
53
+ allEvents.push(...batch.map(({ id, status, htmlLink, summary, description, location, start, end, attendees, organizer, hangoutLink, created, updated, attachments, eventType, transparency, }) => (Object.assign(Object.assign({ id,
54
+ status, url: htmlLink, title: summary, description,
55
+ location, start: (start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || "", startDayOfWeek: getDayOfWeek((start === null || start === void 0 ? void 0 : start.dateTime) || (start === null || start === void 0 ? void 0 : start.date) || ""), end: (end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || "", endDayOfWeek: getDayOfWeek((end === null || end === void 0 ? void 0 : end.dateTime) || (end === null || end === void 0 ? void 0 : end.date) || ""), attendees: Array.isArray(attendees)
65
56
  ? attendees.map(({ email, displayName, responseStatus }) => ({
66
57
  email,
67
58
  displayName,
68
59
  responseStatus,
69
60
  }))
70
- : [],
71
- organizer: organizer
61
+ : [], organizer: organizer
72
62
  ? {
73
63
  email: organizer.email,
74
64
  displayName: organizer.displayName,
75
65
  }
76
- : undefined,
77
- hangoutLink,
66
+ : undefined, hangoutLink,
78
67
  created,
79
- updated,
80
- attachments: Array.isArray(attachments)
68
+ updated, attachments: Array.isArray(attachments)
81
69
  ? attachments.map(({ fileId, fileUrl, title, mimeType }) => ({
82
70
  fileId,
83
71
  fileUrl,
84
72
  title,
85
73
  mimeType,
86
74
  }))
87
- : [],
88
- })));
75
+ : [] }, (eventType === "workingLocation" && { eventType })), (transparency === "transparent" && { transparency: "free" })))));
89
76
  fetchedCount = allEvents.length;
90
77
  if (!nextPageToken || fetchedCount >= max)
91
78
  break;
@@ -9,14 +9,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { WebClient } from "@slack/web-api";
11
11
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
+ import { getSlackChannels } from "./helpers.js";
12
13
  const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
14
  if (!authParams.authToken) {
14
15
  throw new Error(MISSING_AUTH_TOKEN);
15
16
  }
16
17
  try {
17
18
  const client = new WebClient(authParams.authToken);
18
- const { channelId } = params;
19
- const result = yield client.conversations.archive({ channel: channelId });
19
+ const { channelName } = params;
20
+ const allChannels = yield getSlackChannels(client);
21
+ const channel = allChannels.find(channel => channel.name == channelName);
22
+ if (!channel || !channel.id) {
23
+ throw Error(`Channel with name ${channelName} not found`);
24
+ }
25
+ yield client.conversations.join({ channel: channel.id });
26
+ const result = yield client.conversations.archive({ channel: channel.id });
20
27
  if (!result.ok) {
21
28
  return {
22
29
  success: false,
@@ -0,0 +1,3 @@
1
+ import type { slackGetChannelMembersFunction } from "../../autogen/types.js";
2
+ declare const getChannelMembers: slackGetChannelMembersFunction;
3
+ export default getChannelMembers;
@@ -0,0 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { WebClient } from "@slack/web-api";
11
+ import { getSlackChannels } from "./helpers.js";
12
+ import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
13
+ const getChannelMembers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
+ if (!authParams.authToken) {
15
+ throw new Error(MISSING_AUTH_TOKEN);
16
+ }
17
+ const client = new WebClient(authParams.authToken);
18
+ const { channelId: inputChannelId, channelName } = params;
19
+ if (!inputChannelId && !channelName) {
20
+ throw Error("Either channelId or channelName must be provided");
21
+ }
22
+ let channelId = inputChannelId;
23
+ if (!channelId) {
24
+ const allChannels = yield getSlackChannels(client);
25
+ const channel = allChannels.find(channel => channel.name === channelName);
26
+ if (!channel || !channel.id) {
27
+ throw Error(`Channel with name ${channelName} not found`);
28
+ }
29
+ channelId = channel.id;
30
+ }
31
+ const response = yield client.conversations.members({
32
+ channel: channelId,
33
+ });
34
+ if (!response.ok) {
35
+ throw Error(`Failed to fetch members from channel ${channelName}, channelId: ${channelId}`);
36
+ }
37
+ const memberIds = response.members || [];
38
+ // Fetch user information for each member
39
+ const members = yield Promise.all(memberIds.map((userId) => __awaiter(void 0, void 0, void 0, function* () {
40
+ var _a;
41
+ try {
42
+ const userInfo = yield client.users.info({ user: userId });
43
+ if (userInfo.ok && userInfo.user) {
44
+ const user = userInfo.user;
45
+ return {
46
+ id: user.id || userId,
47
+ name: user.real_name || user.name || "",
48
+ email: ((_a = user.profile) === null || _a === void 0 ? void 0 : _a.email) || "",
49
+ };
50
+ }
51
+ }
52
+ catch (error) {
53
+ console.error(`Failed to fetch user info for ${userId}:`, error);
54
+ }
55
+ // Return basic info if user fetch fails
56
+ return {
57
+ id: userId,
58
+ name: "",
59
+ email: "",
60
+ };
61
+ })));
62
+ return {
63
+ success: true,
64
+ members,
65
+ };
66
+ });
67
+ export default getChannelMembers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.175",
3
+ "version": "0.2.179",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- import type { credalCallCopilotFunction } from "../../autogen/types";
2
- declare const callCopilot: credalCallCopilotFunction;
3
- export default callCopilot;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const sdk_1 = require("@credal/sdk");
13
- const callCopilot = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
- var _b;
15
- const requestBody = {
16
- agentId: params.agentId,
17
- query: params.query,
18
- userEmail: params.userEmail,
19
- };
20
- const baseUrl = (_b = authParams.baseUrl) !== null && _b !== void 0 ? _b : "https://app.credal.ai/api";
21
- const client = new sdk_1.CredalClient({ environment: baseUrl, apiKey: authParams.apiKey });
22
- const response = yield client.copilots.sendMessage({
23
- agentId: requestBody.agentId,
24
- message: requestBody.query,
25
- userEmail: requestBody.userEmail,
26
- });
27
- return {
28
- response: response.sendChatResult.type === "ai_response_result"
29
- ? response.sendChatResult.response.message
30
- : "Error getting response",
31
- referencedSources: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.referencedSources : [],
32
- sourcesInDataContext: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.sourcesInDataContext : [],
33
- webSearchResults: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.webSearchResults : [],
34
- };
35
- });
36
- exports.default = callCopilot;
@@ -1 +0,0 @@
1
- export * as add from "./add";