@credal/actions 0.1.16 → 0.1.18

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.
@@ -23,7 +23,9 @@ const sendEmail_1 = __importDefault(require("./providers/resend/sendEmail"));
23
23
  const createSharePostLinkedinUrl_1 = __importDefault(require("./providers/linkedin/createSharePostLinkedinUrl"));
24
24
  const createNewGoogleDoc_1 = __importDefault(require("./providers/google-oauth/createNewGoogleDoc"));
25
25
  const createXSharePostUrl_1 = __importDefault(require("./providers/x/createXSharePostUrl"));
26
- const scrapeTweetDataWithNitter_1 = __importDefault(require("./providers/x/scrapeTweetDataWithNitter"));
26
+ const scrapeTweetDataWithNitter_1 = __importDefault(require("./providers/firecrawl/scrapeTweetDataWithNitter"));
27
+ const symbolLookup_1 = __importDefault(require("./providers/finnhub/symbolLookup"));
28
+ const getBasicFinancials_1 = __importDefault(require("./providers/finnhub/getBasicFinancials"));
27
29
  exports.ActionMapper = {
28
30
  math: {
29
31
  add: {
@@ -125,6 +127,11 @@ exports.ActionMapper = {
125
127
  paramsSchema: types_1.firecrawlScrapeUrlParamsSchema,
126
128
  outputSchema: types_1.firecrawlScrapeUrlOutputSchema,
127
129
  },
130
+ scrapeTweetDataWithNitter: {
131
+ fn: scrapeTweetDataWithNitter_1.default,
132
+ paramsSchema: types_1.firecrawlScrapeTweetDataWithNitterParamsSchema,
133
+ outputSchema: types_1.firecrawlScrapeTweetDataWithNitterOutputSchema,
134
+ },
128
135
  },
129
136
  resend: {
130
137
  sendEmail: {
@@ -146,10 +153,17 @@ exports.ActionMapper = {
146
153
  paramsSchema: types_1.xCreateShareXPostUrlParamsSchema,
147
154
  outputSchema: types_1.xCreateShareXPostUrlOutputSchema,
148
155
  },
149
- scrapePostDataWithNitter: {
150
- fn: scrapeTweetDataWithNitter_1.default,
151
- paramsSchema: types_1.xScrapePostDataWithNitterParamsSchema,
152
- outputSchema: types_1.xScrapePostDataWithNitterOutputSchema,
156
+ },
157
+ finnhub: {
158
+ symbolLookup: {
159
+ fn: symbolLookup_1.default,
160
+ paramsSchema: types_1.finnhubSymbolLookupParamsSchema,
161
+ outputSchema: types_1.finnhubSymbolLookupOutputSchema,
162
+ },
163
+ getBasicFinancials: {
164
+ fn: getBasicFinancials_1.default,
165
+ paramsSchema: types_1.finnhubGetBasicFinancialsParamsSchema,
166
+ outputSchema: types_1.finnhubGetBasicFinancialsOutputSchema,
153
167
  },
154
168
  },
155
169
  };
@@ -0,0 +1,5 @@
1
+ import { ActionTemplate } from "@/actions/parse";
2
+ export declare const slackSendMessageDefinition: ActionTemplate;
3
+ export declare const slackListConversationsDefinition: ActionTemplate;
4
+ export declare const mathAddDefinition: ActionTemplate;
5
+ export declare const confluenceUpdatePageDefinition: ActionTemplate;
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.confluenceUpdatePageDefinition = exports.mathAddDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = void 0;
4
+ exports.slackSendMessageDefinition = {
5
+ provider: "slack",
6
+ name: "send_message",
7
+ description: "Sends a message to a Slack channel",
8
+ scopes: ["chat:write"],
9
+ parameters: {
10
+ channel: {
11
+ type: "string",
12
+ description: "The Slack channel to send the message to (e.g., \\#general, \\#alerts)",
13
+ required: true,
14
+ },
15
+ message: {
16
+ type: "string",
17
+ description: "The message content to send to Slack. Can include markdown formatting.",
18
+ required: true,
19
+ },
20
+ },
21
+ output: {},
22
+ };
23
+ exports.slackListConversationsDefinition = {
24
+ provider: "slack",
25
+ name: "list_conversations",
26
+ description: "Lists all conversations in a Slack workspace",
27
+ scopes: ["channels:read", "groups:read", "im:read", "mpim:read"],
28
+ authToken: {
29
+ type: "string",
30
+ description: "The Slack access token to use",
31
+ required: true,
32
+ },
33
+ parameters: {},
34
+ output: {
35
+ channels: {
36
+ type: "array",
37
+ description: "A list of channels in Slack",
38
+ required: true,
39
+ items: {
40
+ type: "object",
41
+ description: "A channel in Slack",
42
+ required: true,
43
+ properties: {
44
+ id: {
45
+ type: "string",
46
+ description: "The ID of the channel",
47
+ required: true,
48
+ },
49
+ name: {
50
+ type: "string",
51
+ description: "The name of the channel",
52
+ required: true,
53
+ },
54
+ topic: {
55
+ type: "string",
56
+ description: "The topic of the channel",
57
+ required: true,
58
+ },
59
+ purpose: {
60
+ type: "string",
61
+ description: "The purpose of the channel",
62
+ required: true,
63
+ },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ };
69
+ exports.mathAddDefinition = {
70
+ provider: "math",
71
+ name: "add",
72
+ description: "Adds two numbers together",
73
+ scopes: [],
74
+ parameters: {
75
+ a: {
76
+ type: "number",
77
+ description: "The first number to add",
78
+ required: true,
79
+ },
80
+ b: {
81
+ type: "number",
82
+ description: "The second number to add",
83
+ required: true,
84
+ },
85
+ },
86
+ output: {
87
+ result: {
88
+ type: "number",
89
+ description: "The sum of the two numbers",
90
+ required: true,
91
+ },
92
+ },
93
+ };
94
+ exports.confluenceUpdatePageDefinition = {
95
+ provider: "confluence",
96
+ name: "updatePage",
97
+ description: "Updates a confluence page with the new content specified",
98
+ scopes: [],
99
+ authToken: {
100
+ type: "string",
101
+ description: "The access token to use for confluence",
102
+ required: true,
103
+ },
104
+ baseUrl: {
105
+ type: "string",
106
+ description: "The base url required to access the confluence instance",
107
+ required: true,
108
+ },
109
+ parameters: {
110
+ pageId: {
111
+ type: "string",
112
+ description: "The page id that should be updated",
113
+ required: true,
114
+ },
115
+ title: {
116
+ type: "string",
117
+ description: "The title of the page that should be updated",
118
+ required: true,
119
+ },
120
+ username: {
121
+ type: "string",
122
+ description: "The username of the person updating the page",
123
+ required: true,
124
+ },
125
+ content: {
126
+ type: "string",
127
+ description: "The new content for the page",
128
+ required: true,
129
+ },
130
+ },
131
+ output: {},
132
+ };
@@ -10,11 +10,13 @@ export declare const credalCallCopilotDefinition: ActionTemplate;
10
10
  export declare const zendeskCreateZendeskTicketDefinition: ActionTemplate;
11
11
  export declare const linkedinCreateShareLinkedinPostUrlDefinition: ActionTemplate;
12
12
  export declare const xCreateShareXPostUrlDefinition: ActionTemplate;
13
- export declare const xScrapePostDataWithNitterDefinition: ActionTemplate;
14
13
  export declare const mongoInsertMongoDocDefinition: ActionTemplate;
15
14
  export declare const snowflakeGetRowByFieldValueDefinition: ActionTemplate;
16
15
  export declare const openstreetmapGetLatitudeLongitudeFromLocationDefinition: ActionTemplate;
17
16
  export declare const nwsGetForecastForLocationDefinition: ActionTemplate;
18
17
  export declare const firecrawlScrapeUrlDefinition: ActionTemplate;
18
+ export declare const firecrawlScrapeTweetDataWithNitterDefinition: ActionTemplate;
19
19
  export declare const resendSendEmailDefinition: ActionTemplate;
20
20
  export declare const googleOauthCreateNewGoogleDocDefinition: ActionTemplate;
21
+ export declare const finnhubSymbolLookupDefinition: ActionTemplate;
22
+ export declare const finnhubGetBasicFinancialsDefinition: ActionTemplate;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleOauthCreateNewGoogleDocDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeUrlDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xScrapePostDataWithNitterDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraCreateJiraTicketDefinition = exports.confluenceUpdatePageDefinition = exports.mathAddDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = void 0;
3
+ exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.googleOauthCreateNewGoogleDocDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeTweetDataWithNitterDefinition = exports.firecrawlScrapeUrlDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = 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"],
@@ -549,32 +549,6 @@ exports.xCreateShareXPostUrlDefinition = {
549
549
  name: "createShareXPostUrl",
550
550
  provider: "x",
551
551
  };
552
- exports.xScrapePostDataWithNitterDefinition = {
553
- description: "Given A tweet URL scrape the tweet data with nitter+firecrawl",
554
- scopes: [],
555
- parameters: {
556
- type: "object",
557
- required: ["tweetUrl"],
558
- properties: {
559
- tweetUrl: {
560
- type: "string",
561
- description: "The url for the X(formerly twitter) post",
562
- },
563
- },
564
- },
565
- output: {
566
- type: "object",
567
- required: ["text"],
568
- properties: {
569
- text: {
570
- type: "string",
571
- description: "The text in the tweet URL",
572
- },
573
- },
574
- },
575
- name: "scrapePostDataWithNitter",
576
- provider: "x",
577
- };
578
552
  exports.mongoInsertMongoDocDefinition = {
579
553
  description: "Insert a document into a MongoDB collection",
580
554
  scopes: [],
@@ -787,6 +761,32 @@ exports.firecrawlScrapeUrlDefinition = {
787
761
  name: "scrapeUrl",
788
762
  provider: "firecrawl",
789
763
  };
764
+ exports.firecrawlScrapeTweetDataWithNitterDefinition = {
765
+ description: "Given A tweet URL scrape the tweet data with nitter+firecrawl",
766
+ scopes: [],
767
+ parameters: {
768
+ type: "object",
769
+ required: ["tweetUrl"],
770
+ properties: {
771
+ tweetUrl: {
772
+ type: "string",
773
+ description: "The url for the X(formerly twitter) post",
774
+ },
775
+ },
776
+ },
777
+ output: {
778
+ type: "object",
779
+ required: ["text"],
780
+ properties: {
781
+ text: {
782
+ type: "string",
783
+ description: "The text in the tweet URL",
784
+ },
785
+ },
786
+ },
787
+ name: "scrapeTweetDataWithNitter",
788
+ provider: "firecrawl",
789
+ };
790
790
  exports.resendSendEmailDefinition = {
791
791
  description: "Send an email using Resend",
792
792
  scopes: [],
@@ -859,3 +859,135 @@ exports.googleOauthCreateNewGoogleDocDefinition = {
859
859
  name: "createNewGoogleDoc",
860
860
  provider: "googleOauth",
861
861
  };
862
+ exports.finnhubSymbolLookupDefinition = {
863
+ description: "Look up a stock symbol by name",
864
+ scopes: [],
865
+ parameters: {
866
+ type: "object",
867
+ required: ["query"],
868
+ properties: {
869
+ query: {
870
+ type: "string",
871
+ description: "The query to look up",
872
+ },
873
+ },
874
+ },
875
+ output: {
876
+ type: "object",
877
+ required: ["result"],
878
+ properties: {
879
+ result: {
880
+ type: "array",
881
+ description: "The results of the symbol lookup",
882
+ items: {
883
+ type: "object",
884
+ description: "The metadata of the stock",
885
+ properties: {
886
+ symbol: {
887
+ type: "string",
888
+ description: "The symbol of the stock",
889
+ },
890
+ description: {
891
+ type: "string",
892
+ description: "The description of the stock",
893
+ },
894
+ },
895
+ },
896
+ },
897
+ },
898
+ },
899
+ name: "symbolLookup",
900
+ provider: "finnhub",
901
+ };
902
+ exports.finnhubGetBasicFinancialsDefinition = {
903
+ description: "Get company basic financials such as margin, P/E ratio, 52-week high/low etc.",
904
+ scopes: [],
905
+ parameters: {
906
+ type: "object",
907
+ required: ["symbol"],
908
+ properties: {
909
+ symbol: {
910
+ type: "string",
911
+ description: "The symbol/TICKER of the stock",
912
+ },
913
+ },
914
+ },
915
+ output: {
916
+ type: "object",
917
+ required: ["result"],
918
+ properties: {
919
+ result: {
920
+ type: "object",
921
+ description: "The basic financials of the stock",
922
+ properties: {
923
+ annual: {
924
+ type: "array",
925
+ description: "The annual financials of the stock",
926
+ items: {
927
+ type: "object",
928
+ description: "The annual financials of the stock",
929
+ properties: {
930
+ metric: {
931
+ type: "string",
932
+ description: "The name of the financial metric",
933
+ },
934
+ series: {
935
+ type: "array",
936
+ description: "The series of values for the financial metric",
937
+ items: {
938
+ type: "object",
939
+ description: "The value of the financial metric",
940
+ properties: {
941
+ period: {
942
+ type: "string",
943
+ description: "The period of the financial metric in YYYY-MM-DD format",
944
+ },
945
+ v: {
946
+ type: "number",
947
+ description: "The value of the financial metric",
948
+ },
949
+ },
950
+ },
951
+ },
952
+ },
953
+ },
954
+ },
955
+ quarterly: {
956
+ type: "array",
957
+ description: "The quarterly financials of the stock",
958
+ items: {
959
+ type: "object",
960
+ description: "The quarterly financials of the stock",
961
+ properties: {
962
+ metric: {
963
+ type: "string",
964
+ description: "The name of the financial metric",
965
+ },
966
+ series: {
967
+ type: "array",
968
+ description: "The series of values for the financial metric",
969
+ items: {
970
+ type: "object",
971
+ description: "The value of the financial metric",
972
+ properties: {
973
+ period: {
974
+ type: "string",
975
+ description: "The period of the financial metric in YYYY-MM-DD format",
976
+ },
977
+ v: {
978
+ type: "number",
979
+ description: "The value of the financial metric",
980
+ },
981
+ },
982
+ },
983
+ },
984
+ },
985
+ },
986
+ },
987
+ },
988
+ },
989
+ },
990
+ },
991
+ name: "getBasicFinancials",
992
+ provider: "finnhub",
993
+ };
@@ -542,23 +542,6 @@ export declare const xCreateShareXPostUrlOutputSchema: z.ZodObject<{
542
542
  }>;
543
543
  export type xCreateShareXPostUrlOutputType = z.infer<typeof xCreateShareXPostUrlOutputSchema>;
544
544
  export type xCreateShareXPostUrlFunction = ActionFunction<xCreateShareXPostUrlParamsType, AuthParamsType, xCreateShareXPostUrlOutputType>;
545
- export declare const xScrapePostDataWithNitterParamsSchema: z.ZodObject<{
546
- tweetUrl: z.ZodString;
547
- }, "strip", z.ZodTypeAny, {
548
- tweetUrl: string;
549
- }, {
550
- tweetUrl: string;
551
- }>;
552
- export type xScrapePostDataWithNitterParamsType = z.infer<typeof xScrapePostDataWithNitterParamsSchema>;
553
- export declare const xScrapePostDataWithNitterOutputSchema: z.ZodObject<{
554
- text: z.ZodString;
555
- }, "strip", z.ZodTypeAny, {
556
- text: string;
557
- }, {
558
- text: string;
559
- }>;
560
- export type xScrapePostDataWithNitterOutputType = z.infer<typeof xScrapePostDataWithNitterOutputSchema>;
561
- export type xScrapePostDataWithNitterFunction = ActionFunction<xScrapePostDataWithNitterParamsType, AuthParamsType, xScrapePostDataWithNitterOutputType>;
562
545
  export declare const mongoInsertMongoDocParamsSchema: z.ZodObject<{
563
546
  databaseName: z.ZodString;
564
547
  collectionName: z.ZodString;
@@ -733,6 +716,23 @@ export declare const firecrawlScrapeUrlOutputSchema: z.ZodObject<{
733
716
  }>;
734
717
  export type firecrawlScrapeUrlOutputType = z.infer<typeof firecrawlScrapeUrlOutputSchema>;
735
718
  export type firecrawlScrapeUrlFunction = ActionFunction<firecrawlScrapeUrlParamsType, AuthParamsType, firecrawlScrapeUrlOutputType>;
719
+ export declare const firecrawlScrapeTweetDataWithNitterParamsSchema: z.ZodObject<{
720
+ tweetUrl: z.ZodString;
721
+ }, "strip", z.ZodTypeAny, {
722
+ tweetUrl: string;
723
+ }, {
724
+ tweetUrl: string;
725
+ }>;
726
+ export type firecrawlScrapeTweetDataWithNitterParamsType = z.infer<typeof firecrawlScrapeTweetDataWithNitterParamsSchema>;
727
+ export declare const firecrawlScrapeTweetDataWithNitterOutputSchema: z.ZodObject<{
728
+ text: z.ZodString;
729
+ }, "strip", z.ZodTypeAny, {
730
+ text: string;
731
+ }, {
732
+ text: string;
733
+ }>;
734
+ export type firecrawlScrapeTweetDataWithNitterOutputType = z.infer<typeof firecrawlScrapeTweetDataWithNitterOutputSchema>;
735
+ export type firecrawlScrapeTweetDataWithNitterFunction = ActionFunction<firecrawlScrapeTweetDataWithNitterParamsType, AuthParamsType, firecrawlScrapeTweetDataWithNitterOutputType>;
736
736
  export declare const resendSendEmailParamsSchema: z.ZodObject<{
737
737
  to: z.ZodString;
738
738
  subject: z.ZodString;
@@ -782,3 +782,163 @@ export declare const googleOauthCreateNewGoogleDocOutputSchema: z.ZodObject<{
782
782
  }>;
783
783
  export type googleOauthCreateNewGoogleDocOutputType = z.infer<typeof googleOauthCreateNewGoogleDocOutputSchema>;
784
784
  export type googleOauthCreateNewGoogleDocFunction = ActionFunction<googleOauthCreateNewGoogleDocParamsType, AuthParamsType, googleOauthCreateNewGoogleDocOutputType>;
785
+ export declare const finnhubSymbolLookupParamsSchema: z.ZodObject<{
786
+ query: z.ZodString;
787
+ }, "strip", z.ZodTypeAny, {
788
+ query: string;
789
+ }, {
790
+ query: string;
791
+ }>;
792
+ export type finnhubSymbolLookupParamsType = z.infer<typeof finnhubSymbolLookupParamsSchema>;
793
+ export declare const finnhubSymbolLookupOutputSchema: z.ZodObject<{
794
+ result: z.ZodArray<z.ZodObject<{
795
+ symbol: z.ZodOptional<z.ZodString>;
796
+ description: z.ZodOptional<z.ZodString>;
797
+ }, "strip", z.ZodTypeAny, {
798
+ symbol?: string | undefined;
799
+ description?: string | undefined;
800
+ }, {
801
+ symbol?: string | undefined;
802
+ description?: string | undefined;
803
+ }>, "many">;
804
+ }, "strip", z.ZodTypeAny, {
805
+ result: {
806
+ symbol?: string | undefined;
807
+ description?: string | undefined;
808
+ }[];
809
+ }, {
810
+ result: {
811
+ symbol?: string | undefined;
812
+ description?: string | undefined;
813
+ }[];
814
+ }>;
815
+ export type finnhubSymbolLookupOutputType = z.infer<typeof finnhubSymbolLookupOutputSchema>;
816
+ export type finnhubSymbolLookupFunction = ActionFunction<finnhubSymbolLookupParamsType, AuthParamsType, finnhubSymbolLookupOutputType>;
817
+ export declare const finnhubGetBasicFinancialsParamsSchema: z.ZodObject<{
818
+ symbol: z.ZodString;
819
+ }, "strip", z.ZodTypeAny, {
820
+ symbol: string;
821
+ }, {
822
+ symbol: string;
823
+ }>;
824
+ export type finnhubGetBasicFinancialsParamsType = z.infer<typeof finnhubGetBasicFinancialsParamsSchema>;
825
+ export declare const finnhubGetBasicFinancialsOutputSchema: z.ZodObject<{
826
+ result: z.ZodObject<{
827
+ annual: z.ZodOptional<z.ZodArray<z.ZodObject<{
828
+ metric: z.ZodOptional<z.ZodString>;
829
+ series: z.ZodOptional<z.ZodArray<z.ZodObject<{
830
+ period: z.ZodOptional<z.ZodString>;
831
+ v: z.ZodOptional<z.ZodNumber>;
832
+ }, "strip", z.ZodTypeAny, {
833
+ period?: string | undefined;
834
+ v?: number | undefined;
835
+ }, {
836
+ period?: string | undefined;
837
+ v?: number | undefined;
838
+ }>, "many">>;
839
+ }, "strip", z.ZodTypeAny, {
840
+ metric?: string | undefined;
841
+ series?: {
842
+ period?: string | undefined;
843
+ v?: number | undefined;
844
+ }[] | undefined;
845
+ }, {
846
+ metric?: string | undefined;
847
+ series?: {
848
+ period?: string | undefined;
849
+ v?: number | undefined;
850
+ }[] | undefined;
851
+ }>, "many">>;
852
+ quarterly: z.ZodOptional<z.ZodArray<z.ZodObject<{
853
+ metric: z.ZodOptional<z.ZodString>;
854
+ series: z.ZodOptional<z.ZodArray<z.ZodObject<{
855
+ period: z.ZodOptional<z.ZodString>;
856
+ v: z.ZodOptional<z.ZodNumber>;
857
+ }, "strip", z.ZodTypeAny, {
858
+ period?: string | undefined;
859
+ v?: number | undefined;
860
+ }, {
861
+ period?: string | undefined;
862
+ v?: number | undefined;
863
+ }>, "many">>;
864
+ }, "strip", z.ZodTypeAny, {
865
+ metric?: string | undefined;
866
+ series?: {
867
+ period?: string | undefined;
868
+ v?: number | undefined;
869
+ }[] | undefined;
870
+ }, {
871
+ metric?: string | undefined;
872
+ series?: {
873
+ period?: string | undefined;
874
+ v?: number | undefined;
875
+ }[] | undefined;
876
+ }>, "many">>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ annual?: {
879
+ metric?: string | undefined;
880
+ series?: {
881
+ period?: string | undefined;
882
+ v?: number | undefined;
883
+ }[] | undefined;
884
+ }[] | undefined;
885
+ quarterly?: {
886
+ metric?: string | undefined;
887
+ series?: {
888
+ period?: string | undefined;
889
+ v?: number | undefined;
890
+ }[] | undefined;
891
+ }[] | undefined;
892
+ }, {
893
+ annual?: {
894
+ metric?: string | undefined;
895
+ series?: {
896
+ period?: string | undefined;
897
+ v?: number | undefined;
898
+ }[] | undefined;
899
+ }[] | undefined;
900
+ quarterly?: {
901
+ metric?: string | undefined;
902
+ series?: {
903
+ period?: string | undefined;
904
+ v?: number | undefined;
905
+ }[] | undefined;
906
+ }[] | undefined;
907
+ }>;
908
+ }, "strip", z.ZodTypeAny, {
909
+ result: {
910
+ annual?: {
911
+ metric?: string | undefined;
912
+ series?: {
913
+ period?: string | undefined;
914
+ v?: number | undefined;
915
+ }[] | undefined;
916
+ }[] | undefined;
917
+ quarterly?: {
918
+ metric?: string | undefined;
919
+ series?: {
920
+ period?: string | undefined;
921
+ v?: number | undefined;
922
+ }[] | undefined;
923
+ }[] | undefined;
924
+ };
925
+ }, {
926
+ result: {
927
+ annual?: {
928
+ metric?: string | undefined;
929
+ series?: {
930
+ period?: string | undefined;
931
+ v?: number | undefined;
932
+ }[] | undefined;
933
+ }[] | undefined;
934
+ quarterly?: {
935
+ metric?: string | undefined;
936
+ series?: {
937
+ period?: string | undefined;
938
+ v?: number | undefined;
939
+ }[] | undefined;
940
+ }[] | undefined;
941
+ };
942
+ }>;
943
+ export type finnhubGetBasicFinancialsOutputType = z.infer<typeof finnhubGetBasicFinancialsOutputSchema>;
944
+ export type finnhubGetBasicFinancialsFunction = ActionFunction<finnhubGetBasicFinancialsParamsType, AuthParamsType, finnhubGetBasicFinancialsOutputType>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = 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.xScrapePostDataWithNitterOutputSchema = exports.xScrapePostDataWithNitterParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = 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;
3
+ exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = 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(),
@@ -168,12 +168,6 @@ exports.xCreateShareXPostUrlParamsSchema = zod_1.z.object({
168
168
  exports.xCreateShareXPostUrlOutputSchema = zod_1.z.object({
169
169
  xUrl: zod_1.z.string().describe("The share post X(formerly twitter) URL"),
170
170
  });
171
- exports.xScrapePostDataWithNitterParamsSchema = zod_1.z.object({
172
- tweetUrl: zod_1.z.string().describe("The url for the X(formerly twitter) post"),
173
- });
174
- exports.xScrapePostDataWithNitterOutputSchema = zod_1.z.object({
175
- text: zod_1.z.string().describe("The text in the tweet URL"),
176
- });
177
171
  exports.mongoInsertMongoDocParamsSchema = zod_1.z.object({
178
172
  databaseName: zod_1.z.string().describe("Database to connect to"),
179
173
  collectionName: zod_1.z.string().describe("Collection to insert the document into"),
@@ -228,6 +222,12 @@ exports.nwsGetForecastForLocationOutputSchema = zod_1.z.object({
228
222
  });
229
223
  exports.firecrawlScrapeUrlParamsSchema = zod_1.z.object({ url: zod_1.z.string().describe("The URL to scrape") });
230
224
  exports.firecrawlScrapeUrlOutputSchema = zod_1.z.object({ content: zod_1.z.string().describe("The content of the URL") });
225
+ exports.firecrawlScrapeTweetDataWithNitterParamsSchema = zod_1.z.object({
226
+ tweetUrl: zod_1.z.string().describe("The url for the X(formerly twitter) post"),
227
+ });
228
+ exports.firecrawlScrapeTweetDataWithNitterOutputSchema = zod_1.z.object({
229
+ text: zod_1.z.string().describe("The text in the tweet URL"),
230
+ });
231
231
  exports.resendSendEmailParamsSchema = zod_1.z.object({
232
232
  to: zod_1.z.string().describe("The email address to send the email to"),
233
233
  subject: zod_1.z.string().describe("The subject of the email"),
@@ -245,3 +245,57 @@ exports.googleOauthCreateNewGoogleDocOutputSchema = zod_1.z.object({
245
245
  documentId: zod_1.z.string().describe("The ID of the created Google Doc"),
246
246
  documentUrl: zod_1.z.string().describe("The URL to access the created Google Doc").optional(),
247
247
  });
248
+ exports.finnhubSymbolLookupParamsSchema = zod_1.z.object({ query: zod_1.z.string().describe("The query to look up") });
249
+ exports.finnhubSymbolLookupOutputSchema = zod_1.z.object({
250
+ result: zod_1.z
251
+ .array(zod_1.z
252
+ .object({
253
+ symbol: zod_1.z.string().describe("The symbol of the stock").optional(),
254
+ description: zod_1.z.string().describe("The description of the stock").optional(),
255
+ })
256
+ .describe("The metadata of the stock"))
257
+ .describe("The results of the symbol lookup"),
258
+ });
259
+ exports.finnhubGetBasicFinancialsParamsSchema = zod_1.z.object({
260
+ symbol: zod_1.z.string().describe("The symbol/TICKER of the stock"),
261
+ });
262
+ exports.finnhubGetBasicFinancialsOutputSchema = zod_1.z.object({
263
+ result: zod_1.z
264
+ .object({
265
+ annual: zod_1.z
266
+ .array(zod_1.z
267
+ .object({
268
+ metric: zod_1.z.string().describe("The name of the financial metric").optional(),
269
+ series: zod_1.z
270
+ .array(zod_1.z
271
+ .object({
272
+ period: zod_1.z.string().describe("The period of the financial metric in YYYY-MM-DD format").optional(),
273
+ v: zod_1.z.number().describe("The value of the financial metric").optional(),
274
+ })
275
+ .describe("The value of the financial metric"))
276
+ .describe("The series of values for the financial metric")
277
+ .optional(),
278
+ })
279
+ .describe("The annual financials of the stock"))
280
+ .describe("The annual financials of the stock")
281
+ .optional(),
282
+ quarterly: zod_1.z
283
+ .array(zod_1.z
284
+ .object({
285
+ metric: zod_1.z.string().describe("The name of the financial metric").optional(),
286
+ series: zod_1.z
287
+ .array(zod_1.z
288
+ .object({
289
+ period: zod_1.z.string().describe("The period of the financial metric in YYYY-MM-DD format").optional(),
290
+ v: zod_1.z.number().describe("The value of the financial metric").optional(),
291
+ })
292
+ .describe("The value of the financial metric"))
293
+ .describe("The series of values for the financial metric")
294
+ .optional(),
295
+ })
296
+ .describe("The quarterly financials of the stock"))
297
+ .describe("The quarterly financials of the stock")
298
+ .optional(),
299
+ })
300
+ .describe("The basic financials of the stock"),
301
+ });
@@ -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
+ };
@@ -57,7 +57,7 @@ exports.ACTION_GROUPS = {
57
57
  },
58
58
  FIRECRAWL: {
59
59
  description: "Actions for interacting with Firecrawl",
60
- actions: [templates_1.firecrawlScrapeUrlDefinition],
60
+ actions: [templates_1.firecrawlScrapeUrlDefinition, templates_1.firecrawlScrapeTweetDataWithNitterDefinition],
61
61
  },
62
62
  RESEND: {
63
63
  description: "Action for sending an email",
@@ -65,6 +65,10 @@ exports.ACTION_GROUPS = {
65
65
  },
66
66
  X: {
67
67
  description: "Actions for interacting with X(formerly twitter)",
68
- actions: [templates_1.xCreateShareXPostUrlDefinition, templates_1.xScrapePostDataWithNitterDefinition],
68
+ actions: [templates_1.xCreateShareXPostUrlDefinition],
69
+ },
70
+ FINNHUB: {
71
+ description: "Action for interacting with Finnhub for stock market data",
72
+ actions: [templates_1.finnhubSymbolLookupDefinition, templates_1.finnhubGetBasicFinancialsDefinition],
69
73
  },
70
74
  };
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ import { finnhubGetBasicFinancialsFunction } from "../../autogen/types";
2
+ declare const getBasicFinancials: finnhubGetBasicFinancialsFunction;
3
+ export default getBasicFinancials;
@@ -0,0 +1,51 @@
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 types_1 = require("../../autogen/types");
16
+ const axios_1 = __importDefault(require("axios"));
17
+ function transformData(data) {
18
+ return Object.entries(data).map(([key, value]) => ({
19
+ metric: key,
20
+ series: value.map(item => {
21
+ var _a;
22
+ return ({
23
+ period: item.period,
24
+ v: (_a = item.v) !== null && _a !== void 0 ? _a : undefined,
25
+ });
26
+ }),
27
+ }));
28
+ }
29
+ const getBasicFinancials = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
30
+ try {
31
+ const apiKey = authParams.apiKey;
32
+ const result = yield axios_1.default.get(`https://finnhub.io/api/v1/stock/metric?symbol=${params.symbol}`, {
33
+ headers: {
34
+ "X-Finnhub-Token": apiKey,
35
+ },
36
+ });
37
+ return types_1.finnhubGetBasicFinancialsOutputSchema.parse({
38
+ result: {
39
+ annual: transformData(result.data.series.annual),
40
+ quarterly: transformData(result.data.series.quarterly),
41
+ },
42
+ });
43
+ }
44
+ catch (error) {
45
+ console.error(error);
46
+ return types_1.finnhubGetBasicFinancialsOutputSchema.parse({
47
+ result: {},
48
+ });
49
+ }
50
+ });
51
+ exports.default = getBasicFinancials;
@@ -0,0 +1,3 @@
1
+ import { finnhubSymbolLookupFunction } from "../../autogen/types";
2
+ declare const symbolLookup: finnhubSymbolLookupFunction;
3
+ export default symbolLookup;
@@ -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
+ 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 types_1 = require("../../autogen/types");
16
+ const axios_1 = __importDefault(require("axios"));
17
+ const symbolLookup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
18
+ try {
19
+ const apiKey = authParams.apiKey;
20
+ const result = yield axios_1.default.get(`https://finnhub.io/api/v1/search?q=${params.query}`, {
21
+ headers: {
22
+ "X-Finnhub-Token": apiKey,
23
+ },
24
+ });
25
+ return types_1.finnhubSymbolLookupOutputSchema.parse({
26
+ result: result.data.result,
27
+ });
28
+ }
29
+ catch (error) {
30
+ console.error(error);
31
+ return types_1.finnhubSymbolLookupOutputSchema.parse({
32
+ result: [],
33
+ });
34
+ }
35
+ });
36
+ exports.default = symbolLookup;
@@ -0,0 +1,3 @@
1
+ import { firecrawlScrapeTweetDataWithNitterFunction } from "../../autogen/types";
2
+ declare const scrapeTweetDataWithNitter: firecrawlScrapeTweetDataWithNitterFunction;
3
+ export default scrapeTweetDataWithNitter;
@@ -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 { jiraCreateTicketFunction } from "../../autogen/types";
2
+ declare const createTicket: jiraCreateTicketFunction;
3
+ export default createTicket;
@@ -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,3 @@
1
+ import { slackListConversationsFunction } from "../../../actions/autogen/types";
2
+ declare const slackListConversations: slackListConversationsFunction;
3
+ export default slackListConversations;
@@ -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;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createParametersObject = createParametersObject;
4
+ function createParametersObject(parameters) {
5
+ return Object.fromEntries(Object.entries(parameters).map(([key, param]) => [key, param.type]));
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/main.js ADDED
@@ -0,0 +1,11 @@
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
+ const list_conversations_1 = __importDefault(require("./actions/providers/slack/list_conversations"));
7
+ const result = (0, list_conversations_1.default)({
8
+ accessToken: "xoxp-4172665288294-8092684180551-8154529379075-89f1f70cc06e5648e8f912ba96f56626"
9
+ }).then((result) => {
10
+ console.log(result);
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,3 +0,0 @@
1
- import { xScrapePostDataWithNitterFunction } from "../../autogen/types";
2
- declare const scrapeTweetDataWithNitter: xScrapePostDataWithNitterFunction;
3
- export default scrapeTweetDataWithNitter;