@credal/actions 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actionMapper.js +69 -1
- 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 +888 -0
- package/dist/actions/autogen/types.d.ts +997 -0
- package/dist/actions/autogen/types.js +290 -0
- package/dist/actions/definitions.js +35 -0
- package/dist/actions/groups.js +17 -1
- package/dist/actions/invokeMapper.d.ts +9 -0
- package/dist/actions/invokeMapper.js +33 -0
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +43 -0
- package/dist/actions/providers/credal/callCopilot.d.ts +3 -0
- package/dist/actions/providers/credal/callCopilot.js +36 -0
- package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listGmailThreads.js +98 -0
- package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchGmailMessages.js +91 -0
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/jira/createTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createTicket.js +34 -0
- package/dist/actions/providers/math/index.d.ts +1 -0
- package/dist/actions/providers/math/index.js +37 -0
- package/dist/actions/providers/okta/addUserToGroup.d.ts +3 -0
- package/dist/actions/providers/okta/addUserToGroup.js +56 -0
- package/dist/actions/providers/okta/getOktaGroup.d.ts +3 -0
- package/dist/actions/providers/okta/getOktaGroup.js +73 -0
- package/dist/actions/providers/okta/getOktaUser.d.ts +3 -0
- package/dist/actions/providers/okta/getOktaUser.js +40 -0
- package/dist/actions/providers/okta/listMFA.d.ts +3 -0
- package/dist/actions/providers/okta/listMFA.js +52 -0
- package/dist/actions/providers/okta/listOktaGroupMembers.d.ts +3 -0
- package/dist/actions/providers/okta/listOktaGroupMembers.js +99 -0
- package/dist/actions/providers/okta/listOktaGroups.d.ts +3 -0
- package/dist/actions/providers/okta/listOktaGroups.js +92 -0
- package/dist/actions/providers/okta/listOktaUserGroups.d.ts +3 -0
- package/dist/actions/providers/okta/listOktaUserGroups.js +83 -0
- package/dist/actions/providers/okta/listOktaUsers.d.ts +3 -0
- package/dist/actions/providers/okta/listOktaUsers.js +100 -0
- package/dist/actions/providers/okta/removeUserFromGroup.d.ts +3 -0
- package/dist/actions/providers/okta/removeUserFromGroup.js +56 -0
- package/dist/actions/providers/okta/resetMFA.d.ts +3 -0
- package/dist/actions/providers/okta/resetMFA.js +62 -0
- package/dist/actions/providers/okta/resetPassword.d.ts +3 -0
- package/dist/actions/providers/okta/resetPassword.js +57 -0
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +3 -0
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.js +43 -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/summarizeChannel.d.ts +3 -0
- package/dist/actions/providers/slack/summarizeChannel.js +51 -0
- package/dist/actions/schema.js +6 -0
- package/dist/actions/types.js +2 -0
- package/dist/main.js +11 -0
- package/package.json +1 -1
- package/dist/server.d.ts +0 -2
- package/dist/server.js +0 -8
@@ -2268,6 +2268,296 @@ export const googlemailListGmailThreadsOutputSchema = z.object({
|
|
2268
2268
|
.describe("List of matching Gmail threads"),
|
2269
2269
|
error: z.string().describe("Error message if search failed").optional(),
|
2270
2270
|
});
|
2271
|
+
export const oktaGetOktaUserParamsSchema = z.object({ userId: z.string().describe("The ID of the user to retrieve.") });
|
2272
|
+
export const oktaGetOktaUserOutputSchema = z.object({
|
2273
|
+
success: z.boolean().describe("Whether the user details were successfully retrieved."),
|
2274
|
+
user: z
|
2275
|
+
.object({
|
2276
|
+
id: z.string().describe("The user's Okta ID"),
|
2277
|
+
status: z.string().describe("The user's status").optional(),
|
2278
|
+
created: z.string().describe("The timestamp when the user was created").optional(),
|
2279
|
+
activated: z.string().describe("The timestamp when the user was activated").optional(),
|
2280
|
+
statusChanged: z.string().describe("The timestamp when the user's status changed").optional(),
|
2281
|
+
lastLogin: z.string().describe("The timestamp of the user's last login").optional(),
|
2282
|
+
lastUpdated: z.string().describe("The timestamp of the user's last update").optional(),
|
2283
|
+
passwordChanged: z.string().describe("The timestamp when the user's password was last changed").optional(),
|
2284
|
+
profile: z
|
2285
|
+
.object({
|
2286
|
+
login: z.string().describe("The user's login").optional(),
|
2287
|
+
firstName: z.string().describe("The user's first name").optional(),
|
2288
|
+
lastName: z.string().describe("The user's last name").optional(),
|
2289
|
+
nickName: z.string().describe("The user's nickname").optional(),
|
2290
|
+
displayName: z.string().describe("The user's display name").optional(),
|
2291
|
+
email: z.string().describe("The user's email address").optional(),
|
2292
|
+
secondEmail: z.string().describe("The user's secondary email address").optional(),
|
2293
|
+
profileUrl: z.string().describe("The URL to the user's profile").optional(),
|
2294
|
+
preferredLanguage: z.string().describe("The user's preferred language").optional(),
|
2295
|
+
userType: z.string().describe("The user's type").optional(),
|
2296
|
+
organization: z.string().describe("The user's organization").optional(),
|
2297
|
+
title: z.string().describe("The user's title").optional(),
|
2298
|
+
division: z.string().describe("The user's division").optional(),
|
2299
|
+
department: z.string().describe("The user's department").optional(),
|
2300
|
+
costCenter: z.string().describe("The user's cost center").optional(),
|
2301
|
+
employeeNumber: z.string().describe("The user's employee number").optional(),
|
2302
|
+
mobilePhone: z.string().describe("The user's mobile phone number").optional(),
|
2303
|
+
primaryPhone: z.string().describe("The user's primary phone number").optional(),
|
2304
|
+
streetAddress: z.string().describe("The user's street address").optional(),
|
2305
|
+
city: z.string().describe("The user's city").optional(),
|
2306
|
+
state: z.string().describe("The user's state").optional(),
|
2307
|
+
zipCode: z.string().describe("The user's zip code").optional(),
|
2308
|
+
countryCode: z.string().describe("The user's country code").optional(),
|
2309
|
+
})
|
2310
|
+
.describe("The user's profile information")
|
2311
|
+
.optional(),
|
2312
|
+
credentials: z.object({}).catchall(z.any()).describe("The user's credentials").optional(),
|
2313
|
+
_links: z.object({}).catchall(z.any()).describe("Links related to the user").optional(),
|
2314
|
+
})
|
2315
|
+
.optional(),
|
2316
|
+
error: z.string().describe("Error message if retrieval failed.").optional(),
|
2317
|
+
});
|
2318
|
+
export const oktaListOktaUserGroupsParamsSchema = z.object({
|
2319
|
+
userId: z.string().describe("The ID of the user whose groups are to be listed."),
|
2320
|
+
maxResults: z.number().int().gte(1).describe("The maximum number of results to return.").optional(),
|
2321
|
+
});
|
2322
|
+
export const oktaListOktaUserGroupsOutputSchema = z.object({
|
2323
|
+
success: z.boolean().describe("Whether the groups were successfully retrieved."),
|
2324
|
+
groups: z
|
2325
|
+
.array(z.object({
|
2326
|
+
id: z.string().describe("The group's ID."),
|
2327
|
+
profile: z.object({
|
2328
|
+
name: z.string().describe("The group's name."),
|
2329
|
+
description: z.string().describe("The group's description."),
|
2330
|
+
}),
|
2331
|
+
}))
|
2332
|
+
.describe("List of groups the user belongs to.")
|
2333
|
+
.optional(),
|
2334
|
+
error: z.string().describe("Error message if retrieval failed.").optional(),
|
2335
|
+
});
|
2336
|
+
export const oktaListOktaGroupsParamsSchema = z.object({
|
2337
|
+
searchQuery: z
|
2338
|
+
.string()
|
2339
|
+
.describe("Optional search query to filter groups.\nThis field corresponds to the `search` query parameter in the Okta API's List Groups operation.\nFor detailed information on constructing search queries and available filter expressions, refer to the Okta API documentation:\nhttps://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=search&t=request\nExample: 'profile.name eq \"My Group\"'\n")
|
2340
|
+
.optional(),
|
2341
|
+
maxResults: z.number().int().gte(1).describe("The maximum number of results to return.").optional(),
|
2342
|
+
});
|
2343
|
+
export const oktaListOktaGroupsOutputSchema = z.object({
|
2344
|
+
success: z.boolean().describe("Whether the groups were successfully retrieved."),
|
2345
|
+
groups: z
|
2346
|
+
.array(z.object({
|
2347
|
+
id: z.string().describe("The group's ID."),
|
2348
|
+
profile: z.object({
|
2349
|
+
name: z.string().describe("The group's name."),
|
2350
|
+
description: z.string().describe("The group's description."),
|
2351
|
+
}),
|
2352
|
+
}))
|
2353
|
+
.describe("List of Okta groups.")
|
2354
|
+
.optional(),
|
2355
|
+
error: z.string().describe("Error message if retrieval failed.").optional(),
|
2356
|
+
});
|
2357
|
+
export const oktaGetOktaGroupParamsSchema = z.object({
|
2358
|
+
groupId: z.string().describe("The ID of the group to retrieve."),
|
2359
|
+
});
|
2360
|
+
export const oktaGetOktaGroupOutputSchema = z.object({
|
2361
|
+
success: z.boolean().describe("Whether the group details were successfully retrieved."),
|
2362
|
+
group: z
|
2363
|
+
.object({
|
2364
|
+
id: z.string().describe("The unique identifier for the Okta group"),
|
2365
|
+
created: z.string().datetime({ offset: true }).describe("The timestamp when the group was created").optional(),
|
2366
|
+
lastUpdated: z
|
2367
|
+
.string()
|
2368
|
+
.datetime({ offset: true })
|
2369
|
+
.describe("The timestamp when the group was last updated")
|
2370
|
+
.optional(),
|
2371
|
+
lastMembershipUpdated: z
|
2372
|
+
.string()
|
2373
|
+
.datetime({ offset: true })
|
2374
|
+
.describe("The timestamp when the group's membership was last updated")
|
2375
|
+
.optional(),
|
2376
|
+
objectClass: z.array(z.string()).describe("The object class of the group").optional(),
|
2377
|
+
type: z.string().describe("The type of the group (e.g., OKTA_GROUP)").optional(),
|
2378
|
+
profile: z.object({
|
2379
|
+
name: z.string().describe("The name of the group"),
|
2380
|
+
description: z.string().describe("The description of the group"),
|
2381
|
+
}),
|
2382
|
+
_links: z
|
2383
|
+
.object({
|
2384
|
+
logo: z.array(z.object({}).catchall(z.any())).describe("Links to the group's logo").optional(),
|
2385
|
+
users: z
|
2386
|
+
.object({ href: z.string().describe("The URL to retrieve users in the group").optional() })
|
2387
|
+
.optional(),
|
2388
|
+
apps: z
|
2389
|
+
.object({ href: z.string().describe("The URL to retrieve apps associated with the group").optional() })
|
2390
|
+
.optional(),
|
2391
|
+
})
|
2392
|
+
.optional(),
|
2393
|
+
})
|
2394
|
+
.describe("Schema for an Okta group object")
|
2395
|
+
.optional(),
|
2396
|
+
error: z.string().describe("Error message if retrieval failed.").optional(),
|
2397
|
+
});
|
2398
|
+
export const oktaListOktaGroupMembersParamsSchema = z.object({
|
2399
|
+
groupId: z.string().describe("The ID of the group whose members are to be listed."),
|
2400
|
+
maxResults: z.number().int().gte(1).describe("The maximum number of results to return.").optional(),
|
2401
|
+
});
|
2402
|
+
export const oktaListOktaGroupMembersOutputSchema = z.object({
|
2403
|
+
success: z.boolean().describe("Whether the members were successfully retrieved."),
|
2404
|
+
members: z
|
2405
|
+
.array(z.object({
|
2406
|
+
id: z.string().describe("The user's ID.").optional(),
|
2407
|
+
status: z.string().describe("The user's status.").optional(),
|
2408
|
+
created: z.string().datetime({ offset: true }).describe("The timestamp when the user was created.").optional(),
|
2409
|
+
activated: z
|
2410
|
+
.string()
|
2411
|
+
.datetime({ offset: true })
|
2412
|
+
.nullable()
|
2413
|
+
.describe("The timestamp when the user was activated.")
|
2414
|
+
.optional(),
|
2415
|
+
statusChanged: z
|
2416
|
+
.string()
|
2417
|
+
.datetime({ offset: true })
|
2418
|
+
.nullable()
|
2419
|
+
.describe("The timestamp when the user's status changed.")
|
2420
|
+
.optional(),
|
2421
|
+
lastLogin: z
|
2422
|
+
.string()
|
2423
|
+
.datetime({ offset: true })
|
2424
|
+
.nullable()
|
2425
|
+
.describe("The timestamp of the user's last login.")
|
2426
|
+
.optional(),
|
2427
|
+
lastUpdated: z
|
2428
|
+
.string()
|
2429
|
+
.datetime({ offset: true })
|
2430
|
+
.describe("The timestamp of the user's last update.")
|
2431
|
+
.optional(),
|
2432
|
+
passwordChanged: z
|
2433
|
+
.string()
|
2434
|
+
.datetime({ offset: true })
|
2435
|
+
.describe("The timestamp when the user's password was last changed.")
|
2436
|
+
.optional(),
|
2437
|
+
type: z.object({ id: z.string().describe("The type ID of the user.").optional() }).optional(),
|
2438
|
+
profile: z
|
2439
|
+
.object({
|
2440
|
+
firstName: z.string().describe("The user's first name.").optional(),
|
2441
|
+
lastName: z.string().describe("The user's last name.").optional(),
|
2442
|
+
mobilePhone: z.string().nullable().describe("The user's mobile phone number.").optional(),
|
2443
|
+
secondEmail: z.string().nullable().describe("The user's secondary email address.").optional(),
|
2444
|
+
login: z.string().describe("The user's login.").optional(),
|
2445
|
+
email: z.string().describe("The user's email address.").optional(),
|
2446
|
+
})
|
2447
|
+
.describe("The user's profile information.")
|
2448
|
+
.optional(),
|
2449
|
+
}))
|
2450
|
+
.describe("List of members in the group.")
|
2451
|
+
.optional(),
|
2452
|
+
error: z.string().describe("Error message if retrieval failed.").optional(),
|
2453
|
+
});
|
2454
|
+
export const oktaAddUserToGroupParamsSchema = z.object({
|
2455
|
+
groupId: z.string().describe("The ID of the group to add the user to."),
|
2456
|
+
userId: z.string().describe("The ID of the user to add to the group."),
|
2457
|
+
});
|
2458
|
+
export const oktaAddUserToGroupOutputSchema = z.object({
|
2459
|
+
success: z.boolean().describe("Whether the user was successfully added to the group."),
|
2460
|
+
error: z.string().describe("Error message if the operation failed.").optional(),
|
2461
|
+
});
|
2462
|
+
export const oktaRemoveUserFromGroupParamsSchema = z.object({
|
2463
|
+
groupId: z.string().describe("The ID of the group to remove the user from."),
|
2464
|
+
userId: z.string().describe("The ID of the user to remove from the group."),
|
2465
|
+
});
|
2466
|
+
export const oktaRemoveUserFromGroupOutputSchema = z.object({
|
2467
|
+
success: z.boolean().describe("Whether the user was successfully removed from the group."),
|
2468
|
+
error: z.string().describe("Error message if the operation failed.").optional(),
|
2469
|
+
});
|
2470
|
+
export const oktaListOktaUsersParamsSchema = z.object({
|
2471
|
+
searchQuery: z
|
2472
|
+
.string()
|
2473
|
+
.describe("Optional search query to filter users.\nThis field corresponds to the `search` query parameter in the Okta API's List Users operation.\nFor detailed information on constructing search queries and available filter expressions, refer to the Okta API documentation:\nhttps://developer.okta.com/docs/api/openapi/okta-management/management/tag/User/#tag/User/operation/listUsers!in=query&path=search&t=request\nExample: 'profile.email eq \"my_user@example.com\"'\n")
|
2474
|
+
.optional(),
|
2475
|
+
maxResults: z.number().int().gte(1).describe("The maximum number of results to return.").optional(),
|
2476
|
+
});
|
2477
|
+
export const oktaListOktaUsersOutputSchema = z.object({
|
2478
|
+
success: z.boolean().describe("Whether the user list was successfully retrieved"),
|
2479
|
+
users: z
|
2480
|
+
.array(z.object({
|
2481
|
+
id: z.string().describe("The user's Okta ID"),
|
2482
|
+
status: z.string().describe("The user's status").optional(),
|
2483
|
+
created: z.string().describe("The timestamp when the user was created").optional(),
|
2484
|
+
activated: z.string().nullable().describe("The timestamp when the user was activated").optional(),
|
2485
|
+
statusChanged: z.string().nullable().describe("The timestamp when the user's status changed").optional(),
|
2486
|
+
lastLogin: z.string().nullable().describe("The timestamp of the user's last login").optional(),
|
2487
|
+
lastUpdated: z.string().describe("The timestamp of the user's last update").optional(),
|
2488
|
+
passwordChanged: z.string().describe("The timestamp when the user's password was last changed").optional(),
|
2489
|
+
type: z.object({ id: z.string().describe("The type ID of the user").optional() }).optional(),
|
2490
|
+
profile: z.object({
|
2491
|
+
firstName: z.string().describe("The user's first name").optional(),
|
2492
|
+
lastName: z.string().describe("The user's last name").optional(),
|
2493
|
+
mobilePhone: z.string().nullable().describe("The user's mobile phone number").optional(),
|
2494
|
+
secondEmail: z.string().nullable().describe("The user's secondary email address").optional(),
|
2495
|
+
login: z.string().describe("The user's login").optional(),
|
2496
|
+
email: z.string().describe("The user's email address").optional(),
|
2497
|
+
}),
|
2498
|
+
realmId: z.string().describe("The realm ID of the user").optional(),
|
2499
|
+
}))
|
2500
|
+
.describe("List of Okta users matching the query")
|
2501
|
+
.optional(),
|
2502
|
+
error: z.string().describe("Error message if user retrieval failed").optional(),
|
2503
|
+
});
|
2504
|
+
export const oktaResetMFAParamsSchema = z.object({
|
2505
|
+
userId: z.string().describe("The ID of the user whose MFA needs to be reset."),
|
2506
|
+
factorId: z
|
2507
|
+
.string()
|
2508
|
+
.describe("Optional. The ID of the specific factor to reset. If not provided, all factors will be reset.")
|
2509
|
+
.optional(),
|
2510
|
+
});
|
2511
|
+
export const oktaResetMFAOutputSchema = z.object({
|
2512
|
+
success: z.boolean().describe("Whether the MFA reset was successful."),
|
2513
|
+
error: z.string().describe("Error message if the MFA reset failed.").optional(),
|
2514
|
+
});
|
2515
|
+
export const oktaListMFAParamsSchema = z.object({
|
2516
|
+
userId: z.string().describe("The ID of the user whose MFA factors need to be listed."),
|
2517
|
+
});
|
2518
|
+
export const oktaListMFAOutputSchema = z.object({
|
2519
|
+
success: z.boolean().describe("Whether the MFA factors were successfully retrieved."),
|
2520
|
+
factors: z
|
2521
|
+
.array(z.object({
|
2522
|
+
id: z.string().describe("The ID of the MFA factor."),
|
2523
|
+
factorType: z
|
2524
|
+
.string()
|
2525
|
+
.describe("The type of the MFA factor (e.g., question, sms, token:software:totp).")
|
2526
|
+
.optional(),
|
2527
|
+
provider: z.string().describe("The provider of the MFA factor (e.g., OKTA).").optional(),
|
2528
|
+
vendorName: z.string().describe("The vendor name of the MFA factor.").optional(),
|
2529
|
+
status: z.string().describe("The status of the MFA factor (e.g., ACTIVE, PENDING_ACTIVATION).").optional(),
|
2530
|
+
created: z.string().describe("The timestamp when the MFA factor was created.").optional(),
|
2531
|
+
lastUpdated: z.string().describe("The timestamp when the MFA factor was last updated.").optional(),
|
2532
|
+
profile: z
|
2533
|
+
.object({})
|
2534
|
+
.catchall(z.any())
|
2535
|
+
.describe("Additional profile information for the MFA factor.")
|
2536
|
+
.optional(),
|
2537
|
+
_links: z.object({}).catchall(z.any()).describe("Links related to the MFA factor.").optional(),
|
2538
|
+
_embedded: z
|
2539
|
+
.object({})
|
2540
|
+
.catchall(z.any())
|
2541
|
+
.describe("Embedded data for the MFA factor (e.g., activation details).")
|
2542
|
+
.optional(),
|
2543
|
+
}))
|
2544
|
+
.describe("List of MFA factors for the user.")
|
2545
|
+
.optional(),
|
2546
|
+
error: z.string().describe("Error message if the MFA factors could not be retrieved.").optional(),
|
2547
|
+
});
|
2548
|
+
export const oktaResetPasswordParamsSchema = z.object({
|
2549
|
+
userId: z.string().describe("The ID of the user whose password needs to be reset."),
|
2550
|
+
sendEmail: z.boolean().describe("Whether to send a password reset email to the user."),
|
2551
|
+
revokeSessions: z
|
2552
|
+
.boolean()
|
2553
|
+
.describe("Whether to revoke all active sessions for the user after the password reset.")
|
2554
|
+
.optional(),
|
2555
|
+
});
|
2556
|
+
export const oktaResetPasswordOutputSchema = z.object({
|
2557
|
+
success: z.boolean().describe("Whether the password reset was successful."),
|
2558
|
+
error: z.string().describe("Error message if the password reset failed.").optional(),
|
2559
|
+
resetPasswordUrl: z.string().describe("The URL for resetting the password manually.").optional(),
|
2560
|
+
});
|
2271
2561
|
export const gongGetGongTranscriptsParamsSchema = z.object({
|
2272
2562
|
userRole: z.string().describe("The role of users whose transcripts are being fetched"),
|
2273
2563
|
trackers: z
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mathAddDefinition = exports.slackSendMessageDefinition = void 0;
|
4
|
+
exports.slackSendMessageDefinition = {
|
5
|
+
name: "send_message",
|
6
|
+
description: "Sends a message to a Slack channel",
|
7
|
+
parameters: {
|
8
|
+
"channel": {
|
9
|
+
"type": "string",
|
10
|
+
"description": "The Slack channel to send the message to (e.g., \\#general, \\#alerts)",
|
11
|
+
"required": true
|
12
|
+
},
|
13
|
+
"message": {
|
14
|
+
"type": "string",
|
15
|
+
"description": "The message content to send to Slack. Can include markdown formatting.",
|
16
|
+
"required": true
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
20
|
+
exports.mathAddDefinition = {
|
21
|
+
name: "add",
|
22
|
+
description: "Adds two numbers together",
|
23
|
+
parameters: {
|
24
|
+
"a": {
|
25
|
+
"type": "number",
|
26
|
+
"description": "The first number to add",
|
27
|
+
"required": true
|
28
|
+
},
|
29
|
+
"b": {
|
30
|
+
"type": "number",
|
31
|
+
"description": "The second number to add",
|
32
|
+
"required": true
|
33
|
+
}
|
34
|
+
}
|
35
|
+
};
|
package/dist/actions/groups.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, } from "../actions/autogen/templates";
|
1
|
+
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, } from "../actions/autogen/templates";
|
2
2
|
export const ACTION_GROUPS = {
|
3
3
|
GENERIC: {
|
4
4
|
description: "Generic utility actions",
|
@@ -201,4 +201,20 @@ export const ACTION_GROUPS = {
|
|
201
201
|
googleOauthDeleteGroupMemberDefinition,
|
202
202
|
],
|
203
203
|
},
|
204
|
+
OKTA: {
|
205
|
+
description: "Actions for interacting with Okta",
|
206
|
+
actions: [
|
207
|
+
oktaListOktaUsersDefinition,
|
208
|
+
oktaGetOktaUserDefinition,
|
209
|
+
oktaListOktaUserGroupsDefinition,
|
210
|
+
oktaListOktaGroupsDefinition,
|
211
|
+
oktaGetOktaGroupDefinition,
|
212
|
+
oktaListOktaGroupMembersDefinition,
|
213
|
+
oktaRemoveUserFromGroupDefinition,
|
214
|
+
oktaAddUserToGroupDefinition,
|
215
|
+
oktaResetPasswordDefinition,
|
216
|
+
oktaResetMFADefinition,
|
217
|
+
oktaListMFADefinition,
|
218
|
+
],
|
219
|
+
},
|
204
220
|
};
|
@@ -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,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
14
|
+
return {
|
15
|
+
baseURL: baseUrl,
|
16
|
+
headers: {
|
17
|
+
Accept: "application/json",
|
18
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
19
|
+
},
|
20
|
+
};
|
21
|
+
}
|
22
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
23
|
+
const { pageId, username, content, title } = params;
|
24
|
+
const { baseUrl, authToken } = authParams;
|
25
|
+
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
26
|
+
// Get current version number
|
27
|
+
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
28
|
+
const currVersion = response.data.version.number;
|
29
|
+
const payload = {
|
30
|
+
id: pageId,
|
31
|
+
status: "current",
|
32
|
+
title,
|
33
|
+
body: {
|
34
|
+
representation: "storage",
|
35
|
+
value: content,
|
36
|
+
},
|
37
|
+
version: {
|
38
|
+
number: currVersion + 1,
|
39
|
+
},
|
40
|
+
};
|
41
|
+
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
42
|
+
});
|
43
|
+
exports.default = confluenceUpdatePage;
|
@@ -0,0 +1,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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const sdk_1 = require("@credal/sdk");
|
13
|
+
const callCopilot = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
var _b;
|
15
|
+
const requestBody = {
|
16
|
+
agentId: params.agentId,
|
17
|
+
query: params.query,
|
18
|
+
userEmail: params.userEmail,
|
19
|
+
};
|
20
|
+
const baseUrl = (_b = authParams.baseUrl) !== null && _b !== void 0 ? _b : "https://app.credal.ai/api";
|
21
|
+
const client = new sdk_1.CredalClient({ environment: baseUrl, apiKey: authParams.apiKey });
|
22
|
+
const response = yield client.copilots.sendMessage({
|
23
|
+
agentId: requestBody.agentId,
|
24
|
+
message: requestBody.query,
|
25
|
+
userEmail: requestBody.userEmail,
|
26
|
+
});
|
27
|
+
return {
|
28
|
+
response: response.sendChatResult.type === "ai_response_result"
|
29
|
+
? response.sendChatResult.response.message
|
30
|
+
: "Error getting response",
|
31
|
+
referencedSources: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.referencedSources : [],
|
32
|
+
sourcesInDataContext: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.sourcesInDataContext : [],
|
33
|
+
webSearchResults: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.webSearchResults : [],
|
34
|
+
};
|
35
|
+
});
|
36
|
+
exports.default = callCopilot;
|
@@ -0,0 +1,98 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
+
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
14
|
+
const decodeMessage_1 = require("./utils/decodeMessage");
|
15
|
+
const listGmailThreads = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
16
|
+
if (!authParams.authToken) {
|
17
|
+
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN, threads: [] };
|
18
|
+
}
|
19
|
+
const { query, maxResults } = params;
|
20
|
+
const allThreads = [];
|
21
|
+
const errorMessages = [];
|
22
|
+
const max = maxResults !== null && maxResults !== void 0 ? maxResults : 100;
|
23
|
+
let fetched = 0;
|
24
|
+
let pageToken = undefined;
|
25
|
+
try {
|
26
|
+
while (fetched < max) {
|
27
|
+
const url = `https://gmail.googleapis.com/gmail/v1/users/me/threads?q=${encodeURIComponent(query)}` +
|
28
|
+
(pageToken ? `&pageToken=${encodeURIComponent(pageToken)}` : "") +
|
29
|
+
`&maxResults=${Math.min(100, max - fetched)}`;
|
30
|
+
const listRes = yield axiosClient_1.axiosClient.get(url, {
|
31
|
+
headers: {
|
32
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
33
|
+
},
|
34
|
+
});
|
35
|
+
const { threads: threadList = [], nextPageToken } = listRes.data;
|
36
|
+
if (!Array.isArray(threadList) || threadList.length === 0)
|
37
|
+
break;
|
38
|
+
const remaining = max - allThreads.length;
|
39
|
+
const batch = threadList.slice(0, remaining);
|
40
|
+
const results = yield Promise.all(batch.map((thread) => __awaiter(void 0, void 0, void 0, function* () {
|
41
|
+
try {
|
42
|
+
const threadRes = yield axiosClient_1.axiosClient.get(`https://gmail.googleapis.com/gmail/v1/users/me/threads/${thread.id}?format=full`, {
|
43
|
+
headers: {
|
44
|
+
Authorization: `Bearer ${authParams.authToken}`,
|
45
|
+
},
|
46
|
+
});
|
47
|
+
const { id, historyId, messages } = threadRes.data;
|
48
|
+
return {
|
49
|
+
id,
|
50
|
+
historyId,
|
51
|
+
messages: Array.isArray(messages)
|
52
|
+
? messages.map(msg => {
|
53
|
+
const { id, threadId, snippet, labelIds, internalDate } = msg;
|
54
|
+
const emailBody = (0, decodeMessage_1.getEmailContent)(msg) || "";
|
55
|
+
return {
|
56
|
+
id,
|
57
|
+
threadId,
|
58
|
+
snippet,
|
59
|
+
labelIds,
|
60
|
+
internalDate,
|
61
|
+
emailBody,
|
62
|
+
};
|
63
|
+
})
|
64
|
+
: [],
|
65
|
+
};
|
66
|
+
}
|
67
|
+
catch (err) {
|
68
|
+
errorMessages.push(err instanceof Error ? err.message : "Failed to fetch thread details");
|
69
|
+
return {
|
70
|
+
id: thread.id,
|
71
|
+
snippet: "",
|
72
|
+
historyId: "",
|
73
|
+
messages: [],
|
74
|
+
error: err instanceof Error ? err.message : "Failed to fetch thread details",
|
75
|
+
};
|
76
|
+
}
|
77
|
+
})));
|
78
|
+
allThreads.push(...results);
|
79
|
+
fetched = allThreads.length;
|
80
|
+
if (!nextPageToken || allThreads.length >= max)
|
81
|
+
break;
|
82
|
+
pageToken = nextPageToken;
|
83
|
+
}
|
84
|
+
return {
|
85
|
+
success: errorMessages.length === 0,
|
86
|
+
threads: allThreads,
|
87
|
+
error: errorMessages.join("; "),
|
88
|
+
};
|
89
|
+
}
|
90
|
+
catch (error) {
|
91
|
+
return {
|
92
|
+
success: false,
|
93
|
+
error: error instanceof Error ? error.message : "Unknown error listing Gmail threads",
|
94
|
+
threads: [],
|
95
|
+
};
|
96
|
+
}
|
97
|
+
});
|
98
|
+
exports.default = listGmailThreads;
|