@credal/actions 0.2.145 → 0.2.147
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/README.md +1 -1
- package/dist/actions/autogen/templates.js +22 -1
- package/dist/actions/autogen/types.d.ts +43 -0
- package/dist/actions/autogen/types.js +9 -1
- package/dist/actions/groups.d.ts +6 -0
- package/dist/actions/groups.js +261 -0
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +47 -0
- package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
- package/dist/actions/providers/credal/callCopilot.js +36 -0
- package/dist/actions/providers/gitlab/getFileContent.js +4 -1
- package/dist/actions/providers/gitlab/searchGroup.js +1 -27
- package/dist/actions/providers/gitlab/utils.d.ts +3 -0
- package/dist/actions/providers/gitlab/utils.js +37 -0
- package/dist/actions/providers/jamf/types.d.ts +8 -0
- package/dist/actions/providers/jamf/types.js +7 -0
- package/dist/actions/providers/math/index.d.ts +1 -0
- package/dist/actions/providers/math/index.js +37 -0
- package/dist/actions/providers/slack/archiveChannel.d.ts +3 -0
- package/dist/actions/providers/slack/archiveChannel.js +42 -0
- package/dist/actions/providers/slack/index.d.ts +1 -0
- package/dist/actions/providers/slack/index.js +37 -0
- package/dist/actions/providers/slack/listConversations.d.ts +3 -0
- package/dist/actions/providers/slack/listConversations.js +41 -0
- package/dist/actions/providers/slackUser/searchSlack.d.ts +6 -1
- package/dist/actions/providers/slackUser/searchSlack.js +183 -242
- package/package.json +1 -1
- package/dist/actions/providers/jira/updateServiceDeskRequest.d.ts +0 -3
- package/dist/actions/providers/jira/updateServiceDeskRequest.js +0 -72
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ We strongly encourage you to develop actions that rely on oauth based credential
|
|
|
12
12
|
2. Run `npm run generate:types` to generate the new types
|
|
13
13
|
3. Run `npm run prettier-format` to format the new files
|
|
14
14
|
4. Create a new provider function in `src/actions/providers/<provider>/<action>.ts` (eg. `src/actions/providers/math/add.ts`) which exports a function using the generated types
|
|
15
|
-
5. If adding a new action or provider, update `src/actions/actionMapper.ts
|
|
15
|
+
5. If adding a new action or provider, update `src/actions/actionMapper.ts`.
|
|
16
16
|
6. In `package.json` and `package-lock.json` (which must be updated in two places), bump the version number.
|
|
17
17
|
7. Run `npm publish --access public` to publish the new version to npm. (Need to be logged in via `npm login`)
|
|
18
18
|
|
|
@@ -740,7 +740,7 @@ export const slackUserSearchSlackDefinition = {
|
|
|
740
740
|
properties: {
|
|
741
741
|
emails: {
|
|
742
742
|
type: "array",
|
|
743
|
-
description: "
|
|
743
|
+
description: "List of participant emails to search conversations for. If a single email is provided, searches your 1:1 DM with that user as well as any channel discussions they participated in. If multiple emails are provided, searches group DMs/MPIMs with those participants and channel discussions where at least one of them posted. The current user is always excluded from the participant check.\n",
|
|
744
744
|
items: {
|
|
745
745
|
type: "string",
|
|
746
746
|
format: "email",
|
|
@@ -820,6 +820,27 @@ export const slackUserSearchSlackDefinition = {
|
|
|
820
820
|
type: "string",
|
|
821
821
|
description: "A Slack permalink to the anchor (message or thread root), if resolvable.",
|
|
822
822
|
},
|
|
823
|
+
members: {
|
|
824
|
+
type: "array",
|
|
825
|
+
description: "The members of the result",
|
|
826
|
+
items: {
|
|
827
|
+
type: "object",
|
|
828
|
+
properties: {
|
|
829
|
+
userId: {
|
|
830
|
+
type: "string",
|
|
831
|
+
description: "The ID of the member",
|
|
832
|
+
},
|
|
833
|
+
userEmail: {
|
|
834
|
+
type: "string",
|
|
835
|
+
description: "The email of the member",
|
|
836
|
+
},
|
|
837
|
+
userName: {
|
|
838
|
+
type: "string",
|
|
839
|
+
description: "The name of the member",
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
},
|
|
823
844
|
context: {
|
|
824
845
|
type: "array",
|
|
825
846
|
description: "When a hit is in a thread, this is the full thread (root first). Otherwise, a small surrounding context window (~3 before, 5 after).",
|
|
@@ -895,6 +895,19 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
895
895
|
userEmail: z.ZodOptional<z.ZodString>;
|
|
896
896
|
userName: z.ZodOptional<z.ZodString>;
|
|
897
897
|
permalink: z.ZodOptional<z.ZodString>;
|
|
898
|
+
members: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
899
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
900
|
+
userEmail: z.ZodOptional<z.ZodString>;
|
|
901
|
+
userName: z.ZodOptional<z.ZodString>;
|
|
902
|
+
}, "strip", z.ZodTypeAny, {
|
|
903
|
+
userId?: string | undefined;
|
|
904
|
+
userEmail?: string | undefined;
|
|
905
|
+
userName?: string | undefined;
|
|
906
|
+
}, {
|
|
907
|
+
userId?: string | undefined;
|
|
908
|
+
userEmail?: string | undefined;
|
|
909
|
+
userName?: string | undefined;
|
|
910
|
+
}>, "many">>;
|
|
898
911
|
context: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
899
912
|
ts: z.ZodString;
|
|
900
913
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -914,6 +927,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
914
927
|
}, "strip", z.ZodTypeAny, {
|
|
915
928
|
channelId: string;
|
|
916
929
|
ts: string;
|
|
930
|
+
members?: {
|
|
931
|
+
userId?: string | undefined;
|
|
932
|
+
userEmail?: string | undefined;
|
|
933
|
+
userName?: string | undefined;
|
|
934
|
+
}[] | undefined;
|
|
917
935
|
text?: string | undefined;
|
|
918
936
|
userEmail?: string | undefined;
|
|
919
937
|
userName?: string | undefined;
|
|
@@ -927,6 +945,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
927
945
|
}, {
|
|
928
946
|
channelId: string;
|
|
929
947
|
ts: string;
|
|
948
|
+
members?: {
|
|
949
|
+
userId?: string | undefined;
|
|
950
|
+
userEmail?: string | undefined;
|
|
951
|
+
userName?: string | undefined;
|
|
952
|
+
}[] | undefined;
|
|
930
953
|
text?: string | undefined;
|
|
931
954
|
userEmail?: string | undefined;
|
|
932
955
|
userName?: string | undefined;
|
|
@@ -944,6 +967,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
944
967
|
contents: {
|
|
945
968
|
channelId: string;
|
|
946
969
|
ts: string;
|
|
970
|
+
members?: {
|
|
971
|
+
userId?: string | undefined;
|
|
972
|
+
userEmail?: string | undefined;
|
|
973
|
+
userName?: string | undefined;
|
|
974
|
+
}[] | undefined;
|
|
947
975
|
text?: string | undefined;
|
|
948
976
|
userEmail?: string | undefined;
|
|
949
977
|
userName?: string | undefined;
|
|
@@ -961,6 +989,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
961
989
|
contents: {
|
|
962
990
|
channelId: string;
|
|
963
991
|
ts: string;
|
|
992
|
+
members?: {
|
|
993
|
+
userId?: string | undefined;
|
|
994
|
+
userEmail?: string | undefined;
|
|
995
|
+
userName?: string | undefined;
|
|
996
|
+
}[] | undefined;
|
|
964
997
|
text?: string | undefined;
|
|
965
998
|
userEmail?: string | undefined;
|
|
966
999
|
userName?: string | undefined;
|
|
@@ -994,6 +1027,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
994
1027
|
contents: {
|
|
995
1028
|
channelId: string;
|
|
996
1029
|
ts: string;
|
|
1030
|
+
members?: {
|
|
1031
|
+
userId?: string | undefined;
|
|
1032
|
+
userEmail?: string | undefined;
|
|
1033
|
+
userName?: string | undefined;
|
|
1034
|
+
}[] | undefined;
|
|
997
1035
|
text?: string | undefined;
|
|
998
1036
|
userEmail?: string | undefined;
|
|
999
1037
|
userName?: string | undefined;
|
|
@@ -1019,6 +1057,11 @@ export declare const slackUserSearchSlackOutputSchema: z.ZodObject<{
|
|
|
1019
1057
|
contents: {
|
|
1020
1058
|
channelId: string;
|
|
1021
1059
|
ts: string;
|
|
1060
|
+
members?: {
|
|
1061
|
+
userId?: string | undefined;
|
|
1062
|
+
userEmail?: string | undefined;
|
|
1063
|
+
userName?: string | undefined;
|
|
1064
|
+
}[] | undefined;
|
|
1022
1065
|
text?: string | undefined;
|
|
1023
1066
|
userEmail?: string | undefined;
|
|
1024
1067
|
userName?: string | undefined;
|
|
@@ -280,7 +280,7 @@ export const slackGetChannelMessagesOutputSchema = z.object({
|
|
|
280
280
|
export const slackUserSearchSlackParamsSchema = z.object({
|
|
281
281
|
emails: z
|
|
282
282
|
.array(z.string().email())
|
|
283
|
-
.describe("
|
|
283
|
+
.describe("List of participant emails to search conversations for. If a single email is provided, searches your 1:1 DM with that user as well as any channel discussions they participated in. If multiple emails are provided, searches group DMs/MPIMs with those participants and channel discussions where at least one of them posted. The current user is always excluded from the participant check.\n")
|
|
284
284
|
.optional(),
|
|
285
285
|
channel: z.string().describe('Channel name or ID. Examples - "#eng-updates", "eng-updates", "C01234567".').optional(),
|
|
286
286
|
topic: z.string().describe('Keyword(s) to search for (e.g., "jogging decision").').optional(),
|
|
@@ -311,6 +311,14 @@ export const slackUserSearchSlackOutputSchema = z.object({
|
|
|
311
311
|
.string()
|
|
312
312
|
.describe("A Slack permalink to the anchor (message or thread root), if resolvable.")
|
|
313
313
|
.optional(),
|
|
314
|
+
members: z
|
|
315
|
+
.array(z.object({
|
|
316
|
+
userId: z.string().describe("The ID of the member").optional(),
|
|
317
|
+
userEmail: z.string().describe("The email of the member").optional(),
|
|
318
|
+
userName: z.string().describe("The name of the member").optional(),
|
|
319
|
+
}))
|
|
320
|
+
.describe("The members of the result")
|
|
321
|
+
.optional(),
|
|
314
322
|
context: z
|
|
315
323
|
.array(z.object({
|
|
316
324
|
ts: z.string().describe("Timestamp of the contextual message."),
|
|
@@ -0,0 +1,261 @@
|
|
|
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, linearGetIssueDetailsDefinition, linearGetProjectsDefinition, linearGetProjectDetailsDefinition, linearGetTeamDetailsDefinition, linearGetTeamsDefinition, 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
|
+
export const ACTION_GROUPS = {
|
|
3
|
+
GENERIC: {
|
|
4
|
+
description: "Generic utility actions",
|
|
5
|
+
actions: [genericFillTemplateDefinition],
|
|
6
|
+
},
|
|
7
|
+
ASANA: {
|
|
8
|
+
description: "Actions for interacting with Asana",
|
|
9
|
+
actions: [
|
|
10
|
+
asanaCommentTaskDefinition,
|
|
11
|
+
asanaCreateTaskDefinition,
|
|
12
|
+
asanaUpdateTaskDefinition,
|
|
13
|
+
asanaSearchTasksDefinition,
|
|
14
|
+
asanaListAsanaTasksByProjectDefinition,
|
|
15
|
+
asanaGetTasksDetailsDefinition,
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
SLACK_LIST_CONVERSATIONS: {
|
|
19
|
+
description: "Actions for interacting with Slack",
|
|
20
|
+
actions: [
|
|
21
|
+
slackSendMessageDefinition,
|
|
22
|
+
slackGetChannelMessagesDefinition,
|
|
23
|
+
slackCreateChannelDefinition,
|
|
24
|
+
slackArchiveChannelDefinition,
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
CONFLUENCE: {
|
|
28
|
+
description: "Action for interacting with Confluence",
|
|
29
|
+
actions: [confluenceOverwritePageDefinition, confluenceFetchPageContentDefinition],
|
|
30
|
+
},
|
|
31
|
+
MATH_ADD: {
|
|
32
|
+
description: "Action for adding two numbers",
|
|
33
|
+
actions: [mathAddDefinition],
|
|
34
|
+
},
|
|
35
|
+
GOOGLE_MAPS: {
|
|
36
|
+
description: "Action for interacting with Google Maps",
|
|
37
|
+
actions: [googlemapsValidateAddressDefinition, googlemapsNearbysearchRestaurantsDefinition],
|
|
38
|
+
},
|
|
39
|
+
GOOGLE_DRIVE: {
|
|
40
|
+
description: "Action for interacting with Google Drive",
|
|
41
|
+
actions: [
|
|
42
|
+
googleOauthCreateNewGoogleDocDefinition,
|
|
43
|
+
googleOauthUpdateDocDefinition,
|
|
44
|
+
googleOauthCreateSpreadsheetDefinition,
|
|
45
|
+
googleOauthUpdateSpreadsheetDefinition,
|
|
46
|
+
googleOauthCreatePresentationDefinition,
|
|
47
|
+
googleOauthUpdatePresentationDefinition,
|
|
48
|
+
googleOauthSearchDriveByKeywordsDefinition,
|
|
49
|
+
googleOauthSearchDriveByQueryDefinition,
|
|
50
|
+
googleOauthSearchDriveByQueryAndGetFileContentDefinition,
|
|
51
|
+
googleOauthGetDriveFileContentByIdDefinition,
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
GOOGLE_CALENDAR: {
|
|
55
|
+
description: "Actions for interacting with Google Calendar",
|
|
56
|
+
actions: [
|
|
57
|
+
googleOauthScheduleCalendarMeetingDefinition,
|
|
58
|
+
googleOauthListCalendarsDefinition,
|
|
59
|
+
googleOauthListCalendarEventsDefinition,
|
|
60
|
+
googleOauthUpdateCalendarEventDefinition,
|
|
61
|
+
googleOauthDeleteCalendarEventDefinition,
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
GMAIL: {
|
|
65
|
+
description: "Actions for interacting with Gmail",
|
|
66
|
+
actions: [googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition],
|
|
67
|
+
},
|
|
68
|
+
LINKEDIN_SHARE_POST: {
|
|
69
|
+
description: "Action for creating a share post url on linkedin",
|
|
70
|
+
actions: [linkedinCreateShareLinkedinPostUrlDefinition],
|
|
71
|
+
},
|
|
72
|
+
ZENDESK_ACTIONS: {
|
|
73
|
+
description: "Actions for interacting with Zendesk",
|
|
74
|
+
actions: [
|
|
75
|
+
zendeskCreateZendeskTicketDefinition,
|
|
76
|
+
zendeskListZendeskTicketsDefinition,
|
|
77
|
+
zendeskGetTicketDetailsDefinition,
|
|
78
|
+
zendeskUpdateTicketStatusDefinition,
|
|
79
|
+
zendeskAddCommentToTicketDefinition,
|
|
80
|
+
zendeskAssignTicketDefinition,
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
BING_SEARCH: {
|
|
84
|
+
description: "Action for searching Bing",
|
|
85
|
+
actions: [bingGetTopNSearchResultUrlsDefinition],
|
|
86
|
+
},
|
|
87
|
+
MONGO_INSERT_DOC: {
|
|
88
|
+
description: "Action for inserting a document into a MongoDB collection",
|
|
89
|
+
actions: [mongoInsertMongoDocDefinition],
|
|
90
|
+
},
|
|
91
|
+
SNOWFLAKE_ACTIONS: {
|
|
92
|
+
description: "Action for getting content from a Snowflake table",
|
|
93
|
+
actions: [snowflakeGetRowByFieldValueDefinition, snowflakeRunSnowflakeQueryDefinition],
|
|
94
|
+
},
|
|
95
|
+
JIRA_ACTIONS: {
|
|
96
|
+
description: "Action for interacting with Jira tickets",
|
|
97
|
+
actions: [
|
|
98
|
+
jiraAssignJiraTicketDefinition,
|
|
99
|
+
jiraCreateJiraTicketDefinition,
|
|
100
|
+
jiraCommentJiraTicketDefinition,
|
|
101
|
+
jiraGetJiraTicketDetailsDefinition,
|
|
102
|
+
jiraGetJiraTicketHistoryDefinition,
|
|
103
|
+
jiraUpdateJiraTicketDetailsDefinition,
|
|
104
|
+
jiraUpdateJiraTicketStatusDefinition,
|
|
105
|
+
jiraGetJiraIssuesByQueryDefinition,
|
|
106
|
+
jiraGetServiceDesksDefinition,
|
|
107
|
+
jiraCreateServiceDeskRequestDefinition,
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
JIRA_ORG_ACTIONS: {
|
|
111
|
+
description: "Action for interacting with Jira tickets",
|
|
112
|
+
actions: [
|
|
113
|
+
jiraOrgAssignJiraTicketDefinition,
|
|
114
|
+
jiraOrgCreateJiraTicketDefinition,
|
|
115
|
+
jiraOrgCommentJiraTicketDefinition,
|
|
116
|
+
jiraOrgGetJiraTicketDetailsDefinition,
|
|
117
|
+
jiraOrgGetJiraTicketHistoryDefinition,
|
|
118
|
+
jiraOrgUpdateJiraTicketDetailsDefinition,
|
|
119
|
+
jiraOrgUpdateJiraTicketStatusDefinition,
|
|
120
|
+
jiraOrgGetJiraIssuesByQueryDefinition,
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
|
|
124
|
+
description: "Action for getting the latitude and longitude of a location",
|
|
125
|
+
actions: [openstreetmapGetLatitudeLongitudeFromLocationDefinition],
|
|
126
|
+
},
|
|
127
|
+
NWS_GET_FORECAST_FOR_LOCATION: {
|
|
128
|
+
description: "Action for getting the weather forecast for a location",
|
|
129
|
+
actions: [nwsGetForecastForLocationDefinition],
|
|
130
|
+
},
|
|
131
|
+
FIRECRAWL: {
|
|
132
|
+
description: "Actions for interacting with Firecrawl",
|
|
133
|
+
actions: [
|
|
134
|
+
firecrawlScrapeUrlDefinition,
|
|
135
|
+
firecrawlScrapeTweetDataWithNitterDefinition,
|
|
136
|
+
firecrawlDeepResearchDefinition,
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
RESEND: {
|
|
140
|
+
description: "Action for sending an email",
|
|
141
|
+
actions: [resendSendEmailDefinition],
|
|
142
|
+
},
|
|
143
|
+
X: {
|
|
144
|
+
description: "Actions for interacting with X(formerly twitter)",
|
|
145
|
+
actions: [xCreateShareXPostUrlDefinition],
|
|
146
|
+
},
|
|
147
|
+
GONG: {
|
|
148
|
+
description: "Actions for interacting with Gong",
|
|
149
|
+
actions: [gongGetGongTranscriptsDefinition],
|
|
150
|
+
},
|
|
151
|
+
FINNHUB: {
|
|
152
|
+
description: "Action for interacting with Finnhub for stock market data",
|
|
153
|
+
actions: [finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition],
|
|
154
|
+
},
|
|
155
|
+
JAMF: {
|
|
156
|
+
description: "Actions for interacting with Jamf",
|
|
157
|
+
actions: [
|
|
158
|
+
jamfGetJamfComputerInventoryDefinition,
|
|
159
|
+
jamfGetJamfFileVaultRecoveryKeyDefinition,
|
|
160
|
+
jamfGetJamfUserComputerIdDefinition,
|
|
161
|
+
jamfLockJamfComputerByIdDefinition,
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
LOOKER: {
|
|
165
|
+
description: "Actions for interacting with Looker",
|
|
166
|
+
actions: [lookerEnableUserByEmailDefinition],
|
|
167
|
+
},
|
|
168
|
+
SALESFORCE: {
|
|
169
|
+
description: "Actions for interacting with Salesforce",
|
|
170
|
+
actions: [
|
|
171
|
+
salesforceUpdateRecordDefinition,
|
|
172
|
+
salesforceCreateRecordDefinition,
|
|
173
|
+
salesforceCreateCaseDefinition,
|
|
174
|
+
salesforceGenerateSalesReportDefinition,
|
|
175
|
+
salesforceGetRecordDefinition,
|
|
176
|
+
salesforceGetSalesforceRecordsByQueryDefinition,
|
|
177
|
+
salesforceFetchSalesforceSchemaByObjectDefinition,
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
MICROSOFT: {
|
|
181
|
+
description: "Actions for interacting with Microsoft 365",
|
|
182
|
+
actions: [
|
|
183
|
+
microsoftMessageTeamsChatDefinition,
|
|
184
|
+
microsoftMessageTeamsChannelDefinition,
|
|
185
|
+
microsoftUpdateSpreadsheetDefinition,
|
|
186
|
+
microsoftUpdateDocumentDefinition,
|
|
187
|
+
microsoftCreateDocumentDefinition,
|
|
188
|
+
microsoftGetDocumentDefinition,
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
KANDJI: {
|
|
192
|
+
description: "Actions for interacting with Kandji",
|
|
193
|
+
actions: [kandjiGetFVRecoveryKeyForDeviceDefinition],
|
|
194
|
+
},
|
|
195
|
+
GITHUB: {
|
|
196
|
+
description: "Actions for interacting with GitHub",
|
|
197
|
+
actions: [
|
|
198
|
+
githubCreateOrUpdateFileDefinition,
|
|
199
|
+
githubCreateBranchDefinition,
|
|
200
|
+
githubCreatePullRequestDefinition,
|
|
201
|
+
githubListPullRequestsDefinition,
|
|
202
|
+
githubGetFileContentDefinition,
|
|
203
|
+
githubListDirectoryDefinition,
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
ASHBY: {
|
|
207
|
+
description: "Actions for interacting with Ashby",
|
|
208
|
+
actions: [
|
|
209
|
+
ashbyCreateNoteDefinition,
|
|
210
|
+
ashbyGetCandidateInfoDefinition,
|
|
211
|
+
ashbyListCandidatesDefinition,
|
|
212
|
+
ashbyListCandidateNotesDefinition,
|
|
213
|
+
ashbySearchCandidatesDefinition,
|
|
214
|
+
ashbyCreateCandidateDefinition,
|
|
215
|
+
ashbyUpdateCandidateDefinition,
|
|
216
|
+
ashbyAddCandidateToProjectDefinition,
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
NOTION: {
|
|
220
|
+
description: "Actions for interacting with Notion",
|
|
221
|
+
actions: [notionSearchByTitleDefinition],
|
|
222
|
+
},
|
|
223
|
+
GOOGLE_GROUPS: {
|
|
224
|
+
description: "Google Workspace Groups management actions",
|
|
225
|
+
actions: [
|
|
226
|
+
googleOauthListGroupsDefinition,
|
|
227
|
+
googleOauthGetGroupDefinition,
|
|
228
|
+
googleOauthListGroupMembersDefinition,
|
|
229
|
+
googleOauthHasGroupMemberDefinition,
|
|
230
|
+
googleOauthAddGroupMemberDefinition,
|
|
231
|
+
googleOauthDeleteGroupMemberDefinition,
|
|
232
|
+
],
|
|
233
|
+
},
|
|
234
|
+
OKTA: {
|
|
235
|
+
description: "Actions for interacting with Okta",
|
|
236
|
+
actions: [
|
|
237
|
+
oktaListOktaUsersDefinition,
|
|
238
|
+
oktaGetOktaUserDefinition,
|
|
239
|
+
oktaListOktaUserGroupsDefinition,
|
|
240
|
+
oktaListOktaGroupsDefinition,
|
|
241
|
+
oktaGetOktaGroupDefinition,
|
|
242
|
+
oktaListOktaGroupMembersDefinition,
|
|
243
|
+
oktaRemoveUserFromGroupDefinition,
|
|
244
|
+
oktaAddUserToGroupDefinition,
|
|
245
|
+
oktaResetPasswordDefinition,
|
|
246
|
+
oktaResetMFADefinition,
|
|
247
|
+
oktaListMFADefinition,
|
|
248
|
+
oktaTriggerOktaWorkflowDefinition,
|
|
249
|
+
],
|
|
250
|
+
},
|
|
251
|
+
LINEAR: {
|
|
252
|
+
description: "Actions for interacting with Linear",
|
|
253
|
+
actions: [
|
|
254
|
+
linearGetIssueDetailsDefinition,
|
|
255
|
+
linearGetProjectsDefinition,
|
|
256
|
+
linearGetProjectDetailsDefinition,
|
|
257
|
+
linearGetTeamDetailsDefinition,
|
|
258
|
+
linearGetTeamsDefinition,
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
function getConfluenceApi(baseUrl, username, apiToken) {
|
|
17
|
+
const api = axios_1.default.create({
|
|
18
|
+
baseURL: baseUrl,
|
|
19
|
+
headers: {
|
|
20
|
+
Accept: "application/json",
|
|
21
|
+
// Tokens are associated with a specific user.
|
|
22
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
return api;
|
|
26
|
+
}
|
|
27
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
28
|
+
const { pageId, username, content, title } = params;
|
|
29
|
+
const { baseUrl, authToken } = authParams;
|
|
30
|
+
const api = getConfluenceApi(baseUrl, username, authToken);
|
|
31
|
+
// Get current version number
|
|
32
|
+
const response = yield api.get(`/api/v2/pages/${pageId}`);
|
|
33
|
+
const currVersion = response.data.version.number;
|
|
34
|
+
yield api.put(`/api/v2/pages/${pageId}`, {
|
|
35
|
+
id: pageId,
|
|
36
|
+
status: "current",
|
|
37
|
+
title,
|
|
38
|
+
body: {
|
|
39
|
+
representation: "storage",
|
|
40
|
+
value: content,
|
|
41
|
+
},
|
|
42
|
+
version: {
|
|
43
|
+
number: currVersion + 1,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
exports.default = confluenceUpdatePage;
|
|
@@ -0,0 +1,36 @@
|
|
|
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;
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
|
+
import { getProjectPath } from "./utils.js";
|
|
11
12
|
const GITLAB_API_URL = "https://gitlab.com";
|
|
12
13
|
function gitlabFetch(endpoint, authToken) {
|
|
13
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -42,7 +43,9 @@ const getFileContent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
|
|
|
42
43
|
return { success: false, error: `Unexpected response: ${JSON.stringify(data)}` };
|
|
43
44
|
}
|
|
44
45
|
const content = Buffer.from(data.content, "base64").toString("utf-8");
|
|
45
|
-
|
|
46
|
+
// Get the project path to construct the correct web URL
|
|
47
|
+
const url = data.web_url ||
|
|
48
|
+
`${gitlabBaseUrl}/${yield getProjectPath(project_id, authToken, `${gitlabBaseUrl}/api/v4`)}/-/blob/${ref}/${path}`;
|
|
46
49
|
return {
|
|
47
50
|
success: true,
|
|
48
51
|
results: [
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
|
+
import { createProjectPathCache, getProjectPath, gitlabFetch } from "./utils.js";
|
|
11
12
|
const GITLAB_API_URL = "https://gitlab.com";
|
|
12
13
|
const MAX_CODE_RESULTS = 15;
|
|
13
14
|
const MAX_COMMITS = 10;
|
|
@@ -16,33 +17,6 @@ const MAX_ISSUES_OR_PRS = 10;
|
|
|
16
17
|
const MAX_FILES_PER_PR = 5;
|
|
17
18
|
const MAX_PATCH_LINES = 20;
|
|
18
19
|
const MAX_FRAGMENT_LINES = 20;
|
|
19
|
-
function createProjectPathCache() {
|
|
20
|
-
return new Map();
|
|
21
|
-
}
|
|
22
|
-
function gitlabFetch(endpoint, authToken) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const res = yield fetch(endpoint, { headers: { Authorization: `Bearer ${authToken}` } });
|
|
25
|
-
if (!res.ok)
|
|
26
|
-
throw new Error(`GitLab API error: ${res.status} ${res.statusText}`);
|
|
27
|
-
return res.json();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function getProjectPath(projectId, authToken, baseUrl, projectPathCache) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (projectPathCache.has(projectId))
|
|
33
|
-
return projectPathCache.get(projectId);
|
|
34
|
-
try {
|
|
35
|
-
const project = yield gitlabFetch(`${baseUrl}/projects/${projectId}`, authToken);
|
|
36
|
-
const path = project.path_with_namespace;
|
|
37
|
-
projectPathCache.set(projectId, path);
|
|
38
|
-
return path;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
console.warn(`Failed to fetch project path for project ${projectId}:`, error);
|
|
42
|
-
return `project-${projectId}`;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
20
|
function constructBlobUrl(input) {
|
|
47
21
|
const { baseUrl, projectPath, ref, path, startline } = input;
|
|
48
22
|
let url = `${baseUrl}/${projectPath}/-/blob/${ref}/${path}`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function gitlabFetch<T = unknown>(endpoint: string, authToken: string): Promise<T>;
|
|
2
|
+
export declare function getProjectPath(projectId: number, authToken: string, baseUrl: string, projectPathCache?: Map<number, string>): Promise<string>;
|
|
3
|
+
export declare function createProjectPathCache(): Map<number, string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
export function gitlabFetch(endpoint, authToken) {
|
|
11
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const res = yield fetch(endpoint, { headers: { Authorization: `Bearer ${authToken}` } });
|
|
13
|
+
if (!res.ok)
|
|
14
|
+
throw new Error(`GitLab API error: ${res.status} ${res.statusText}`);
|
|
15
|
+
return res.json();
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export function getProjectPath(projectId, authToken, baseUrl, projectPathCache) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
if (projectPathCache && projectPathCache.has(projectId))
|
|
21
|
+
return projectPathCache.get(projectId);
|
|
22
|
+
try {
|
|
23
|
+
const project = yield gitlabFetch(`${baseUrl}/projects/${projectId}`, authToken);
|
|
24
|
+
const path = project.path_with_namespace;
|
|
25
|
+
if (projectPathCache)
|
|
26
|
+
projectPathCache.set(projectId, path);
|
|
27
|
+
return path;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.warn(`Failed to fetch project path for project ${projectId}:`, error);
|
|
31
|
+
return `project-${projectId}`;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export function createProjectPathCache() {
|
|
36
|
+
return new Map();
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as add from "./add";
|