@credal/actions 0.1.7 → 0.1.10

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.
@@ -17,7 +17,9 @@ const createZendeskTicket_1 = __importDefault(require("./providers/zendesk/creat
17
17
  const createJiraTicket_1 = __importDefault(require("./providers/jira/createJiraTicket"));
18
18
  const getLatitudeLongitudeFromLocation_1 = __importDefault(require("./providers/openstreetmap/getLatitudeLongitudeFromLocation"));
19
19
  const getForecastForLocation_1 = __importDefault(require("./providers/nws/getForecastForLocation"));
20
- const nearbysearch_1 = __importDefault(require("./providers/googlemaps/nearbysearch"));
20
+ const nearbysearchRestaurants_1 = __importDefault(require("./providers/googlemaps/nearbysearchRestaurants"));
21
+ const scrapeUrl_1 = __importDefault(require("./providers/firecrawl/scrapeUrl"));
22
+ const sendEmail_1 = __importDefault(require("./providers/resend/sendEmail"));
21
23
  exports.ActionMapper = {
22
24
  math: {
23
25
  add: {
@@ -52,9 +54,9 @@ exports.ActionMapper = {
52
54
  outputSchema: types_1.googlemapsValidateAddressOutputSchema,
53
55
  },
54
56
  nearbysearch: {
55
- fn: nearbysearch_1.default,
56
- paramsSchema: types_1.googlemapsNearbysearchParamsSchema,
57
- outputSchema: types_1.googlemapsNearbysearchOutputSchema,
57
+ fn: nearbysearchRestaurants_1.default,
58
+ paramsSchema: types_1.googlemapsNearbysearchRestaurantsParamsSchema,
59
+ outputSchema: types_1.googlemapsNearbysearchRestaurantsOutputSchema,
58
60
  },
59
61
  },
60
62
  credal: {
@@ -106,4 +108,18 @@ exports.ActionMapper = {
106
108
  outputSchema: types_1.nwsGetForecastForLocationOutputSchema,
107
109
  },
108
110
  },
111
+ firecrawl: {
112
+ scrapeUrl: {
113
+ fn: scrapeUrl_1.default,
114
+ paramsSchema: types_1.firecrawlScrapeUrlParamsSchema,
115
+ outputSchema: types_1.firecrawlScrapeUrlOutputSchema,
116
+ },
117
+ },
118
+ resend: {
119
+ sendEmail: {
120
+ fn: sendEmail_1.default,
121
+ paramsSchema: types_1.resendSendEmailParamsSchema,
122
+ outputSchema: types_1.resendSendEmailOutputSchema,
123
+ },
124
+ },
109
125
  };
@@ -5,10 +5,12 @@ export declare const mathAddDefinition: ActionTemplate;
5
5
  export declare const confluenceUpdatePageDefinition: ActionTemplate;
6
6
  export declare const jiraCreateJiraTicketDefinition: ActionTemplate;
7
7
  export declare const googlemapsValidateAddressDefinition: ActionTemplate;
8
- export declare const googlemapsNearbysearchDefinition: ActionTemplate;
8
+ export declare const googlemapsNearbysearchRestaurantsDefinition: ActionTemplate;
9
9
  export declare const credalCallCopilotDefinition: ActionTemplate;
10
10
  export declare const zendeskCreateZendeskTicketDefinition: ActionTemplate;
11
11
  export declare const mongoInsertMongoDocDefinition: ActionTemplate;
12
12
  export declare const snowflakeGetRowByFieldValueDefinition: ActionTemplate;
13
13
  export declare const openstreetmapGetLatitudeLongitudeFromLocationDefinition: ActionTemplate;
14
14
  export declare const nwsGetForecastForLocationDefinition: ActionTemplate;
15
+ export declare const firecrawlScrapeUrlDefinition: ActionTemplate;
16
+ export declare const resendSendEmailDefinition: ActionTemplate;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.googlemapsNearbysearchDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraCreateJiraTicketDefinition = exports.confluenceUpdatePageDefinition = exports.mathAddDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = void 0;
3
+ exports.resendSendEmailDefinition = exports.firecrawlScrapeUrlDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraCreateJiraTicketDefinition = exports.confluenceUpdatePageDefinition = exports.mathAddDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = void 0;
4
4
  exports.slackSendMessageDefinition = {
5
5
  description: "Sends a message to a Slack channel",
6
6
  scopes: ["chat:write"],
@@ -335,7 +335,7 @@ exports.googlemapsValidateAddressDefinition = {
335
335
  name: "validateAddress",
336
336
  provider: "googlemaps",
337
337
  };
338
- exports.googlemapsNearbysearchDefinition = {
338
+ exports.googlemapsNearbysearchRestaurantsDefinition = {
339
339
  description: "Search for nearby places using Google Maps",
340
340
  scopes: [],
341
341
  parameters: {
@@ -390,12 +390,16 @@ exports.googlemapsNearbysearchDefinition = {
390
390
  type: "string",
391
391
  description: "The editorial summary of the place",
392
392
  },
393
+ websiteUri: {
394
+ type: "string",
395
+ description: "The website URI of the place",
396
+ },
393
397
  },
394
398
  },
395
399
  },
396
400
  },
397
401
  },
398
- name: "nearbysearch",
402
+ name: "nearbysearchRestaurants",
399
403
  provider: "googlemaps",
400
404
  };
401
405
  exports.credalCallCopilotDefinition = {
@@ -660,3 +664,67 @@ exports.nwsGetForecastForLocationDefinition = {
660
664
  name: "getForecastForLocation",
661
665
  provider: "nws",
662
666
  };
667
+ exports.firecrawlScrapeUrlDefinition = {
668
+ description: "Scrape a URL and get website content using Firecrawl",
669
+ scopes: [],
670
+ parameters: {
671
+ type: "object",
672
+ required: ["url"],
673
+ properties: {
674
+ url: {
675
+ type: "string",
676
+ description: "The URL to scrape",
677
+ },
678
+ },
679
+ },
680
+ output: {
681
+ type: "object",
682
+ required: ["content"],
683
+ properties: {
684
+ content: {
685
+ type: "string",
686
+ description: "The content of the URL",
687
+ },
688
+ },
689
+ },
690
+ name: "scrapeUrl",
691
+ provider: "firecrawl",
692
+ };
693
+ exports.resendSendEmailDefinition = {
694
+ description: "Send an email using Resend",
695
+ scopes: [],
696
+ parameters: {
697
+ type: "object",
698
+ required: ["to", "subject", "content"],
699
+ properties: {
700
+ to: {
701
+ type: "string",
702
+ description: "The email address to send the email to",
703
+ },
704
+ subject: {
705
+ type: "string",
706
+ description: "The subject of the email",
707
+ },
708
+ content: {
709
+ type: "string",
710
+ description: "The content of the email",
711
+ },
712
+ },
713
+ },
714
+ output: {
715
+ type: "object",
716
+ required: ["success"],
717
+ properties: {
718
+ success: {
719
+ type: "boolean",
720
+ description: "Whether the email was sent successfully",
721
+ },
722
+ error: {
723
+ type: "string",
724
+ description: "The error that occurred if the email was not sent successfully",
725
+ },
726
+ },
727
+ },
728
+ name: "sendEmail",
729
+ provider: "resend",
730
+ };
@@ -8,16 +8,22 @@ export declare const AuthParamsSchema: z.ZodObject<{
8
8
  baseUrl: z.ZodOptional<z.ZodString>;
9
9
  apiKey: z.ZodOptional<z.ZodString>;
10
10
  userAgent: z.ZodOptional<z.ZodString>;
11
+ emailFrom: z.ZodOptional<z.ZodString>;
12
+ emailReplyTo: z.ZodOptional<z.ZodString>;
11
13
  }, "strip", z.ZodTypeAny, {
12
14
  authToken?: string | undefined;
13
15
  baseUrl?: string | undefined;
14
16
  apiKey?: string | undefined;
15
17
  userAgent?: string | undefined;
18
+ emailFrom?: string | undefined;
19
+ emailReplyTo?: string | undefined;
16
20
  }, {
17
21
  authToken?: string | undefined;
18
22
  baseUrl?: string | undefined;
19
23
  apiKey?: string | undefined;
20
24
  userAgent?: string | undefined;
25
+ emailFrom?: string | undefined;
26
+ emailReplyTo?: string | undefined;
21
27
  }>;
22
28
  export type AuthParamsType = z.infer<typeof AuthParamsSchema>;
23
29
  export declare const slackSendMessageParamsSchema: z.ZodObject<{
@@ -367,7 +373,7 @@ export declare const googlemapsValidateAddressOutputSchema: z.ZodObject<{
367
373
  }>;
368
374
  export type googlemapsValidateAddressOutputType = z.infer<typeof googlemapsValidateAddressOutputSchema>;
369
375
  export type googlemapsValidateAddressFunction = ActionFunction<googlemapsValidateAddressParamsType, AuthParamsType, googlemapsValidateAddressOutputType>;
370
- export declare const googlemapsNearbysearchParamsSchema: z.ZodObject<{
376
+ export declare const googlemapsNearbysearchRestaurantsParamsSchema: z.ZodObject<{
371
377
  latitude: z.ZodNumber;
372
378
  longitude: z.ZodNumber;
373
379
  }, "strip", z.ZodTypeAny, {
@@ -377,8 +383,8 @@ export declare const googlemapsNearbysearchParamsSchema: z.ZodObject<{
377
383
  latitude: number;
378
384
  longitude: number;
379
385
  }>;
380
- export type googlemapsNearbysearchParamsType = z.infer<typeof googlemapsNearbysearchParamsSchema>;
381
- export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
386
+ export type googlemapsNearbysearchRestaurantsParamsType = z.infer<typeof googlemapsNearbysearchRestaurantsParamsSchema>;
387
+ export declare const googlemapsNearbysearchRestaurantsOutputSchema: z.ZodObject<{
382
388
  results: z.ZodArray<z.ZodObject<{
383
389
  name: z.ZodOptional<z.ZodString>;
384
390
  address: z.ZodOptional<z.ZodString>;
@@ -387,6 +393,7 @@ export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
387
393
  openingHours: z.ZodOptional<z.ZodString>;
388
394
  primaryType: z.ZodOptional<z.ZodString>;
389
395
  editorialSummary: z.ZodOptional<z.ZodString>;
396
+ websiteUri: z.ZodOptional<z.ZodString>;
390
397
  }, "strip", z.ZodTypeAny, {
391
398
  name?: string | undefined;
392
399
  address?: string | undefined;
@@ -395,6 +402,7 @@ export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
395
402
  openingHours?: string | undefined;
396
403
  primaryType?: string | undefined;
397
404
  editorialSummary?: string | undefined;
405
+ websiteUri?: string | undefined;
398
406
  }, {
399
407
  name?: string | undefined;
400
408
  address?: string | undefined;
@@ -403,6 +411,7 @@ export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
403
411
  openingHours?: string | undefined;
404
412
  primaryType?: string | undefined;
405
413
  editorialSummary?: string | undefined;
414
+ websiteUri?: string | undefined;
406
415
  }>, "many">;
407
416
  }, "strip", z.ZodTypeAny, {
408
417
  results: {
@@ -413,6 +422,7 @@ export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
413
422
  openingHours?: string | undefined;
414
423
  primaryType?: string | undefined;
415
424
  editorialSummary?: string | undefined;
425
+ websiteUri?: string | undefined;
416
426
  }[];
417
427
  }, {
418
428
  results: {
@@ -423,10 +433,11 @@ export declare const googlemapsNearbysearchOutputSchema: z.ZodObject<{
423
433
  openingHours?: string | undefined;
424
434
  primaryType?: string | undefined;
425
435
  editorialSummary?: string | undefined;
436
+ websiteUri?: string | undefined;
426
437
  }[];
427
438
  }>;
428
- export type googlemapsNearbysearchOutputType = z.infer<typeof googlemapsNearbysearchOutputSchema>;
429
- export type googlemapsNearbysearchFunction = ActionFunction<googlemapsNearbysearchParamsType, AuthParamsType, googlemapsNearbysearchOutputType>;
439
+ export type googlemapsNearbysearchRestaurantsOutputType = z.infer<typeof googlemapsNearbysearchRestaurantsOutputSchema>;
440
+ export type googlemapsNearbysearchRestaurantsFunction = ActionFunction<googlemapsNearbysearchRestaurantsParamsType, AuthParamsType, googlemapsNearbysearchRestaurantsOutputType>;
430
441
  export declare const credalCallCopilotParamsSchema: z.ZodObject<{
431
442
  agentId: z.ZodString;
432
443
  query: z.ZodString;
@@ -636,3 +647,46 @@ export declare const nwsGetForecastForLocationOutputSchema: z.ZodObject<{
636
647
  }>;
637
648
  export type nwsGetForecastForLocationOutputType = z.infer<typeof nwsGetForecastForLocationOutputSchema>;
638
649
  export type nwsGetForecastForLocationFunction = ActionFunction<nwsGetForecastForLocationParamsType, AuthParamsType, nwsGetForecastForLocationOutputType>;
650
+ export declare const firecrawlScrapeUrlParamsSchema: z.ZodObject<{
651
+ url: z.ZodString;
652
+ }, "strip", z.ZodTypeAny, {
653
+ url: string;
654
+ }, {
655
+ url: string;
656
+ }>;
657
+ export type firecrawlScrapeUrlParamsType = z.infer<typeof firecrawlScrapeUrlParamsSchema>;
658
+ export declare const firecrawlScrapeUrlOutputSchema: z.ZodObject<{
659
+ content: z.ZodString;
660
+ }, "strip", z.ZodTypeAny, {
661
+ content: string;
662
+ }, {
663
+ content: string;
664
+ }>;
665
+ export type firecrawlScrapeUrlOutputType = z.infer<typeof firecrawlScrapeUrlOutputSchema>;
666
+ export type firecrawlScrapeUrlFunction = ActionFunction<firecrawlScrapeUrlParamsType, AuthParamsType, firecrawlScrapeUrlOutputType>;
667
+ export declare const resendSendEmailParamsSchema: z.ZodObject<{
668
+ to: z.ZodString;
669
+ subject: z.ZodString;
670
+ content: z.ZodString;
671
+ }, "strip", z.ZodTypeAny, {
672
+ content: string;
673
+ subject: string;
674
+ to: string;
675
+ }, {
676
+ content: string;
677
+ subject: string;
678
+ to: string;
679
+ }>;
680
+ export type resendSendEmailParamsType = z.infer<typeof resendSendEmailParamsSchema>;
681
+ export declare const resendSendEmailOutputSchema: z.ZodObject<{
682
+ success: z.ZodBoolean;
683
+ error: z.ZodOptional<z.ZodString>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ success: boolean;
686
+ error?: string | undefined;
687
+ }, {
688
+ success: boolean;
689
+ error?: string | undefined;
690
+ }>;
691
+ export type resendSendEmailOutputType = z.infer<typeof resendSendEmailOutputSchema>;
692
+ export type resendSendEmailFunction = ActionFunction<resendSendEmailParamsType, AuthParamsType, resendSendEmailOutputType>;
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.googlemapsNearbysearchOutputSchema = exports.googlemapsNearbysearchParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.confluenceUpdatePageOutputSchema = exports.confluenceUpdatePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.AuthParamsSchema = void 0;
3
+ exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.confluenceUpdatePageOutputSchema = exports.confluenceUpdatePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.AuthParamsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.AuthParamsSchema = zod_1.z.object({
6
6
  authToken: zod_1.z.string().optional(),
7
7
  baseUrl: zod_1.z.string().optional(),
8
8
  apiKey: zod_1.z.string().optional(),
9
9
  userAgent: zod_1.z.string().optional(),
10
+ emailFrom: zod_1.z.string().optional(),
11
+ emailReplyTo: zod_1.z.string().optional(),
10
12
  });
11
13
  exports.slackSendMessageParamsSchema = zod_1.z.object({
12
14
  channelName: zod_1.z.string().describe("The name of the Slack channel to send the message to (e.g. general, alerts)"),
@@ -112,11 +114,11 @@ exports.googlemapsValidateAddressOutputSchema = zod_1.z.object({
112
114
  .describe("USPS-specific validation details.")
113
115
  .optional(),
114
116
  });
115
- exports.googlemapsNearbysearchParamsSchema = zod_1.z.object({
117
+ exports.googlemapsNearbysearchRestaurantsParamsSchema = zod_1.z.object({
116
118
  latitude: zod_1.z.number().describe("The latitude of the location to search nearby"),
117
119
  longitude: zod_1.z.number().describe("The longitude of the location to search nearby"),
118
120
  });
119
- exports.googlemapsNearbysearchOutputSchema = zod_1.z.object({
121
+ exports.googlemapsNearbysearchRestaurantsOutputSchema = zod_1.z.object({
120
122
  results: zod_1.z
121
123
  .array(zod_1.z.object({
122
124
  name: zod_1.z.string().describe("The name of the place").optional(),
@@ -126,6 +128,7 @@ exports.googlemapsNearbysearchOutputSchema = zod_1.z.object({
126
128
  openingHours: zod_1.z.string().describe("The opening hours of the place").optional(),
127
129
  primaryType: zod_1.z.string().describe("The primary type of the place").optional(),
128
130
  editorialSummary: zod_1.z.string().describe("The editorial summary of the place").optional(),
131
+ websiteUri: zod_1.z.string().describe("The website URI of the place").optional(),
129
132
  }))
130
133
  .describe("The results of the nearby search"),
131
134
  });
@@ -199,3 +202,14 @@ exports.nwsGetForecastForLocationOutputSchema = zod_1.z.object({
199
202
  })
200
203
  .optional(),
201
204
  });
205
+ exports.firecrawlScrapeUrlParamsSchema = zod_1.z.object({ url: zod_1.z.string().describe("The URL to scrape") });
206
+ exports.firecrawlScrapeUrlOutputSchema = zod_1.z.object({ content: zod_1.z.string().describe("The content of the URL") });
207
+ exports.resendSendEmailParamsSchema = zod_1.z.object({
208
+ to: zod_1.z.string().describe("The email address to send the email to"),
209
+ subject: zod_1.z.string().describe("The subject of the email"),
210
+ content: zod_1.z.string().describe("The content of the email"),
211
+ });
212
+ exports.resendSendEmailOutputSchema = zod_1.z.object({
213
+ success: zod_1.z.boolean().describe("Whether the email was sent successfully"),
214
+ error: zod_1.z.string().describe("The error that occurred if the email was not sent successfully").optional(),
215
+ });
@@ -17,7 +17,7 @@ exports.ACTION_GROUPS = {
17
17
  },
18
18
  GOOGLE_MAPS: {
19
19
  description: "Action for interacting with Google Maps",
20
- actions: [templates_1.googlemapsValidateAddressDefinition, templates_1.googlemapsNearbysearchDefinition],
20
+ actions: [templates_1.googlemapsValidateAddressDefinition, templates_1.googlemapsNearbysearchRestaurantsDefinition],
21
21
  },
22
22
  CREDAL_CALL_COPILOT: {
23
23
  description: "Action for calling a Credal Copilot",
@@ -47,4 +47,12 @@ exports.ACTION_GROUPS = {
47
47
  description: "Action for getting the weather forecast for a location",
48
48
  actions: [templates_1.nwsGetForecastForLocationDefinition],
49
49
  },
50
+ FIRECRAWL: {
51
+ description: "Actions for interacting with Firecrawl",
52
+ actions: [templates_1.firecrawlScrapeUrlDefinition],
53
+ },
54
+ RESEND: {
55
+ description: "Action for sending an email",
56
+ actions: [templates_1.resendSendEmailDefinition],
57
+ },
50
58
  };
@@ -44,6 +44,8 @@ z.object({
44
44
  baseUrl: z.string().optional(),
45
45
  apiKey: z.string().optional(),
46
46
  userAgent: z.string().optional(),
47
+ emailFrom: z.string().optional(),
48
+ emailReplyTo: z.string().optional(),
47
49
  })
48
50
  `;
49
51
  function validateObject(object) {
@@ -0,0 +1,3 @@
1
+ import { firecrawlScrapeUrlFunction } from "../../autogen/types";
2
+ declare const scrapeUrl: firecrawlScrapeUrlFunction;
3
+ export default scrapeUrl;
@@ -0,0 +1,26 @@
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 firecrawl_js_1 = __importDefault(require("@mendable/firecrawl-js"));
16
+ const types_1 = require("../../autogen/types");
17
+ const scrapeUrl = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
18
+ const firecrawl = new firecrawl_js_1.default({
19
+ apiKey: authParams.apiKey,
20
+ });
21
+ const result = yield firecrawl.scrapeUrl(params.url);
22
+ return types_1.firecrawlScrapeUrlOutputSchema.parse({
23
+ content: result.success ? result.markdown : "",
24
+ });
25
+ });
26
+ exports.default = scrapeUrl;
@@ -15,38 +15,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const axios_1 = __importDefault(require("axios"));
16
16
  const types_1 = require("../../autogen/types");
17
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",
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
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",
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
50
  ];
51
51
  const nearbysearch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
52
52
  const url = `https://places.googleapis.com/v1/places:searchNearby`;
@@ -0,0 +1,3 @@
1
+ import { googlemapsNearbysearchRestaurantsFunction } from "../../autogen/types";
2
+ declare const nearbysearchRestaurants: googlemapsNearbysearchRestaurantsFunction;
3
+ export default nearbysearchRestaurants;
@@ -0,0 +1,65 @@
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 = ["restaurant"];
18
+ const nearbysearchRestaurants = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
19
+ const url = `https://places.googleapis.com/v1/places:searchNearby`;
20
+ const fieldMask = [
21
+ "places.displayName",
22
+ "places.formattedAddress",
23
+ "places.priceLevel",
24
+ "places.rating",
25
+ "places.primaryTypeDisplayName",
26
+ "places.editorialSummary",
27
+ "places.regularOpeningHours",
28
+ "places.websiteUri",
29
+ ].join(",");
30
+ const response = yield axios_1.default.post(url, {
31
+ maxResultCount: 20,
32
+ includedTypes: INCLUDED_TYPES,
33
+ locationRestriction: {
34
+ circle: {
35
+ center: {
36
+ latitude: params.latitude,
37
+ longitude: params.longitude,
38
+ },
39
+ radius: 5000,
40
+ },
41
+ },
42
+ }, {
43
+ headers: {
44
+ "X-Goog-Api-Key": authParams.apiKey,
45
+ "X-Goog-FieldMask": fieldMask,
46
+ "Content-Type": "application/json",
47
+ },
48
+ });
49
+ return types_1.googlemapsNearbysearchRestaurantsOutputSchema.parse({
50
+ results: response.data.places.map((place) => {
51
+ var _a, _b;
52
+ return ({
53
+ name: place.displayName.text,
54
+ address: place.formattedAddress,
55
+ priceLevel: place.priceLevel,
56
+ rating: place.rating,
57
+ primaryType: place.primaryTypeDisplayName.text,
58
+ editorialSummary: ((_a = place.editorialSummary) === null || _a === void 0 ? void 0 : _a.text) || "",
59
+ openingHours: ((_b = place.regularOpeningHours) === null || _b === void 0 ? void 0 : _b.weekdayDescriptions.join("\n")) || "",
60
+ websiteUri: place.websiteUri,
61
+ });
62
+ }),
63
+ });
64
+ });
65
+ exports.default = nearbysearchRestaurants;
@@ -0,0 +1,3 @@
1
+ import { resendSendEmailFunction } from "../../autogen/types";
2
+ declare const sendEmail: resendSendEmailFunction;
3
+ export default sendEmail;
@@ -0,0 +1,38 @@
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 resend_1 = require("resend");
13
+ const types_1 = require("../../autogen/types");
14
+ const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
+ try {
16
+ const resend = new resend_1.Resend(authParams.apiKey);
17
+ const result = yield resend.emails.send({
18
+ from: authParams.emailFrom,
19
+ replyTo: authParams.emailReplyTo,
20
+ to: params.to,
21
+ subject: params.subject,
22
+ text: params.content,
23
+ });
24
+ if (result.error) {
25
+ throw new Error(result.error.message);
26
+ }
27
+ return types_1.resendSendEmailOutputSchema.parse({
28
+ success: true,
29
+ });
30
+ }
31
+ catch (error) {
32
+ return types_1.resendSendEmailOutputSchema.parse({
33
+ success: false,
34
+ error: error instanceof Error ? error.message : "Unknown error",
35
+ });
36
+ }
37
+ });
38
+ exports.default = sendEmail;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.7",
3
+ "version": "0.1.10",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -39,12 +39,14 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@credal/sdk": "^0.0.21",
42
+ "@mendable/firecrawl-js": "^1.19.0",
42
43
  "@slack/web-api": "^7.8.0",
43
44
  "@types/snowflake-sdk": "^1.6.24",
44
45
  "ajv": "^8.17.1",
45
46
  "date-fns": "^4.1.0",
46
47
  "json-schema-to-zod": "^2.5.0",
47
48
  "mongodb": "^6.13.1",
49
+ "resend": "^4.1.2",
48
50
  "snowflake-sdk": "^2.0.2",
49
51
  "ts-node": "^10.9.2",
50
52
  "zod": "^3.24.1"