@credal/actions 0.1.83 → 0.1.84

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.
@@ -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.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = void 0;
6
+ exports.ActionNames = exports.ActionProviderNames = 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,3 +2456,110 @@ 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
+ ];
@@ -1,6 +1,7 @@
1
+ import type { ActionName, ActionProviderName } from "./parse";
1
2
  interface InvokeActionInput<P, A> {
2
- provider: string;
3
- name: string;
3
+ provider: ActionProviderName;
4
+ name: ActionName;
4
5
  parameters: P;
5
6
  authParams: A;
6
7
  }
@@ -17,8 +17,12 @@ function invokeAction(input) {
17
17
  if (!actionMapper_1.ActionMapper[provider]) {
18
18
  throw new Error(`Provider '${provider}' not found`);
19
19
  }
20
- const providerFunction = actionMapper_1.ActionMapper[provider][name].fn;
21
- const safeParseParams = actionMapper_1.ActionMapper[provider][name].paramsSchema.safeParse(parameters);
20
+ const action = actionMapper_1.ActionMapper[provider][name];
21
+ if (!action) {
22
+ throw new Error(`Action '${name}' not found for provider '${provider}'`);
23
+ }
24
+ const providerFunction = action.fn;
25
+ const safeParseParams = action.paramsSchema.safeParse(parameters);
22
26
  if (!safeParseParams.success) {
23
27
  throw new Error(`Invalid parameters for action '${name}': ${safeParseParams.error}`);
24
28
  }
@@ -1,4 +1,7 @@
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];
2
5
  declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
3
6
  description: z.ZodString;
4
7
  scopes: z.ZodArray<z.ZodString, "many">;
@@ -8,12 +11,12 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
8
11
  properties: z.ZodRecord<z.ZodString, z.ZodAny>;
9
12
  }, "strip", z.ZodTypeAny, {
10
13
  type: string;
11
- required: string[];
12
14
  properties: Record<string, any>;
15
+ required: string[];
13
16
  }, {
14
17
  type: string;
15
- required: string[];
16
18
  properties: Record<string, any>;
19
+ required: string[];
17
20
  }>>;
18
21
  output: z.ZodOptional<z.ZodObject<{
19
22
  type: z.ZodString;
@@ -21,45 +24,45 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
21
24
  properties: z.ZodRecord<z.ZodString, z.ZodAny>;
22
25
  }, "strip", z.ZodTypeAny, {
23
26
  type: string;
24
- required: string[];
25
27
  properties: Record<string, any>;
28
+ required: string[];
26
29
  }, {
27
30
  type: string;
28
- required: string[];
29
31
  properties: Record<string, any>;
32
+ required: string[];
30
33
  }>>;
31
34
  }, {
32
- name: z.ZodString;
33
- provider: z.ZodString;
35
+ provider: z.ZodEnum<["generic", "asana", "slack", "math", "confluence", "jira", "kandji", "googlemaps", "bing", "credal", "zendesk", "linkedin", "x", "mongo", "snowflake", "openstreetmap", "nws", "firecrawl", "resend", "googleOauth", "gong", "finnhub", "looker", "ashby", "salesforce", "microsoft", "github"]>;
36
+ name: z.ZodEnum<["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", "updateSpreadsheet", "messageTeamsChat", "messageTeamsChannel", "getDocument", "createOrUpdateFile", "createBranch", "createPullRequest", "listPullRequests"]>;
34
37
  }>, "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";
35
39
  description: string;
36
40
  scopes: string[];
37
- name: string;
38
- provider: string;
41
+ provider: "generic" | "asana" | "slack" | "math" | "confluence" | "jira" | "kandji" | "googlemaps" | "bing" | "credal" | "zendesk" | "linkedin" | "x" | "mongo" | "snowflake" | "openstreetmap" | "nws" | "firecrawl" | "resend" | "googleOauth" | "gong" | "finnhub" | "looker" | "ashby" | "salesforce" | "microsoft" | "github";
39
42
  parameters?: {
40
43
  type: string;
41
- required: string[];
42
44
  properties: Record<string, any>;
45
+ required: string[];
43
46
  } | undefined;
44
47
  output?: {
45
48
  type: string;
46
- required: string[];
47
49
  properties: Record<string, any>;
50
+ required: string[];
48
51
  } | undefined;
49
52
  }, {
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";
50
54
  description: string;
51
55
  scopes: string[];
52
- name: string;
53
- provider: string;
56
+ provider: "generic" | "asana" | "slack" | "math" | "confluence" | "jira" | "kandji" | "googlemaps" | "bing" | "credal" | "zendesk" | "linkedin" | "x" | "mongo" | "snowflake" | "openstreetmap" | "nws" | "firecrawl" | "resend" | "googleOauth" | "gong" | "finnhub" | "looker" | "ashby" | "salesforce" | "microsoft" | "github";
54
57
  parameters?: {
55
58
  type: string;
56
- required: string[];
57
59
  properties: Record<string, any>;
60
+ required: string[];
58
61
  } | undefined;
59
62
  output?: {
60
63
  type: string;
61
- required: string[];
62
64
  properties: Record<string, any>;
65
+ required: string[];
63
66
  } | undefined;
64
67
  }>;
65
68
  export type ActionTemplate = z.infer<typeof actionTemplateSchema>;
@@ -19,6 +19,7 @@ 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");
22
23
  const jsonObjectSchema = zod_1.z.object({
23
24
  type: zod_1.z.string(),
24
25
  required: zod_1.z.array(zod_1.z.string()),
@@ -30,9 +31,11 @@ const actionSchema = zod_1.z.object({
30
31
  parameters: jsonObjectSchema.optional(),
31
32
  output: jsonObjectSchema.optional(),
32
33
  });
34
+ const actionProviderSchema = zod_1.z.enum(types_1.ActionProviderNames);
35
+ const actionNameSchema = zod_1.z.enum(types_1.ActionNames);
33
36
  const actionTemplateSchema = actionSchema.extend({
34
- name: zod_1.z.string(),
35
- provider: zod_1.z.string(),
37
+ provider: actionProviderSchema,
38
+ name: actionNameSchema,
36
39
  });
37
40
  const providerSchema = zod_1.z.record(zod_1.z.string(), actionSchema);
38
41
  const configSchema = zod_1.z.object({
@@ -209,6 +212,29 @@ function generateTypes(_a) {
209
212
  });
210
213
  }
211
214
  }
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
+ });
212
238
  // Save the generated TypeScript file
213
239
  yield templatesFile.save();
214
240
  yield typesFile.save();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.83",
3
+ "version": "0.1.84",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",