@credal/actions 0.2.190 → 0.2.192
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.
|
@@ -708,6 +708,7 @@ export const slackSendMessageDefinition = {
|
|
|
708
708
|
channelName: {
|
|
709
709
|
type: "string",
|
|
710
710
|
description: "The name of the Slack channel to send the message to (e.g. general, alerts)",
|
|
711
|
+
tags: ["recommend-enum"],
|
|
711
712
|
},
|
|
712
713
|
message: {
|
|
713
714
|
type: "string",
|
|
@@ -752,6 +753,7 @@ export const slackGetChannelMessagesDefinition = {
|
|
|
752
753
|
channelName: {
|
|
753
754
|
type: "string",
|
|
754
755
|
description: "Name of the channel to summarize. Either the channelId or channelName must be provided.",
|
|
756
|
+
tags: ["recommend-enum"],
|
|
755
757
|
},
|
|
756
758
|
oldest: {
|
|
757
759
|
type: "string",
|
|
@@ -830,6 +832,7 @@ export const slackGetChannelMembersDefinition = {
|
|
|
830
832
|
channelName: {
|
|
831
833
|
type: "string",
|
|
832
834
|
description: "The name of the channel to get members from",
|
|
835
|
+
tags: ["recommend-enum"],
|
|
833
836
|
},
|
|
834
837
|
},
|
|
835
838
|
},
|
|
@@ -897,6 +900,7 @@ export const slackUserSearchSlackDefinition = {
|
|
|
897
900
|
channel: {
|
|
898
901
|
type: "string",
|
|
899
902
|
description: 'Channel name or ID. Examples - "#eng-updates", "eng-updates", "C01234567".',
|
|
903
|
+
tags: ["recommend-enum"],
|
|
900
904
|
},
|
|
901
905
|
topic: {
|
|
902
906
|
type: "string",
|
|
@@ -1056,7 +1060,7 @@ export const slackUserSearchSlackDefinition = {
|
|
|
1056
1060
|
};
|
|
1057
1061
|
export const slackUserSearchSlackRTSDefinition = {
|
|
1058
1062
|
displayName: "Search Slack with Real-Time Search",
|
|
1059
|
-
description: "Search Slack messages across your organization using Slack's Real-Time Search API
|
|
1063
|
+
description: "Search Slack messages across your organization using Slack's Real-Time Search API. Searches all conversations within the scope of permissions granted and returns relevant messages with content, author info, and permalinks.",
|
|
1060
1064
|
scopes: [
|
|
1061
1065
|
"search:read.public",
|
|
1062
1066
|
"search:read.private",
|
|
@@ -1071,25 +1075,25 @@ export const slackUserSearchSlackRTSDefinition = {
|
|
|
1071
1075
|
properties: {
|
|
1072
1076
|
query: {
|
|
1073
1077
|
type: "string",
|
|
1074
|
-
description: 'The search query string (e.g., "What is project gizmo?", "mobile UX revamp").
|
|
1078
|
+
description: 'The search query string (e.g., "What is project gizmo?", "mobile UX revamp"). If you want to filter by user or channel, leave this field empty and use the userEmails and channelIds fields.',
|
|
1075
1079
|
},
|
|
1076
1080
|
userEmails: {
|
|
1077
1081
|
type: "array",
|
|
1078
|
-
description: 'Optional. Users to
|
|
1082
|
+
description: 'Optional. Users that you want to see messages from. Each value should be a plain-text email (e.g. "user@company.com"). Will be resolved to a Slack user ID and formatted into the query as from:<@U...>.',
|
|
1079
1083
|
items: {
|
|
1080
1084
|
type: "string",
|
|
1081
1085
|
},
|
|
1082
1086
|
},
|
|
1083
1087
|
channelIds: {
|
|
1084
1088
|
type: "array",
|
|
1085
|
-
description: 'Optional. Channels to
|
|
1089
|
+
description: 'Optional. Channels that you want to see messages from. Each value can be a Slack channel ID like "C12345678" (or "<#C123...>") OR a channel name like "general" / "#general". Values are formatted into the query as in:<#C...> (ID) or in:#channel-name (name).',
|
|
1086
1090
|
items: {
|
|
1087
1091
|
type: "string",
|
|
1088
1092
|
},
|
|
1089
1093
|
},
|
|
1090
1094
|
channelTypes: {
|
|
1091
1095
|
type: "array",
|
|
1092
|
-
description: "Filter by channel types to search. If not specified, searches all channel types the user has access to.",
|
|
1096
|
+
description: "Filter by channel types to search (e.g., public_channel, private_channel, mpim, im). If not specified, searches all channel types the user has access to.",
|
|
1093
1097
|
items: {
|
|
1094
1098
|
type: "string",
|
|
1095
1099
|
enum: ["public_channel", "private_channel", "mpim", "im"],
|
|
@@ -1097,7 +1101,7 @@ export const slackUserSearchSlackRTSDefinition = {
|
|
|
1097
1101
|
},
|
|
1098
1102
|
contentTypes: {
|
|
1099
1103
|
type: "array",
|
|
1100
|
-
description: "Filter by content types to include in search results.",
|
|
1104
|
+
description: "Filter by content types to include in search results (e.g., messages, files, channels). If not specified, searches all content types the user has access to.",
|
|
1101
1105
|
items: {
|
|
1102
1106
|
type: "string",
|
|
1103
1107
|
enum: ["messages", "files", "channels"],
|
|
@@ -1123,11 +1127,11 @@ export const slackUserSearchSlackRTSDefinition = {
|
|
|
1123
1127
|
},
|
|
1124
1128
|
before: {
|
|
1125
1129
|
type: "string",
|
|
1126
|
-
description: "Optional UNIX timestamp filter. If present, filters for results before this date.",
|
|
1130
|
+
description: "Optional UNIX timestamp filter. If present, filters for results before this date. Use this field when you want to find messages in a specific date/time range.",
|
|
1127
1131
|
},
|
|
1128
1132
|
after: {
|
|
1129
1133
|
type: "string",
|
|
1130
|
-
description: "Optional UNIX timestamp filter. If present, filters for results after this date.",
|
|
1134
|
+
description: "Optional UNIX timestamp filter. If present, filters for results after this date. Use this field when you want to find messages in a specific date/time range.",
|
|
1131
1135
|
},
|
|
1132
1136
|
},
|
|
1133
1137
|
},
|
|
@@ -237,9 +237,9 @@ export type AuthParamsType = z.infer<typeof AuthParamsSchema>;
|
|
|
237
237
|
export declare const ActionTagSchema: z.ZodEnum<["read", "write"]>;
|
|
238
238
|
export type ActionTag = z.infer<typeof ActionTagSchema>;
|
|
239
239
|
export declare const ACTION_TAGS: readonly ["read", "write"];
|
|
240
|
-
export declare const ParameterTagSchema: z.ZodEnum<["recommend-predefined"]>;
|
|
240
|
+
export declare const ParameterTagSchema: z.ZodEnum<["recommend-predefined", "recommend-enum"]>;
|
|
241
241
|
export type ParameterTag = z.infer<typeof ParameterTagSchema>;
|
|
242
|
-
export declare const PARAMETER_TAGS: readonly ["recommend-predefined"];
|
|
242
|
+
export declare const PARAMETER_TAGS: readonly ["recommend-predefined", "recommend-enum"];
|
|
243
243
|
export declare const genericFillTemplateParamsSchema: z.ZodObject<{
|
|
244
244
|
template: z.ZodString;
|
|
245
245
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -193,8 +193,8 @@ export const AuthParamsSchema = z.object({
|
|
|
193
193
|
});
|
|
194
194
|
export const ActionTagSchema = z.enum(["read", "write"]);
|
|
195
195
|
export const ACTION_TAGS = ["read", "write"];
|
|
196
|
-
export const ParameterTagSchema = z.enum(["recommend-predefined"]);
|
|
197
|
-
export const PARAMETER_TAGS = ["recommend-predefined"];
|
|
196
|
+
export const ParameterTagSchema = z.enum(["recommend-predefined", "recommend-enum"]);
|
|
197
|
+
export const PARAMETER_TAGS = ["recommend-predefined", "recommend-enum"];
|
|
198
198
|
export const genericFillTemplateParamsSchema = z.object({
|
|
199
199
|
template: z.string().describe("The template string to be processed and returned"),
|
|
200
200
|
});
|
|
@@ -529,23 +529,23 @@ export const slackUserSearchSlackOutputSchema = z.object({
|
|
|
529
529
|
export const slackUserSearchSlackRTSParamsSchema = z.object({
|
|
530
530
|
query: z
|
|
531
531
|
.string()
|
|
532
|
-
.describe('The search query string (e.g., "What is project gizmo?", "mobile UX revamp").
|
|
532
|
+
.describe('The search query string (e.g., "What is project gizmo?", "mobile UX revamp"). If you want to filter by user or channel, leave this field empty and use the userEmails and channelIds fields.')
|
|
533
533
|
.optional(),
|
|
534
534
|
userEmails: z
|
|
535
535
|
.array(z.string())
|
|
536
|
-
.describe('Optional. Users to
|
|
536
|
+
.describe('Optional. Users that you want to see messages from. Each value should be a plain-text email (e.g. "user@company.com"). Will be resolved to a Slack user ID and formatted into the query as from:<@U...>.')
|
|
537
537
|
.optional(),
|
|
538
538
|
channelIds: z
|
|
539
539
|
.array(z.string())
|
|
540
|
-
.describe('Optional. Channels to
|
|
540
|
+
.describe('Optional. Channels that you want to see messages from. Each value can be a Slack channel ID like "C12345678" (or "<#C123...>") OR a channel name like "general" / "#general". Values are formatted into the query as in:<#C...> (ID) or in:#channel-name (name).')
|
|
541
541
|
.optional(),
|
|
542
542
|
channelTypes: z
|
|
543
543
|
.array(z.enum(["public_channel", "private_channel", "mpim", "im"]))
|
|
544
|
-
.describe("Filter by channel types to search. If not specified, searches all channel types the user has access to.")
|
|
544
|
+
.describe("Filter by channel types to search (e.g., public_channel, private_channel, mpim, im). If not specified, searches all channel types the user has access to.")
|
|
545
545
|
.optional(),
|
|
546
546
|
contentTypes: z
|
|
547
547
|
.array(z.enum(["messages", "files", "channels"]))
|
|
548
|
-
.describe("Filter by content types to include in search results.")
|
|
548
|
+
.describe("Filter by content types to include in search results (e.g., messages, files, channels). If not specified, searches all content types the user has access to.")
|
|
549
549
|
.default(["messages", "files", "channels"]),
|
|
550
550
|
includeBots: z.boolean().describe("Whether to include bot messages in search results.").default(false),
|
|
551
551
|
includeContextMessages: z
|
|
@@ -555,11 +555,11 @@ export const slackUserSearchSlackRTSParamsSchema = z.object({
|
|
|
555
555
|
limit: z.number().gte(1).lte(20).describe("Maximum number of results per page (max 20).").default(20),
|
|
556
556
|
before: z
|
|
557
557
|
.string()
|
|
558
|
-
.describe("Optional UNIX timestamp filter. If present, filters for results before this date.")
|
|
558
|
+
.describe("Optional UNIX timestamp filter. If present, filters for results before this date. Use this field when you want to find messages in a specific date/time range.")
|
|
559
559
|
.optional(),
|
|
560
560
|
after: z
|
|
561
561
|
.string()
|
|
562
|
-
.describe("Optional UNIX timestamp filter. If present, filters for results after this date.")
|
|
562
|
+
.describe("Optional UNIX timestamp filter. If present, filters for results after this date. Use this field when you want to find messages in a specific date/time range.")
|
|
563
563
|
.optional(),
|
|
564
564
|
});
|
|
565
565
|
export const slackUserSearchSlackRTSOutputSchema = z.object({
|
package/dist/actions/parse.js
CHANGED
|
@@ -22,6 +22,7 @@ const actionTagValues = [
|
|
|
22
22
|
];
|
|
23
23
|
const parameterTagValues = [
|
|
24
24
|
"recommend-predefined", // we recommend that this parameter is predefined by the user versus AI generated at runtime
|
|
25
|
+
"recommend-enum", // we recommend that this parameter is an enum
|
|
25
26
|
];
|
|
26
27
|
const jsonObjectSchema = z.object({
|
|
27
28
|
type: z.string(),
|
|
@@ -8,22 +8,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
import { markdownToAdf } from "marklassian";
|
|
11
12
|
const cloudStrategy = {
|
|
12
|
-
formatText: (text) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
],
|
|
26
|
-
}),
|
|
13
|
+
formatText: (text) => {
|
|
14
|
+
try {
|
|
15
|
+
return markdownToAdf(text);
|
|
16
|
+
}
|
|
17
|
+
catch (_a) {
|
|
18
|
+
// Fallback to plain text ADF if markdown parsing fails
|
|
19
|
+
return {
|
|
20
|
+
type: "doc",
|
|
21
|
+
version: 1,
|
|
22
|
+
content: [{ type: "paragraph", content: [{ type: "text", text }] }],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
},
|
|
27
26
|
formatUser: (userId) => {
|
|
28
27
|
if (!userId)
|
|
29
28
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credal/actions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.192",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI Actions by Credal AI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"jsonwebtoken": "^9.0.2",
|
|
71
71
|
"limiter": "^3.0.0",
|
|
72
72
|
"mammoth": "^1.11.00",
|
|
73
|
+
"marklassian": "^1.1.0",
|
|
73
74
|
"mongodb": "^6.13.1",
|
|
74
75
|
"node-forge": "^1.3.3",
|
|
75
76
|
"officeparser": "^5.2.2",
|