@credal/actions 0.2.2 → 0.2.4

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.
Files changed (133) hide show
  1. package/dist/actions/actionMapper.js +374 -380
  2. package/dist/actions/autogen/templates.js +94 -98
  3. package/dist/actions/autogen/types.js +1621 -1627
  4. package/dist/actions/groups.js +88 -91
  5. package/dist/actions/invoke.js +5 -8
  6. package/dist/actions/parse.js +28 -33
  7. package/dist/actions/providers/asana/commentAsanaTask.js +5 -7
  8. package/dist/actions/providers/asana/createAsanaTask.js +9 -11
  9. package/dist/actions/providers/asana/getTasksDetails.js +9 -11
  10. package/dist/actions/providers/asana/listAsanaTasksByProject.js +46 -51
  11. package/dist/actions/providers/asana/searchAsanaTasks.js +6 -8
  12. package/dist/actions/providers/asana/updateAsanaTask.js +8 -10
  13. package/dist/actions/providers/asana/utils.js +7 -12
  14. package/dist/actions/providers/ashby/addCandidateToProject.js +5 -7
  15. package/dist/actions/providers/ashby/createCandidate.js +5 -7
  16. package/dist/actions/providers/ashby/createNote.js +5 -7
  17. package/dist/actions/providers/ashby/getCandidateInfo.js +5 -7
  18. package/dist/actions/providers/ashby/listCandidateNotes.js +5 -7
  19. package/dist/actions/providers/ashby/listCandidates.js +5 -7
  20. package/dist/actions/providers/ashby/searchCandidates.js +5 -7
  21. package/dist/actions/providers/ashby/updateCandidate.js +5 -7
  22. package/dist/actions/providers/bing/getTopNSearchResultUrls.js +5 -7
  23. package/dist/actions/providers/confluence/fetchPageContent.js +8 -10
  24. package/dist/actions/providers/confluence/helpers.js +1 -4
  25. package/dist/actions/providers/confluence/overwritePage.js +9 -11
  26. package/dist/actions/providers/finnhub/getBasicFinancials.js +6 -8
  27. package/dist/actions/providers/finnhub/symbolLookup.js +6 -8
  28. package/dist/actions/providers/firecrawl/deepResearch.js +5 -10
  29. package/dist/actions/providers/firecrawl/scrapeTweetDataWithNitter.js +5 -10
  30. package/dist/actions/providers/firecrawl/scrapeUrl.js +5 -10
  31. package/dist/actions/providers/generic/fillTemplate.js +1 -3
  32. package/dist/actions/providers/github/createBranch.js +4 -39
  33. package/dist/actions/providers/github/createOrUpdateFile.js +6 -41
  34. package/dist/actions/providers/github/createPullRequest.js +4 -39
  35. package/dist/actions/providers/github/listPullRequests.js +7 -12
  36. package/dist/actions/providers/gong/getGongTranscripts.js +49 -84
  37. package/dist/actions/providers/google-oauth/addGroupMember.js +5 -7
  38. package/dist/actions/providers/google-oauth/createNewGoogleDoc.js +6 -8
  39. package/dist/actions/providers/google-oauth/createPresentation.js +5 -7
  40. package/dist/actions/providers/google-oauth/createSpreadsheet.js +5 -10
  41. package/dist/actions/providers/google-oauth/deleteCalendarEvent.js +5 -7
  42. package/dist/actions/providers/google-oauth/deleteGroupMember.js +5 -7
  43. package/dist/actions/providers/google-oauth/getGroup.js +5 -7
  44. package/dist/actions/providers/google-oauth/hasGroupMember.js +5 -7
  45. package/dist/actions/providers/google-oauth/listCalendarEvents.js +5 -7
  46. package/dist/actions/providers/google-oauth/listCalendars.js +5 -7
  47. package/dist/actions/providers/google-oauth/listGroupMembers.js +5 -7
  48. package/dist/actions/providers/google-oauth/listGroups.js +5 -7
  49. package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +7 -9
  50. package/dist/actions/providers/google-oauth/searchDriveByKeywords.js +5 -7
  51. package/dist/actions/providers/google-oauth/updateCalendarEvent.js +5 -7
  52. package/dist/actions/providers/google-oauth/updateDoc.js +5 -10
  53. package/dist/actions/providers/google-oauth/updatePresentation.js +5 -7
  54. package/dist/actions/providers/google-oauth/updateSpreadsheet.js +5 -7
  55. package/dist/actions/providers/google-oauth/utils/decodeMessage.js +2 -6
  56. package/dist/actions/providers/googlemail/listGmailThreads.js +8 -10
  57. package/dist/actions/providers/googlemail/searchGmailMessages.js +8 -10
  58. package/dist/actions/providers/googlemaps/nearbysearchRestaurants.js +5 -7
  59. package/dist/actions/providers/googlemaps/validateAddress.js +3 -5
  60. package/dist/actions/providers/jamf/getJamfComputerInventory.js +3 -5
  61. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +3 -5
  62. package/dist/actions/providers/jira/assignJiraTicket.js +5 -10
  63. package/dist/actions/providers/jira/commentJiraTicket.js +3 -5
  64. package/dist/actions/providers/jira/createJiraTicket.js +6 -8
  65. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +4 -6
  66. package/dist/actions/providers/jira/getJiraTicketDetails.js +3 -5
  67. package/dist/actions/providers/jira/getJiraTicketHistory.js +3 -5
  68. package/dist/actions/providers/jira/updateJiraTicketDetails.js +3 -5
  69. package/dist/actions/providers/jira/updateJiraTicketStatus.js +4 -6
  70. package/dist/actions/providers/jira/utils.js +3 -6
  71. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +4 -6
  72. package/dist/actions/providers/linkedin/createSharePostLinkedinUrl.js +1 -3
  73. package/dist/actions/providers/looker/enableUserByEmail.js +5 -7
  74. package/dist/actions/providers/math/add.js +1 -3
  75. package/dist/actions/providers/microsoft/createDocument.js +5 -7
  76. package/dist/actions/providers/microsoft/getDocument.js +3 -5
  77. package/dist/actions/providers/microsoft/messageTeamsChannel.js +4 -6
  78. package/dist/actions/providers/microsoft/messageTeamsChat.js +4 -6
  79. package/dist/actions/providers/microsoft/updateDocument.js +4 -6
  80. package/dist/actions/providers/microsoft/updateSpreadsheet.js +4 -6
  81. package/dist/actions/providers/microsoft/utils.js +6 -10
  82. package/dist/actions/providers/mongodb/insertMongoDoc.js +3 -5
  83. package/dist/actions/providers/notion/searchByTitle.js +5 -10
  84. package/dist/actions/providers/nws/getForecastForLocation.js +7 -9
  85. package/dist/actions/providers/openstreetmap/getLatitudeLongitudeFromLocation.js +3 -5
  86. package/dist/actions/providers/resend/sendEmail.js +6 -8
  87. package/dist/actions/providers/salesforce/createCase.js +3 -5
  88. package/dist/actions/providers/salesforce/createRecord.js +4 -6
  89. package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +3 -5
  90. package/dist/actions/providers/salesforce/generateSalesReport.js +3 -5
  91. package/dist/actions/providers/salesforce/getRecord.js +3 -5
  92. package/dist/actions/providers/salesforce/getSalesforceRecordsByQuery.js +4 -6
  93. package/dist/actions/providers/salesforce/updateRecord.js +3 -5
  94. package/dist/actions/providers/slack/getChannelMessages.js +7 -9
  95. package/dist/actions/providers/slack/helpers.js +1 -4
  96. package/dist/actions/providers/slack/sendMessage.js +10 -12
  97. package/dist/actions/providers/snowflake/auth/getSnowflakeConnection.js +4 -41
  98. package/dist/actions/providers/snowflake/getRowByFieldValue.js +3 -5
  99. package/dist/actions/providers/snowflake/runSnowflakeQuery.js +8 -13
  100. package/dist/actions/providers/x/createXSharePostUrl.js +1 -3
  101. package/dist/actions/providers/zendesk/addCommentToTicket.js +5 -7
  102. package/dist/actions/providers/zendesk/assignTicket.js +5 -7
  103. package/dist/actions/providers/zendesk/createZendeskTicket.js +5 -7
  104. package/dist/actions/providers/zendesk/getTicketDetails.js +5 -7
  105. package/dist/actions/providers/zendesk/listTickets.js +5 -7
  106. package/dist/actions/providers/zendesk/updateTicketStatus.js +5 -7
  107. package/dist/actions/util/axiosClient.js +4 -11
  108. package/dist/actions/util/formatDataForCodeInterpreter.js +1 -4
  109. package/dist/actions/util/missingAuthConstants.js +2 -5
  110. package/dist/app.js +5 -42
  111. package/dist/index.d.ts +1 -1
  112. package/dist/index.js +4 -24
  113. package/dist/server.d.ts +2 -0
  114. package/dist/server.js +8 -0
  115. package/dist/utils/datetime.js +4 -8
  116. package/dist/utils/string.js +1 -4
  117. package/package.json +2 -1
  118. package/dist/actions/providers/credal/callCopilot.d.ts +0 -3
  119. package/dist/actions/providers/credal/callCopilot.js +0 -36
  120. package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +0 -3
  121. package/dist/actions/providers/google-oauth/listGmailThreads.js +0 -98
  122. package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +0 -3
  123. package/dist/actions/providers/google-oauth/searchGmailMessages.js +0 -91
  124. package/dist/actions/providers/jamf/getComputerInventory.d.ts +0 -3
  125. package/dist/actions/providers/jamf/getComputerInventory.js +0 -45
  126. package/dist/actions/providers/jamf/getFileVaultRecoveryKey.d.ts +0 -3
  127. package/dist/actions/providers/jamf/getFileVaultRecoveryKey.js +0 -40
  128. package/dist/actions/providers/math/index.d.ts +0 -1
  129. package/dist/actions/providers/math/index.js +0 -37
  130. package/dist/actions/providers/slack/index.d.ts +0 -1
  131. package/dist/actions/providers/slack/index.js +0 -37
  132. package/dist/actions/providers/slack/listConversations.d.ts +0 -3
  133. package/dist/actions/providers/slack/listConversations.js +0 -41
@@ -1,207 +1,204 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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: [templates_1.genericFillTemplateDefinition],
5
+ actions: [genericFillTemplateDefinition],
9
6
  },
10
7
  ASANA: {
11
8
  description: "Actions for interacting with Asana",
12
9
  actions: [
13
- templates_1.asanaCommentTaskDefinition,
14
- templates_1.asanaCreateTaskDefinition,
15
- templates_1.asanaUpdateTaskDefinition,
16
- templates_1.asanaSearchTasksDefinition,
17
- templates_1.asanaListAsanaTasksByProjectDefinition,
18
- templates_1.asanaGetTasksDetailsDefinition,
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: [templates_1.slackSendMessageDefinition, templates_1.slackGetChannelMessagesDefinition],
20
+ actions: [slackSendMessageDefinition, slackGetChannelMessagesDefinition],
24
21
  },
25
22
  CONFLUENCE: {
26
23
  description: "Action for interacting with Confluence",
27
- actions: [templates_1.confluenceOverwritePageDefinition, templates_1.confluenceFetchPageContentDefinition],
24
+ actions: [confluenceOverwritePageDefinition, confluenceFetchPageContentDefinition],
28
25
  },
29
26
  MATH_ADD: {
30
27
  description: "Action for adding two numbers",
31
- actions: [templates_1.mathAddDefinition],
28
+ actions: [mathAddDefinition],
32
29
  },
33
30
  GOOGLE_MAPS: {
34
31
  description: "Action for interacting with Google Maps",
35
- actions: [templates_1.googlemapsValidateAddressDefinition, templates_1.googlemapsNearbysearchRestaurantsDefinition],
32
+ actions: [googlemapsValidateAddressDefinition, googlemapsNearbysearchRestaurantsDefinition],
36
33
  },
37
34
  GOOGLE_DRIVE: {
38
35
  description: "Action for interacting with Google Drive",
39
36
  actions: [
40
- templates_1.googleOauthCreateNewGoogleDocDefinition,
41
- templates_1.googleOauthUpdateDocDefinition,
42
- templates_1.googleOauthCreateSpreadsheetDefinition,
43
- templates_1.googleOauthUpdateSpreadsheetDefinition,
44
- templates_1.googleOauthCreatePresentationDefinition,
45
- templates_1.googleOauthUpdatePresentationDefinition,
46
- templates_1.googleOauthSearchDriveByKeywordsDefinition,
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
- templates_1.googleOauthScheduleCalendarMeetingDefinition,
53
- templates_1.googleOauthListCalendarsDefinition,
54
- templates_1.googleOauthListCalendarEventsDefinition,
55
- templates_1.googleOauthUpdateCalendarEventDefinition,
56
- templates_1.googleOauthDeleteCalendarEventDefinition,
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: [templates_1.googlemailSearchGmailMessagesDefinition, templates_1.googlemailListGmailThreadsDefinition],
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: [templates_1.linkedinCreateShareLinkedinPostUrlDefinition],
62
+ actions: [linkedinCreateShareLinkedinPostUrlDefinition],
66
63
  },
67
64
  ZENDESK_ACTIONS: {
68
65
  description: "Actions for interacting with Zendesk",
69
66
  actions: [
70
- templates_1.zendeskCreateZendeskTicketDefinition,
71
- templates_1.zendeskListZendeskTicketsDefinition,
72
- templates_1.zendeskGetTicketDetailsDefinition,
73
- templates_1.zendeskUpdateTicketStatusDefinition,
74
- templates_1.zendeskAddCommentToTicketDefinition,
75
- templates_1.zendeskAssignTicketDefinition,
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: [templates_1.bingGetTopNSearchResultUrlsDefinition],
77
+ actions: [bingGetTopNSearchResultUrlsDefinition],
81
78
  },
82
79
  MONGO_INSERT_DOC: {
83
80
  description: "Action for inserting a document into a MongoDB collection",
84
- actions: [templates_1.mongoInsertMongoDocDefinition],
81
+ actions: [mongoInsertMongoDocDefinition],
85
82
  },
86
83
  SNOWFLAKE_ACTIONS: {
87
84
  description: "Action for getting content from a Snowflake table",
88
- actions: [templates_1.snowflakeGetRowByFieldValueDefinition, templates_1.snowflakeRunSnowflakeQueryDefinition],
85
+ actions: [snowflakeGetRowByFieldValueDefinition, snowflakeRunSnowflakeQueryDefinition],
89
86
  },
90
87
  JIRA_ACTIONS: {
91
88
  description: "Action for interacting with Jira tickets",
92
89
  actions: [
93
- templates_1.jiraAssignJiraTicketDefinition,
94
- templates_1.jiraCreateJiraTicketDefinition,
95
- templates_1.jiraCommentJiraTicketDefinition,
96
- templates_1.jiraGetJiraTicketDetailsDefinition,
97
- templates_1.jiraGetJiraTicketHistoryDefinition,
98
- templates_1.jiraUpdateJiraTicketDetailsDefinition,
99
- templates_1.jiraUpdateJiraTicketStatusDefinition,
100
- templates_1.jiraGetJiraIssuesByQueryDefinition,
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: [templates_1.openstreetmapGetLatitudeLongitudeFromLocationDefinition],
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: [templates_1.nwsGetForecastForLocationDefinition],
106
+ actions: [nwsGetForecastForLocationDefinition],
110
107
  },
111
108
  FIRECRAWL: {
112
109
  description: "Actions for interacting with Firecrawl",
113
110
  actions: [
114
- templates_1.firecrawlScrapeUrlDefinition,
115
- templates_1.firecrawlScrapeTweetDataWithNitterDefinition,
116
- templates_1.firecrawlDeepResearchDefinition,
111
+ firecrawlScrapeUrlDefinition,
112
+ firecrawlScrapeTweetDataWithNitterDefinition,
113
+ firecrawlDeepResearchDefinition,
117
114
  ],
118
115
  },
119
116
  RESEND: {
120
117
  description: "Action for sending an email",
121
- actions: [templates_1.resendSendEmailDefinition],
118
+ actions: [resendSendEmailDefinition],
122
119
  },
123
120
  X: {
124
121
  description: "Actions for interacting with X(formerly twitter)",
125
- actions: [templates_1.xCreateShareXPostUrlDefinition],
122
+ actions: [xCreateShareXPostUrlDefinition],
126
123
  },
127
124
  GONG: {
128
125
  description: "Actions for interacting with Gong",
129
- actions: [templates_1.gongGetGongTranscriptsDefinition],
126
+ actions: [gongGetGongTranscriptsDefinition],
130
127
  },
131
128
  FINNHUB: {
132
129
  description: "Action for interacting with Finnhub for stock market data",
133
- actions: [templates_1.finnhubSymbolLookupDefinition, templates_1.finnhubGetBasicFinancialsDefinition],
130
+ actions: [finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition],
134
131
  },
135
132
  JAMF: {
136
133
  description: "Actions for interacting with Jamf",
137
- actions: [templates_1.jamfGetJamfComputerInventoryDefinition, templates_1.jamfGetJamfFileVaultRecoveryKeyDefinition],
134
+ actions: [jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition],
138
135
  },
139
136
  LOOKER: {
140
137
  description: "Actions for interacting with Looker",
141
- actions: [templates_1.lookerEnableUserByEmailDefinition],
138
+ actions: [lookerEnableUserByEmailDefinition],
142
139
  },
143
140
  SALESFORCE: {
144
141
  description: "Actions for interacting with Salesforce",
145
142
  actions: [
146
- templates_1.salesforceUpdateRecordDefinition,
147
- templates_1.salesforceCreateRecordDefinition,
148
- templates_1.salesforceCreateCaseDefinition,
149
- templates_1.salesforceGenerateSalesReportDefinition,
150
- templates_1.salesforceGetRecordDefinition,
151
- templates_1.salesforceGetSalesforceRecordsByQueryDefinition,
152
- templates_1.salesforceFetchSalesforceSchemaByObjectDefinition,
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
- templates_1.microsoftMessageTeamsChatDefinition,
159
- templates_1.microsoftMessageTeamsChannelDefinition,
160
- templates_1.microsoftUpdateSpreadsheetDefinition,
161
- templates_1.microsoftUpdateDocumentDefinition,
162
- templates_1.microsoftCreateDocumentDefinition,
163
- templates_1.microsoftGetDocumentDefinition,
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: [templates_1.kandjiGetFVRecoveryKeyForDeviceDefinition],
165
+ actions: [kandjiGetFVRecoveryKeyForDeviceDefinition],
169
166
  },
170
167
  GITHUB: {
171
168
  description: "Actions for interacting with GitHub",
172
169
  actions: [
173
- templates_1.githubCreateOrUpdateFileDefinition,
174
- templates_1.githubCreateBranchDefinition,
175
- templates_1.githubCreatePullRequestDefinition,
176
- templates_1.githubListPullRequestsDefinition,
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
- templates_1.ashbyCreateNoteDefinition,
183
- templates_1.ashbyGetCandidateInfoDefinition,
184
- templates_1.ashbyListCandidatesDefinition,
185
- templates_1.ashbyListCandidateNotesDefinition,
186
- templates_1.ashbySearchCandidatesDefinition,
187
- templates_1.ashbyCreateCandidateDefinition,
188
- templates_1.ashbyUpdateCandidateDefinition,
189
- templates_1.ashbyAddCandidateToProjectDefinition,
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: [templates_1.notionSearchByTitleDefinition],
191
+ actions: [notionSearchByTitleDefinition],
195
192
  },
196
193
  GOOGLE_GROUPS: {
197
194
  description: "Google Workspace Groups management actions",
198
195
  actions: [
199
- templates_1.googleOauthListGroupsDefinition,
200
- templates_1.googleOauthGetGroupDefinition,
201
- templates_1.googleOauthListGroupMembersDefinition,
202
- templates_1.googleOauthHasGroupMemberDefinition,
203
- templates_1.googleOauthAddGroupMemberDefinition,
204
- templates_1.googleOauthDeleteGroupMemberDefinition,
196
+ googleOauthListGroupsDefinition,
197
+ googleOauthGetGroupDefinition,
198
+ googleOauthListGroupMembersDefinition,
199
+ googleOauthHasGroupMemberDefinition,
200
+ googleOauthAddGroupMemberDefinition,
201
+ googleOauthDeleteGroupMemberDefinition,
205
202
  ],
206
203
  },
207
204
  };
@@ -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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.invokeAction = invokeAction;
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 (!actionMapper_1.ActionMapper[provider]) {
14
+ if (!ActionMapper[provider]) {
18
15
  throw new Error(`Provider '${provider}' not found`);
19
16
  }
20
- const providerFunction = actionMapper_1.ActionMapper[provider][name].fn;
21
- const safeParseParams = actionMapper_1.ActionMapper[provider][name].paramsSchema.safeParse(parameters);
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
  }
@@ -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
- 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 ajv_1 = __importDefault(require("ajv"));
16
- const promises_1 = __importDefault(require("fs/promises"));
17
- const js_yaml_1 = __importDefault(require("js-yaml"));
18
- const json_schema_to_zod_1 = __importDefault(require("json-schema-to-zod"));
19
- const ts_morph_1 = require("ts-morph");
20
- const zod_1 = require("zod");
21
- const string_1 = require("../utils/string");
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 = zod_1.z.object({
28
- description: zod_1.z.string(),
29
- scopes: zod_1.z.array(zod_1.z.string()),
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: zod_1.z.string(),
35
- provider: zod_1.z.string(),
29
+ name: z.string(),
30
+ provider: z.string(),
36
31
  });
37
- const providerSchema = zod_1.z.record(zod_1.z.string(), actionSchema);
38
- const configSchema = zod_1.z.object({
39
- actions: zod_1.z.record(zod_1.z.string(), providerSchema),
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 ajv_1.default({
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 ? (0, json_schema_to_zod_1.default)(obj).replace(/z\.record\(z\.any\(\)\)/g, "z.object({}).catchall(z.any())") : fallback;
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: ts_morph_1.VariableDeclarationKind.Const,
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 promises_1.default.readFile(inputPath, "utf8");
137
- const rawConfig = js_yaml_1.default.load(yamlContent);
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 ts_morph_1.Project();
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: ts_morph_1.VariableDeclarationKind.Const,
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}${(0, string_1.snakeToPascal)(actionName)}`;
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: ts_morph_1.VariableDeclarationKind.Const,
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
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: missingAuthConstants_1.MISSING_AUTH_TOKEN };
17
+ return { success: false, error: MISSING_AUTH_TOKEN };
20
18
  }
21
19
  try {
22
- const response = yield axiosClient_1.axiosClient.post(`https://app.asana.com/api/1.0/tasks/${taskId}/stories`, {
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
- exports.default = commentAsanaTask;
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
13
- const missingAuthConstants_1 = require("../../util/missingAuthConstants");
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 axiosClient_1.axiosClient.get(url, {
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: missingAuthConstants_1.MISSING_AUTH_TOKEN };
31
+ return { success: false, error: MISSING_AUTH_TOKEN };
34
32
  }
35
- const workspaceId = yield (0, utils_1.getWorkspaceIdFromProject)(projectId, authToken);
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 (0, utils_1.getUserIdByEmail)(authToken, workspaceId, assignee);
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 axiosClient_1.axiosClient.post(`https://app.asana.com/api/1.0/tasks`, {
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
- exports.default = createAsanaTask;
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const types_1 = require("../../autogen/types");
13
- const axiosClient_1 = require("../../util/axiosClient");
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: [missingAuthConstants_1.MISSING_AUTH_TOKEN] };
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 axiosClient_1.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`, {
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 axiosClient_1.axiosClient.get(`https://app.asana.com/api/1.0/tasks/${taskId}/stories?opt_fields=text,created_at,created_by,resource_subtype`, {
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 axiosClient_1.axiosClient.get(nextLink, {
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 types_1.asanaGetTasksDetailsOutputSchema.parse(result);
95
+ return asanaGetTasksDetailsOutputSchema.parse(result);
98
96
  });
99
- exports.default = getTasksDetails;
97
+ export default getTasksDetails;