@credal/actions 0.2.47 → 0.2.49

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 (37) hide show
  1. package/dist/actions/actionMapper.js +39 -1
  2. package/dist/actions/autogen/templates.d.ts +6 -0
  3. package/dist/actions/autogen/templates.js +640 -0
  4. package/dist/actions/autogen/types.d.ts +803 -1
  5. package/dist/actions/autogen/types.js +222 -0
  6. package/dist/actions/groups.js +11 -1
  7. package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
  8. package/dist/actions/providers/confluence/updatePage.js +47 -0
  9. package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
  10. package/dist/actions/providers/credal/callCopilot.js +36 -0
  11. package/dist/actions/providers/github/searchRepository.js +3 -2
  12. package/dist/actions/providers/gitlab/searchGroup.js +11 -5
  13. package/dist/actions/providers/jamf/types.d.ts +8 -0
  14. package/dist/actions/providers/jamf/types.js +7 -0
  15. package/dist/actions/providers/linear/getIssueDetails.d.ts +3 -0
  16. package/dist/actions/providers/linear/getIssueDetails.js +127 -0
  17. package/dist/actions/providers/linear/getIssues.d.ts +3 -0
  18. package/dist/actions/providers/linear/getIssues.js +160 -0
  19. package/dist/actions/providers/linear/getProjectDetails.d.ts +3 -0
  20. package/dist/actions/providers/linear/getProjectDetails.js +129 -0
  21. package/dist/actions/providers/linear/getProjects.d.ts +3 -0
  22. package/dist/actions/providers/linear/getProjects.js +96 -0
  23. package/dist/actions/providers/linear/getTeamDetails.d.ts +3 -0
  24. package/dist/actions/providers/linear/getTeamDetails.js +84 -0
  25. package/dist/actions/providers/linear/getTeams.d.ts +3 -0
  26. package/dist/actions/providers/linear/getTeams.js +68 -0
  27. package/dist/actions/providers/math/index.d.ts +1 -0
  28. package/dist/actions/providers/math/index.js +37 -0
  29. package/dist/actions/providers/slack/index.d.ts +1 -0
  30. package/dist/actions/providers/slack/index.js +37 -0
  31. package/dist/actions/providers/slack/listConversations.d.ts +3 -0
  32. package/dist/actions/providers/slack/listConversations.js +41 -0
  33. package/package.json +1 -1
  34. package/dist/actions/providers/github/fetchFile.d.ts +0 -3
  35. package/dist/actions/providers/github/fetchFile.js +0 -131
  36. package/dist/actions/providers/github/getContents.d.ts +0 -3
  37. package/dist/actions/providers/github/getContents.js +0 -41
@@ -33,6 +33,7 @@ export var ProviderName;
33
33
  ProviderName["NOTION"] = "notion";
34
34
  ProviderName["JAMF"] = "jamf";
35
35
  ProviderName["GITLAB"] = "gitlab";
36
+ ProviderName["LINEAR"] = "linear";
36
37
  })(ProviderName || (ProviderName = {}));
37
38
  export const AuthParamsSchema = z.object({
38
39
  authToken: z.string().optional(),
@@ -3487,3 +3488,224 @@ export const gitlabSearchGroupOutputSchema = z.object({
3487
3488
  }))
3488
3489
  .describe("A list of blobs that match the query"),
3489
3490
  });
3491
+ export const linearGetIssuesParamsSchema = z.object({
3492
+ query: z.string().describe("Optional query string to filter issues").optional(),
3493
+ maxResults: z.number().describe("Optional limit to number of results").optional(),
3494
+ });
3495
+ export const linearGetIssuesOutputSchema = z.object({
3496
+ success: z.boolean().describe("Whether the operation was successful"),
3497
+ error: z.string().describe("Error message if the operation failed").optional(),
3498
+ issues: z
3499
+ .array(z.object({
3500
+ id: z.string().describe("The issue ID").optional(),
3501
+ title: z.string().describe("The issue title").optional(),
3502
+ labels: z.array(z.string()).describe("The issue labels").optional(),
3503
+ state: z.string().describe("The issue state").optional(),
3504
+ assignee: z
3505
+ .object({
3506
+ id: z.string().describe("The assignee ID").optional(),
3507
+ name: z.string().describe("The assignee name").optional(),
3508
+ })
3509
+ .describe("The issue assignee")
3510
+ .optional(),
3511
+ due_date: z.string().describe("The issue due date").optional(),
3512
+ project: z
3513
+ .object({
3514
+ id: z.string().describe("The project ID").optional(),
3515
+ name: z.string().describe("The project name").optional(),
3516
+ })
3517
+ .describe("The project the issue belongs to")
3518
+ .optional(),
3519
+ team: z
3520
+ .object({
3521
+ id: z.string().describe("The team ID").optional(),
3522
+ name: z.string().describe("The team name").optional(),
3523
+ })
3524
+ .describe("The team the issue belongs to")
3525
+ .optional(),
3526
+ url: z.string().describe("The issue URL").optional(),
3527
+ comments: z
3528
+ .array(z.object({
3529
+ author_name: z.string().describe("The comment author name").optional(),
3530
+ comment: z.string().describe("The comment content").optional(),
3531
+ }))
3532
+ .describe("The issue comments")
3533
+ .optional(),
3534
+ }))
3535
+ .describe("List of issues matching the query")
3536
+ .optional(),
3537
+ });
3538
+ export const linearGetIssueDetailsParamsSchema = z.object({
3539
+ issueId: z.string().describe("The ID of the Linear issue to retrieve"),
3540
+ });
3541
+ export const linearGetIssueDetailsOutputSchema = z.object({
3542
+ success: z.boolean().describe("Whether the operation was successful"),
3543
+ error: z.string().describe("Error message if the operation failed").optional(),
3544
+ issue: z
3545
+ .object({
3546
+ id: z.string().describe("The issue ID").optional(),
3547
+ title: z.string().describe("The issue title").optional(),
3548
+ description: z.string().describe("The issue description").optional(),
3549
+ state: z.string().describe("The issue state").optional(),
3550
+ assignee: z
3551
+ .object({
3552
+ id: z.string().describe("The assignee ID").optional(),
3553
+ name: z.string().describe("The assignee name").optional(),
3554
+ })
3555
+ .describe("The issue assignee")
3556
+ .optional(),
3557
+ creator: z
3558
+ .object({
3559
+ id: z.string().describe("The creator ID").optional(),
3560
+ name: z.string().describe("The creator name").optional(),
3561
+ })
3562
+ .describe("The issue creator")
3563
+ .optional(),
3564
+ team: z
3565
+ .object({
3566
+ id: z.string().describe("The team ID").optional(),
3567
+ name: z.string().describe("The team name").optional(),
3568
+ })
3569
+ .describe("The team the issue belongs to")
3570
+ .optional(),
3571
+ project: z
3572
+ .object({
3573
+ id: z.string().describe("The project ID").optional(),
3574
+ name: z.string().describe("The project name").optional(),
3575
+ })
3576
+ .describe("The project the issue belongs to")
3577
+ .optional(),
3578
+ priority: z.number().describe("The issue priority (0-4)").optional(),
3579
+ estimate: z.number().describe("The issue estimate in story points").optional(),
3580
+ dueDate: z.string().describe("The issue due date").optional(),
3581
+ createdAt: z.string().describe("When the issue was created").optional(),
3582
+ updatedAt: z.string().describe("When the issue was last updated").optional(),
3583
+ labels: z.array(z.string()).describe("The issue labels").optional(),
3584
+ url: z.string().describe("The issue URL").optional(),
3585
+ comments: z
3586
+ .array(z.object({
3587
+ author_name: z.string().describe("The comment author name").optional(),
3588
+ comment: z.string().describe("The comment content").optional(),
3589
+ }))
3590
+ .describe("The issue comments")
3591
+ .optional(),
3592
+ content: z.string().describe("The issue content").optional(),
3593
+ })
3594
+ .describe("The issue details")
3595
+ .optional(),
3596
+ });
3597
+ export const linearGetProjectsParamsSchema = z.object({});
3598
+ export const linearGetProjectsOutputSchema = z.object({
3599
+ success: z.boolean().describe("Whether the operation was successful"),
3600
+ error: z.string().describe("Error message if the operation failed").optional(),
3601
+ projects: z
3602
+ .array(z.object({
3603
+ id: z.string().describe("The project ID").optional(),
3604
+ name: z.string().describe("The project name").optional(),
3605
+ status: z.string().describe("The project status").optional(),
3606
+ labels: z.array(z.string()).describe("The project labels").optional(),
3607
+ content: z.string().describe("The project content").optional(),
3608
+ description: z.string().describe("The project description").optional(),
3609
+ creator: z
3610
+ .object({
3611
+ id: z.string().describe("The creator ID").optional(),
3612
+ name: z.string().describe("The creator name").optional(),
3613
+ })
3614
+ .describe("The project creator")
3615
+ .optional(),
3616
+ lead: z
3617
+ .object({
3618
+ id: z.string().describe("The lead ID").optional(),
3619
+ name: z.string().describe("The lead name").optional(),
3620
+ })
3621
+ .describe("The project lead")
3622
+ .optional(),
3623
+ progress: z.number().describe("The project progress percentage").optional(),
3624
+ url: z.string().describe("The project URL").optional(),
3625
+ }))
3626
+ .describe("List of all projects")
3627
+ .optional(),
3628
+ });
3629
+ export const linearGetProjectDetailsParamsSchema = z.object({
3630
+ projectId: z.string().describe("The ID of the Linear project to retrieve"),
3631
+ });
3632
+ export const linearGetProjectDetailsOutputSchema = z.object({
3633
+ success: z.boolean().describe("Whether the operation was successful"),
3634
+ error: z.string().describe("Error message if the operation failed").optional(),
3635
+ project: z
3636
+ .object({
3637
+ id: z.string().describe("The project ID").optional(),
3638
+ name: z.string().describe("The project name").optional(),
3639
+ description: z.string().describe("The project description").optional(),
3640
+ state: z.string().describe("The project state").optional(),
3641
+ progress: z.number().describe("The project progress percentage").optional(),
3642
+ targetDate: z.string().describe("The project target date").optional(),
3643
+ createdAt: z.string().describe("When the project was created").optional(),
3644
+ updatedAt: z.string().describe("When the project was last updated").optional(),
3645
+ lead: z
3646
+ .object({
3647
+ id: z.string().describe("The lead ID").optional(),
3648
+ name: z.string().describe("The lead name").optional(),
3649
+ })
3650
+ .describe("The project lead")
3651
+ .optional(),
3652
+ team: z
3653
+ .object({
3654
+ id: z.string().describe("The team ID").optional(),
3655
+ name: z.string().describe("The team name").optional(),
3656
+ })
3657
+ .describe("The team the project belongs to")
3658
+ .optional(),
3659
+ issues: z
3660
+ .array(z.object({
3661
+ id: z.string().describe("The issue ID").optional(),
3662
+ name: z.string().describe("The issue name").optional(),
3663
+ }))
3664
+ .describe("The issues in the project")
3665
+ .optional(),
3666
+ url: z.string().describe("The project URL").optional(),
3667
+ updates: z
3668
+ .array(z.object({
3669
+ id: z.string().describe("The update ID").optional(),
3670
+ content: z.string().describe("The update content").optional(),
3671
+ author_name: z.string().describe("The update author name").optional(),
3672
+ created_at: z.string().describe("When the update was created").optional(),
3673
+ }))
3674
+ .describe("The project updates")
3675
+ .optional(),
3676
+ content: z.string().describe("The project content").optional(),
3677
+ })
3678
+ .describe("The project details")
3679
+ .optional(),
3680
+ });
3681
+ export const linearGetTeamDetailsParamsSchema = z.object({
3682
+ teamId: z.string().describe("The ID of the Linear team to retrieve"),
3683
+ });
3684
+ export const linearGetTeamDetailsOutputSchema = z.object({
3685
+ success: z.boolean().describe("Whether the operation was successful"),
3686
+ error: z.string().describe("Error message if the operation failed").optional(),
3687
+ team: z
3688
+ .object({
3689
+ id: z.string().describe("The team ID").optional(),
3690
+ name: z.string().describe("The team name").optional(),
3691
+ identifier: z.string().describe("Used to identify issues from this team").optional(),
3692
+ members: z
3693
+ .array(z.object({ id: z.string().optional(), name: z.string().optional(), email: z.string().optional() }))
3694
+ .describe("The team members")
3695
+ .optional(),
3696
+ })
3697
+ .describe("The team details")
3698
+ .optional(),
3699
+ });
3700
+ export const linearGetTeamsParamsSchema = z.object({});
3701
+ export const linearGetTeamsOutputSchema = z.object({
3702
+ success: z.boolean().describe("Whether the operation was successful"),
3703
+ error: z.string().describe("Error message if the operation failed").optional(),
3704
+ teams: z
3705
+ .array(z.object({
3706
+ id: z.string().describe("The team ID").optional(),
3707
+ name: z.string().describe("The team name").optional(),
3708
+ }))
3709
+ .describe("List of all teams")
3710
+ .optional(),
3711
+ });
@@ -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, linearGetIssueDetailsDefinition, linearGetProjectsDefinition, linearGetProjectDetailsDefinition, linearGetTeamDetailsDefinition, linearGetTeamsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } from "./autogen/templates.js";
2
2
  export const ACTION_GROUPS = {
3
3
  GENERIC: {
4
4
  description: "Generic utility actions",
@@ -248,4 +248,14 @@ export const ACTION_GROUPS = {
248
248
  oktaTriggerOktaWorkflowDefinition,
249
249
  ],
250
250
  },
251
+ LINEAR: {
252
+ description: "Actions for interacting with Linear",
253
+ actions: [
254
+ linearGetIssueDetailsDefinition,
255
+ linearGetProjectsDefinition,
256
+ linearGetProjectDetailsDefinition,
257
+ linearGetTeamDetailsDefinition,
258
+ linearGetTeamsDefinition,
259
+ ],
260
+ },
251
261
  };
@@ -0,0 +1,3 @@
1
+ import { confluenceUpdatePageFunction } from "../../../actions/autogen/types";
2
+ declare const confluenceUpdatePage: confluenceUpdatePageFunction;
3
+ export default confluenceUpdatePage;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const axios_1 = __importDefault(require("axios"));
16
+ function getConfluenceApi(baseUrl, username, apiToken) {
17
+ const api = axios_1.default.create({
18
+ baseURL: baseUrl,
19
+ headers: {
20
+ Accept: "application/json",
21
+ // Tokens are associated with a specific user.
22
+ Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
23
+ },
24
+ });
25
+ return api;
26
+ }
27
+ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
28
+ const { pageId, username, content, title } = params;
29
+ const { baseUrl, authToken } = authParams;
30
+ const api = getConfluenceApi(baseUrl, username, authToken);
31
+ // Get current version number
32
+ const response = yield api.get(`/api/v2/pages/${pageId}`);
33
+ const currVersion = response.data.version.number;
34
+ yield api.put(`/api/v2/pages/${pageId}`, {
35
+ id: pageId,
36
+ status: "current",
37
+ title,
38
+ body: {
39
+ representation: "storage",
40
+ value: content,
41
+ },
42
+ version: {
43
+ number: currVersion + 1,
44
+ },
45
+ });
46
+ });
47
+ exports.default = confluenceUpdatePage;
@@ -0,0 +1,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;
@@ -80,9 +80,10 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
80
80
  })) || [],
81
81
  };
82
82
  });
83
- // Search ISSUES & PRs
83
+ // Search Issues and PRs
84
84
  const issueResults = yield octokit.rest.search.issuesAndPullRequests({
85
- q: `${query} repo:${organization}/${repository}`,
85
+ q: `${query} repo:${organization}/${repository} (is:issue OR is:pull-request)`,
86
+ advanced_search: "true",
86
87
  });
87
88
  const prItems = issueResults.data.items.filter(item => item.pull_request).slice(0, MAX_ISSUES_OR_PRS);
88
89
  const prNumbers = prItems.map(item => item.number);
@@ -22,13 +22,14 @@ function gitlabFetch(endpoint, authToken) {
22
22
  function globalSearch(input) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  const { scope, query, groupId, authToken, baseUrl } = input;
25
- const endpoint = `${baseUrl}/api/v4/groups/${groupId}/search?scope=${scope}&search=${encodeURIComponent(query)}`;
25
+ const endpoint = `${baseUrl}/groups/${groupId}/search?scope=${scope}&search=${encodeURIComponent(query)}`;
26
26
  return gitlabFetch(endpoint, authToken);
27
27
  });
28
28
  }
29
- function getMRDiffs(projectId, mrIid, authToken) {
29
+ function getMRDiffs(input) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
- const endpoint = `/projects/${projectId}/merge_requests/${mrIid}/diffs`;
31
+ const { projectId, mrIid, authToken, baseUrl } = input;
32
+ const endpoint = `${baseUrl}/projects/${projectId}/merge_requests/${mrIid}/diffs`;
32
33
  return gitlabFetch(endpoint, authToken);
33
34
  });
34
35
  }
@@ -37,7 +38,7 @@ function getMRDiffs(projectId, mrIid, authToken) {
37
38
  */
38
39
  const searchGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
39
40
  const { authToken, baseUrl } = authParams;
40
- const gitlabBaseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : GITLAB_API_URL;
41
+ const gitlabBaseUrl = `${baseUrl !== null && baseUrl !== void 0 ? baseUrl : GITLAB_API_URL}/api/v4`;
41
42
  if (!authToken) {
42
43
  throw new Error(MISSING_AUTH_TOKEN);
43
44
  }
@@ -47,7 +48,12 @@ const searchGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
47
48
  globalSearch({ scope: "blobs", query, groupId, authToken, baseUrl: gitlabBaseUrl }),
48
49
  ]);
49
50
  const mergeRequests = yield Promise.all(mrResults.map((metadata) => __awaiter(void 0, void 0, void 0, function* () {
50
- const diffs = yield getMRDiffs(metadata.project_id, metadata.iid, authToken);
51
+ const diffs = yield getMRDiffs({
52
+ projectId: metadata.project_id,
53
+ mrIid: metadata.iid,
54
+ authToken,
55
+ baseUrl: gitlabBaseUrl,
56
+ });
51
57
  return { metadata, diffs };
52
58
  })));
53
59
  const blobs = blobResults.map(blob => {
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export declare const TokenResponseSchema: z.ZodObject<{
3
+ token: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ token: string;
6
+ }, {
7
+ token: string;
8
+ }>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TokenResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.TokenResponseSchema = zod_1.z.object({
6
+ token: zod_1.z.string(),
7
+ });
@@ -0,0 +1,3 @@
1
+ import type { linearGetIssueDetailsFunction } from "../../autogen/types";
2
+ declare const getIssueDetails: linearGetIssueDetailsFunction;
3
+ export default getIssueDetails;
@@ -0,0 +1,127 @@
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
+ const getIssueDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
11
+ var _b;
12
+ const { authToken } = authParams;
13
+ const { issueId } = params;
14
+ if (!authToken) {
15
+ throw new Error("Valid auth token is required to get Linear issue details");
16
+ }
17
+ const query = `
18
+ query GetIssue($id: String!) {
19
+ issue(id: $id) {
20
+ id
21
+ title
22
+ description
23
+ url
24
+ state {
25
+ name
26
+ }
27
+ assignee {
28
+ id
29
+ name
30
+ }
31
+ creator {
32
+ id
33
+ name
34
+ }
35
+ team {
36
+ id
37
+ name
38
+ }
39
+ project {
40
+ id
41
+ name
42
+ }
43
+ priority
44
+ estimate
45
+ dueDate
46
+ createdAt
47
+ updatedAt
48
+ labels {
49
+ nodes {
50
+ name
51
+ }
52
+ }
53
+ comments {
54
+ nodes {
55
+ user {
56
+ name
57
+ }
58
+ body
59
+ }
60
+ }
61
+ }
62
+ }
63
+ `;
64
+ try {
65
+ const response = yield fetch("https://api.linear.app/graphql", {
66
+ method: "POST",
67
+ headers: {
68
+ "Content-Type": "application/json",
69
+ Authorization: `Bearer ${authToken}`,
70
+ },
71
+ body: JSON.stringify({
72
+ query,
73
+ variables: { id: issueId },
74
+ }),
75
+ });
76
+ if (!response.ok) {
77
+ const errorText = yield response.text();
78
+ throw new Error(`HTTP error: status: ${response.status}, body: ${errorText}`);
79
+ }
80
+ const data = yield response.json();
81
+ if (data.errors) {
82
+ throw new Error(`GraphQL errors: ${JSON.stringify(data.errors)}`);
83
+ }
84
+ if (!((_b = data.data) === null || _b === void 0 ? void 0 : _b.issue)) {
85
+ return {
86
+ success: false,
87
+ error: "Issue not found",
88
+ };
89
+ }
90
+ const { id, title, description, url, state, assignee, creator, team, project, priority, estimate, dueDate, createdAt, updatedAt, labels, comments, } = data.data.issue;
91
+ return {
92
+ success: true,
93
+ issue: {
94
+ id,
95
+ title,
96
+ description: description || undefined,
97
+ state: (state === null || state === void 0 ? void 0 : state.name) || undefined,
98
+ assignee: assignee ? { id: assignee.id, name: assignee.name } : undefined,
99
+ creator: creator ? { id: creator.id, name: creator.name } : undefined,
100
+ team: team ? { id: team.id, name: team.name } : undefined,
101
+ project: project ? { id: project.id, name: project.name } : undefined,
102
+ priority: priority || undefined,
103
+ estimate: estimate || undefined,
104
+ dueDate: dueDate || undefined,
105
+ createdAt: createdAt || undefined,
106
+ updatedAt: updatedAt || undefined,
107
+ labels: Array.isArray(labels === null || labels === void 0 ? void 0 : labels.nodes) ? labels.nodes.map(({ name }) => name) : [],
108
+ url: url || undefined,
109
+ comments: Array.isArray(comments === null || comments === void 0 ? void 0 : comments.nodes)
110
+ ? comments.nodes.map(({ user, body }) => ({
111
+ author_name: (user === null || user === void 0 ? void 0 : user.name) || "Unknown",
112
+ comment: body,
113
+ }))
114
+ : [],
115
+ content: description || undefined,
116
+ },
117
+ };
118
+ }
119
+ catch (error) {
120
+ console.error("Error retrieving Linear issue details: ", error);
121
+ return {
122
+ success: false,
123
+ error: error instanceof Error ? error.message : "Unknown error",
124
+ };
125
+ }
126
+ });
127
+ export default getIssueDetails;
@@ -0,0 +1,3 @@
1
+ import type { linearGetIssuesFunction } from "../../autogen/types";
2
+ declare const getIssues: linearGetIssuesFunction;
3
+ export default getIssues;