@credal/actions 0.1.84 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.d.ts +1 -2
- package/dist/actions/actionMapper.js +66 -65
- package/dist/actions/autogen/definitions.d.ts +5 -0
- package/dist/actions/autogen/definitions.js +132 -0
- package/dist/actions/autogen/templates.js +76 -76
- package/dist/actions/autogen/types.d.ts +85 -87
- package/dist/actions/autogen/types.js +1 -108
- package/dist/actions/definitions.js +35 -0
- package/dist/actions/invoke.d.ts +2 -3
- package/dist/actions/invoke.js +2 -6
- package/dist/actions/invokeMapper.d.ts +9 -0
- package/dist/actions/invokeMapper.js +33 -0
- package/dist/actions/parse.d.ts +14 -17
- package/dist/actions/parse.js +2 -28
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +43 -0
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/jira/createTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createTicket.js +34 -0
- package/dist/actions/providers/slack/listConversations.d.ts +1 -1
- package/dist/actions/providers/slack/list_conversations.d.ts +3 -0
- package/dist/actions/providers/slack/list_conversations.js +60 -0
- package/dist/actions/providers/slack/summarizeChannel.d.ts +3 -0
- package/dist/actions/providers/slack/summarizeChannel.js +51 -0
- package/dist/actions/schema.js +6 -0
- package/dist/actions/types.js +2 -0
- package/dist/main.js +11 -0
- package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.kandjiGetFVRecoveryKeyForDeviceOutputSchema = exports.kandjiGetFVRecoveryKeyForDeviceParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaListAsanaTasksByProjectOutputSchema = exports.asanaListAsanaTasksByProjectParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
|
4
4
|
exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.firecrawlDeepResearchOutputSchema = exports.firecrawlDeepResearchParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = void 0;
|
5
5
|
exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = void 0;
|
6
|
-
exports.
|
6
|
+
exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = void 0;
|
7
7
|
const zod_1 = require("zod");
|
8
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
9
9
|
authToken: zod_1.z.string().optional(),
|
@@ -2456,110 +2456,3 @@ exports.githubListPullRequestsOutputSchema = zod_1.z.object({
|
|
2456
2456
|
}))
|
2457
2457
|
.describe("A list of pull requests in the repository"),
|
2458
2458
|
});
|
2459
|
-
exports.ActionProviderNames = [
|
2460
|
-
"generic",
|
2461
|
-
"asana",
|
2462
|
-
"slack",
|
2463
|
-
"math",
|
2464
|
-
"confluence",
|
2465
|
-
"jira",
|
2466
|
-
"kandji",
|
2467
|
-
"googlemaps",
|
2468
|
-
"bing",
|
2469
|
-
"credal",
|
2470
|
-
"zendesk",
|
2471
|
-
"linkedin",
|
2472
|
-
"x",
|
2473
|
-
"mongo",
|
2474
|
-
"snowflake",
|
2475
|
-
"openstreetmap",
|
2476
|
-
"nws",
|
2477
|
-
"firecrawl",
|
2478
|
-
"resend",
|
2479
|
-
"googleOauth",
|
2480
|
-
"gong",
|
2481
|
-
"finnhub",
|
2482
|
-
"looker",
|
2483
|
-
"ashby",
|
2484
|
-
"salesforce",
|
2485
|
-
"microsoft",
|
2486
|
-
"github",
|
2487
|
-
];
|
2488
|
-
exports.ActionNames = [
|
2489
|
-
"fillTemplate",
|
2490
|
-
"commentTask",
|
2491
|
-
"listAsanaTasksByProject",
|
2492
|
-
"createTask",
|
2493
|
-
"updateTask",
|
2494
|
-
"sendMessage",
|
2495
|
-
"getChannelMessages",
|
2496
|
-
"add",
|
2497
|
-
"overwritePage",
|
2498
|
-
"fetchPageContent",
|
2499
|
-
"assignJiraTicket",
|
2500
|
-
"commentJiraTicket",
|
2501
|
-
"createJiraTicket",
|
2502
|
-
"getJiraTicketDetails",
|
2503
|
-
"getJiraTicketHistory",
|
2504
|
-
"updateJiraTicketDetails",
|
2505
|
-
"updateJiraTicketStatus",
|
2506
|
-
"getJiraIssuesByQuery",
|
2507
|
-
"getFVRecoveryKeyForDevice",
|
2508
|
-
"validateAddress",
|
2509
|
-
"nearbysearchRestaurants",
|
2510
|
-
"getTopNSearchResultUrls",
|
2511
|
-
"callCopilot",
|
2512
|
-
"createZendeskTicket",
|
2513
|
-
"listZendeskTickets",
|
2514
|
-
"getTicketDetails",
|
2515
|
-
"updateTicketStatus",
|
2516
|
-
"addCommentToTicket",
|
2517
|
-
"assignTicket",
|
2518
|
-
"createShareLinkedinPostUrl",
|
2519
|
-
"createShareXPostUrl",
|
2520
|
-
"insertMongoDoc",
|
2521
|
-
"getRowByFieldValue",
|
2522
|
-
"runSnowflakeQuery",
|
2523
|
-
"getLatitudeLongitudeFromLocation",
|
2524
|
-
"getForecastForLocation",
|
2525
|
-
"deepResearch",
|
2526
|
-
"scrapeUrl",
|
2527
|
-
"scrapeTweetDataWithNitter",
|
2528
|
-
"sendEmail",
|
2529
|
-
"createNewGoogleDoc",
|
2530
|
-
"updateDoc",
|
2531
|
-
"scheduleCalendarMeeting",
|
2532
|
-
"createSpreadsheet",
|
2533
|
-
"updateSpreadsheet",
|
2534
|
-
"createPresentation",
|
2535
|
-
"updatePresentation",
|
2536
|
-
"getGongTranscripts",
|
2537
|
-
"symbolLookup",
|
2538
|
-
"getBasicFinancials",
|
2539
|
-
"enableUserByEmail",
|
2540
|
-
"createNote",
|
2541
|
-
"getCandidateInfo",
|
2542
|
-
"addCandidateToProject",
|
2543
|
-
"listCandidates",
|
2544
|
-
"searchCandidates",
|
2545
|
-
"listCandidateNotes",
|
2546
|
-
"createCandidate",
|
2547
|
-
"updateCandidate",
|
2548
|
-
"updateRecord",
|
2549
|
-
"createRecord",
|
2550
|
-
"createCase",
|
2551
|
-
"generateSalesReport",
|
2552
|
-
"getSalesforceRecordsByQuery",
|
2553
|
-
"getRecord",
|
2554
|
-
"fetchSalesforceSchemaByObject",
|
2555
|
-
"createDocument",
|
2556
|
-
"updateDocument",
|
2557
|
-
"updateSpreadsheet",
|
2558
|
-
"messageTeamsChat",
|
2559
|
-
"messageTeamsChannel",
|
2560
|
-
"getDocument",
|
2561
|
-
"createOrUpdateFile",
|
2562
|
-
"createBranch",
|
2563
|
-
"createPullRequest",
|
2564
|
-
"listPullRequests",
|
2565
|
-
];
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mathAddDefinition = exports.slackSendMessageDefinition = void 0;
|
4
|
+
exports.slackSendMessageDefinition = {
|
5
|
+
name: "send_message",
|
6
|
+
description: "Sends a message to a Slack channel",
|
7
|
+
parameters: {
|
8
|
+
"channel": {
|
9
|
+
"type": "string",
|
10
|
+
"description": "The Slack channel to send the message to (e.g., \\#general, \\#alerts)",
|
11
|
+
"required": true
|
12
|
+
},
|
13
|
+
"message": {
|
14
|
+
"type": "string",
|
15
|
+
"description": "The message content to send to Slack. Can include markdown formatting.",
|
16
|
+
"required": true
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
20
|
+
exports.mathAddDefinition = {
|
21
|
+
name: "add",
|
22
|
+
description: "Adds two numbers together",
|
23
|
+
parameters: {
|
24
|
+
"a": {
|
25
|
+
"type": "number",
|
26
|
+
"description": "The first number to add",
|
27
|
+
"required": true
|
28
|
+
},
|
29
|
+
"b": {
|
30
|
+
"type": "number",
|
31
|
+
"description": "The second number to add",
|
32
|
+
"required": true
|
33
|
+
}
|
34
|
+
}
|
35
|
+
};
|
package/dist/actions/invoke.d.ts
CHANGED
package/dist/actions/invoke.js
CHANGED
@@ -17,12 +17,8 @@ function invokeAction(input) {
|
|
17
17
|
if (!actionMapper_1.ActionMapper[provider]) {
|
18
18
|
throw new Error(`Provider '${provider}' not found`);
|
19
19
|
}
|
20
|
-
const
|
21
|
-
|
22
|
-
throw new Error(`Action '${name}' not found for provider '${provider}'`);
|
23
|
-
}
|
24
|
-
const providerFunction = action.fn;
|
25
|
-
const safeParseParams = action.paramsSchema.safeParse(parameters);
|
20
|
+
const providerFunction = actionMapper_1.ActionMapper[provider][name].fn;
|
21
|
+
const safeParseParams = actionMapper_1.ActionMapper[provider][name].paramsSchema.safeParse(parameters);
|
26
22
|
if (!safeParseParams.success) {
|
27
23
|
throw new Error(`Invalid parameters for action '${name}': ${safeParseParams.error}`);
|
28
24
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { type ActionFunction } from "./autogen/types";
|
2
|
+
import { z } from "zod";
|
3
|
+
interface ActionFunctionComponents {
|
4
|
+
fn: ActionFunction<any, any, any>;
|
5
|
+
paramsSchema: z.ZodSchema;
|
6
|
+
outputSchema: z.ZodSchema;
|
7
|
+
}
|
8
|
+
export declare const FunctionMapper: Record<string, Record<string, ActionFunctionComponents>>;
|
9
|
+
export {};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.FunctionMapper = void 0;
|
7
|
+
const add_1 = __importDefault(require("./providers/math/add"));
|
8
|
+
const list_conversations_1 = __importDefault(require("./providers/slack/list_conversations"));
|
9
|
+
const updatePage_1 = __importDefault(require("./providers/confluence/updatePage"));
|
10
|
+
const types_1 = require("./autogen/types");
|
11
|
+
exports.FunctionMapper = {
|
12
|
+
math: {
|
13
|
+
add: {
|
14
|
+
fn: add_1.default,
|
15
|
+
paramsSchema: types_1.mathAddParamsSchema,
|
16
|
+
outputSchema: types_1.mathAddOutputSchema,
|
17
|
+
},
|
18
|
+
},
|
19
|
+
slack: {
|
20
|
+
listConversations: {
|
21
|
+
fn: list_conversations_1.default,
|
22
|
+
paramsSchema: types_1.slackListConversationsParamsSchema,
|
23
|
+
outputSchema: types_1.slackListConversationsOutputSchema,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
confluence: {
|
27
|
+
updatePage: {
|
28
|
+
fn: updatePage_1.default,
|
29
|
+
paramsSchema: types_1.confluenceUpdatePageParamsSchema,
|
30
|
+
outputSchema: types_1.confluenceUpdatePageOutputSchema,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
};
|
package/dist/actions/parse.d.ts
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
-
import { ActionNames, ActionProviderNames } from "./autogen/types";
|
3
|
-
export type ActionProviderName = (typeof ActionProviderNames)[number];
|
4
|
-
export type ActionName = (typeof ActionNames)[number];
|
5
2
|
declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
6
3
|
description: z.ZodString;
|
7
4
|
scopes: z.ZodArray<z.ZodString, "many">;
|
@@ -11,12 +8,12 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
11
8
|
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
12
9
|
}, "strip", z.ZodTypeAny, {
|
13
10
|
type: string;
|
14
|
-
properties: Record<string, any>;
|
15
11
|
required: string[];
|
12
|
+
properties: Record<string, any>;
|
16
13
|
}, {
|
17
14
|
type: string;
|
18
|
-
properties: Record<string, any>;
|
19
15
|
required: string[];
|
16
|
+
properties: Record<string, any>;
|
20
17
|
}>>;
|
21
18
|
output: z.ZodOptional<z.ZodObject<{
|
22
19
|
type: z.ZodString;
|
@@ -24,45 +21,45 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
24
21
|
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
25
22
|
}, "strip", z.ZodTypeAny, {
|
26
23
|
type: string;
|
27
|
-
properties: Record<string, any>;
|
28
24
|
required: string[];
|
25
|
+
properties: Record<string, any>;
|
29
26
|
}, {
|
30
27
|
type: string;
|
31
|
-
properties: Record<string, any>;
|
32
28
|
required: string[];
|
29
|
+
properties: Record<string, any>;
|
33
30
|
}>>;
|
34
31
|
}, {
|
35
|
-
|
36
|
-
|
32
|
+
name: z.ZodString;
|
33
|
+
provider: z.ZodString;
|
37
34
|
}>, "strip", z.ZodTypeAny, {
|
38
|
-
name: "fillTemplate" | "commentTask" | "listAsanaTasksByProject" | "createTask" | "updateTask" | "sendMessage" | "getChannelMessages" | "add" | "overwritePage" | "fetchPageContent" | "assignJiraTicket" | "commentJiraTicket" | "createJiraTicket" | "getJiraTicketDetails" | "getJiraTicketHistory" | "updateJiraTicketDetails" | "updateJiraTicketStatus" | "getJiraIssuesByQuery" | "getFVRecoveryKeyForDevice" | "validateAddress" | "nearbysearchRestaurants" | "getTopNSearchResultUrls" | "callCopilot" | "createZendeskTicket" | "listZendeskTickets" | "getTicketDetails" | "updateTicketStatus" | "addCommentToTicket" | "assignTicket" | "createShareLinkedinPostUrl" | "createShareXPostUrl" | "insertMongoDoc" | "getRowByFieldValue" | "runSnowflakeQuery" | "getLatitudeLongitudeFromLocation" | "getForecastForLocation" | "deepResearch" | "scrapeUrl" | "scrapeTweetDataWithNitter" | "sendEmail" | "createNewGoogleDoc" | "updateDoc" | "scheduleCalendarMeeting" | "createSpreadsheet" | "updateSpreadsheet" | "createPresentation" | "updatePresentation" | "getGongTranscripts" | "symbolLookup" | "getBasicFinancials" | "enableUserByEmail" | "createNote" | "getCandidateInfo" | "addCandidateToProject" | "listCandidates" | "searchCandidates" | "listCandidateNotes" | "createCandidate" | "updateCandidate" | "updateRecord" | "createRecord" | "createCase" | "generateSalesReport" | "getSalesforceRecordsByQuery" | "getRecord" | "fetchSalesforceSchemaByObject" | "createDocument" | "updateDocument" | "messageTeamsChat" | "messageTeamsChannel" | "getDocument" | "createOrUpdateFile" | "createBranch" | "createPullRequest" | "listPullRequests";
|
39
35
|
description: string;
|
40
36
|
scopes: string[];
|
41
|
-
|
37
|
+
name: string;
|
38
|
+
provider: string;
|
42
39
|
parameters?: {
|
43
40
|
type: string;
|
44
|
-
properties: Record<string, any>;
|
45
41
|
required: string[];
|
42
|
+
properties: Record<string, any>;
|
46
43
|
} | undefined;
|
47
44
|
output?: {
|
48
45
|
type: string;
|
49
|
-
properties: Record<string, any>;
|
50
46
|
required: string[];
|
47
|
+
properties: Record<string, any>;
|
51
48
|
} | undefined;
|
52
49
|
}, {
|
53
|
-
name: "fillTemplate" | "commentTask" | "listAsanaTasksByProject" | "createTask" | "updateTask" | "sendMessage" | "getChannelMessages" | "add" | "overwritePage" | "fetchPageContent" | "assignJiraTicket" | "commentJiraTicket" | "createJiraTicket" | "getJiraTicketDetails" | "getJiraTicketHistory" | "updateJiraTicketDetails" | "updateJiraTicketStatus" | "getJiraIssuesByQuery" | "getFVRecoveryKeyForDevice" | "validateAddress" | "nearbysearchRestaurants" | "getTopNSearchResultUrls" | "callCopilot" | "createZendeskTicket" | "listZendeskTickets" | "getTicketDetails" | "updateTicketStatus" | "addCommentToTicket" | "assignTicket" | "createShareLinkedinPostUrl" | "createShareXPostUrl" | "insertMongoDoc" | "getRowByFieldValue" | "runSnowflakeQuery" | "getLatitudeLongitudeFromLocation" | "getForecastForLocation" | "deepResearch" | "scrapeUrl" | "scrapeTweetDataWithNitter" | "sendEmail" | "createNewGoogleDoc" | "updateDoc" | "scheduleCalendarMeeting" | "createSpreadsheet" | "updateSpreadsheet" | "createPresentation" | "updatePresentation" | "getGongTranscripts" | "symbolLookup" | "getBasicFinancials" | "enableUserByEmail" | "createNote" | "getCandidateInfo" | "addCandidateToProject" | "listCandidates" | "searchCandidates" | "listCandidateNotes" | "createCandidate" | "updateCandidate" | "updateRecord" | "createRecord" | "createCase" | "generateSalesReport" | "getSalesforceRecordsByQuery" | "getRecord" | "fetchSalesforceSchemaByObject" | "createDocument" | "updateDocument" | "messageTeamsChat" | "messageTeamsChannel" | "getDocument" | "createOrUpdateFile" | "createBranch" | "createPullRequest" | "listPullRequests";
|
54
50
|
description: string;
|
55
51
|
scopes: string[];
|
56
|
-
|
52
|
+
name: string;
|
53
|
+
provider: string;
|
57
54
|
parameters?: {
|
58
55
|
type: string;
|
59
|
-
properties: Record<string, any>;
|
60
56
|
required: string[];
|
57
|
+
properties: Record<string, any>;
|
61
58
|
} | undefined;
|
62
59
|
output?: {
|
63
60
|
type: string;
|
64
|
-
properties: Record<string, any>;
|
65
61
|
required: string[];
|
62
|
+
properties: Record<string, any>;
|
66
63
|
} | undefined;
|
67
64
|
}>;
|
68
65
|
export type ActionTemplate = z.infer<typeof actionTemplateSchema>;
|
package/dist/actions/parse.js
CHANGED
@@ -19,7 +19,6 @@ const json_schema_to_zod_1 = __importDefault(require("json-schema-to-zod"));
|
|
19
19
|
const ts_morph_1 = require("ts-morph");
|
20
20
|
const zod_1 = require("zod");
|
21
21
|
const string_1 = require("../utils/string");
|
22
|
-
const types_1 = require("./autogen/types");
|
23
22
|
const jsonObjectSchema = zod_1.z.object({
|
24
23
|
type: zod_1.z.string(),
|
25
24
|
required: zod_1.z.array(zod_1.z.string()),
|
@@ -31,11 +30,9 @@ const actionSchema = zod_1.z.object({
|
|
31
30
|
parameters: jsonObjectSchema.optional(),
|
32
31
|
output: jsonObjectSchema.optional(),
|
33
32
|
});
|
34
|
-
const actionProviderSchema = zod_1.z.enum(types_1.ActionProviderNames);
|
35
|
-
const actionNameSchema = zod_1.z.enum(types_1.ActionNames);
|
36
33
|
const actionTemplateSchema = actionSchema.extend({
|
37
|
-
|
38
|
-
|
34
|
+
name: zod_1.z.string(),
|
35
|
+
provider: zod_1.z.string(),
|
39
36
|
});
|
40
37
|
const providerSchema = zod_1.z.record(zod_1.z.string(), actionSchema);
|
41
38
|
const configSchema = zod_1.z.object({
|
@@ -212,29 +209,6 @@ function generateTypes(_a) {
|
|
212
209
|
});
|
213
210
|
}
|
214
211
|
}
|
215
|
-
// Add the ActionProviderName and ActionName schemas and types
|
216
|
-
const actionProviderNames = Object.keys(parsedConfig.actions);
|
217
|
-
typesFile.addVariableStatement({
|
218
|
-
declarationKind: ts_morph_1.VariableDeclarationKind.Const,
|
219
|
-
isExported: true,
|
220
|
-
declarations: [
|
221
|
-
{
|
222
|
-
name: "ActionProviderNames",
|
223
|
-
initializer: ts_morph_1.Writers.assertion(JSON.stringify(actionProviderNames), "const"),
|
224
|
-
},
|
225
|
-
],
|
226
|
-
});
|
227
|
-
const actionNames = Object.values(parsedConfig.actions).flatMap(category => Object.keys(category));
|
228
|
-
typesFile.addVariableStatement({
|
229
|
-
declarationKind: ts_morph_1.VariableDeclarationKind.Const,
|
230
|
-
isExported: true,
|
231
|
-
declarations: [
|
232
|
-
{
|
233
|
-
name: "ActionNames",
|
234
|
-
initializer: ts_morph_1.Writers.assertion(JSON.stringify(actionNames), "const"),
|
235
|
-
},
|
236
|
-
],
|
237
|
-
});
|
238
212
|
// Save the generated TypeScript file
|
239
213
|
yield templatesFile.save();
|
240
214
|
yield typesFile.save();
|
@@ -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
|
+
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
14
|
+
return {
|
15
|
+
baseURL: baseUrl,
|
16
|
+
headers: {
|
17
|
+
Accept: "application/json",
|
18
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
19
|
+
},
|
20
|
+
};
|
21
|
+
}
|
22
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
23
|
+
const { pageId, username, content, title } = params;
|
24
|
+
const { baseUrl, authToken } = authParams;
|
25
|
+
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
26
|
+
// Get current version number
|
27
|
+
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
28
|
+
const currVersion = response.data.version.number;
|
29
|
+
const payload = {
|
30
|
+
id: pageId,
|
31
|
+
status: "current",
|
32
|
+
title,
|
33
|
+
body: {
|
34
|
+
representation: "storage",
|
35
|
+
value: content,
|
36
|
+
},
|
37
|
+
version: {
|
38
|
+
number: currVersion + 1,
|
39
|
+
},
|
40
|
+
};
|
41
|
+
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
42
|
+
});
|
43
|
+
exports.default = confluenceUpdatePage;
|
@@ -0,0 +1,96 @@
|
|
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
|
+
const types_1 = require("../../autogen/types");
|
17
|
+
const INCLUDED_TYPES = [
|
18
|
+
// "monument",
|
19
|
+
// "museum",
|
20
|
+
// "art_gallery",
|
21
|
+
// "sculpture",
|
22
|
+
// "cultural_landmark",
|
23
|
+
// "historical_place",
|
24
|
+
// "performing_arts_theater",
|
25
|
+
// "university",
|
26
|
+
// "aquarium",
|
27
|
+
// "botanical_garden",
|
28
|
+
// "comedy_club",
|
29
|
+
// "park",
|
30
|
+
// "movie_theater",
|
31
|
+
// "national_park",
|
32
|
+
// "garden",
|
33
|
+
// "night_club",
|
34
|
+
// "tourist_attraction",
|
35
|
+
// "water_park",
|
36
|
+
// "zoo",
|
37
|
+
// "bar",
|
38
|
+
"restaurant",
|
39
|
+
// "food_court",
|
40
|
+
// "bakery",
|
41
|
+
// "cafe",
|
42
|
+
// "coffee_shop",
|
43
|
+
// "pub",
|
44
|
+
// "wine_bar",
|
45
|
+
// "spa",
|
46
|
+
// "beach",
|
47
|
+
// "market",
|
48
|
+
// "shopping_mall",
|
49
|
+
// "stadium",
|
50
|
+
];
|
51
|
+
const nearbysearch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
52
|
+
const url = `https://places.googleapis.com/v1/places:searchNearby`;
|
53
|
+
const fieldMask = [
|
54
|
+
"places.displayName",
|
55
|
+
"places.formattedAddress",
|
56
|
+
"places.priceLevel",
|
57
|
+
"places.rating",
|
58
|
+
"places.primaryTypeDisplayName",
|
59
|
+
"places.editorialSummary",
|
60
|
+
"places.regularOpeningHours",
|
61
|
+
].join(",");
|
62
|
+
const response = yield axios_1.default.post(url, {
|
63
|
+
maxResultCount: 20,
|
64
|
+
includedTypes: INCLUDED_TYPES,
|
65
|
+
locationRestriction: {
|
66
|
+
circle: {
|
67
|
+
center: {
|
68
|
+
latitude: params.latitude,
|
69
|
+
longitude: params.longitude,
|
70
|
+
},
|
71
|
+
radius: 10000,
|
72
|
+
},
|
73
|
+
},
|
74
|
+
}, {
|
75
|
+
headers: {
|
76
|
+
"X-Goog-Api-Key": authParams.apiKey,
|
77
|
+
"X-Goog-FieldMask": fieldMask,
|
78
|
+
"Content-Type": "application/json",
|
79
|
+
},
|
80
|
+
});
|
81
|
+
return types_1.googlemapsNearbysearchOutputSchema.parse({
|
82
|
+
results: response.data.places.map((place) => {
|
83
|
+
var _a, _b;
|
84
|
+
return ({
|
85
|
+
name: place.displayName.text,
|
86
|
+
address: place.formattedAddress,
|
87
|
+
priceLevel: place.priceLevel,
|
88
|
+
rating: place.rating,
|
89
|
+
primaryType: place.primaryTypeDisplayName.text,
|
90
|
+
editorialSummary: ((_a = place.editorialSummary) === null || _a === void 0 ? void 0 : _a.text) || "",
|
91
|
+
openingHours: ((_b = place.regularOpeningHours) === null || _b === void 0 ? void 0 : _b.weekdayDescriptions.join("\n")) || "",
|
92
|
+
});
|
93
|
+
}),
|
94
|
+
});
|
95
|
+
});
|
96
|
+
exports.default = nearbysearch;
|
@@ -0,0 +1,34 @@
|
|
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
|
+
const createTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
17
|
+
const { authToken, baseUrl } = authParams;
|
18
|
+
const url = `${baseUrl}/rest/api/3/issue`;
|
19
|
+
const payload = {
|
20
|
+
fields: Object.assign({ project: {
|
21
|
+
key: params.projectKey,
|
22
|
+
}, summary: params.summary, description: params.description, issuetype: {
|
23
|
+
name: params.issueType,
|
24
|
+
} }, (params.reporter ? { reporter: { id: params.reporter } } : {})),
|
25
|
+
};
|
26
|
+
const response = yield axios_1.default.post(url, payload, {
|
27
|
+
headers: {
|
28
|
+
Authorization: `Basic ${Buffer.from(`${params.username}:${authToken}`).toString("base64")}`,
|
29
|
+
"Content-Type": "application/json",
|
30
|
+
},
|
31
|
+
});
|
32
|
+
return response.data;
|
33
|
+
});
|
34
|
+
exports.default = createTicket;
|
@@ -0,0 +1,60 @@
|
|
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 slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
|
14
|
+
var _b;
|
15
|
+
const client = new web_api_1.WebClient(authParams.authToken);
|
16
|
+
const allChannels = [];
|
17
|
+
let cursor;
|
18
|
+
const limit = 100;
|
19
|
+
try {
|
20
|
+
do {
|
21
|
+
const response = yield client.conversations.list({
|
22
|
+
exclude_archived: true,
|
23
|
+
limit: limit,
|
24
|
+
cursor: cursor,
|
25
|
+
});
|
26
|
+
if (!response.ok) {
|
27
|
+
throw new Error(`Slack API error: ${response.error}`);
|
28
|
+
}
|
29
|
+
// Add channels from this page to our results
|
30
|
+
if (response.channels && Array.isArray(response.channels)) {
|
31
|
+
allChannels.push(...response.channels);
|
32
|
+
}
|
33
|
+
// Get cursor for next page
|
34
|
+
cursor = (_b = response.response_metadata) === null || _b === void 0 ? void 0 : _b.next_cursor;
|
35
|
+
// If user specified a limit and we've hit it, stop paginating
|
36
|
+
if (limit && allChannels.length >= limit) {
|
37
|
+
allChannels.splice(limit); // Trim to exact limit
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
} while (cursor && cursor.length > 0);
|
41
|
+
return {
|
42
|
+
channels: allChannels.map(channel => ({
|
43
|
+
id: channel.id,
|
44
|
+
name: channel.name,
|
45
|
+
topic: channel.topic.value,
|
46
|
+
purpose: channel.purpose.value,
|
47
|
+
})),
|
48
|
+
};
|
49
|
+
}
|
50
|
+
catch (error) {
|
51
|
+
if (error instanceof Error) {
|
52
|
+
// Enhance error with more context
|
53
|
+
throw new Error(`Failed to list Slack conversations: ${error.message}`);
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
throw error;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
60
|
+
exports.default = slackListConversations;
|