@credal/actions 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.js +374 -380
- package/dist/actions/autogen/templates.js +94 -98
- package/dist/actions/autogen/types.js +1621 -1627
- package/dist/actions/groups.js +88 -91
- package/dist/actions/invoke.js +5 -8
- package/dist/actions/parse.js +28 -33
- package/dist/actions/providers/asana/commentAsanaTask.js +5 -7
- package/dist/actions/providers/asana/createAsanaTask.js +9 -11
- package/dist/actions/providers/asana/getTasksDetails.js +9 -11
- package/dist/actions/providers/asana/listAsanaTasksByProject.js +46 -51
- package/dist/actions/providers/asana/searchAsanaTasks.js +6 -8
- package/dist/actions/providers/asana/updateAsanaTask.js +8 -10
- package/dist/actions/providers/asana/utils.js +7 -12
- package/dist/actions/providers/ashby/addCandidateToProject.js +5 -7
- package/dist/actions/providers/ashby/createCandidate.js +5 -7
- package/dist/actions/providers/ashby/createNote.js +5 -7
- package/dist/actions/providers/ashby/getCandidateInfo.js +5 -7
- package/dist/actions/providers/ashby/listCandidateNotes.js +5 -7
- package/dist/actions/providers/ashby/listCandidates.js +5 -7
- package/dist/actions/providers/ashby/searchCandidates.js +5 -7
- package/dist/actions/providers/ashby/updateCandidate.js +5 -7
- package/dist/actions/providers/bing/getTopNSearchResultUrls.js +5 -7
- package/dist/actions/providers/confluence/fetchPageContent.js +8 -10
- package/dist/actions/providers/confluence/helpers.js +1 -4
- package/dist/actions/providers/confluence/overwritePage.js +9 -11
- package/dist/actions/providers/finnhub/getBasicFinancials.js +6 -8
- package/dist/actions/providers/finnhub/symbolLookup.js +6 -8
- package/dist/actions/providers/firecrawl/deepResearch.js +5 -10
- package/dist/actions/providers/firecrawl/scrapeTweetDataWithNitter.js +5 -10
- package/dist/actions/providers/firecrawl/scrapeUrl.js +5 -10
- package/dist/actions/providers/generic/fillTemplate.js +1 -3
- package/dist/actions/providers/github/createBranch.js +4 -39
- package/dist/actions/providers/github/createOrUpdateFile.js +6 -41
- package/dist/actions/providers/github/createPullRequest.js +4 -39
- package/dist/actions/providers/github/listPullRequests.js +7 -12
- package/dist/actions/providers/gong/getGongTranscripts.js +49 -84
- package/dist/actions/providers/google-oauth/addGroupMember.js +5 -7
- package/dist/actions/providers/google-oauth/createNewGoogleDoc.js +6 -8
- package/dist/actions/providers/google-oauth/createPresentation.js +5 -7
- package/dist/actions/providers/google-oauth/createSpreadsheet.js +5 -10
- package/dist/actions/providers/google-oauth/deleteCalendarEvent.js +5 -7
- package/dist/actions/providers/google-oauth/deleteGroupMember.js +5 -7
- package/dist/actions/providers/google-oauth/getGroup.js +5 -7
- package/dist/actions/providers/google-oauth/hasGroupMember.js +5 -7
- package/dist/actions/providers/google-oauth/listCalendarEvents.js +5 -7
- package/dist/actions/providers/google-oauth/listCalendars.js +5 -7
- package/dist/actions/providers/google-oauth/listGroupMembers.js +5 -7
- package/dist/actions/providers/google-oauth/listGroups.js +5 -7
- package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +7 -9
- package/dist/actions/providers/google-oauth/searchDriveByKeywords.js +5 -7
- package/dist/actions/providers/google-oauth/updateCalendarEvent.js +5 -7
- package/dist/actions/providers/google-oauth/updateDoc.js +5 -10
- package/dist/actions/providers/google-oauth/updatePresentation.js +5 -7
- package/dist/actions/providers/google-oauth/updateSpreadsheet.js +5 -7
- package/dist/actions/providers/google-oauth/utils/decodeMessage.js +2 -6
- package/dist/actions/providers/googlemail/listGmailThreads.js +8 -10
- package/dist/actions/providers/googlemail/searchGmailMessages.js +8 -10
- package/dist/actions/providers/googlemaps/nearbysearchRestaurants.js +5 -7
- package/dist/actions/providers/googlemaps/validateAddress.js +3 -5
- package/dist/actions/providers/jamf/getJamfComputerInventory.js +3 -5
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +3 -5
- package/dist/actions/providers/jira/assignJiraTicket.js +5 -10
- package/dist/actions/providers/jira/commentJiraTicket.js +3 -5
- package/dist/actions/providers/jira/createJiraTicket.js +6 -8
- package/dist/actions/providers/jira/getJiraIssuesByQuery.js +4 -6
- package/dist/actions/providers/jira/getJiraTicketDetails.js +3 -5
- package/dist/actions/providers/jira/getJiraTicketHistory.js +3 -5
- package/dist/actions/providers/jira/updateJiraTicketDetails.js +3 -5
- package/dist/actions/providers/jira/updateJiraTicketStatus.js +4 -6
- package/dist/actions/providers/jira/utils.js +3 -6
- package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +4 -6
- package/dist/actions/providers/linkedin/createSharePostLinkedinUrl.js +1 -3
- package/dist/actions/providers/looker/enableUserByEmail.js +5 -7
- package/dist/actions/providers/math/add.js +1 -3
- package/dist/actions/providers/microsoft/createDocument.js +5 -7
- package/dist/actions/providers/microsoft/getDocument.js +3 -5
- package/dist/actions/providers/microsoft/messageTeamsChannel.js +4 -6
- package/dist/actions/providers/microsoft/messageTeamsChat.js +4 -6
- package/dist/actions/providers/microsoft/updateDocument.js +4 -6
- package/dist/actions/providers/microsoft/updateSpreadsheet.js +4 -6
- package/dist/actions/providers/microsoft/utils.js +6 -10
- package/dist/actions/providers/mongodb/insertMongoDoc.js +3 -5
- package/dist/actions/providers/notion/searchByTitle.js +5 -10
- package/dist/actions/providers/nws/getForecastForLocation.js +7 -9
- package/dist/actions/providers/openstreetmap/getLatitudeLongitudeFromLocation.js +3 -5
- package/dist/actions/providers/resend/sendEmail.js +6 -8
- package/dist/actions/providers/salesforce/createCase.js +3 -5
- package/dist/actions/providers/salesforce/createRecord.js +4 -6
- package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +3 -5
- package/dist/actions/providers/salesforce/generateSalesReport.js +3 -5
- package/dist/actions/providers/salesforce/getRecord.js +3 -5
- package/dist/actions/providers/salesforce/getSalesforceRecordsByQuery.js +4 -6
- package/dist/actions/providers/salesforce/updateRecord.js +3 -5
- package/dist/actions/providers/slack/getChannelMessages.js +7 -9
- package/dist/actions/providers/slack/helpers.js +1 -4
- package/dist/actions/providers/slack/sendMessage.js +10 -12
- package/dist/actions/providers/snowflake/auth/getSnowflakeConnection.js +4 -41
- package/dist/actions/providers/snowflake/getRowByFieldValue.js +3 -5
- package/dist/actions/providers/snowflake/runSnowflakeQuery.js +8 -13
- package/dist/actions/providers/x/createXSharePostUrl.js +1 -3
- package/dist/actions/providers/zendesk/addCommentToTicket.js +5 -7
- package/dist/actions/providers/zendesk/assignTicket.js +5 -7
- package/dist/actions/providers/zendesk/createZendeskTicket.js +5 -7
- package/dist/actions/providers/zendesk/getTicketDetails.js +5 -7
- package/dist/actions/providers/zendesk/listTickets.js +5 -7
- package/dist/actions/providers/zendesk/updateTicketStatus.js +5 -7
- package/dist/actions/util/axiosClient.js +4 -11
- package/dist/actions/util/formatDataForCodeInterpreter.js +1 -4
- package/dist/actions/util/missingAuthConstants.js +2 -5
- package/dist/app.js +5 -42
- package/dist/index.js +4 -24
- package/dist/server.d.ts +2 -0
- package/dist/server.js +8 -0
- package/dist/utils/datetime.js +4 -8
- package/dist/utils/string.js +1 -4
- package/package.json +2 -1
- package/dist/actions/providers/credal/callCopilot.d.ts +0 -3
- package/dist/actions/providers/credal/callCopilot.js +0 -36
- package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +0 -3
- package/dist/actions/providers/google-oauth/listGmailThreads.js +0 -98
- package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchGmailMessages.js +0 -91
- package/dist/actions/providers/jamf/getComputerInventory.d.ts +0 -3
- package/dist/actions/providers/jamf/getComputerInventory.js +0 -45
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.d.ts +0 -3
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.js +0 -40
- package/dist/actions/providers/math/index.d.ts +0 -1
- package/dist/actions/providers/math/index.js +0 -37
- package/dist/actions/providers/slack/index.d.ts +0 -1
- package/dist/actions/providers/slack/index.js +0 -37
- package/dist/actions/providers/slack/listConversations.d.ts +0 -3
- package/dist/actions/providers/slack/listConversations.js +0 -41
package/dist/actions/groups.js
CHANGED
@@ -1,207 +1,204 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.ACTION_GROUPS = void 0;
|
4
|
-
const templates_1 = require("../actions/autogen/templates");
|
5
|
-
exports.ACTION_GROUPS = {
|
1
|
+
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, 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, } from "../actions/autogen/templates";
|
2
|
+
export const ACTION_GROUPS = {
|
6
3
|
GENERIC: {
|
7
4
|
description: "Generic utility actions",
|
8
|
-
actions: [
|
5
|
+
actions: [genericFillTemplateDefinition],
|
9
6
|
},
|
10
7
|
ASANA: {
|
11
8
|
description: "Actions for interacting with Asana",
|
12
9
|
actions: [
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
asanaCommentTaskDefinition,
|
11
|
+
asanaCreateTaskDefinition,
|
12
|
+
asanaUpdateTaskDefinition,
|
13
|
+
asanaSearchTasksDefinition,
|
14
|
+
asanaListAsanaTasksByProjectDefinition,
|
15
|
+
asanaGetTasksDetailsDefinition,
|
19
16
|
],
|
20
17
|
},
|
21
18
|
SLACK_LIST_CONVERSATIONS: {
|
22
19
|
description: "Actions for interacting with Slack",
|
23
|
-
actions: [
|
20
|
+
actions: [slackSendMessageDefinition, slackGetChannelMessagesDefinition],
|
24
21
|
},
|
25
22
|
CONFLUENCE: {
|
26
23
|
description: "Action for interacting with Confluence",
|
27
|
-
actions: [
|
24
|
+
actions: [confluenceOverwritePageDefinition, confluenceFetchPageContentDefinition],
|
28
25
|
},
|
29
26
|
MATH_ADD: {
|
30
27
|
description: "Action for adding two numbers",
|
31
|
-
actions: [
|
28
|
+
actions: [mathAddDefinition],
|
32
29
|
},
|
33
30
|
GOOGLE_MAPS: {
|
34
31
|
description: "Action for interacting with Google Maps",
|
35
|
-
actions: [
|
32
|
+
actions: [googlemapsValidateAddressDefinition, googlemapsNearbysearchRestaurantsDefinition],
|
36
33
|
},
|
37
34
|
GOOGLE_DRIVE: {
|
38
35
|
description: "Action for interacting with Google Drive",
|
39
36
|
actions: [
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
37
|
+
googleOauthCreateNewGoogleDocDefinition,
|
38
|
+
googleOauthUpdateDocDefinition,
|
39
|
+
googleOauthCreateSpreadsheetDefinition,
|
40
|
+
googleOauthUpdateSpreadsheetDefinition,
|
41
|
+
googleOauthCreatePresentationDefinition,
|
42
|
+
googleOauthUpdatePresentationDefinition,
|
43
|
+
googleOauthSearchDriveByKeywordsDefinition,
|
47
44
|
],
|
48
45
|
},
|
49
46
|
GOOGLE_CALENDAR: {
|
50
47
|
description: "Actions for interacting with Google Calendar",
|
51
48
|
actions: [
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
googleOauthScheduleCalendarMeetingDefinition,
|
50
|
+
googleOauthListCalendarsDefinition,
|
51
|
+
googleOauthListCalendarEventsDefinition,
|
52
|
+
googleOauthUpdateCalendarEventDefinition,
|
53
|
+
googleOauthDeleteCalendarEventDefinition,
|
57
54
|
],
|
58
55
|
},
|
59
56
|
GMAIL: {
|
60
57
|
description: "Actions for interacting with Gmail",
|
61
|
-
actions: [
|
58
|
+
actions: [googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition],
|
62
59
|
},
|
63
60
|
LINKEDIN_SHARE_POST: {
|
64
61
|
description: "Action for creating a share post url on linkedin",
|
65
|
-
actions: [
|
62
|
+
actions: [linkedinCreateShareLinkedinPostUrlDefinition],
|
66
63
|
},
|
67
64
|
ZENDESK_ACTIONS: {
|
68
65
|
description: "Actions for interacting with Zendesk",
|
69
66
|
actions: [
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
67
|
+
zendeskCreateZendeskTicketDefinition,
|
68
|
+
zendeskListZendeskTicketsDefinition,
|
69
|
+
zendeskGetTicketDetailsDefinition,
|
70
|
+
zendeskUpdateTicketStatusDefinition,
|
71
|
+
zendeskAddCommentToTicketDefinition,
|
72
|
+
zendeskAssignTicketDefinition,
|
76
73
|
],
|
77
74
|
},
|
78
75
|
BING_SEARCH: {
|
79
76
|
description: "Action for searching Bing",
|
80
|
-
actions: [
|
77
|
+
actions: [bingGetTopNSearchResultUrlsDefinition],
|
81
78
|
},
|
82
79
|
MONGO_INSERT_DOC: {
|
83
80
|
description: "Action for inserting a document into a MongoDB collection",
|
84
|
-
actions: [
|
81
|
+
actions: [mongoInsertMongoDocDefinition],
|
85
82
|
},
|
86
83
|
SNOWFLAKE_ACTIONS: {
|
87
84
|
description: "Action for getting content from a Snowflake table",
|
88
|
-
actions: [
|
85
|
+
actions: [snowflakeGetRowByFieldValueDefinition, snowflakeRunSnowflakeQueryDefinition],
|
89
86
|
},
|
90
87
|
JIRA_ACTIONS: {
|
91
88
|
description: "Action for interacting with Jira tickets",
|
92
89
|
actions: [
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
90
|
+
jiraAssignJiraTicketDefinition,
|
91
|
+
jiraCreateJiraTicketDefinition,
|
92
|
+
jiraCommentJiraTicketDefinition,
|
93
|
+
jiraGetJiraTicketDetailsDefinition,
|
94
|
+
jiraGetJiraTicketHistoryDefinition,
|
95
|
+
jiraUpdateJiraTicketDetailsDefinition,
|
96
|
+
jiraUpdateJiraTicketStatusDefinition,
|
97
|
+
jiraGetJiraIssuesByQueryDefinition,
|
101
98
|
],
|
102
99
|
},
|
103
100
|
OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
|
104
101
|
description: "Action for getting the latitude and longitude of a location",
|
105
|
-
actions: [
|
102
|
+
actions: [openstreetmapGetLatitudeLongitudeFromLocationDefinition],
|
106
103
|
},
|
107
104
|
NWS_GET_FORECAST_FOR_LOCATION: {
|
108
105
|
description: "Action for getting the weather forecast for a location",
|
109
|
-
actions: [
|
106
|
+
actions: [nwsGetForecastForLocationDefinition],
|
110
107
|
},
|
111
108
|
FIRECRAWL: {
|
112
109
|
description: "Actions for interacting with Firecrawl",
|
113
110
|
actions: [
|
114
|
-
|
115
|
-
|
116
|
-
|
111
|
+
firecrawlScrapeUrlDefinition,
|
112
|
+
firecrawlScrapeTweetDataWithNitterDefinition,
|
113
|
+
firecrawlDeepResearchDefinition,
|
117
114
|
],
|
118
115
|
},
|
119
116
|
RESEND: {
|
120
117
|
description: "Action for sending an email",
|
121
|
-
actions: [
|
118
|
+
actions: [resendSendEmailDefinition],
|
122
119
|
},
|
123
120
|
X: {
|
124
121
|
description: "Actions for interacting with X(formerly twitter)",
|
125
|
-
actions: [
|
122
|
+
actions: [xCreateShareXPostUrlDefinition],
|
126
123
|
},
|
127
124
|
GONG: {
|
128
125
|
description: "Actions for interacting with Gong",
|
129
|
-
actions: [
|
126
|
+
actions: [gongGetGongTranscriptsDefinition],
|
130
127
|
},
|
131
128
|
FINNHUB: {
|
132
129
|
description: "Action for interacting with Finnhub for stock market data",
|
133
|
-
actions: [
|
130
|
+
actions: [finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition],
|
134
131
|
},
|
135
132
|
JAMF: {
|
136
133
|
description: "Actions for interacting with Jamf",
|
137
|
-
actions: [
|
134
|
+
actions: [jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition],
|
138
135
|
},
|
139
136
|
LOOKER: {
|
140
137
|
description: "Actions for interacting with Looker",
|
141
|
-
actions: [
|
138
|
+
actions: [lookerEnableUserByEmailDefinition],
|
142
139
|
},
|
143
140
|
SALESFORCE: {
|
144
141
|
description: "Actions for interacting with Salesforce",
|
145
142
|
actions: [
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
143
|
+
salesforceUpdateRecordDefinition,
|
144
|
+
salesforceCreateRecordDefinition,
|
145
|
+
salesforceCreateCaseDefinition,
|
146
|
+
salesforceGenerateSalesReportDefinition,
|
147
|
+
salesforceGetRecordDefinition,
|
148
|
+
salesforceGetSalesforceRecordsByQueryDefinition,
|
149
|
+
salesforceFetchSalesforceSchemaByObjectDefinition,
|
153
150
|
],
|
154
151
|
},
|
155
152
|
MICROSOFT: {
|
156
153
|
description: "Actions for interacting with Microsoft 365",
|
157
154
|
actions: [
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
155
|
+
microsoftMessageTeamsChatDefinition,
|
156
|
+
microsoftMessageTeamsChannelDefinition,
|
157
|
+
microsoftUpdateSpreadsheetDefinition,
|
158
|
+
microsoftUpdateDocumentDefinition,
|
159
|
+
microsoftCreateDocumentDefinition,
|
160
|
+
microsoftGetDocumentDefinition,
|
164
161
|
],
|
165
162
|
},
|
166
163
|
KANDJI: {
|
167
164
|
description: "Actions for interacting with Kandji",
|
168
|
-
actions: [
|
165
|
+
actions: [kandjiGetFVRecoveryKeyForDeviceDefinition],
|
169
166
|
},
|
170
167
|
GITHUB: {
|
171
168
|
description: "Actions for interacting with GitHub",
|
172
169
|
actions: [
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
170
|
+
githubCreateOrUpdateFileDefinition,
|
171
|
+
githubCreateBranchDefinition,
|
172
|
+
githubCreatePullRequestDefinition,
|
173
|
+
githubListPullRequestsDefinition,
|
177
174
|
],
|
178
175
|
},
|
179
176
|
ASHBY: {
|
180
177
|
description: "Actions for interacting with Ashby",
|
181
178
|
actions: [
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
179
|
+
ashbyCreateNoteDefinition,
|
180
|
+
ashbyGetCandidateInfoDefinition,
|
181
|
+
ashbyListCandidatesDefinition,
|
182
|
+
ashbyListCandidateNotesDefinition,
|
183
|
+
ashbySearchCandidatesDefinition,
|
184
|
+
ashbyCreateCandidateDefinition,
|
185
|
+
ashbyUpdateCandidateDefinition,
|
186
|
+
ashbyAddCandidateToProjectDefinition,
|
190
187
|
],
|
191
188
|
},
|
192
189
|
NOTION: {
|
193
190
|
description: "Actions for interacting with Notion",
|
194
|
-
actions: [
|
191
|
+
actions: [notionSearchByTitleDefinition],
|
195
192
|
},
|
196
193
|
GOOGLE_GROUPS: {
|
197
194
|
description: "Google Workspace Groups management actions",
|
198
195
|
actions: [
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
196
|
+
googleOauthListGroupsDefinition,
|
197
|
+
googleOauthGetGroupDefinition,
|
198
|
+
googleOauthListGroupMembersDefinition,
|
199
|
+
googleOauthHasGroupMemberDefinition,
|
200
|
+
googleOauthAddGroupMemberDefinition,
|
201
|
+
googleOauthDeleteGroupMemberDefinition,
|
205
202
|
],
|
206
203
|
},
|
207
204
|
};
|
package/dist/actions/invoke.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,17 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
const actionMapper_1 = require("./actionMapper");
|
14
|
-
function invokeAction(input) {
|
10
|
+
import { ActionMapper } from "./actionMapper";
|
11
|
+
export function invokeAction(input) {
|
15
12
|
return __awaiter(this, void 0, void 0, function* () {
|
16
13
|
const { provider, name, parameters, authParams } = input;
|
17
|
-
if (!
|
14
|
+
if (!ActionMapper[provider]) {
|
18
15
|
throw new Error(`Provider '${provider}' not found`);
|
19
16
|
}
|
20
|
-
const providerFunction =
|
21
|
-
const safeParseParams =
|
17
|
+
const providerFunction = ActionMapper[provider][name].fn;
|
18
|
+
const safeParseParams = ActionMapper[provider][name].paramsSchema.safeParse(parameters);
|
22
19
|
if (!safeParseParams.success) {
|
23
20
|
throw new Error(`Invalid parameters for action '${name}': ${safeParseParams.error}`);
|
24
21
|
}
|
package/dist/actions/parse.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,35 +7,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
const jsonObjectSchema = zod_1.z.object({
|
23
|
-
type: zod_1.z.string(),
|
24
|
-
required: zod_1.z.array(zod_1.z.string()),
|
25
|
-
properties: zod_1.z.record(zod_1.z.string(), zod_1.z.any()), // Permissive for now, validate using JSON schema later
|
10
|
+
import Ajv from "ajv";
|
11
|
+
import fs from "fs/promises";
|
12
|
+
import yaml from "js-yaml";
|
13
|
+
import convert from "json-schema-to-zod";
|
14
|
+
import { Project, VariableDeclarationKind } from "ts-morph";
|
15
|
+
import { z } from "zod";
|
16
|
+
import { snakeToPascal } from "../utils/string";
|
17
|
+
const jsonObjectSchema = z.object({
|
18
|
+
type: z.string(),
|
19
|
+
required: z.array(z.string()),
|
20
|
+
properties: z.record(z.string(), z.any()), // Permissive for now, validate using JSON schema later
|
26
21
|
});
|
27
|
-
const actionSchema =
|
28
|
-
description:
|
29
|
-
scopes:
|
22
|
+
const actionSchema = z.object({
|
23
|
+
description: z.string(),
|
24
|
+
scopes: z.array(z.string()),
|
30
25
|
parameters: jsonObjectSchema.optional(),
|
31
26
|
output: jsonObjectSchema.optional(),
|
32
27
|
});
|
33
28
|
const actionTemplateSchema = actionSchema.extend({
|
34
|
-
name:
|
35
|
-
provider:
|
29
|
+
name: z.string(),
|
30
|
+
provider: z.string(),
|
36
31
|
});
|
37
|
-
const providerSchema =
|
38
|
-
const configSchema =
|
39
|
-
actions:
|
32
|
+
const providerSchema = z.record(z.string(), actionSchema);
|
33
|
+
const configSchema = z.object({
|
34
|
+
actions: z.record(z.string(), providerSchema),
|
40
35
|
});
|
41
36
|
const authParamsSchemaStr = `
|
42
37
|
z.object({
|
@@ -62,7 +57,7 @@ z.object({
|
|
62
57
|
`;
|
63
58
|
function validateObject(object) {
|
64
59
|
return __awaiter(this, void 0, void 0, function* () {
|
65
|
-
const ajv = new
|
60
|
+
const ajv = new Ajv({
|
66
61
|
strict: true,
|
67
62
|
strictTypes: true,
|
68
63
|
strictTuples: true,
|
@@ -112,10 +107,10 @@ function addActionTypes(_a) {
|
|
112
107
|
function addTypesToFile(_a) {
|
113
108
|
return __awaiter(this, arguments, void 0, function* ({ file, obj, fallback, name, }) {
|
114
109
|
// Tool calling framework currently having trouble filling in records as opposed to objects
|
115
|
-
const zodSchema = obj ? (
|
110
|
+
const zodSchema = obj ? convert(obj).replace(/z\.record\(z\.any\(\)\)/g, "z.object({}).catchall(z.any())") : fallback;
|
116
111
|
const zodName = `${name}Schema`;
|
117
112
|
file.addVariableStatement({
|
118
|
-
declarationKind:
|
113
|
+
declarationKind: VariableDeclarationKind.Const,
|
119
114
|
isExported: true,
|
120
115
|
declarations: [
|
121
116
|
{
|
@@ -133,13 +128,13 @@ function addTypesToFile(_a) {
|
|
133
128
|
}
|
134
129
|
function generateTypes(_a) {
|
135
130
|
return __awaiter(this, arguments, void 0, function* ({ inputPath = "src/actions/schema.yaml", outputPath = "src/actions/autogen/templates.ts", templatesOutputPath = "src/actions/autogen/types.ts", }) {
|
136
|
-
const yamlContent = yield
|
137
|
-
const rawConfig =
|
131
|
+
const yamlContent = yield fs.readFile(inputPath, "utf8");
|
132
|
+
const rawConfig = yaml.load(yamlContent);
|
138
133
|
// Validate the config
|
139
134
|
const parsedConfig = configSchema.parse(rawConfig);
|
140
135
|
// Generate the TypeScript file
|
141
136
|
// Initialize ts-morph project
|
142
|
-
const project = new
|
137
|
+
const project = new Project();
|
143
138
|
const templatesFile = project.createSourceFile(outputPath, "", { overwrite: true });
|
144
139
|
const typesFile = project.createSourceFile(templatesOutputPath, "", { overwrite: true });
|
145
140
|
// // Set the ProviderName enum based on the schema providers
|
@@ -170,7 +165,7 @@ function generateTypes(_a) {
|
|
170
165
|
});
|
171
166
|
// Initialization: set up authparams zod schema and type
|
172
167
|
typesFile.addVariableStatement({
|
173
|
-
declarationKind:
|
168
|
+
declarationKind: VariableDeclarationKind.Const,
|
174
169
|
isExported: true,
|
175
170
|
declarations: [
|
176
171
|
{
|
@@ -192,7 +187,7 @@ function generateTypes(_a) {
|
|
192
187
|
if (action.output) {
|
193
188
|
yield validateObject(action.output);
|
194
189
|
}
|
195
|
-
const actionPrefix = `${categoryName}${
|
190
|
+
const actionPrefix = `${categoryName}${snakeToPascal(actionName)}`;
|
196
191
|
const constName = `${actionPrefix}Definition`;
|
197
192
|
// Convert the action definition to a string representation
|
198
193
|
const templateObj = Object.assign({ provider: categoryName, name: actionName }, action);
|
@@ -201,7 +196,7 @@ function generateTypes(_a) {
|
|
201
196
|
// Add the constant declaration
|
202
197
|
const templateStr = JSON.stringify(template, null, 4);
|
203
198
|
templatesFile.addVariableStatement({
|
204
|
-
declarationKind:
|
199
|
+
declarationKind: VariableDeclarationKind.Const,
|
205
200
|
isExported: true,
|
206
201
|
declarations: [
|
207
202
|
{
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,18 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
10
|
+
import { axiosClient } from "../../util/axiosClient";
|
11
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants";
|
14
12
|
const commentAsanaTask = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
13
|
var _b, _c;
|
16
14
|
const { authToken } = authParams;
|
17
15
|
const { commentText, isPinned, taskId } = params;
|
18
16
|
if (!authToken) {
|
19
|
-
return { success: false, error:
|
17
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
20
18
|
}
|
21
19
|
try {
|
22
|
-
const response = yield
|
20
|
+
const response = yield axiosClient.post(`https://app.asana.com/api/1.0/tasks/${taskId}/stories`, {
|
23
21
|
data: Object.assign({ text: commentText }, (isPinned !== undefined && { is_pinned: isPinned })),
|
24
22
|
}, {
|
25
23
|
headers: { Authorization: `Bearer ${authToken}` },
|
@@ -42,4 +40,4 @@ const commentAsanaTask = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
|
|
42
40
|
};
|
43
41
|
}
|
44
42
|
});
|
45
|
-
|
43
|
+
export default commentAsanaTask;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const utils_1 = require("./utils");
|
10
|
+
import { axiosClient } from "../../util/axiosClient";
|
11
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants";
|
12
|
+
import { getWorkspaceIdFromProject, getUserIdByEmail } from "./utils";
|
15
13
|
const getTaskTemplates = (authToken, projectId) => __awaiter(void 0, void 0, void 0, function* () {
|
16
14
|
const url = `https://app.asana.com/api/1.0/task_templates/?project=${projectId}`;
|
17
15
|
try {
|
18
|
-
const response = yield
|
16
|
+
const response = yield axiosClient.get(url, {
|
19
17
|
headers: { Authorization: `Bearer ${authToken}` },
|
20
18
|
});
|
21
19
|
return response.data.data;
|
@@ -30,15 +28,15 @@ const createAsanaTask = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
30
28
|
const { authToken } = authParams;
|
31
29
|
const { name, projectId, description, customFields, taskTemplate, assignee, approvalStatus, dueAt } = params;
|
32
30
|
if (!authToken) {
|
33
|
-
return { success: false, error:
|
31
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
34
32
|
}
|
35
|
-
const workspaceId = yield
|
33
|
+
const workspaceId = yield getWorkspaceIdFromProject(projectId, authToken);
|
36
34
|
if (!workspaceId) {
|
37
35
|
return { success: false, error: "Project ID invalid: unable to get workspaceID" };
|
38
36
|
}
|
39
37
|
let assigneeId;
|
40
38
|
if (assignee && assignee.includes("@")) {
|
41
|
-
assigneeId = yield
|
39
|
+
assigneeId = yield getUserIdByEmail(authToken, workspaceId, assignee);
|
42
40
|
}
|
43
41
|
else {
|
44
42
|
assigneeId = assignee;
|
@@ -68,7 +66,7 @@ const createAsanaTask = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
68
66
|
};
|
69
67
|
}
|
70
68
|
}
|
71
|
-
const response = yield
|
69
|
+
const response = yield axiosClient.post(`https://app.asana.com/api/1.0/tasks`, {
|
72
70
|
data: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ name, projects: [projectId] }, (description && { notes: description })), (customFields && { custom_fields: customFields })), (templateId && { task_template: templateId })), (assigneeId && { assignee: assigneeId })), (approvalStatus && { approval_status: approvalStatus })), (dueAt && { due_at: dueAt })),
|
73
71
|
}, {
|
74
72
|
headers: { Authorization: `Bearer ${authToken}` },
|
@@ -91,4 +89,4 @@ const createAsanaTask = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
91
89
|
};
|
92
90
|
}
|
93
91
|
});
|
94
|
-
|
92
|
+
export default createAsanaTask;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -8,16 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
8
|
});
|
10
9
|
};
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
10
|
+
import { asanaGetTasksDetailsOutputSchema } from "../../autogen/types";
|
11
|
+
import { axiosClient } from "../../util/axiosClient";
|
12
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants";
|
15
13
|
const getTasksDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
16
14
|
var _b, _c, _d;
|
17
15
|
const { authToken } = authParams;
|
18
16
|
const { taskIds } = params;
|
19
17
|
if (!authToken) {
|
20
|
-
return { success: false, errors: [
|
18
|
+
return { success: false, errors: [MISSING_AUTH_TOKEN] };
|
21
19
|
}
|
22
20
|
const tasks = [];
|
23
21
|
const errors = [];
|
@@ -25,7 +23,7 @@ const getTasksDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
25
23
|
for (const taskId of taskIds) {
|
26
24
|
try {
|
27
25
|
// Get task details
|
28
|
-
const taskResponse = yield
|
26
|
+
const taskResponse = yield axiosClient.get(`https://app.asana.com/api/1.0/tasks/${taskId}?opt_fields=name,notes,assignee,assignee.name,created_at,completed,due_at,approval_status`, {
|
29
27
|
headers: { Authorization: `Bearer ${authToken}` },
|
30
28
|
});
|
31
29
|
const taskData = taskResponse.data.data;
|
@@ -34,7 +32,7 @@ const getTasksDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
34
32
|
throw new Error(`No data returned for task ${taskId}`);
|
35
33
|
}
|
36
34
|
// Get the stories (comments)
|
37
|
-
const storyResponse = yield
|
35
|
+
const storyResponse = yield axiosClient.get(`https://app.asana.com/api/1.0/tasks/${taskId}/stories?opt_fields=text,created_at,created_by,resource_subtype`, {
|
38
36
|
headers: { Authorization: `Bearer ${authToken}` },
|
39
37
|
});
|
40
38
|
// Filter and map comments
|
@@ -51,7 +49,7 @@ const getTasksDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
51
49
|
// Handle pagination for comments
|
52
50
|
let nextLink = (_b = storyResponse.data.next_page) === null || _b === void 0 ? void 0 : _b.uri;
|
53
51
|
while (nextLink) {
|
54
|
-
const nextResponse = yield
|
52
|
+
const nextResponse = yield axiosClient.get(nextLink, {
|
55
53
|
headers: { Authorization: `Bearer ${authToken}` },
|
56
54
|
});
|
57
55
|
const nextData = nextResponse.data;
|
@@ -94,6 +92,6 @@ const getTasksDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
|
|
94
92
|
success: true,
|
95
93
|
results: tasks,
|
96
94
|
};
|
97
|
-
return
|
95
|
+
return asanaGetTasksDetailsOutputSchema.parse(result);
|
98
96
|
});
|
99
|
-
|
97
|
+
export default getTasksDetails;
|