@credal/actions 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/actions/actionMapper.d.ts +9 -0
- package/dist/actions/actionMapper.js +79 -0
- package/dist/actions/autogen/definitions.d.ts +5 -0
- package/dist/actions/autogen/definitions.js +132 -0
- package/dist/actions/autogen/templates.d.ts +11 -0
- package/dist/actions/autogen/templates.js +493 -0
- package/dist/actions/autogen/types.d.ts +482 -0
- package/dist/actions/autogen/types.js +153 -0
- package/dist/actions/definitions.js +35 -0
- package/dist/actions/groups.d.ts +6 -0
- package/dist/actions/groups.js +38 -0
- package/dist/actions/invoke.d.ts +8 -0
- package/dist/actions/invoke.js +20 -0
- package/dist/actions/invokeMapper.d.ts +9 -0
- package/dist/actions/invokeMapper.js +33 -0
- package/dist/actions/parse.d.ts +66 -0
- package/dist/actions/parse.js +201 -0
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +47 -0
- package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
- package/dist/actions/providers/credal/callCopilot.js +31 -0
- package/dist/actions/providers/googlemaps/validateAddress.d.ts +3 -0
- package/dist/actions/providers/googlemaps/validateAddress.js +30 -0
- package/dist/actions/providers/jira/createJiraTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createJiraTicket.js +34 -0
- package/dist/actions/providers/jira/createTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createTicket.js +34 -0
- package/dist/actions/providers/math/add.d.ts +3 -0
- package/dist/actions/providers/math/add.js +17 -0
- package/dist/actions/providers/math/index.d.ts +1 -0
- package/dist/actions/providers/math/index.js +37 -0
- package/dist/actions/providers/mongodb/insertMongoDoc.d.ts +3 -0
- package/dist/actions/providers/mongodb/insertMongoDoc.js +36 -0
- package/dist/actions/providers/slack/helpers.d.ts +6 -0
- package/dist/actions/providers/slack/helpers.js +53 -0
- package/dist/actions/providers/slack/index.d.ts +1 -0
- package/dist/actions/providers/slack/index.js +37 -0
- package/dist/actions/providers/slack/listConversations.d.ts +3 -0
- package/dist/actions/providers/slack/listConversations.js +41 -0
- package/dist/actions/providers/slack/list_conversations.d.ts +3 -0
- package/dist/actions/providers/slack/list_conversations.js +60 -0
- package/dist/actions/providers/slack/sendMessage.d.ts +3 -0
- package/dist/actions/providers/slack/sendMessage.js +36 -0
- package/dist/actions/providers/snowflake/getRowByFieldValue.d.ts +3 -0
- package/dist/actions/providers/snowflake/getRowByFieldValue.js +100 -0
- package/dist/actions/providers/zendesk/createZendeskTicket.d.ts +3 -0
- package/dist/actions/providers/zendesk/createZendeskTicket.js +48 -0
- package/dist/actions/schema.js +6 -0
- package/dist/actions/types.js +2 -0
- package/dist/app.d.ts +9 -0
- package/dist/app.js +97 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +27 -0
- package/dist/main.js +11 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +10 -0
- package/package.json +51 -0
@@ -0,0 +1,493 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraCreateJiraTicketDefinition = exports.confluenceUpdatePageDefinition = exports.mathAddDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = void 0;
|
4
|
+
exports.slackSendMessageDefinition = {
|
5
|
+
description: "Sends a message to a Slack channel",
|
6
|
+
scopes: ["chat:write"],
|
7
|
+
parameters: {
|
8
|
+
type: "object",
|
9
|
+
required: ["channelName", "message"],
|
10
|
+
properties: {
|
11
|
+
channelName: {
|
12
|
+
type: "string",
|
13
|
+
description: "The name of the Slack channel to send the message to (e.g. general, alerts)",
|
14
|
+
},
|
15
|
+
message: {
|
16
|
+
type: "string",
|
17
|
+
description: "The message content to send to Slack. Can include markdown formatting.",
|
18
|
+
},
|
19
|
+
},
|
20
|
+
},
|
21
|
+
name: "sendMessage",
|
22
|
+
provider: "slack",
|
23
|
+
};
|
24
|
+
exports.slackListConversationsDefinition = {
|
25
|
+
description: "Lists all conversations in a Slack workspace",
|
26
|
+
scopes: ["channels:read", "groups:read", "im:read", "mpim:read"],
|
27
|
+
output: {
|
28
|
+
type: "object",
|
29
|
+
required: ["channels"],
|
30
|
+
properties: {
|
31
|
+
channels: {
|
32
|
+
type: "array",
|
33
|
+
description: "A list of channels in Slack",
|
34
|
+
items: {
|
35
|
+
type: "object",
|
36
|
+
description: "A channel in Slack",
|
37
|
+
required: ["id", "name", "topic", "purpose"],
|
38
|
+
properties: {
|
39
|
+
id: {
|
40
|
+
type: "string",
|
41
|
+
description: "The ID of the channel",
|
42
|
+
},
|
43
|
+
name: {
|
44
|
+
type: "string",
|
45
|
+
description: "The name of the channel",
|
46
|
+
},
|
47
|
+
topic: {
|
48
|
+
type: "string",
|
49
|
+
description: "The topic of the channel",
|
50
|
+
},
|
51
|
+
purpose: {
|
52
|
+
type: "string",
|
53
|
+
description: "The purpose of the channel",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
},
|
57
|
+
},
|
58
|
+
},
|
59
|
+
},
|
60
|
+
name: "listConversations",
|
61
|
+
provider: "slack",
|
62
|
+
};
|
63
|
+
exports.mathAddDefinition = {
|
64
|
+
description: "Adds two numbers together",
|
65
|
+
scopes: [],
|
66
|
+
parameters: {
|
67
|
+
type: "object",
|
68
|
+
required: ["a", "b"],
|
69
|
+
properties: {
|
70
|
+
a: {
|
71
|
+
type: "number",
|
72
|
+
description: "The first number to add",
|
73
|
+
},
|
74
|
+
b: {
|
75
|
+
type: "number",
|
76
|
+
description: "The second number to add",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
},
|
80
|
+
output: {
|
81
|
+
type: "object",
|
82
|
+
required: ["result"],
|
83
|
+
properties: {
|
84
|
+
result: {
|
85
|
+
type: "number",
|
86
|
+
description: "The sum of the two numbers",
|
87
|
+
},
|
88
|
+
},
|
89
|
+
},
|
90
|
+
name: "add",
|
91
|
+
provider: "math",
|
92
|
+
};
|
93
|
+
exports.confluenceUpdatePageDefinition = {
|
94
|
+
description: "Updates a Confluence page with the new content specified",
|
95
|
+
scopes: [],
|
96
|
+
parameters: {
|
97
|
+
type: "object",
|
98
|
+
required: ["pageId", "title", "username", "content"],
|
99
|
+
properties: {
|
100
|
+
pageId: {
|
101
|
+
type: "string",
|
102
|
+
description: "The page id that should be updated",
|
103
|
+
},
|
104
|
+
title: {
|
105
|
+
type: "string",
|
106
|
+
description: "The title of the page that should be updated",
|
107
|
+
},
|
108
|
+
username: {
|
109
|
+
type: "string",
|
110
|
+
description: "The username of the person updating the page",
|
111
|
+
},
|
112
|
+
content: {
|
113
|
+
type: "string",
|
114
|
+
description: "The new content for the page",
|
115
|
+
},
|
116
|
+
},
|
117
|
+
},
|
118
|
+
name: "updatePage",
|
119
|
+
provider: "confluence",
|
120
|
+
};
|
121
|
+
exports.jiraCreateJiraTicketDefinition = {
|
122
|
+
description: "Create a jira ticket with new content specified",
|
123
|
+
scopes: [],
|
124
|
+
parameters: {
|
125
|
+
type: "object",
|
126
|
+
required: ["projectKey", "summary", "description", "issueType", "username"],
|
127
|
+
properties: {
|
128
|
+
projectKey: {
|
129
|
+
type: "string",
|
130
|
+
description: "The key for the project you want to add it to",
|
131
|
+
},
|
132
|
+
summary: {
|
133
|
+
type: "string",
|
134
|
+
description: "The summary of the new ticket",
|
135
|
+
},
|
136
|
+
description: {
|
137
|
+
type: "string",
|
138
|
+
description: "The description for the new ticket",
|
139
|
+
},
|
140
|
+
issueType: {
|
141
|
+
type: "string",
|
142
|
+
description: "The issue type of the new ticket",
|
143
|
+
},
|
144
|
+
reporter: {
|
145
|
+
type: "string",
|
146
|
+
description: "The reporter for the new ticket creation",
|
147
|
+
},
|
148
|
+
username: {
|
149
|
+
type: "string",
|
150
|
+
description: "The username of the person creating the ticket",
|
151
|
+
},
|
152
|
+
},
|
153
|
+
},
|
154
|
+
name: "createJiraTicket",
|
155
|
+
provider: "jira",
|
156
|
+
};
|
157
|
+
exports.googlemapsValidateAddressDefinition = {
|
158
|
+
description: "Validate a Google Maps address",
|
159
|
+
scopes: [],
|
160
|
+
parameters: {
|
161
|
+
type: "object",
|
162
|
+
required: ["regionCode", "locality", "addressLines", "postalCode"],
|
163
|
+
properties: {
|
164
|
+
regionCode: {
|
165
|
+
type: "string",
|
166
|
+
description: "The country of the address being verified.",
|
167
|
+
},
|
168
|
+
locality: {
|
169
|
+
type: "string",
|
170
|
+
description: "The locality of the address being verified. This is likely a city.",
|
171
|
+
},
|
172
|
+
postalCode: {
|
173
|
+
type: "string",
|
174
|
+
description: "The postal code of the address being verified.",
|
175
|
+
},
|
176
|
+
addressLines: {
|
177
|
+
type: "array",
|
178
|
+
description: "A list of lines of the address. These should be in order as they would appear on an envelope.",
|
179
|
+
items: {
|
180
|
+
type: "string",
|
181
|
+
},
|
182
|
+
},
|
183
|
+
addressType: {
|
184
|
+
type: "string",
|
185
|
+
description: "The type of address being validated.",
|
186
|
+
enum: ["residential", "business", "poBox"],
|
187
|
+
},
|
188
|
+
allowFuzzyMatches: {
|
189
|
+
type: "boolean",
|
190
|
+
description: "Whether to allow fuzzy matches in the address validation by inferring components.",
|
191
|
+
},
|
192
|
+
},
|
193
|
+
},
|
194
|
+
output: {
|
195
|
+
type: "object",
|
196
|
+
required: ["valid"],
|
197
|
+
properties: {
|
198
|
+
valid: {
|
199
|
+
type: "boolean",
|
200
|
+
description: "Whether the address is valid.",
|
201
|
+
},
|
202
|
+
formattedAddress: {
|
203
|
+
type: "string",
|
204
|
+
description: "The standardized formatted address.",
|
205
|
+
},
|
206
|
+
addressComponents: {
|
207
|
+
type: "array",
|
208
|
+
description: "Components of the address, such as street number and route.",
|
209
|
+
items: {
|
210
|
+
type: "object",
|
211
|
+
properties: {
|
212
|
+
componentName: {
|
213
|
+
type: "string",
|
214
|
+
description: "The name of the address component.",
|
215
|
+
},
|
216
|
+
componentType: {
|
217
|
+
type: "array",
|
218
|
+
description: "The types associated with this component (e.g., street_number, route).",
|
219
|
+
items: {
|
220
|
+
type: "string",
|
221
|
+
},
|
222
|
+
},
|
223
|
+
},
|
224
|
+
},
|
225
|
+
},
|
226
|
+
missingComponentTypes: {
|
227
|
+
type: "array",
|
228
|
+
description: "List of components missing in the input address.",
|
229
|
+
items: {
|
230
|
+
type: "string",
|
231
|
+
},
|
232
|
+
},
|
233
|
+
unresolvedTokens: {
|
234
|
+
type: "array",
|
235
|
+
description: "Unrecognized parts of the address.",
|
236
|
+
items: {
|
237
|
+
type: "string",
|
238
|
+
},
|
239
|
+
},
|
240
|
+
geocode: {
|
241
|
+
type: "object",
|
242
|
+
description: "Geocode data for the address.",
|
243
|
+
properties: {
|
244
|
+
location: {
|
245
|
+
type: "object",
|
246
|
+
properties: {
|
247
|
+
latitude: {
|
248
|
+
type: "number",
|
249
|
+
description: "The latitude of the address.",
|
250
|
+
},
|
251
|
+
longitude: {
|
252
|
+
type: "number",
|
253
|
+
description: "The longitude of the address.",
|
254
|
+
},
|
255
|
+
},
|
256
|
+
},
|
257
|
+
plusCode: {
|
258
|
+
type: "object",
|
259
|
+
description: "The Plus Code for the address.",
|
260
|
+
properties: {
|
261
|
+
globalCode: {
|
262
|
+
type: "string",
|
263
|
+
description: "The global Plus Code.",
|
264
|
+
},
|
265
|
+
compoundCode: {
|
266
|
+
type: "string",
|
267
|
+
description: "The compound Plus Code.",
|
268
|
+
},
|
269
|
+
},
|
270
|
+
},
|
271
|
+
bounds: {
|
272
|
+
type: "object",
|
273
|
+
description: "The viewport bounds for the address.",
|
274
|
+
properties: {
|
275
|
+
northeast: {
|
276
|
+
type: "object",
|
277
|
+
properties: {
|
278
|
+
latitude: {
|
279
|
+
type: "number",
|
280
|
+
},
|
281
|
+
longitude: {
|
282
|
+
type: "number",
|
283
|
+
},
|
284
|
+
},
|
285
|
+
},
|
286
|
+
southwest: {
|
287
|
+
type: "object",
|
288
|
+
properties: {
|
289
|
+
latitude: {
|
290
|
+
type: "number",
|
291
|
+
},
|
292
|
+
longitude: {
|
293
|
+
type: "number",
|
294
|
+
},
|
295
|
+
},
|
296
|
+
},
|
297
|
+
},
|
298
|
+
},
|
299
|
+
},
|
300
|
+
},
|
301
|
+
uspsData: {
|
302
|
+
type: "object",
|
303
|
+
description: "USPS-specific validation details.",
|
304
|
+
properties: {
|
305
|
+
standardizedAddress: {
|
306
|
+
type: "object",
|
307
|
+
description: "The standardized USPS address.",
|
308
|
+
},
|
309
|
+
deliveryPointValidation: {
|
310
|
+
type: "string",
|
311
|
+
description: "The USPS delivery point validation status.",
|
312
|
+
},
|
313
|
+
uspsAddressPrecision: {
|
314
|
+
type: "string",
|
315
|
+
description: "The level of precision for the USPS address.",
|
316
|
+
},
|
317
|
+
},
|
318
|
+
},
|
319
|
+
},
|
320
|
+
},
|
321
|
+
name: "validateAddress",
|
322
|
+
provider: "googlemaps",
|
323
|
+
};
|
324
|
+
exports.credalCallCopilotDefinition = {
|
325
|
+
description: "Call Credal Copilot for response on a given query",
|
326
|
+
scopes: [],
|
327
|
+
parameters: {
|
328
|
+
type: "object",
|
329
|
+
required: ["agentId", "query", "userEmail"],
|
330
|
+
properties: {
|
331
|
+
agentId: {
|
332
|
+
type: "string",
|
333
|
+
description: "The ID of the copilot to call",
|
334
|
+
},
|
335
|
+
query: {
|
336
|
+
type: "string",
|
337
|
+
description: "The query to ask Credal Copilot",
|
338
|
+
},
|
339
|
+
userEmail: {
|
340
|
+
type: "string",
|
341
|
+
description: "The email of the user sending or authorizing the query",
|
342
|
+
},
|
343
|
+
},
|
344
|
+
},
|
345
|
+
output: {
|
346
|
+
type: "object",
|
347
|
+
required: ["response"],
|
348
|
+
properties: {
|
349
|
+
response: {
|
350
|
+
type: "string",
|
351
|
+
description: "The response from the Credal Copilot",
|
352
|
+
},
|
353
|
+
},
|
354
|
+
},
|
355
|
+
name: "callCopilot",
|
356
|
+
provider: "credal",
|
357
|
+
};
|
358
|
+
exports.zendeskCreateZendeskTicketDefinition = {
|
359
|
+
description: "Create a ticket in Zendesk",
|
360
|
+
scopes: [],
|
361
|
+
parameters: {
|
362
|
+
type: "object",
|
363
|
+
required: ["subject", "requesterEmail", "subdomain"],
|
364
|
+
properties: {
|
365
|
+
subject: {
|
366
|
+
type: "string",
|
367
|
+
description: "The subject of the ticket",
|
368
|
+
},
|
369
|
+
body: {
|
370
|
+
type: "string",
|
371
|
+
description: "The body of the ticket",
|
372
|
+
},
|
373
|
+
requesterEmail: {
|
374
|
+
type: "string",
|
375
|
+
description: "The email of the requester",
|
376
|
+
},
|
377
|
+
subdomain: {
|
378
|
+
type: "string",
|
379
|
+
description: "The subdomain of the Zendesk account",
|
380
|
+
},
|
381
|
+
},
|
382
|
+
},
|
383
|
+
output: {
|
384
|
+
type: "object",
|
385
|
+
required: ["ticketId"],
|
386
|
+
properties: {
|
387
|
+
ticketId: {
|
388
|
+
type: "string",
|
389
|
+
description: "The ID of the ticket created",
|
390
|
+
},
|
391
|
+
ticketUrl: {
|
392
|
+
type: "string",
|
393
|
+
description: "The URL of the ticket created",
|
394
|
+
},
|
395
|
+
},
|
396
|
+
},
|
397
|
+
name: "createZendeskTicket",
|
398
|
+
provider: "zendesk",
|
399
|
+
};
|
400
|
+
exports.mongoInsertMongoDocDefinition = {
|
401
|
+
description: "Insert a document into a MongoDB collection",
|
402
|
+
scopes: [],
|
403
|
+
parameters: {
|
404
|
+
type: "object",
|
405
|
+
required: ["databaseName", "collectionName", "document"],
|
406
|
+
properties: {
|
407
|
+
databaseName: {
|
408
|
+
type: "string",
|
409
|
+
description: "Database to connect to",
|
410
|
+
},
|
411
|
+
collectionName: {
|
412
|
+
type: "string",
|
413
|
+
description: "Collection to insert the document into",
|
414
|
+
},
|
415
|
+
document: {
|
416
|
+
type: "object",
|
417
|
+
description: "The document to insert",
|
418
|
+
},
|
419
|
+
},
|
420
|
+
},
|
421
|
+
output: {
|
422
|
+
type: "object",
|
423
|
+
required: ["objectId"],
|
424
|
+
properties: {
|
425
|
+
objectId: {
|
426
|
+
type: "string",
|
427
|
+
description: "The new ID of the document inserted",
|
428
|
+
},
|
429
|
+
},
|
430
|
+
},
|
431
|
+
name: "insertMongoDoc",
|
432
|
+
provider: "mongo",
|
433
|
+
};
|
434
|
+
exports.snowflakeGetRowByFieldValueDefinition = {
|
435
|
+
description: "Get a row from a Snowflake table by a field value",
|
436
|
+
scopes: [],
|
437
|
+
parameters: {
|
438
|
+
type: "object",
|
439
|
+
required: ["tableName", "fieldName", "fieldValue"],
|
440
|
+
properties: {
|
441
|
+
databaseName: {
|
442
|
+
type: "string",
|
443
|
+
description: "The name of the database to query",
|
444
|
+
},
|
445
|
+
tableName: {
|
446
|
+
type: "string",
|
447
|
+
description: "The name of the table to query",
|
448
|
+
},
|
449
|
+
fieldName: {
|
450
|
+
type: "string",
|
451
|
+
description: "The name of the field to query",
|
452
|
+
},
|
453
|
+
fieldValue: {
|
454
|
+
type: "string",
|
455
|
+
description: "The value of the field to query",
|
456
|
+
},
|
457
|
+
accountName: {
|
458
|
+
type: "string",
|
459
|
+
description: "The name of the Snowflake account",
|
460
|
+
},
|
461
|
+
user: {
|
462
|
+
type: "string",
|
463
|
+
description: "The user to authenticate with",
|
464
|
+
},
|
465
|
+
warehouse: {
|
466
|
+
type: "string",
|
467
|
+
description: "The warehouse to use",
|
468
|
+
},
|
469
|
+
},
|
470
|
+
},
|
471
|
+
output: {
|
472
|
+
type: "object",
|
473
|
+
required: ["row"],
|
474
|
+
properties: {
|
475
|
+
row: {
|
476
|
+
type: "object",
|
477
|
+
description: "The row from the Snowflake table",
|
478
|
+
properties: {
|
479
|
+
id: {
|
480
|
+
type: "string",
|
481
|
+
description: "The ID of the row",
|
482
|
+
},
|
483
|
+
rowContents: {
|
484
|
+
type: "object",
|
485
|
+
description: "The contents of the row",
|
486
|
+
},
|
487
|
+
},
|
488
|
+
},
|
489
|
+
},
|
490
|
+
},
|
491
|
+
name: "getRowByFieldValue",
|
492
|
+
provider: "snowflake",
|
493
|
+
};
|