@meistrari/chat-nuxt 4.14.0-rc.9 → 4.14.0

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.14.0-rc.9",
4
+ "version": "4.14.0-rc.10",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  userImage?: string;
11
11
  };
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- select: (id: string) => any;
14
13
  close: () => any;
14
+ select: (id: string) => any;
15
15
  newConvo: (groupId?: string | null | undefined) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onSelect?: ((id: string) => any) | undefined;
18
17
  onClose?: (() => any) | undefined;
18
+ onSelect?: ((id: string) => any) | undefined;
19
19
  onNewConvo?: ((groupId?: string | null | undefined) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  declare const _default: typeof __VLS_export;
@@ -10,12 +10,12 @@ type __VLS_Props = {
10
10
  userImage?: string;
11
11
  };
12
12
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- select: (id: string) => any;
14
13
  close: () => any;
14
+ select: (id: string) => any;
15
15
  newConvo: (groupId?: string | null | undefined) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onSelect?: ((id: string) => any) | undefined;
18
17
  onClose?: (() => any) | undefined;
18
+ onSelect?: ((id: string) => any) | undefined;
19
19
  onNewConvo?: ((groupId?: string | null | undefined) => any) | undefined;
20
20
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  declare const _default: typeof __VLS_export;
@@ -67,11 +67,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
67
67
  "update:selectedReasoningEffort": (value: any) => any;
68
68
  } & {
69
69
  delete: () => any;
70
- cancel: () => any;
71
70
  rename: () => any;
72
71
  duplicate: () => any;
73
72
  export: () => any;
74
73
  copyLink: () => any;
74
+ cancel: () => any;
75
75
  debug: () => any;
76
76
  selectConversation: (id: string) => any;
77
77
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
@@ -89,11 +89,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
89
89
  "update:workspaceSheetOpen": (value: boolean) => any;
90
90
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
91
91
  onDelete?: (() => any) | undefined;
92
- onCancel?: (() => any) | undefined;
93
92
  onRename?: (() => any) | undefined;
94
93
  onDuplicate?: (() => any) | undefined;
95
94
  onExport?: (() => any) | undefined;
96
95
  onCopyLink?: (() => any) | undefined;
96
+ onCancel?: (() => any) | undefined;
97
97
  onDebug?: (() => any) | undefined;
98
98
  onSelectConversation?: ((id: string) => any) | undefined;
99
99
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
@@ -67,11 +67,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
67
67
  "update:selectedReasoningEffort": (value: any) => any;
68
68
  } & {
69
69
  delete: () => any;
70
- cancel: () => any;
71
70
  rename: () => any;
72
71
  duplicate: () => any;
73
72
  export: () => any;
74
73
  copyLink: () => any;
74
+ cancel: () => any;
75
75
  debug: () => any;
76
76
  selectConversation: (id: string) => any;
77
77
  send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
@@ -89,11 +89,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
89
89
  "update:workspaceSheetOpen": (value: boolean) => any;
90
90
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
91
91
  onDelete?: (() => any) | undefined;
92
- onCancel?: (() => any) | undefined;
93
92
  onRename?: (() => any) | undefined;
94
93
  onDuplicate?: (() => any) | undefined;
95
94
  onExport?: (() => any) | undefined;
96
95
  onCopyLink?: (() => any) | undefined;
96
+ onCancel?: (() => any) | undefined;
97
97
  onDebug?: (() => any) | undefined;
98
98
  onSelectConversation?: ((id: string) => any) | undefined;
99
99
  onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
@@ -10,7 +10,7 @@ export const credentialsSchema = z.strictObject({
10
10
  export const botCapabilities = ['thread_context', 'files', 'direct_messages', 'message_triggers', 'reaction_triggers', 'post_to_public_channels', 'member_email'];
11
11
  export const botCapabilitySchema = z.enum(botCapabilities);
12
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, with native streaming and the thread context of a DM thread: `im:history`, `im:read`), `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`).');
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, with native streaming and the thread context of a DM thread: `im:history`, `im:read`), `message_triggers` and `reaction_triggers` (allow configurable triggers of that type: the bot reads public channel messages or reactions), `post_to_public_channels` (`chat:write.public`), `member_email` (`users:read.email`).');
14
14
  const common = {
15
15
  appId: z.string().regex(/^A[A-Z0-9]+$/),
16
16
  teamId: z.string().regex(/^T[A-Z0-9]+$/),
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ export declare const botTriggerTypes: readonly ["message", "reaction"];
3
+ export declare const botTriggerTypeSchema: z.ZodEnum<{
4
+ message: "message";
5
+ reaction: "reaction";
6
+ }>;
7
+ export declare const botTriggerConnectionModes: readonly ["ignore", "prompt"];
8
+ export declare const botTriggerLimits: {
9
+ readonly triggers: 20;
10
+ readonly pattern: 500;
11
+ readonly instruction: 2000;
12
+ };
13
+ export declare const botTriggerInputSchema: z.ZodObject<{
14
+ id: z.ZodOptional<z.ZodUUID>;
15
+ type: z.ZodEnum<{
16
+ message: "message";
17
+ reaction: "reaction";
18
+ }>;
19
+ pattern: z.ZodString;
20
+ channelNamePattern: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
21
+ instruction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
22
+ ifNotConnected: z.ZodDefault<z.ZodEnum<{
23
+ prompt: "prompt";
24
+ ignore: "ignore";
25
+ }>>;
26
+ }, z.core.$strip>;
27
+ export declare const botTriggerSchema: z.ZodObject<{
28
+ id: z.ZodUUID;
29
+ type: z.ZodEnum<{
30
+ message: "message";
31
+ reaction: "reaction";
32
+ }>;
33
+ pattern: z.ZodString;
34
+ channelNamePattern: z.ZodNullable<z.ZodString>;
35
+ instruction: z.ZodNullable<z.ZodString>;
36
+ ifNotConnected: z.ZodEnum<{
37
+ prompt: "prompt";
38
+ ignore: "ignore";
39
+ }>;
40
+ }, z.core.$strip>;
41
+ export declare const botTriggersChangeSchema: z.ZodObject<{
42
+ actorId: z.ZodString;
43
+ workspaceId: z.ZodUUID;
44
+ agentId: z.ZodUUID;
45
+ triggers: z.ZodArray<z.ZodObject<{
46
+ id: z.ZodOptional<z.ZodUUID>;
47
+ type: z.ZodEnum<{
48
+ message: "message";
49
+ reaction: "reaction";
50
+ }>;
51
+ pattern: z.ZodString;
52
+ channelNamePattern: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
53
+ instruction: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
54
+ ifNotConnected: z.ZodDefault<z.ZodEnum<{
55
+ prompt: "prompt";
56
+ ignore: "ignore";
57
+ }>>;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$strip>;
60
+ export type BotTriggerInput = z.infer<typeof botTriggerInputSchema>;
61
+ export type BotTrigger = z.infer<typeof botTriggerSchema>;
62
+ export type BotTriggersChange = z.infer<typeof botTriggersChangeSchema> & {
63
+ botId: string;
64
+ };
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { botTargetSchema } from './apps';
3
+ // A trigger makes a dedicated bot run a turn without being mentioned: a channel message whose text matches its pattern, or a reaction
4
+ // whose name does. Patterns are RE2 regular expressions, matched anywhere in the text unless anchored; the service refuses one RE2 cannot
5
+ // compile (no backreferences or lookarounds).
6
+ export const botTriggerTypes = ['message', 'reaction'];
7
+ export const botTriggerTypeSchema = z.enum(botTriggerTypes);
8
+ export const botTriggerConnectionModes = ['ignore', 'prompt'];
9
+ export const botTriggerLimits = { triggers: 20, pattern: 500, instruction: 2000 };
10
+ const optionalText = (max) => z.string().max(max).nullish().transform(value => value?.trim() || null);
11
+ export const botTriggerInputSchema = z.object({
12
+ id: z.uuid().optional().describe('An existing trigger of this bot to keep its id; omitted for a new trigger.'),
13
+ type: botTriggerTypeSchema.describe('`message`: the pattern matches the text of a public channel message (Slack writes member mentions as `<@U…>`). `reaction`: the pattern matches a reaction name, without colons.'),
14
+ pattern: z.string().min(1).max(botTriggerLimits.pattern),
15
+ channelNamePattern: optionalText(botTriggerLimits.pattern).describe('Restricts the trigger to public channels whose name, without `#`, matches this RE2 pattern. Null or empty: every channel the bot is in.'),
16
+ instruction: optionalText(botTriggerLimits.instruction).describe('Sent to the agent as `gatilho.instrucao` of the request context. Null or empty: none.'),
17
+ ifNotConnected: z.enum(botTriggerConnectionModes).default('ignore').describe('A member without a connected Tela account: `ignore` drops the event without any message; `prompt` posts the usual connection card.'),
18
+ });
19
+ export const botTriggerSchema = z.object({
20
+ id: z.uuid(),
21
+ type: botTriggerTypeSchema,
22
+ pattern: z.string(),
23
+ channelNamePattern: z.string().nullable(),
24
+ instruction: z.string().nullable(),
25
+ ifNotConnected: z.enum(botTriggerConnectionModes),
26
+ });
27
+ // The whole ordered list replaces the bot's triggers; the first trigger that matches an event is the one that runs.
28
+ export const botTriggersChangeSchema = botTargetSchema.extend({
29
+ triggers: z.array(botTriggerInputSchema).max(botTriggerLimits.triggers).refine((triggers) => {
30
+ const ids = triggers.flatMap(trigger => trigger.id ? [trigger.id] : []);
31
+ return new Set(ids).size === ids.length;
32
+ }, 'Trigger ids must be unique'),
33
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.14.0-rc.9",
3
+ "version": "4.14.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {