@credal/actions 0.2.174 → 0.2.175

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.
@@ -1,9 +1,11 @@
1
1
  import type { z } from "zod";
2
2
  import { type ActionFunction, type ProviderName } from "./autogen/types.js";
3
+ type ActionTypeSchema = "read" | "write";
3
4
  interface ActionFunctionComponents {
4
5
  fn: ActionFunction<any, any, any>;
5
6
  paramsSchema: z.ZodSchema;
6
7
  outputSchema: z.ZodSchema;
8
+ actionType?: ActionTypeSchema;
7
9
  }
8
10
  export declare const ActionMapper: Record<ProviderName, Record<string, ActionFunctionComponents>>;
9
11
  export {};
@@ -133,56 +133,67 @@ const jiraActions = {
133
133
  fn: getJiraIssuesByQuery,
134
134
  paramsSchema: jiraGetJiraIssuesByQueryParamsSchema,
135
135
  outputSchema: jiraGetJiraIssuesByQueryOutputSchema,
136
+ actionType: "read",
136
137
  },
137
138
  assignJiraTicket: {
138
139
  fn: assignJiraTicket,
139
140
  paramsSchema: jiraAssignJiraTicketParamsSchema,
140
141
  outputSchema: jiraAssignJiraTicketOutputSchema,
142
+ actionType: "write",
141
143
  },
142
144
  commentJiraTicket: {
143
145
  fn: commentJiraTicket,
144
146
  paramsSchema: jiraCommentJiraTicketParamsSchema,
145
147
  outputSchema: jiraCommentJiraTicketOutputSchema,
148
+ actionType: "write",
146
149
  },
147
150
  publicCommentOnServiceDeskRequest: {
148
151
  fn: publicCommentOnServiceDeskRequest,
149
152
  paramsSchema: jiraPublicCommentOnServiceDeskRequestParamsSchema,
150
153
  outputSchema: jiraPublicCommentOnServiceDeskRequestOutputSchema,
154
+ actionType: "write",
151
155
  },
152
156
  createJiraTicket: {
153
157
  fn: createJiraTicket,
154
158
  paramsSchema: jiraCreateJiraTicketParamsSchema,
155
159
  outputSchema: jiraCreateJiraTicketOutputSchema,
160
+ actionType: "write",
156
161
  },
157
162
  getJiraTicketDetails: {
158
163
  fn: getJiraTicketDetails,
159
164
  paramsSchema: jiraGetJiraTicketDetailsParamsSchema,
160
165
  outputSchema: jiraGetJiraTicketDetailsOutputSchema,
166
+ actionType: "read",
161
167
  },
162
168
  getJiraTicketHistory: {
163
169
  fn: getJiraTicketHistory,
164
170
  paramsSchema: jiraGetJiraTicketHistoryParamsSchema,
165
171
  outputSchema: jiraGetJiraTicketHistoryOutputSchema,
172
+ actionType: "read",
166
173
  },
167
174
  updateJiraTicketDetails: {
168
175
  fn: updateJiraTicketDetails,
169
176
  paramsSchema: jiraUpdateJiraTicketDetailsParamsSchema,
170
177
  outputSchema: jiraUpdateJiraTicketDetailsOutputSchema,
178
+ actionType: "write",
171
179
  },
172
180
  updateJiraTicketStatus: {
173
181
  fn: updateJiraTicketStatus,
174
182
  paramsSchema: jiraUpdateJiraTicketStatusParamsSchema,
175
183
  outputSchema: jiraUpdateJiraTicketStatusOutputSchema,
184
+ actionType: "write",
176
185
  },
177
186
  getServiceDesks: {
178
187
  fn: getServiceDesks,
179
188
  paramsSchema: jiraGetServiceDesksParamsSchema,
180
189
  outputSchema: jiraGetServiceDesksOutputSchema,
190
+ actionType: "read",
181
191
  },
182
192
  createServiceDeskRequest: {
183
193
  fn: createServiceDeskRequest,
184
194
  paramsSchema: jiraCreateServiceDeskRequestParamsSchema,
185
195
  outputSchema: jiraCreateServiceDeskRequestOutputSchema,
196
+ actionType: "write",
186
197
  },
187
198
  };
188
199
  export const ActionMapper = {
@@ -205,31 +216,37 @@ export const ActionMapper = {
205
216
  fn: commentAsanaTask,
206
217
  paramsSchema: asanaCommentTaskParamsSchema,
207
218
  outputSchema: asanaCommentTaskOutputSchema,
219
+ actionType: "write",
208
220
  },
209
221
  createTask: {
210
222
  fn: createAsanaTask,
211
223
  paramsSchema: asanaCreateTaskParamsSchema,
212
224
  outputSchema: asanaCreateTaskOutputSchema,
225
+ actionType: "write",
213
226
  },
214
227
  updateTask: {
215
228
  fn: updateAsanaTask,
216
229
  paramsSchema: asanaUpdateTaskParamsSchema,
217
230
  outputSchema: asanaUpdateTaskOutputSchema,
231
+ actionType: "write",
218
232
  },
219
233
  searchTasks: {
220
234
  fn: searchAsanaTasks,
221
235
  paramsSchema: asanaSearchTasksParamsSchema,
222
236
  outputSchema: asanaSearchTasksOutputSchema,
237
+ actionType: "read",
223
238
  },
224
239
  listAsanaTasksByProject: {
225
240
  fn: listAsanaTasksByProject,
226
241
  paramsSchema: asanaListAsanaTasksByProjectParamsSchema,
227
242
  outputSchema: asanaListAsanaTasksByProjectOutputSchema,
243
+ actionType: "read",
228
244
  },
229
245
  getTasksDetails: {
230
246
  fn: getTasksDetails,
231
247
  paramsSchema: asanaGetTasksDetailsParamsSchema,
232
248
  outputSchema: asanaGetTasksDetailsOutputSchema,
249
+ actionType: "read",
233
250
  },
234
251
  },
235
252
  math: {
@@ -244,21 +261,25 @@ export const ActionMapper = {
244
261
  fn: sendMessage,
245
262
  paramsSchema: slackSendMessageParamsSchema,
246
263
  outputSchema: slackSendMessageOutputSchema,
264
+ actionType: "write",
247
265
  },
248
266
  getChannelMessages: {
249
267
  fn: getChannelMessages,
250
268
  paramsSchema: slackGetChannelMessagesParamsSchema,
251
269
  outputSchema: slackGetChannelMessagesOutputSchema,
270
+ actionType: "read",
252
271
  },
253
272
  createChannel: {
254
273
  fn: createChannel,
255
274
  paramsSchema: slackCreateChannelParamsSchema,
256
275
  outputSchema: slackCreateChannelOutputSchema,
276
+ actionType: "write",
257
277
  },
258
278
  sendDmFromBot: {
259
279
  fn: sendDmFromBot,
260
280
  paramsSchema: slackSendDmFromBotParamsSchema,
261
281
  outputSchema: slackSendDmFromBotOutputSchema,
282
+ actionType: "write",
262
283
  },
263
284
  },
264
285
  slackUser: {
@@ -266,6 +287,7 @@ export const ActionMapper = {
266
287
  fn: searchSlack,
267
288
  paramsSchema: slackUserSearchSlackParamsSchema,
268
289
  outputSchema: slackUserSearchSlackOutputSchema,
290
+ actionType: "read",
269
291
  },
270
292
  },
271
293
  confluence: {
@@ -273,11 +295,13 @@ export const ActionMapper = {
273
295
  fn: confluenceOverwritePage,
274
296
  paramsSchema: confluenceOverwritePageParamsSchema,
275
297
  outputSchema: confluenceOverwritePageOutputSchema,
298
+ actionType: "write",
276
299
  },
277
300
  fetchPageContent: {
278
301
  fn: confluenceFetchPageContent,
279
302
  paramsSchema: confluenceFetchPageContentParamsSchema,
280
303
  outputSchema: confluenceFetchPageContentOutputSchema,
304
+ actionType: "read",
281
305
  },
282
306
  },
283
307
  googlemaps: {
@@ -304,36 +328,43 @@ export const ActionMapper = {
304
328
  fn: createZendeskTicket,
305
329
  paramsSchema: zendeskCreateZendeskTicketParamsSchema,
306
330
  outputSchema: zendeskCreateZendeskTicketOutputSchema,
331
+ actionType: "write",
307
332
  },
308
333
  getTicketDetails: {
309
334
  fn: getZendeskTicketDetails,
310
335
  paramsSchema: zendeskGetTicketDetailsParamsSchema,
311
336
  outputSchema: zendeskGetTicketDetailsOutputSchema,
337
+ actionType: "read",
312
338
  },
313
339
  updateTicketStatus: {
314
340
  fn: updateTicketStatus,
315
341
  paramsSchema: zendeskUpdateTicketStatusParamsSchema,
316
342
  outputSchema: zendeskUpdateTicketStatusOutputSchema,
343
+ actionType: "write",
317
344
  },
318
345
  addCommentToTicket: {
319
346
  fn: addCommentToTicket,
320
347
  paramsSchema: zendeskAddCommentToTicketParamsSchema,
321
348
  outputSchema: zendeskAddCommentToTicketOutputSchema,
349
+ actionType: "write",
322
350
  },
323
351
  assignTicket: {
324
352
  fn: assignTicket,
325
353
  paramsSchema: zendeskAssignTicketParamsSchema,
326
354
  outputSchema: zendeskAssignTicketOutputSchema,
355
+ actionType: "write",
327
356
  },
328
357
  listZendeskTickets: {
329
358
  fn: listZendeskTickets,
330
359
  paramsSchema: zendeskListZendeskTicketsParamsSchema,
331
360
  outputSchema: zendeskListZendeskTicketsOutputSchema,
361
+ actionType: "read",
332
362
  },
333
363
  searchZendeskByQuery: {
334
364
  fn: searchZendeskByQuery,
335
365
  paramsSchema: zendeskSearchZendeskByQueryParamsSchema,
336
366
  outputSchema: zendeskSearchZendeskByQueryOutputSchema,
367
+ actionType: "read",
337
368
  },
338
369
  },
339
370
  mongo: {
@@ -341,6 +372,7 @@ export const ActionMapper = {
341
372
  fn: insertMongoDoc,
342
373
  paramsSchema: mongoInsertMongoDocParamsSchema,
343
374
  outputSchema: mongoInsertMongoDocOutputSchema,
375
+ actionType: "write",
344
376
  },
345
377
  },
346
378
  snowflake: {
@@ -348,11 +380,13 @@ export const ActionMapper = {
348
380
  fn: getRowByFieldValue,
349
381
  paramsSchema: snowflakeGetRowByFieldValueParamsSchema,
350
382
  outputSchema: snowflakeGetRowByFieldValueOutputSchema,
383
+ actionType: "read",
351
384
  },
352
385
  runSnowflakeQuery: {
353
386
  fn: runSnowflakeQuery,
354
387
  paramsSchema: snowflakeRunSnowflakeQueryParamsSchema,
355
388
  outputSchema: snowflakeRunSnowflakeQueryOutputSchema,
389
+ actionType: "write",
356
390
  },
357
391
  },
358
392
  linkedin: {
@@ -370,41 +404,49 @@ export const ActionMapper = {
370
404
  fn: getJiraDCIssuesByQuery,
371
405
  paramsSchema: jiraGetJiraIssuesByQueryParamsSchema,
372
406
  outputSchema: jiraGetJiraIssuesByQueryOutputSchema,
407
+ actionType: "read",
373
408
  },
374
409
  assignJiraTicket: {
375
410
  fn: assignJiraTicket,
376
411
  paramsSchema: jiraAssignJiraTicketParamsSchema,
377
412
  outputSchema: jiraAssignJiraTicketOutputSchema,
413
+ actionType: "write",
378
414
  },
379
415
  commentJiraTicket: {
380
416
  fn: commentJiraTicket,
381
417
  paramsSchema: jiraCommentJiraTicketParamsSchema,
382
418
  outputSchema: jiraCommentJiraTicketOutputSchema,
419
+ actionType: "write",
383
420
  },
384
421
  createJiraTicket: {
385
422
  fn: createJiraTicket,
386
423
  paramsSchema: jiraCreateJiraTicketParamsSchema,
387
424
  outputSchema: jiraCreateJiraTicketOutputSchema,
425
+ actionType: "write",
388
426
  },
389
427
  getJiraTicketDetails: {
390
428
  fn: getJiraTicketDetails,
391
429
  paramsSchema: jiraGetJiraTicketDetailsParamsSchema,
392
430
  outputSchema: jiraGetJiraTicketDetailsOutputSchema,
431
+ actionType: "read",
393
432
  },
394
433
  getJiraTicketHistory: {
395
434
  fn: getJiraTicketHistory,
396
435
  paramsSchema: jiraGetJiraTicketHistoryParamsSchema,
397
436
  outputSchema: jiraGetJiraTicketHistoryOutputSchema,
437
+ actionType: "read",
398
438
  },
399
439
  updateJiraTicketDetails: {
400
440
  fn: updateJiraTicketDetails,
401
441
  paramsSchema: jiraUpdateJiraTicketDetailsParamsSchema,
402
442
  outputSchema: jiraUpdateJiraTicketDetailsOutputSchema,
443
+ actionType: "write",
403
444
  },
404
445
  updateJiraTicketStatus: {
405
446
  fn: updateJiraTicketStatus,
406
447
  paramsSchema: jiraUpdateJiraTicketStatusParamsSchema,
407
448
  outputSchema: jiraUpdateJiraTicketStatusOutputSchema,
449
+ actionType: "write",
408
450
  },
409
451
  },
410
452
  openstreetmap: {
@@ -453,11 +495,13 @@ export const ActionMapper = {
453
495
  fn: sendEmail,
454
496
  paramsSchema: resendSendEmailParamsSchema,
455
497
  outputSchema: resendSendEmailOutputSchema,
498
+ actionType: "write",
456
499
  },
457
500
  sendEmailHtml: {
458
501
  fn: sendEmailHtml,
459
502
  paramsSchema: resendSendEmailHtmlParamsSchema,
460
503
  outputSchema: resendSendEmailHtmlOutputSchema,
504
+ actionType: "write",
461
505
  },
462
506
  },
463
507
  googleOauth: {
@@ -465,126 +509,151 @@ export const ActionMapper = {
465
509
  fn: createNewGoogleDoc,
466
510
  paramsSchema: googleOauthCreateNewGoogleDocParamsSchema,
467
511
  outputSchema: googleOauthCreateNewGoogleDocOutputSchema,
512
+ actionType: "write",
468
513
  },
469
514
  updateDoc: {
470
515
  fn: updateDoc,
471
516
  paramsSchema: googleOauthUpdateDocParamsSchema,
472
517
  outputSchema: googleOauthUpdateDocOutputSchema,
518
+ actionType: "write",
473
519
  },
474
520
  scheduleCalendarMeeting: {
475
521
  fn: scheduleCalendarMeeting,
476
522
  paramsSchema: googleOauthScheduleCalendarMeetingParamsSchema,
477
523
  outputSchema: googleOauthScheduleCalendarMeetingOutputSchema,
524
+ actionType: "write",
478
525
  },
479
526
  createSpreadsheet: {
480
527
  fn: createSpreadsheet,
481
528
  paramsSchema: googleOauthCreateSpreadsheetParamsSchema,
482
529
  outputSchema: googleOauthCreateSpreadsheetOutputSchema,
530
+ actionType: "write",
483
531
  },
484
532
  updateSpreadsheet: {
485
533
  fn: updateSpreadsheet,
486
534
  paramsSchema: googleOauthUpdateSpreadsheetParamsSchema,
487
535
  outputSchema: googleOauthUpdateSpreadsheetOutputSchema,
536
+ actionType: "write",
488
537
  },
489
538
  createPresentation: {
490
539
  fn: createPresentation,
491
540
  paramsSchema: googleOauthCreatePresentationParamsSchema,
492
541
  outputSchema: googleOauthCreatePresentationOutputSchema,
542
+ actionType: "write",
493
543
  },
494
544
  updatePresentation: {
495
545
  fn: updatePresentation,
496
546
  paramsSchema: googleOauthUpdatePresentationParamsSchema,
497
547
  outputSchema: googleOauthUpdatePresentationOutputSchema,
548
+ actionType: "write",
498
549
  },
499
550
  getPresentation: {
500
551
  fn: getPresentation,
501
552
  paramsSchema: googleOauthGetPresentationParamsSchema,
502
553
  outputSchema: googleOauthGetPresentationOutputSchema,
554
+ actionType: "read",
503
555
  },
504
556
  searchDriveByKeywords: {
505
557
  fn: searchDriveByKeywords,
506
558
  paramsSchema: googleOauthSearchDriveByKeywordsParamsSchema,
507
559
  outputSchema: googleOauthSearchDriveByKeywordsOutputSchema,
560
+ actionType: "read",
508
561
  },
509
562
  searchDriveByKeywordsAndGetFileContent: {
510
563
  fn: searchDriveByKeywordsAndGetFileContent,
511
564
  paramsSchema: googleOauthSearchDriveByKeywordsAndGetFileContentParamsSchema,
512
565
  outputSchema: googleOauthSearchDriveByKeywordsAndGetFileContentOutputSchema,
566
+ actionType: "read",
513
567
  },
514
568
  searchDriveByQuery: {
515
569
  fn: searchDriveByQuery,
516
570
  paramsSchema: googleOauthSearchDriveByQueryParamsSchema,
517
571
  outputSchema: googleOauthSearchDriveByQueryOutputSchema,
572
+ actionType: "read",
518
573
  },
519
574
  searchDriveByQueryAndGetFileContent: {
520
575
  fn: searchDriveByQueryAndGetFileContent,
521
576
  paramsSchema: googleOauthSearchDriveByQueryAndGetFileContentParamsSchema,
522
577
  outputSchema: googleOauthSearchDriveByQueryAndGetFileContentOutputSchema,
578
+ actionType: "read",
523
579
  },
524
580
  getDriveFileContentById: {
525
581
  fn: getDriveFileContentById,
526
582
  paramsSchema: googleOauthGetDriveFileContentByIdParamsSchema,
527
583
  outputSchema: googleOauthGetDriveFileContentByIdOutputSchema,
584
+ actionType: "read",
528
585
  },
529
586
  listCalendars: {
530
587
  fn: listCalendars,
531
588
  paramsSchema: googleOauthListCalendarsParamsSchema,
532
589
  outputSchema: googleOauthListCalendarsOutputSchema,
590
+ actionType: "read",
533
591
  },
534
592
  listCalendarEvents: {
535
593
  fn: listCalendarEvents,
536
594
  paramsSchema: googleOauthListCalendarEventsParamsSchema,
537
595
  outputSchema: googleOauthListCalendarEventsOutputSchema,
596
+ actionType: "read",
538
597
  },
539
598
  updateCalendarEvent: {
540
599
  fn: updateCalendarEvent,
541
600
  paramsSchema: googleOauthUpdateCalendarEventParamsSchema,
542
601
  outputSchema: googleOauthUpdateCalendarEventOutputSchema,
602
+ actionType: "write",
543
603
  },
544
604
  deleteCalendarEvent: {
545
605
  fn: deleteCalendarEvent,
546
606
  paramsSchema: googleOauthDeleteCalendarEventParamsSchema,
547
607
  outputSchema: googleOauthDeleteCalendarEventOutputSchema,
608
+ actionType: "write",
548
609
  },
549
610
  editAGoogleCalendarEvent: {
550
611
  fn: editAGoogleCalendarEvent,
551
612
  paramsSchema: googleOauthEditAGoogleCalendarEventParamsSchema,
552
613
  outputSchema: googleOauthEditAGoogleCalendarEventOutputSchema,
614
+ actionType: "write",
553
615
  },
554
616
  listGroups: {
555
617
  fn: listGroups,
556
618
  paramsSchema: googleOauthListGroupsParamsSchema,
557
619
  outputSchema: googleOauthListGroupsOutputSchema,
620
+ actionType: "read",
558
621
  },
559
622
  getGroup: {
560
623
  fn: getGroup,
561
624
  paramsSchema: googleOauthGetGroupParamsSchema,
562
625
  outputSchema: googleOauthGetGroupOutputSchema,
626
+ actionType: "read",
563
627
  },
564
628
  listGroupMembers: {
565
629
  fn: listGroupMembers,
566
630
  paramsSchema: googleOauthListGroupMembersParamsSchema,
567
631
  outputSchema: googleOauthListGroupMembersOutputSchema,
632
+ actionType: "read",
568
633
  },
569
634
  hasGroupMember: {
570
635
  fn: hasGroupMember,
571
636
  paramsSchema: googleOauthHasGroupMemberParamsSchema,
572
637
  outputSchema: googleOauthHasGroupMemberOutputSchema,
638
+ actionType: "read",
573
639
  },
574
640
  addGroupMember: {
575
641
  fn: addGroupMember,
576
642
  paramsSchema: googleOauthAddGroupMemberParamsSchema,
577
643
  outputSchema: googleOauthAddGroupMemberOutputSchema,
644
+ actionType: "write",
578
645
  },
579
646
  deleteGroupMember: {
580
647
  fn: deleteGroupMember,
581
648
  paramsSchema: googleOauthDeleteGroupMemberParamsSchema,
582
649
  outputSchema: googleOauthDeleteGroupMemberOutputSchema,
650
+ actionType: "write",
583
651
  },
584
652
  queryGoogleBigQuery: {
585
653
  fn: queryGoogleBigQuery,
586
654
  paramsSchema: googleOauthQueryGoogleBigQueryParamsSchema,
587
655
  outputSchema: googleOauthQueryGoogleBigQueryOutputSchema,
656
+ actionType: "write",
588
657
  },
589
658
  },
590
659
  googlemail: {
@@ -592,16 +661,19 @@ export const ActionMapper = {
592
661
  fn: searchGmailMessages,
593
662
  paramsSchema: googlemailSearchGmailMessagesParamsSchema,
594
663
  outputSchema: googlemailSearchGmailMessagesOutputSchema,
664
+ actionType: "read",
595
665
  },
596
666
  listGmailThreads: {
597
667
  fn: listGmailThreads,
598
668
  paramsSchema: googlemailListGmailThreadsParamsSchema,
599
669
  outputSchema: googlemailListGmailThreadsOutputSchema,
670
+ actionType: "read",
600
671
  },
601
672
  sendGmail: {
602
673
  fn: sendGmail,
603
674
  paramsSchema: googlemailSendGmailParamsSchema,
604
675
  outputSchema: googlemailSendGmailOutputSchema,
676
+ actionType: "write",
605
677
  },
606
678
  },
607
679
  googleSearch: {
@@ -635,6 +707,7 @@ export const ActionMapper = {
635
707
  fn: enableUserByEmail,
636
708
  paramsSchema: lookerEnableUserByEmailParamsSchema,
637
709
  outputSchema: lookerEnableUserByEmailOutputSchema,
710
+ actionType: "write",
638
711
  },
639
712
  },
640
713
  salesforce: {
@@ -642,41 +715,49 @@ export const ActionMapper = {
642
715
  fn: updateRecord,
643
716
  paramsSchema: salesforceUpdateRecordParamsSchema,
644
717
  outputSchema: salesforceUpdateRecordOutputSchema,
718
+ actionType: "write",
645
719
  },
646
720
  createRecord: {
647
721
  fn: createRecord,
648
722
  paramsSchema: salesforceCreateRecordParamsSchema,
649
723
  outputSchema: salesforceCreateRecordOutputSchema,
724
+ actionType: "write",
650
725
  },
651
726
  createCase: {
652
727
  fn: createCase,
653
728
  paramsSchema: salesforceCreateCaseParamsSchema,
654
729
  outputSchema: salesforceCreateCaseOutputSchema,
730
+ actionType: "write",
655
731
  },
656
732
  generateSalesReport: {
657
733
  fn: generateSalesReport,
658
734
  paramsSchema: salesforceGenerateSalesReportParamsSchema,
659
735
  outputSchema: salesforceGenerateSalesReportOutputSchema,
736
+ actionType: "read",
660
737
  },
661
738
  getRecord: {
662
739
  fn: getRecord,
663
740
  paramsSchema: salesforceGetRecordParamsSchema,
664
741
  outputSchema: salesforceGetRecordOutputSchema,
742
+ actionType: "read",
665
743
  },
666
744
  searchSalesforceRecords: {
667
745
  fn: searchSalesforceRecords,
668
746
  paramsSchema: salesforceSearchSalesforceRecordsParamsSchema,
669
747
  outputSchema: salesforceSearchSalesforceRecordsOutputSchema,
748
+ actionType: "read",
670
749
  },
671
750
  searchAllSalesforceRecords: {
672
751
  fn: searchAllSalesforceRecords,
673
752
  paramsSchema: salesforceSearchAllSalesforceRecordsParamsSchema,
674
753
  outputSchema: salesforceSearchAllSalesforceRecordsOutputSchema,
754
+ actionType: "read",
675
755
  },
676
756
  getSalesforceRecordsByQuery: {
677
757
  fn: getSalesforceRecordsByQuery,
678
758
  paramsSchema: salesforceGetSalesforceRecordsByQueryParamsSchema,
679
759
  outputSchema: salesforceGetSalesforceRecordsByQueryOutputSchema,
760
+ actionType: "read",
680
761
  },
681
762
  },
682
763
  microsoft: {
@@ -684,31 +765,37 @@ export const ActionMapper = {
684
765
  fn: sendMessageToTeamsChat,
685
766
  paramsSchema: microsoftMessageTeamsChatParamsSchema,
686
767
  outputSchema: microsoftMessageTeamsChatOutputSchema,
768
+ actionType: "write",
687
769
  },
688
770
  messageTeamsChannel: {
689
771
  fn: sendMessageToTeamsChannel,
690
772
  paramsSchema: microsoftMessageTeamsChannelParamsSchema,
691
773
  outputSchema: microsoftMessageTeamsChannelOutputSchema,
774
+ actionType: "write",
692
775
  },
693
776
  updateSpreadsheet: {
694
777
  fn: microsoftUpdateSpreadsheet,
695
778
  paramsSchema: microsoftUpdateSpreadsheetParamsSchema,
696
779
  outputSchema: microsoftUpdateSpreadsheetOutputSchema,
780
+ actionType: "write",
697
781
  },
698
782
  updateDocument: {
699
783
  fn: updateDocument,
700
784
  paramsSchema: microsoftUpdateDocumentParamsSchema,
701
785
  outputSchema: microsoftUpdateDocumentOutputSchema,
786
+ actionType: "write",
702
787
  },
703
788
  createDocument: {
704
789
  fn: createDocument,
705
790
  paramsSchema: microsoftCreateDocumentParamsSchema,
706
791
  outputSchema: microsoftCreateDocumentOutputSchema,
792
+ actionType: "write",
707
793
  },
708
794
  getDocument: {
709
795
  fn: getDocument,
710
796
  paramsSchema: microsoftGetDocumentParamsSchema,
711
797
  outputSchema: microsoftGetDocumentOutputSchema,
798
+ actionType: "read",
712
799
  },
713
800
  },
714
801
  github: {
@@ -716,56 +803,67 @@ export const ActionMapper = {
716
803
  fn: searchOrganization,
717
804
  paramsSchema: githubSearchOrganizationParamsSchema,
718
805
  outputSchema: githubSearchOrganizationOutputSchema,
806
+ actionType: "read",
719
807
  },
720
808
  searchRepository: {
721
809
  fn: searchRepository,
722
810
  paramsSchema: githubSearchRepositoryParamsSchema,
723
811
  outputSchema: githubSearchRepositoryOutputSchema,
812
+ actionType: "read",
724
813
  },
725
814
  createOrUpdateFile: {
726
815
  fn: createOrUpdateFile,
727
816
  paramsSchema: githubCreateOrUpdateFileParamsSchema,
728
817
  outputSchema: githubCreateOrUpdateFileOutputSchema,
818
+ actionType: "write",
729
819
  },
730
820
  createBranch: {
731
821
  fn: createBranch,
732
822
  paramsSchema: githubCreateBranchParamsSchema,
733
823
  outputSchema: githubCreateBranchOutputSchema,
824
+ actionType: "write",
734
825
  },
735
826
  createPullRequest: {
736
827
  fn: createPullRequest,
737
828
  paramsSchema: githubCreatePullRequestParamsSchema,
738
829
  outputSchema: githubCreatePullRequestOutputSchema,
830
+ actionType: "write",
739
831
  },
740
832
  listPullRequests: {
741
833
  fn: listPullRequests,
742
834
  paramsSchema: githubListPullRequestsParamsSchema,
743
835
  outputSchema: githubListPullRequestsOutputSchema,
836
+ actionType: "read",
744
837
  },
745
838
  getFileContent: {
746
839
  fn: getFileContent,
747
840
  paramsSchema: githubGetFileContentParamsSchema,
748
841
  outputSchema: githubGetFileContentOutputSchema,
842
+ actionType: "read",
749
843
  },
750
844
  listDirectory: {
751
845
  fn: listDirectory,
752
846
  paramsSchema: githubListDirectoryParamsSchema,
753
847
  outputSchema: githubListDirectoryOutputSchema,
848
+ actionType: "read",
754
849
  },
755
850
  getBranch: {
756
851
  fn: getBranch,
757
852
  paramsSchema: githubGetBranchParamsSchema,
758
853
  outputSchema: githubGetBranchOutputSchema,
854
+ actionType: "read",
759
855
  },
760
856
  listCommits: {
761
857
  fn: listCommits,
762
858
  paramsSchema: githubListCommitsParamsSchema,
763
859
  outputSchema: githubListCommitsOutputSchema,
860
+ actionType: "read",
764
861
  },
765
862
  getPullRequestDetails: {
766
863
  fn: getPullRequestDetails,
767
864
  paramsSchema: githubGetPullRequestDetailsParamsSchema,
768
865
  outputSchema: githubGetPullRequestDetailsOutputSchema,
866
+ actionType: "read",
769
867
  },
770
868
  },
771
869
  notion: {
@@ -773,6 +871,7 @@ export const ActionMapper = {
773
871
  fn: searchByTitle,
774
872
  paramsSchema: notionSearchByTitleParamsSchema,
775
873
  outputSchema: notionSearchByTitleOutputSchema,
874
+ actionType: "read",
776
875
  },
777
876
  },
778
877
  oktaOrg: {
@@ -780,6 +879,7 @@ export const ActionMapper = {
780
879
  fn: getOktaUserByName,
781
880
  paramsSchema: oktaOrgGetOktaUserByNameParamsSchema,
782
881
  outputSchema: oktaOrgGetOktaUserByNameOutputSchema,
882
+ actionType: "read",
783
883
  },
784
884
  },
785
885
  gitlab: {
@@ -787,21 +887,25 @@ export const ActionMapper = {
787
887
  fn: searchGroup,
788
888
  paramsSchema: gitlabSearchGroupParamsSchema,
789
889
  outputSchema: gitlabSearchGroupOutputSchema,
890
+ actionType: "read",
790
891
  },
791
892
  getFileContent: {
792
893
  fn: gitlabGetFileContent,
793
894
  paramsSchema: gitlabGetFileContentParamsSchema,
794
895
  outputSchema: gitlabGetFileContentOutputSchema,
896
+ actionType: "read",
795
897
  },
796
898
  getMergeRequest: {
797
899
  fn: gitlabGetMergeRequest,
798
900
  paramsSchema: gitlabGetMergeRequestParamsSchema,
799
901
  outputSchema: gitlabGetMergeRequestOutputSchema,
902
+ actionType: "read",
800
903
  },
801
904
  listDirectory: {
802
905
  fn: gitlabListDirectory,
803
906
  paramsSchema: gitlabListDirectoryParamsSchema,
804
907
  outputSchema: gitlabListDirectoryOutputSchema,
908
+ actionType: "read",
805
909
  },
806
910
  },
807
911
  linear: {
@@ -809,31 +913,37 @@ export const ActionMapper = {
809
913
  fn: getIssues,
810
914
  paramsSchema: linearGetIssuesParamsSchema,
811
915
  outputSchema: linearGetIssuesOutputSchema,
916
+ actionType: "read",
812
917
  },
813
918
  getIssueDetails: {
814
919
  fn: getIssueDetails,
815
920
  paramsSchema: linearGetIssueDetailsParamsSchema,
816
921
  outputSchema: linearGetIssueDetailsOutputSchema,
922
+ actionType: "read",
817
923
  },
818
924
  getProjects: {
819
925
  fn: getProjects,
820
926
  paramsSchema: linearGetProjectsParamsSchema,
821
927
  outputSchema: linearGetProjectsOutputSchema,
928
+ actionType: "read",
822
929
  },
823
930
  getProjectDetails: {
824
931
  fn: getProjectDetails,
825
932
  paramsSchema: linearGetProjectDetailsParamsSchema,
826
933
  outputSchema: linearGetProjectDetailsOutputSchema,
934
+ actionType: "read",
827
935
  },
828
936
  getTeamDetails: {
829
937
  fn: getTeamDetails,
830
938
  paramsSchema: linearGetTeamDetailsParamsSchema,
831
939
  outputSchema: linearGetTeamDetailsOutputSchema,
940
+ actionType: "read",
832
941
  },
833
942
  getTeams: {
834
943
  fn: getTeams,
835
944
  paramsSchema: linearGetTeamsParamsSchema,
836
945
  outputSchema: linearGetTeamsOutputSchema,
946
+ actionType: "read",
837
947
  },
838
948
  },
839
949
  hubspot: {
@@ -841,41 +951,49 @@ export const ActionMapper = {
841
951
  fn: getContacts,
842
952
  paramsSchema: hubspotGetContactsParamsSchema,
843
953
  outputSchema: hubspotGetContactsOutputSchema,
954
+ actionType: "read",
844
955
  },
845
956
  getContactDetails: {
846
957
  fn: getContactDetails,
847
958
  paramsSchema: hubspotGetContactDetailsParamsSchema,
848
959
  outputSchema: hubspotGetContactDetailsOutputSchema,
960
+ actionType: "read",
849
961
  },
850
962
  getCompanies: {
851
963
  fn: getCompanies,
852
964
  paramsSchema: hubspotGetCompaniesParamsSchema,
853
965
  outputSchema: hubspotGetCompaniesOutputSchema,
966
+ actionType: "read",
854
967
  },
855
968
  getCompanyDetails: {
856
969
  fn: getCompanyDetails,
857
970
  paramsSchema: hubspotGetCompanyDetailsParamsSchema,
858
971
  outputSchema: hubspotGetCompanyDetailsOutputSchema,
972
+ actionType: "read",
859
973
  },
860
974
  getDeals: {
861
975
  fn: getDeals,
862
976
  paramsSchema: hubspotGetDealsParamsSchema,
863
977
  outputSchema: hubspotGetDealsOutputSchema,
978
+ actionType: "read",
864
979
  },
865
980
  getDealDetails: {
866
981
  fn: getDealDetails,
867
982
  paramsSchema: hubspotGetDealDetailsParamsSchema,
868
983
  outputSchema: hubspotGetDealDetailsOutputSchema,
984
+ actionType: "read",
869
985
  },
870
986
  getTickets: {
871
987
  fn: getTickets,
872
988
  paramsSchema: hubspotGetTicketsParamsSchema,
873
989
  outputSchema: hubspotGetTicketsOutputSchema,
990
+ actionType: "read",
874
991
  },
875
992
  getTicketDetails: {
876
993
  fn: getTicketDetails,
877
994
  paramsSchema: hubspotGetTicketDetailsParamsSchema,
878
995
  outputSchema: hubspotGetTicketDetailsOutputSchema,
996
+ actionType: "read",
879
997
  },
880
998
  },
881
999
  };
@@ -1,4 +1,4 @@
1
- import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } from "./autogen/templates.js";
1
+ import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
2
2
  export const ACTION_GROUPS = {
3
3
  GENERIC: {
4
4
  description: "Generic utility actions",
@@ -47,7 +47,6 @@ export const ACTION_GROUPS = {
47
47
  googleOauthUpdatePresentationDefinition,
48
48
  googleOauthSearchDriveByKeywordsDefinition,
49
49
  googleOauthSearchDriveByQueryDefinition,
50
- googleOauthSearchDriveByQueryAndGetFileContentDefinition,
51
50
  googleOauthGetDriveFileContentByIdDefinition,
52
51
  ],
53
52
  },
@@ -199,8 +198,6 @@ export const ACTION_GROUPS = {
199
198
  githubCreateBranchDefinition,
200
199
  githubCreatePullRequestDefinition,
201
200
  githubListPullRequestsDefinition,
202
- githubGetFileContentDefinition,
203
- githubListDirectoryDefinition,
204
201
  ],
205
202
  },
206
203
  ASHBY: {
@@ -0,0 +1,3 @@
1
+ import type { credalCallCopilotFunction } from "../../autogen/types";
2
+ declare const callCopilot: credalCallCopilotFunction;
3
+ export default callCopilot;
@@ -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;
@@ -0,0 +1 @@
1
+ export * as add from "./add";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.add = void 0;
37
+ exports.add = __importStar(require("./add"));
@@ -0,0 +1,3 @@
1
+ import { salesforceGetSalesforceRecordsByQueryFunction } from "../../autogen/types";
2
+ declare const getSalesforceRecordByQuery: salesforceGetSalesforceRecordsByQueryFunction;
3
+ export default getSalesforceRecordByQuery;
@@ -0,0 +1,43 @@
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 axiosClient_1 = require("../../util/axiosClient");
13
+ const getSalesforceRecordByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
+ const { authToken, baseUrl } = authParams;
15
+ const { query, limit } = params;
16
+ if (!authToken || !baseUrl) {
17
+ return {
18
+ success: false,
19
+ error: "authToken and baseUrl are required for Salesforce API",
20
+ };
21
+ }
22
+ // The API limits the maximum number of records returned to 2000, the limit lets the user set a smaller custom limit
23
+ const url = `${baseUrl}/services/data/v56.0/query/?q=${encodeURIComponent(query + " LIMIT " + (limit != undefined && limit <= 2000 ? limit : 2000))}`;
24
+ try {
25
+ const response = yield axiosClient_1.axiosClient.get(url, {
26
+ headers: {
27
+ Authorization: `Bearer ${authToken}`,
28
+ },
29
+ });
30
+ return {
31
+ success: true,
32
+ records: response.data,
33
+ };
34
+ }
35
+ catch (error) {
36
+ console.error("Error retrieving Salesforce record:", error);
37
+ return {
38
+ success: false,
39
+ error: error instanceof Error ? error.message : "An unknown error occurred",
40
+ };
41
+ }
42
+ });
43
+ exports.default = getSalesforceRecordByQuery;
@@ -9,21 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { WebClient } from "@slack/web-api";
11
11
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- import { getSlackChannels } from "./helpers.js";
13
12
  const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
13
  if (!authParams.authToken) {
15
14
  throw new Error(MISSING_AUTH_TOKEN);
16
15
  }
17
16
  try {
18
17
  const client = new WebClient(authParams.authToken);
19
- const { channelName } = params;
20
- const allChannels = yield getSlackChannels(client);
21
- const channel = allChannels.find(channel => channel.name == channelName);
22
- if (!channel || !channel.id) {
23
- throw Error(`Channel with name ${channelName} not found`);
24
- }
25
- yield client.conversations.join({ channel: channel.id });
26
- const result = yield client.conversations.archive({ channel: channel.id });
18
+ const { channelId } = params;
19
+ const result = yield client.conversations.archive({ channel: channelId });
27
20
  if (!result.ok) {
28
21
  return {
29
22
  success: false,
@@ -0,0 +1 @@
1
+ export * as listConversations from "./listConversations";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.listConversations = void 0;
37
+ exports.listConversations = __importStar(require("./listConversations"));
@@ -0,0 +1,3 @@
1
+ import type { slackListConversationsFunction } from "../../autogen/types";
2
+ declare const slackListConversations: slackListConversationsFunction;
3
+ export default slackListConversations;
@@ -0,0 +1,41 @@
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 web_api_1 = require("@slack/web-api");
13
+ const helpers_1 = require("./helpers");
14
+ const slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
15
+ const client = new web_api_1.WebClient(authParams.authToken);
16
+ try {
17
+ const allChannels = yield (0, helpers_1.getSlackChannels)(client);
18
+ const filteredChannels = [];
19
+ for (const channel of allChannels) {
20
+ if (channel.name && channel.topic && channel.topic.value && channel.purpose && channel.purpose.value) {
21
+ const purpose = channel.purpose.value;
22
+ const topic = channel.topic.value;
23
+ const name = channel.name;
24
+ filteredChannels.push(Object.assign(Object.assign({}, channel), { purpose, topic, name }));
25
+ }
26
+ }
27
+ return {
28
+ channels: filteredChannels,
29
+ };
30
+ }
31
+ catch (error) {
32
+ if (error instanceof Error) {
33
+ // Enhance error with more context
34
+ throw new Error(`Failed to list Slack conversations: ${error.message}`);
35
+ }
36
+ else {
37
+ throw error;
38
+ }
39
+ }
40
+ });
41
+ exports.default = slackListConversations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.174",
3
+ "version": "0.2.175",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,3 +0,0 @@
1
- import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
- declare const searchRepository: githubSearchRepositoryFunction;
3
- export default searchRepository;
@@ -1,131 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
11
- // Limits on the number of results to return
12
- const MAX_CODE_RESULTS = 15;
13
- const MAX_COMMITS = 10;
14
- const MAX_FILES_PER_COMMIT = 5;
15
- const MAX_ISSUES_OR_PRS = 10;
16
- const MAX_FILES_PER_PR = 5;
17
- const MAX_PATCH_LINES = 20;
18
- const MAX_FRAGMENT_LINES = 20;
19
- const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
- const { Octokit } = yield import("octokit");
21
- if (!authParams.authToken) {
22
- throw new Error(MISSING_AUTH_TOKEN);
23
- }
24
- const octokit = new Octokit({ auth: authParams.authToken });
25
- const { organization, repository, query } = params;
26
- // Search CODE with text match metadata
27
- const codeResultsResponse = yield octokit.rest.search.code({
28
- q: `${query} in:file,path repo:${organization}/${repository}`,
29
- text_match: true,
30
- headers: {
31
- accept: "application/vnd.github.v3.text-match+json",
32
- },
33
- });
34
- const codeResults = codeResultsResponse.data.items.slice(0, MAX_CODE_RESULTS).map(item => ({
35
- name: item.name,
36
- path: item.path,
37
- sha: item.sha,
38
- url: item.url,
39
- repository: {
40
- full_name: item.repository.full_name,
41
- html_url: item.repository.html_url,
42
- },
43
- score: item.score,
44
- textMatches: item.text_matches
45
- ? item.text_matches.map(match => {
46
- var _a, _b, _c, _d;
47
- return ({
48
- object_url: (_a = match.object_url) !== null && _a !== void 0 ? _a : undefined,
49
- object_type: (_b = match.object_type) !== null && _b !== void 0 ? _b : undefined,
50
- fragment: (_c = match.fragment) === null || _c === void 0 ? void 0 : _c.split("\n").slice(0, MAX_FRAGMENT_LINES).join("\n"),
51
- matches: (_d = match.matches) !== null && _d !== void 0 ? _d : [],
52
- });
53
- })
54
- : [],
55
- }));
56
- // Search COMMITS
57
- const commitResults = yield octokit.rest.search.commits({
58
- q: `${query} repo:${organization}/${repository}`,
59
- headers: {
60
- accept: "application/vnd.github.cloak-preview+json",
61
- },
62
- });
63
- const commitSHAs = commitResults.data.items.slice(0, MAX_COMMITS).map(item => item.sha);
64
- const commitDetails = yield Promise.all(commitSHAs.map(sha => octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha })));
65
- const enrichedCommits = commitResults.data.items.slice(0, MAX_COMMITS).map(item => {
66
- var _a, _b;
67
- const full = commitDetails.find(c => c.data.sha === item.sha);
68
- return {
69
- sha: item.sha,
70
- url: item.url,
71
- commit: {
72
- message: item.commit.message,
73
- author: item.commit.author,
74
- },
75
- score: item.score,
76
- author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
77
- files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
78
- var _a;
79
- return ({
80
- filename: f.filename,
81
- status: f.status,
82
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
83
- });
84
- })) || [],
85
- };
86
- });
87
- // Search ISSUES & PRs
88
- const issueResults = yield octokit.rest.search.issuesAndPullRequests({
89
- q: `${query} repo:${organization}/${repository}`,
90
- });
91
- const prItems = issueResults.data.items.filter(item => item.pull_request).slice(0, MAX_ISSUES_OR_PRS);
92
- const prNumbers = prItems.map(item => item.number);
93
- const prFiles = yield Promise.all(prNumbers.map(number => octokit.rest.pulls.listFiles({ owner: organization, repo: repository, pull_number: number })));
94
- const issuesAndPRs = issueResults.data.items
95
- .slice(0, MAX_ISSUES_OR_PRS)
96
- .map(item => {
97
- var _a, _b, _c, _d;
98
- const isPR = !!item.pull_request;
99
- const prIndex = prNumbers.indexOf(item.number);
100
- const files = isPR && prIndex !== -1
101
- ? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
102
- var _a;
103
- return ({
104
- filename: f.filename,
105
- status: f.status,
106
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
107
- });
108
- })
109
- : undefined;
110
- return {
111
- number: item.number,
112
- title: item.title,
113
- html_url: item.html_url,
114
- state: item.state,
115
- isPullRequest: isPR,
116
- body: item.body,
117
- user: {
118
- email: (_b = (_a = item.user) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : undefined,
119
- name: (_d = (_c = item.user) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined,
120
- },
121
- score: item.score,
122
- files,
123
- };
124
- });
125
- return {
126
- code: codeResults,
127
- commits: enrichedCommits,
128
- issuesAndPullRequests: issuesAndPRs,
129
- };
130
- });
131
- export default searchRepository;
@@ -1,3 +0,0 @@
1
- import type { githubSearchRepositoryFunction } from "../../autogen/types.js";
2
- declare const searchRepository: githubSearchRepositoryFunction;
3
- export default searchRepository;
@@ -1,41 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
11
- // Limits on the number of results to return
12
- const MAX_CODE_RESULTS = 15;
13
- const MAX_COMMITS = 10;
14
- const MAX_FILES_PER_COMMIT = 5;
15
- const MAX_ISSUES_OR_PRS = 10;
16
- const MAX_FILES_PER_PR = 5;
17
- const MAX_PATCH_LINES = 20;
18
- const MAX_FRAGMENT_LINES = 20;
19
- const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
20
- const { Octokit } = yield import("octokit");
21
- if (!authParams.authToken) {
22
- throw new Error(MISSING_AUTH_TOKEN);
23
- }
24
- const octokit = new Octokit({ auth: authParams.authToken });
25
- const { organization, repository, query } = params;
26
- // Search CODE with text match metadata
27
- const codeResultsResponse = yield octokit.rest.search.code({
28
- q: `${query} in:file,path repo:${organization}/${repository}`,
29
- text_match: true,
30
- headers: {
31
- accept: "application/vnd.github.v3.text-match+json",
32
- },
33
- });
34
- const commitResults = yield octokit.rest.repos.getCommit({ owner: organization, repo: repository, ref: sha });
35
- return {
36
- code: codeResults,
37
- commits: enrichedCommits,
38
- issuesAndPullRequests: issuesAndPRs,
39
- };
40
- });
41
- export default searchRepository;