@meistrari/chat-nuxt 4.14.0-rc.6 → 4.14.0-rc.8
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/module.json
CHANGED
|
@@ -4,6 +4,27 @@ export declare const credentialsSchema: z.ZodObject<{
|
|
|
4
4
|
clientSecret: z.ZodString;
|
|
5
5
|
signingSecret: z.ZodString;
|
|
6
6
|
}, z.core.$strict>;
|
|
7
|
+
export declare const botCapabilities: readonly ["thread_context", "files", "direct_messages", "message_triggers", "reaction_triggers", "post_to_public_channels", "member_email"];
|
|
8
|
+
export declare const botCapabilitySchema: z.ZodEnum<{
|
|
9
|
+
files: "files";
|
|
10
|
+
thread_context: "thread_context";
|
|
11
|
+
direct_messages: "direct_messages";
|
|
12
|
+
message_triggers: "message_triggers";
|
|
13
|
+
reaction_triggers: "reaction_triggers";
|
|
14
|
+
post_to_public_channels: "post_to_public_channels";
|
|
15
|
+
member_email: "member_email";
|
|
16
|
+
}>;
|
|
17
|
+
export declare const legacyBotCapabilities: readonly ["thread_context", "files"];
|
|
18
|
+
export declare const botCapabilitiesSchema: z.ZodArray<z.ZodEnum<{
|
|
19
|
+
files: "files";
|
|
20
|
+
thread_context: "thread_context";
|
|
21
|
+
direct_messages: "direct_messages";
|
|
22
|
+
message_triggers: "message_triggers";
|
|
23
|
+
reaction_triggers: "reaction_triggers";
|
|
24
|
+
post_to_public_channels: "post_to_public_channels";
|
|
25
|
+
member_email: "member_email";
|
|
26
|
+
}>>;
|
|
27
|
+
export type BotCapability = z.infer<typeof botCapabilitySchema>;
|
|
7
28
|
export declare const registrationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
29
|
role: z.ZodLiteral<"manager">;
|
|
9
30
|
appId: z.ZodString;
|
|
@@ -19,6 +40,15 @@ export declare const registrationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
19
40
|
role: z.ZodLiteral<"dedicated">;
|
|
20
41
|
workspaceId: z.ZodUUID;
|
|
21
42
|
agentId: z.ZodUUID;
|
|
43
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
44
|
+
files: "files";
|
|
45
|
+
thread_context: "thread_context";
|
|
46
|
+
direct_messages: "direct_messages";
|
|
47
|
+
message_triggers: "message_triggers";
|
|
48
|
+
reaction_triggers: "reaction_triggers";
|
|
49
|
+
post_to_public_channels: "post_to_public_channels";
|
|
50
|
+
member_email: "member_email";
|
|
51
|
+
}>>>;
|
|
22
52
|
appId: z.ZodString;
|
|
23
53
|
teamId: z.ZodString;
|
|
24
54
|
creatorId: z.ZodString;
|
|
@@ -68,6 +98,15 @@ export declare const botRequestSchema: z.ZodObject<{
|
|
|
68
98
|
url: z.ZodURL;
|
|
69
99
|
sha256: z.ZodString;
|
|
70
100
|
}, z.core.$strict>>;
|
|
101
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
102
|
+
files: "files";
|
|
103
|
+
thread_context: "thread_context";
|
|
104
|
+
direct_messages: "direct_messages";
|
|
105
|
+
message_triggers: "message_triggers";
|
|
106
|
+
reaction_triggers: "reaction_triggers";
|
|
107
|
+
post_to_public_channels: "post_to_public_channels";
|
|
108
|
+
member_email: "member_email";
|
|
109
|
+
}>>>;
|
|
71
110
|
}, z.core.$strip>;
|
|
72
111
|
export declare const botChangesSchema: z.ZodObject<{
|
|
73
112
|
actorId: z.ZodString;
|
|
@@ -80,6 +119,15 @@ export declare const botChangesSchema: z.ZodObject<{
|
|
|
80
119
|
url: z.ZodURL;
|
|
81
120
|
sha256: z.ZodString;
|
|
82
121
|
}, z.core.$strict>>;
|
|
122
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
123
|
+
files: "files";
|
|
124
|
+
thread_context: "thread_context";
|
|
125
|
+
direct_messages: "direct_messages";
|
|
126
|
+
message_triggers: "message_triggers";
|
|
127
|
+
reaction_triggers: "reaction_triggers";
|
|
128
|
+
post_to_public_channels: "post_to_public_channels";
|
|
129
|
+
member_email: "member_email";
|
|
130
|
+
}>>>;
|
|
83
131
|
}, z.core.$strip>;
|
|
84
132
|
export declare const botIdSchema: z.ZodUUID;
|
|
85
133
|
export type BotTarget = z.infer<typeof botTargetSchema>;
|
|
@@ -134,6 +182,16 @@ export declare const botSchema: z.ZodObject<{
|
|
|
134
182
|
actorId: z.ZodNullable<z.ZodString>;
|
|
135
183
|
}, z.core.$strip>>;
|
|
136
184
|
manageable: z.ZodBoolean;
|
|
185
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
186
|
+
files: "files";
|
|
187
|
+
thread_context: "thread_context";
|
|
188
|
+
direct_messages: "direct_messages";
|
|
189
|
+
message_triggers: "message_triggers";
|
|
190
|
+
reaction_triggers: "reaction_triggers";
|
|
191
|
+
post_to_public_channels: "post_to_public_channels";
|
|
192
|
+
member_email: "member_email";
|
|
193
|
+
}>>;
|
|
194
|
+
reinstallRequired: z.ZodBoolean;
|
|
137
195
|
}, z.core.$strip>;
|
|
138
196
|
export type BotAdministrator = z.infer<typeof botAdministratorSchema>;
|
|
139
197
|
export type Bot = z.infer<typeof botSchema>;
|
|
@@ -5,6 +5,12 @@ export const credentialsSchema = z.strictObject({
|
|
|
5
5
|
clientSecret: z.string().min(1).max(2000),
|
|
6
6
|
signingSecret: z.string().min(1).max(2000),
|
|
7
7
|
});
|
|
8
|
+
// What a dedicated bot does beyond answering mentions in public channels, chosen when it is created. Each one adds the Slack scopes and
|
|
9
|
+
// events it needs to the bot's manifest. A bot created before capabilities existed has thread_context and files.
|
|
10
|
+
export const botCapabilities = ['thread_context', 'files', 'direct_messages', 'message_triggers', 'reaction_triggers', 'post_to_public_channels', 'member_email'];
|
|
11
|
+
export const botCapabilitySchema = z.enum(botCapabilities);
|
|
12
|
+
export const legacyBotCapabilities = ['thread_context', 'files'];
|
|
13
|
+
export const botCapabilitiesSchema = z.array(botCapabilitySchema).max(botCapabilities.length).describe('`thread_context` (reads the thread of a mention), `files` (reads attachments), `direct_messages` (answers DMs as private conversations), `message_triggers` and `reaction_triggers` (reserved: subscribe to channel messages and reactions for configurable triggers), `post_to_public_channels` (`chat:write.public`), `member_email` (`users:read.email`).');
|
|
8
14
|
const common = {
|
|
9
15
|
appId: z.string().regex(/^A[A-Z0-9]+$/),
|
|
10
16
|
teamId: z.string().regex(/^T[A-Z0-9]+$/),
|
|
@@ -14,7 +20,7 @@ const common = {
|
|
|
14
20
|
};
|
|
15
21
|
export const registrationSchema = z.discriminatedUnion('role', [
|
|
16
22
|
z.strictObject({ ...common, role: z.literal('manager') }),
|
|
17
|
-
z.strictObject({ ...common, role: z.literal('dedicated'), workspaceId: z.uuid(), agentId: z.uuid() }),
|
|
23
|
+
z.strictObject({ ...common, role: z.literal('dedicated'), workspaceId: z.uuid(), agentId: z.uuid(), capabilities: botCapabilitiesSchema.optional() }),
|
|
18
24
|
]);
|
|
19
25
|
// Slack limits app names to 35 characters. Plain unaccented words only: the name is also the bot user's display name, where Slack
|
|
20
26
|
// refuses a manifest with accented letters, and it never carries mention, link or mrkdwn syntax.
|
|
@@ -30,8 +36,8 @@ export const botPhotoSchema = z.strictObject({
|
|
|
30
36
|
sha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
31
37
|
});
|
|
32
38
|
// Workspace and agent names are Tela's current titles, shown in the Slack app; the name is validated by the bot rules.
|
|
33
|
-
export const botRequestSchema = botTargetSchema.extend({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), workspaceName: z.string().min(1).max(200), agentName: z.string().min(1).max(200), name: z.string().max(200), requestKey: z.uuid(), photo: botPhotoSchema.optional() });
|
|
34
|
-
export const botChangesSchema = botTargetSchema.extend({ name: z.string().max(200).optional(), addAdminActorIds: z.array(actorIdSchema).max(20).optional(), removeAdminSlackUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]{1,99}$/)).max(20).optional(), photo: botPhotoSchema.optional() });
|
|
39
|
+
export const botRequestSchema = botTargetSchema.extend({ teamId: z.string().regex(/^T[A-Z0-9]+$/).max(100), workspaceName: z.string().min(1).max(200), agentName: z.string().min(1).max(200), name: z.string().max(200), requestKey: z.uuid(), photo: botPhotoSchema.optional(), capabilities: botCapabilitiesSchema.optional().describe('Defaults to `thread_context` and `files`.') });
|
|
40
|
+
export const botChangesSchema = botTargetSchema.extend({ name: z.string().max(200).optional(), addAdminActorIds: z.array(actorIdSchema).max(20).optional(), removeAdminSlackUserIds: z.array(z.string().regex(/^[UW][A-Z0-9]{1,99}$/)).max(20).optional(), photo: botPhotoSchema.optional(), capabilities: botCapabilitiesSchema.optional() });
|
|
35
41
|
export const botIdSchema = z.uuid();
|
|
36
42
|
export const botAdministratorSchema = z.object({
|
|
37
43
|
slackUserId: z.string(),
|
|
@@ -57,6 +63,8 @@ export const botSchema = z.object({
|
|
|
57
63
|
// An administrator's Tela account while their Slack identity in the bot's team is connected, otherwise null.
|
|
58
64
|
admins: z.array(botAdministratorSchema),
|
|
59
65
|
manageable: z.boolean().describe('The actor manages the bot: its creator or a designated administrator, through a single active Slack identity in its team.'),
|
|
66
|
+
capabilities: z.array(botCapabilitySchema).describe('The bot\'s capabilities, in canonical order.'),
|
|
67
|
+
reinstallRequired: z.boolean().describe('The installation lacks a Slack scope the capabilities need: an administrator must reinstall the bot for the new capabilities to work.'),
|
|
60
68
|
});
|
|
61
69
|
const createdCredentialsSchema = z.strictObject({ clientId: z.string().regex(/^\d+\.\d+$/).max(100), clientSecret: z.string().min(1).max(2000), signingSecret: z.string().min(1).max(2000) });
|
|
62
70
|
export const operationResolutionSchema = z.discriminatedUnion('resolution', [
|