@credal/actions 0.2.156 → 0.2.158

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.
@@ -4295,75 +4295,94 @@ export const githubSearchOrganizationParamsSchema = z.object({
4295
4295
  repository: z.string().describe("The repository to search for data in").optional(),
4296
4296
  });
4297
4297
  export const githubSearchOrganizationOutputSchema = z.object({
4298
- success: z.boolean().describe("Whether the operation was successful"),
4299
- error: z.string().describe("Error message if the operation failed").optional(),
4298
+ success: z.boolean().describe("Whether the operation was successful."),
4299
+ error: z.string().describe("Error message if the operation failed.").optional(),
4300
4300
  results: z
4301
4301
  .array(z.object({
4302
- name: z.string().describe("The name of the result (file name, commit SHA, or issue/PR title)"),
4303
- url: z.string().describe("The URL of the result"),
4304
- type: z.enum(["code", "commit", "issueOrPullRequest"]).describe("The type of the result"),
4305
- content: z.any().superRefine((x, ctx) => {
4302
+ type: z.enum(["code", "commit", "issueOrPullRequest"]).describe("The type of search result."),
4303
+ name: z.string().describe("The name or identifier for the result (e.g., file name, commit SHA, or PR title)."),
4304
+ url: z.string().describe("The API URL of the result."),
4305
+ contents: z
4306
+ .any()
4307
+ .superRefine((x, ctx) => {
4306
4308
  const schemas = [
4307
4309
  z
4308
4310
  .object({
4309
- name: z.string().describe("The name of the file that had a match"),
4310
- path: z.string().describe("The path of the file that had a match"),
4311
- sha: z.string().describe("The SHA of the commit that had a match"),
4312
- url: z.string().describe("The URL of the file that had a match"),
4313
- score: z.number().describe("The similarity score of the match"),
4311
+ name: z.string().describe("The name of the file that had a match."),
4312
+ path: z.string().describe("The path of the file that had a match."),
4313
+ sha: z.string().describe("The short SHA of the commit containing the match."),
4314
+ url: z.string().describe("The API URL of the file that had a match."),
4315
+ score: z.number().describe("The similarity score of the match."),
4314
4316
  textMatches: z
4315
4317
  .array(z.object({
4316
- object_url: z.string().describe("The URL of the object that had a match").optional(),
4317
- object_type: z.string().describe("The type of the object that had a match").optional(),
4318
- fragment: z.string().describe("The fragment of the text that had a match").optional(),
4318
+ object_url: z.string().describe("The API URL of the matched object.").optional(),
4319
+ object_type: z.string().describe("The type of object that was matched.").optional(),
4320
+ fragment: z.string().describe("Text snippet showing the match.").optional(),
4319
4321
  matches: z
4320
4322
  .array(z.object({
4321
- text: z.string().describe("The text that had a match").optional(),
4322
- indices: z
4323
- .array(z.number())
4324
- .describe("The indices of the text that had a match")
4325
- .optional(),
4323
+ text: z.string().describe("The text that matched.").optional(),
4324
+ indices: z.array(z.number()).describe("Start and end indices of the match.").optional(),
4326
4325
  }))
4327
- .describe("A list of matches that match the query"),
4326
+ .describe("List of matches found in the fragment."),
4328
4327
  }))
4329
- .describe("A list of text matches that match the query"),
4328
+ .describe("A list of text matches found within the file."),
4330
4329
  })
4331
- .describe("Code result content"),
4330
+ .describe("Code search result content."),
4332
4331
  z
4333
4332
  .object({
4334
- sha: z.string().describe("The SHA of the commit that had a match"),
4335
- url: z.string().describe("The URL of the commit that had a match"),
4336
- commit: z
4337
- .object({
4333
+ sha: z.string().describe("The commit SHA."),
4334
+ url: z.string().describe("The API URL of the commit."),
4335
+ commit: z.object({
4336
+ message: z.string().describe("The commit message."),
4338
4337
  author: z.object({
4339
- name: z.string().describe("The name of the author"),
4340
- email: z.string().describe("The email of the author"),
4341
- date: z.string().describe("The date of the commit"),
4338
+ name: z.string().describe("The commit author name."),
4339
+ email: z.string().describe("The commit author email."),
4340
+ date: z.string().describe("The commit date."),
4342
4341
  }),
4343
- message: z.string().describe("The message of the commit"),
4342
+ }),
4343
+ author: z
4344
+ .object({
4345
+ login: z.string().describe("GitHub username of the author.").optional(),
4346
+ html_url: z.string().describe("URL to the author’s GitHub profile.").optional(),
4344
4347
  })
4348
+ .describe("The GitHub user who authored the commit.")
4349
+ .optional(),
4350
+ score: z.number().describe("The commit search relevance score."),
4351
+ files: z
4352
+ .array(z.object({
4353
+ filename: z.string().describe("The filename of the changed file."),
4354
+ status: z.string().describe("The status of the change (added, modified, deleted)."),
4355
+ patch: z.string().describe("The diff patch (truncated).").optional(),
4356
+ }))
4357
+ .describe("List of files changed in the commit.")
4345
4358
  .optional(),
4346
4359
  })
4347
- .describe("Commit result content"),
4360
+ .describe("Commit search result content."),
4348
4361
  z
4349
4362
  .object({
4350
- number: z.number().describe("The number of the issue or pull request").optional(),
4351
- title: z.string().describe("The title of the issue or pull request"),
4352
- html_url: z.string().describe("The URL of the issue or pull request").optional(),
4353
- state: z.enum(["open", "closed"]).describe("The state of the issue or pull request"),
4354
- isPullRequest: z.boolean().describe("Whether the issue or pull request is a pull request").optional(),
4355
- body: z.string().describe("The body of the issue or pull request").optional(),
4356
- score: z.number().describe("The score of the issue or pull request").optional(),
4363
+ number: z.number().describe("The issue or pull request number."),
4364
+ title: z.string().describe("The title of the issue or pull request."),
4365
+ html_url: z.string().describe("The URL of the issue or pull request."),
4366
+ state: z.enum(["open", "closed"]).describe("The state of the issue or pull request."),
4367
+ isPullRequest: z.boolean().describe("Whether the item is a pull request."),
4368
+ body: z.string().describe("The body text of the issue or pull request.").optional(),
4369
+ user: z
4370
+ .object({
4371
+ name: z.string().describe("The user’s display name.").optional(),
4372
+ email: z.string().describe("The user’s email address, if available.").optional(),
4373
+ })
4374
+ .describe("The user who created the issue or pull request."),
4375
+ score: z.number().describe("The search result relevance score."),
4357
4376
  files: z
4358
4377
  .array(z.object({
4359
- filename: z.string().describe("The filename of the file"),
4360
- status: z.string().describe("The status of the file"),
4361
- patch: z.string().describe("The patch of the file").optional(),
4378
+ filename: z.string().describe("File name in the PR diff."),
4379
+ status: z.string().describe("File change status (added, modified, removed)."),
4380
+ patch: z.string().describe("Diff patch content (truncated).").optional(),
4362
4381
  }))
4363
- .describe("A list of files that match the query")
4382
+ .describe("Files associated with the pull request.")
4364
4383
  .optional(),
4365
4384
  })
4366
- .describe("Issue or pull request result content"),
4385
+ .describe("Issue or pull request search result content."),
4367
4386
  ];
4368
4387
  const errors = schemas.reduce((errors, schema) => (result => (result.error ? [...errors, result.error] : errors))(schema.safeParse(x)), []);
4369
4388
  if (schemas.length - errors.length !== 1) {
@@ -4374,9 +4393,10 @@ export const githubSearchOrganizationOutputSchema = z.object({
4374
4393
  message: "Invalid input: Should pass single schema",
4375
4394
  });
4376
4395
  }
4377
- }),
4396
+ })
4397
+ .describe("The contents of the result, which vary depending on its type."),
4378
4398
  }))
4379
- .describe("Array of search results")
4399
+ .describe("List of search results.")
4380
4400
  .optional(),
4381
4401
  });
4382
4402
  export const githubGetBranchParamsSchema = z.object({
@@ -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
  };
@@ -6,33 +6,27 @@ declare const actionTemplateSchema: z.ZodObject<{
6
6
  type: z.ZodString;
7
7
  required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
8
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
9
- oneOf: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
10
9
  }, "strip", z.ZodTypeAny, {
11
10
  type: string;
12
11
  required?: string[] | undefined;
13
12
  properties?: Record<string, any> | undefined;
14
- oneOf?: any[] | undefined;
15
13
  }, {
16
14
  type: string;
17
15
  required?: string[] | undefined;
18
16
  properties?: Record<string, any> | undefined;
19
- oneOf?: any[] | undefined;
20
17
  }>>;
21
18
  output: z.ZodOptional<z.ZodObject<{
22
19
  type: z.ZodString;
23
20
  required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
21
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
- oneOf: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
26
22
  }, "strip", z.ZodTypeAny, {
27
23
  type: string;
28
24
  required?: string[] | undefined;
29
25
  properties?: Record<string, any> | undefined;
30
- oneOf?: any[] | undefined;
31
26
  }, {
32
27
  type: string;
33
28
  required?: string[] | undefined;
34
29
  properties?: Record<string, any> | undefined;
35
- oneOf?: any[] | undefined;
36
30
  }>>;
37
31
  } & {
38
32
  name: z.ZodString;
@@ -46,13 +40,11 @@ declare const actionTemplateSchema: z.ZodObject<{
46
40
  type: string;
47
41
  required?: string[] | undefined;
48
42
  properties?: Record<string, any> | undefined;
49
- oneOf?: any[] | undefined;
50
43
  } | undefined;
51
44
  output?: {
52
45
  type: string;
53
46
  required?: string[] | undefined;
54
47
  properties?: Record<string, any> | undefined;
55
- oneOf?: any[] | undefined;
56
48
  } | undefined;
57
49
  }, {
58
50
  description: string;
@@ -63,13 +55,11 @@ declare const actionTemplateSchema: z.ZodObject<{
63
55
  type: string;
64
56
  required?: string[] | undefined;
65
57
  properties?: Record<string, any> | undefined;
66
- oneOf?: any[] | undefined;
67
58
  } | undefined;
68
59
  output?: {
69
60
  type: string;
70
61
  required?: string[] | undefined;
71
62
  properties?: Record<string, any> | undefined;
72
- oneOf?: any[] | undefined;
73
63
  } | undefined;
74
64
  }>;
75
65
  export type ActionTemplate = z.infer<typeof actionTemplateSchema>;
@@ -14,11 +14,11 @@ import convert from "json-schema-to-zod";
14
14
  import { Project, VariableDeclarationKind } from "ts-morph";
15
15
  import { z } from "zod";
16
16
  import { snakeToPascal } from "../utils/string.js";
17
+ // TODO support oneOf correctly
17
18
  const jsonObjectSchema = z.object({
18
19
  type: z.string(),
19
20
  required: z.array(z.string()).optional(),
20
21
  properties: z.record(z.string(), z.any()).optional(), // Permissive for now, validate using JSON schema later
21
- oneOf: z.array(z.any()).optional(), // Support oneOf schemas
22
22
  });
23
23
  const actionSchema = z.object({
24
24
  description: z.string(),
@@ -71,16 +71,7 @@ function validateObject(object) {
71
71
  throw new Error(`Error validating object: ${JSON.stringify(ajv.errors, null, 4)}`);
72
72
  }
73
73
  // Handle oneOf schemas
74
- if (object.oneOf) {
75
- // For oneOf schemas, validate each option
76
- for (const oneOfOption of object.oneOf) {
77
- const validOption = ajv.validateSchema(oneOfOption);
78
- if (!validOption) {
79
- throw new Error(`Error validating oneOf option: ${JSON.stringify(ajv.errors, null, 4)}`);
80
- }
81
- }
82
- }
83
- else if (object.required && object.properties) {
74
+ if (object.required && object.properties) {
84
75
  // Handle regular object schemas - check required fields
85
76
  for (const field of object.required) {
86
77
  if (!object.properties[field]) {
@@ -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;
@@ -51,7 +51,7 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
51
51
  name: item.name,
52
52
  path: item.path,
53
53
  sha: item.sha.slice(0, 7),
54
- url: item.url,
54
+ url: item.html_url,
55
55
  score: item.score,
56
56
  textMatches: item.text_matches
57
57
  ? item.text_matches.map(match => {
@@ -82,7 +82,7 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
82
82
  const full = commitDetails.find(c => c.data.sha === item.sha);
83
83
  return {
84
84
  sha: item.sha,
85
- url: item.url,
85
+ url: item.html_url,
86
86
  commit: {
87
87
  message: item.commit.message,
88
88
  author: item.commit.author,
@@ -90,11 +90,11 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
90
90
  score: item.score,
91
91
  author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
92
92
  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 => {
93
- var _a;
93
+ var _a, _b, _c;
94
94
  return ({
95
95
  filename: f.filename,
96
96
  status: f.status,
97
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
97
+ patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
98
98
  });
99
99
  })) || [],
100
100
  };
@@ -132,7 +132,7 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
132
132
  return {
133
133
  number: item.number,
134
134
  title: item.title,
135
- html_url: item.html_url,
135
+ url: item.html_url,
136
136
  state: item.state,
137
137
  isPullRequest: isPR,
138
138
  body: item.body,
@@ -151,19 +151,19 @@ const searchOrganization = (_a) => __awaiter(void 0, [_a], void 0, function* ({
151
151
  type: "code",
152
152
  name: result.name,
153
153
  url: result.url,
154
- content: result,
154
+ contents: result,
155
155
  })),
156
156
  ...enrichedCommits.map(result => ({
157
157
  type: "commit",
158
- name: result.sha,
158
+ name: `${result.sha.slice(0, 7)} – ${result.commit.message.split("\n")[0]}`,
159
159
  url: result.url,
160
- content: result,
160
+ contents: result,
161
161
  })),
162
162
  ...issuesAndPRs.map(result => ({
163
163
  type: "issueOrPullRequest",
164
164
  name: result.title,
165
- url: result.html_url,
166
- content: result,
165
+ url: result.url,
166
+ contents: result,
167
167
  })),
168
168
  ],
169
169
  };
@@ -47,7 +47,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
47
47
  name: item.name,
48
48
  path: item.path,
49
49
  sha: item.sha.slice(0, 7),
50
- url: item.url,
50
+ url: item.html_url,
51
51
  score: item.score,
52
52
  textMatches: item.text_matches
53
53
  ? item.text_matches.map(match => {
@@ -68,7 +68,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
68
68
  const full = commitDetails.find(c => c.data.sha === item.sha);
69
69
  return {
70
70
  sha: item.sha,
71
- url: item.url,
71
+ url: item.html_url,
72
72
  commit: {
73
73
  message: item.commit.message,
74
74
  author: item.commit.author,
@@ -76,11 +76,11 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
76
76
  score: item.score,
77
77
  author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
78
78
  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 => {
79
- var _a;
79
+ var _a, _b, _c;
80
80
  return ({
81
81
  filename: f.filename,
82
82
  status: f.status,
83
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
83
+ patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
84
84
  });
85
85
  })) || [],
86
86
  };
@@ -104,18 +104,18 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
104
104
  const prIndex = prNumbers.indexOf(item.number);
105
105
  const files = isPR && prIndex !== -1
106
106
  ? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
107
- var _a;
107
+ var _a, _b, _c;
108
108
  return ({
109
109
  filename: f.filename,
110
110
  status: f.status,
111
- patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
111
+ patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
112
112
  });
113
113
  })
114
114
  : undefined;
115
115
  return {
116
116
  number: item.number,
117
117
  title: item.title,
118
- html_url: item.html_url,
118
+ url: item.html_url,
119
119
  state: item.state,
120
120
  isPullRequest: isPR,
121
121
  body: item.body,
@@ -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 @@
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"));
@@ -60,7 +60,7 @@ const getSalesforceRecordsByQuery = (_a) => __awaiter(void 0, [_a], void 0, func
60
60
  return {
61
61
  name: displayName,
62
62
  url: record.webUrl,
63
- content: record,
63
+ contents: record,
64
64
  };
65
65
  }) || [],
66
66
  };
@@ -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;