@meistrari/chat-nuxt 4.14.0-rc.7 → 4.14.0-rc.9
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 +1 -1
- package/dist/runtime/conversations/components/chat-conversation-list.vue +1 -1
- package/dist/runtime/messages/components/chat-message-input.vue +9 -12
- package/dist/runtime/messages/components/chat-model-selector.d.vue.ts +6 -0
- package/dist/runtime/messages/components/chat-model-selector.vue +27 -21
- package/dist/runtime/messages/components/chat-model-selector.vue.d.ts +6 -0
- package/dist/runtime/messages/components/chat-reasoning-selector.vue +51 -0
- package/dist/runtime/types/schemas/slack/apps.d.ts +58 -0
- package/dist/runtime/types/schemas/slack/apps.js +11 -3
- package/package.json +2 -2
- package/dist/runtime/messages/components/chat-reasoning-effort-selector.vue +0 -168
- /package/dist/runtime/messages/components/{chat-reasoning-effort-selector.d.vue.ts → chat-reasoning-selector.d.vue.ts} +0 -0
- /package/dist/runtime/messages/components/{chat-reasoning-effort-selector.vue.d.ts → chat-reasoning-selector.vue.d.ts} +0 -0
package/dist/module.json
CHANGED
|
@@ -695,11 +695,6 @@ defineExpose({
|
|
|
695
695
|
@change="handleFileSelect"
|
|
696
696
|
>
|
|
697
697
|
|
|
698
|
-
<!-- Deliberately NOT position:relative — TelaChatBody pins
|
|
699
|
-
[data-chat-prompt-input] with absolute left-0 right-0 against
|
|
700
|
-
its nearest positioned ancestor; a positioned wrapper here
|
|
701
|
-
would shrink the input. The dropdown positions itself fixed
|
|
702
|
-
from the caret rect, so it needs no relative ancestor. -->
|
|
703
698
|
<AnimatePresence mode="popLayout" :initial="false">
|
|
704
699
|
<TelaChatAnimateEnter v-if="showStopRun" key="stop-run">
|
|
705
700
|
<TelaChatStopRunButton
|
|
@@ -840,17 +835,19 @@ defineExpose({
|
|
|
840
835
|
@select="emit('selectExecutionProfile', $event)"
|
|
841
836
|
@click.stop
|
|
842
837
|
/>
|
|
843
|
-
<ChatReasoningEffortSelector
|
|
844
|
-
v-if="!hideReasoningEffortSelector"
|
|
845
|
-
v-model="selectedReasoningEffort"
|
|
846
|
-
:disabled="isLocked"
|
|
847
|
-
@click.stop
|
|
848
|
-
/>
|
|
849
838
|
<ChatModelSelector
|
|
850
839
|
v-if="!hideModelSelector"
|
|
851
840
|
v-model="selectedModel"
|
|
841
|
+
v-model:reasoning="selectedReasoningEffort"
|
|
842
|
+
:hide-reasoning="hideReasoningEffortSelector"
|
|
843
|
+
:disabled="isLocked"
|
|
844
|
+
@click.stop
|
|
845
|
+
/>
|
|
846
|
+
<!-- Model picker hidden, effort choices kept: the effort on its own. -->
|
|
847
|
+
<ChatReasoningSelector
|
|
848
|
+
v-else-if="!hideReasoningEffortSelector"
|
|
849
|
+
v-model="selectedReasoningEffort"
|
|
852
850
|
:disabled="isLocked"
|
|
853
|
-
mr-4px
|
|
854
851
|
@click.stop
|
|
855
852
|
/>
|
|
856
853
|
<TelaChatPromptSubmitButton
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import type { ChatReasoningEffort } from '../../types/schemas/chat/models.js';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
disabled?: boolean;
|
|
4
|
+
/** Hides the Reasoning row and leaves the effort untouched. */
|
|
5
|
+
hideReasoning?: boolean;
|
|
3
6
|
};
|
|
4
7
|
type __VLS_ModelProps = {
|
|
5
8
|
modelValue?: string | null;
|
|
9
|
+
'reasoning'?: ChatReasoningEffort | null;
|
|
6
10
|
};
|
|
7
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
13
|
"update:modelValue": (value: string | null) => any;
|
|
14
|
+
"update:reasoning": (value: any) => any;
|
|
10
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
16
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
17
|
+
"onUpdate:reasoning"?: ((value: any) => any) | undefined;
|
|
12
18
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
19
|
declare const _default: typeof __VLS_export;
|
|
14
20
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { chatReasoningEffortOptions } from "../../types/schemas/chat/ui.js";
|
|
3
3
|
import { useEmbedConfig } from "../../embed/composables/embed-config";
|
|
4
4
|
import { useChatModelCatalog } from "../composables/chat-model-catalog";
|
|
5
5
|
import { useChatRequestContext } from "../../shared/composables/chat-request-context";
|
|
@@ -8,11 +8,23 @@ import { buildChatModelOptions } from "../../lightweight/messages/model-options"
|
|
|
8
8
|
import { resolveAvailableChatModels } from "../model-availability";
|
|
9
9
|
import TelaChatIconsAnthropic from "@meistrari/tela-build/components/tela/chat/icons/anthropic.vue";
|
|
10
10
|
import TelaChatIconsGemini from "@meistrari/tela-build/components/tela/chat/icons/gemini.vue";
|
|
11
|
+
import TelaChatIconsGrok from "@meistrari/tela-build/components/tela/chat/icons/grok.vue";
|
|
12
|
+
import TelaChatIconsKimi from "@meistrari/tela-build/components/tela/chat/icons/kimi.vue";
|
|
11
13
|
import TelaChatIconsOpenai from "@meistrari/tela-build/components/tela/chat/icons/openai.vue";
|
|
12
|
-
defineProps({
|
|
13
|
-
disabled: { type: Boolean, required: false }
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
disabled: { type: Boolean, required: false },
|
|
16
|
+
hideReasoning: { type: Boolean, required: false }
|
|
14
17
|
});
|
|
15
18
|
const model = defineModel({ type: [String, null], ...{ default: null } });
|
|
19
|
+
const reasoning = defineModel("reasoning", { type: null, ...{ default: null } });
|
|
20
|
+
const reasoningOptions = computed(() => props.hideReasoning ? [] : chatReasoningEffortOptions.map((option) => ({ value: option.value, label: option.label })));
|
|
21
|
+
const boundReasoning = computed({
|
|
22
|
+
get: () => props.hideReasoning ? null : reasoning.value,
|
|
23
|
+
set: (value) => {
|
|
24
|
+
if (!props.hideReasoning)
|
|
25
|
+
reasoning.value = value;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
16
28
|
const embedConfig = useEmbedConfig();
|
|
17
29
|
const isLightweight = useChatRequestContext()?.harness?.value === "lightweight";
|
|
18
30
|
const lightweightCatalog = isLightweight ? useLightweightModelCatalog() : null;
|
|
@@ -21,20 +33,15 @@ const activeCatalog = lightweightCatalog ?? catalog;
|
|
|
21
33
|
const providerIcons = {
|
|
22
34
|
Anthropic: TelaChatIconsAnthropic,
|
|
23
35
|
OpenAI: TelaChatIconsOpenai,
|
|
24
|
-
Google: TelaChatIconsGemini
|
|
36
|
+
Google: TelaChatIconsGemini,
|
|
37
|
+
MoonshotAI: TelaChatIconsKimi,
|
|
38
|
+
xAI: TelaChatIconsGrok
|
|
25
39
|
};
|
|
26
40
|
function toOption(entry) {
|
|
27
41
|
return {
|
|
28
42
|
value: entry.id,
|
|
29
43
|
label: entry.label,
|
|
30
|
-
|
|
31
|
-
group: entry.provider,
|
|
32
|
-
icon: providerIcons[entry.provider],
|
|
33
|
-
cost: entry.cost,
|
|
34
|
-
maxInputTokens: entry.maxInputTokens,
|
|
35
|
-
maxOutputTokens: entry.maxOutputTokens ?? void 0,
|
|
36
|
-
isMultiModal: entry.isMultiModal,
|
|
37
|
-
tabs: chatModelTabs(entry)
|
|
44
|
+
icon: providerIcons[entry.provider]
|
|
38
45
|
};
|
|
39
46
|
}
|
|
40
47
|
const options = computed(() => {
|
|
@@ -52,15 +59,9 @@ const options = computed(() => {
|
|
|
52
59
|
const optionIds = model.value && !availableModels.includes(model.value) ? [model.value, ...availableModels] : availableModels;
|
|
53
60
|
return optionIds.map((id) => {
|
|
54
61
|
const entry = catalog.models.value.find((candidate) => candidate.id === id);
|
|
55
|
-
return entry ? toOption(entry) : { value: id, label: id
|
|
62
|
+
return entry ? toOption(entry) : { value: id, label: id };
|
|
56
63
|
});
|
|
57
64
|
});
|
|
58
|
-
const tabLabels = {
|
|
59
|
-
all: "Todos",
|
|
60
|
-
advanced: "Avan\xE7ados",
|
|
61
|
-
cheap: "Econ\xF4micos",
|
|
62
|
-
multimodal: "Multimodal"
|
|
63
|
-
};
|
|
64
65
|
watch(activeCatalog.scopeKey, () => {
|
|
65
66
|
void activeCatalog.load();
|
|
66
67
|
}, { immediate: true });
|
|
@@ -69,10 +70,15 @@ watch(activeCatalog.scopeKey, () => {
|
|
|
69
70
|
<template>
|
|
70
71
|
<TelaChatModelSelector
|
|
71
72
|
v-model="model"
|
|
73
|
+
v-model:reasoning="boundReasoning"
|
|
74
|
+
data-testid="chat-model-selector"
|
|
72
75
|
:options="options"
|
|
76
|
+
:reasoning-options="reasoningOptions"
|
|
73
77
|
:disabled="disabled || options.length === 0"
|
|
74
78
|
placeholder="Modelo"
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
label-model="Modelo"
|
|
80
|
+
label-reasoning="Raciocínio"
|
|
81
|
+
label-reasoning-default="Padrão"
|
|
82
|
+
label-use-default="Usar padrão do agente"
|
|
77
83
|
/>
|
|
78
84
|
</template>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import type { ChatReasoningEffort } from '../../types/schemas/chat/models.js';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
disabled?: boolean;
|
|
4
|
+
/** Hides the Reasoning row and leaves the effort untouched. */
|
|
5
|
+
hideReasoning?: boolean;
|
|
3
6
|
};
|
|
4
7
|
type __VLS_ModelProps = {
|
|
5
8
|
modelValue?: string | null;
|
|
9
|
+
'reasoning'?: ChatReasoningEffort | null;
|
|
6
10
|
};
|
|
7
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
13
|
"update:modelValue": (value: string | null) => any;
|
|
14
|
+
"update:reasoning": (value: any) => any;
|
|
10
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
16
|
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
17
|
+
"onUpdate:reasoning"?: ((value: any) => any) | undefined;
|
|
12
18
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
19
|
declare const _default: typeof __VLS_export;
|
|
14
20
|
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { chatReasoningEffortOptions } from "../../types/schemas/chat/ui.js";
|
|
3
|
+
defineProps({
|
|
4
|
+
disabled: { type: Boolean, required: false }
|
|
5
|
+
});
|
|
6
|
+
const effort = defineModel({ type: null, ...{ default: null } });
|
|
7
|
+
const DEFAULT_LABEL = "Racioc\xEDnio";
|
|
8
|
+
const selected = computed(() => chatReasoningEffortOptions.find((option) => option.value === effort.value) ?? null);
|
|
9
|
+
const APPLY_DELAY_MS = 120;
|
|
10
|
+
function choose(value) {
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
effort.value = value;
|
|
13
|
+
}, APPLY_DELAY_MS);
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<TelaMenubarRoot class="flex" data-testid="chat-reasoning-selector">
|
|
19
|
+
<TelaMenubarMenu>
|
|
20
|
+
<TelaMenubarTrigger
|
|
21
|
+
:disabled="disabled"
|
|
22
|
+
:aria-label="`Racioc\xEDnio: ${selected?.label ?? 'Padr\xE3o do agente'}`"
|
|
23
|
+
class="group gap-6px rounded-8px py-7px pl-10px pr-8px duration-80 data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
24
|
+
>
|
|
25
|
+
<span class="whitespace-nowrap body-14-medium text-primary group-data-[state=open]:text-secondary">{{ selected?.label ?? DEFAULT_LABEL }}</span>
|
|
26
|
+
<TelaIcon
|
|
27
|
+
name="i-ph-caret-down"
|
|
28
|
+
size="15px"
|
|
29
|
+
color="icon-tertiary"
|
|
30
|
+
class="shrink-0 transition-transform ease-out duration-150 group-data-[state=open]:rotate-180"
|
|
31
|
+
/>
|
|
32
|
+
</TelaMenubarTrigger>
|
|
33
|
+
|
|
34
|
+
<TelaMenubarContent side="top" align="end" :side-offset="6" class="!min-w-200px w-200px z-999">
|
|
35
|
+
<TelaMenubarItem
|
|
36
|
+
v-for="option in chatReasoningEffortOptions"
|
|
37
|
+
:key="option.value"
|
|
38
|
+
class="gap-8px px-8px py-7px"
|
|
39
|
+
@select="choose(option.value)"
|
|
40
|
+
>
|
|
41
|
+
<span class="min-w-0 flex-1 truncate">{{ option.label }}</span>
|
|
42
|
+
<TelaIcon v-if="option.value === effort" name="i-ph-check" size="14px" class="shrink-0 text-gray-400" />
|
|
43
|
+
</TelaMenubarItem>
|
|
44
|
+
<TelaMenubarSeparator class="mx-0 my-4px" />
|
|
45
|
+
<TelaMenubarItem class="gap-8px px-8px py-7px" :disabled="effort === null" @select="choose(null)">
|
|
46
|
+
<span class="min-w-0 flex-1 truncate">Usar padrão do agente</span>
|
|
47
|
+
</TelaMenubarItem>
|
|
48
|
+
</TelaMenubarContent>
|
|
49
|
+
</TelaMenubarMenu>
|
|
50
|
+
</TelaMenubarRoot>
|
|
51
|
+
</template>
|
|
@@ -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, 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`).');
|
|
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', [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/chat-nuxt",
|
|
3
|
-
"version": "4.14.0-rc.
|
|
3
|
+
"version": "4.14.0-rc.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@meistrari/auth-nuxt": "3.31.0",
|
|
55
55
|
"@meistrari/chat-ui-lang": "0.8.1",
|
|
56
56
|
"@meistrari/logger": "^2.1.3",
|
|
57
|
-
"@meistrari/tela-build": "^1.
|
|
57
|
+
"@meistrari/tela-build": "^1.106.0",
|
|
58
58
|
"@openuidev/lang-core": "1.0.0",
|
|
59
59
|
"@sentry/nuxt": "^10.0.0",
|
|
60
60
|
"@vueuse/components": "^12.8.0",
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { chatReasoningEffortOptions } from "../../types/schemas/chat/ui.js";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
disabled: { type: Boolean, required: false }
|
|
5
|
-
});
|
|
6
|
-
const effort = defineModel({ type: null, ...{ default: null } });
|
|
7
|
-
const DEFAULT_LABEL = "Racioc\xEDnio";
|
|
8
|
-
const AGENT_DEFAULT_LABEL = "Padr\xE3o do agente";
|
|
9
|
-
const AGENT_DEFAULT_DESCRIPTION = "Usa o esfor\xE7o configurado no agente";
|
|
10
|
-
const options = chatReasoningEffortOptions;
|
|
11
|
-
const lastIndex = options.length - 1;
|
|
12
|
-
const open = ref(false);
|
|
13
|
-
const trackRef = ref(null);
|
|
14
|
-
const dragging = ref(false);
|
|
15
|
-
const selectedIndex = computed(() => effort.value ? options.findIndex((option) => option.value === effort.value) : -1);
|
|
16
|
-
const selectedOption = computed(() => selectedIndex.value >= 0 ? options[selectedIndex.value] : null);
|
|
17
|
-
const triggerLabel = computed(() => selectedOption.value?.label ?? DEFAULT_LABEL);
|
|
18
|
-
const fillPercent = computed(() => selectedIndex.value < 0 ? 0 : stopPercent(selectedIndex.value));
|
|
19
|
-
function stopPercent(index) {
|
|
20
|
-
return index / lastIndex * 100;
|
|
21
|
-
}
|
|
22
|
-
function select(index) {
|
|
23
|
-
if (props.disabled)
|
|
24
|
-
return;
|
|
25
|
-
const clamped = Math.min(Math.max(index, 0), lastIndex);
|
|
26
|
-
effort.value = options[clamped].value;
|
|
27
|
-
}
|
|
28
|
-
function reset() {
|
|
29
|
-
effort.value = null;
|
|
30
|
-
open.value = false;
|
|
31
|
-
}
|
|
32
|
-
function indexFromPointer(event) {
|
|
33
|
-
const rect = trackRef.value?.getBoundingClientRect();
|
|
34
|
-
if (!rect || rect.width === 0)
|
|
35
|
-
return null;
|
|
36
|
-
const ratio = (event.clientX - rect.left) / rect.width;
|
|
37
|
-
return Math.round(Math.min(Math.max(ratio, 0), 1) * lastIndex);
|
|
38
|
-
}
|
|
39
|
-
function onPointerDown(event) {
|
|
40
|
-
if (props.disabled || event.button !== 0)
|
|
41
|
-
return;
|
|
42
|
-
const index = indexFromPointer(event);
|
|
43
|
-
if (index === null)
|
|
44
|
-
return;
|
|
45
|
-
dragging.value = true;
|
|
46
|
-
trackRef.value?.setPointerCapture(event.pointerId);
|
|
47
|
-
trackRef.value?.focus();
|
|
48
|
-
select(index);
|
|
49
|
-
}
|
|
50
|
-
function onPointerMove(event) {
|
|
51
|
-
if (!dragging.value)
|
|
52
|
-
return;
|
|
53
|
-
const index = indexFromPointer(event);
|
|
54
|
-
if (index !== null && index !== selectedIndex.value)
|
|
55
|
-
select(index);
|
|
56
|
-
}
|
|
57
|
-
function onPointerUp(event) {
|
|
58
|
-
if (!dragging.value)
|
|
59
|
-
return;
|
|
60
|
-
dragging.value = false;
|
|
61
|
-
if (trackRef.value?.hasPointerCapture(event.pointerId))
|
|
62
|
-
trackRef.value.releasePointerCapture(event.pointerId);
|
|
63
|
-
}
|
|
64
|
-
function onKeydown(event) {
|
|
65
|
-
const current = selectedIndex.value < 0 ? Math.floor(lastIndex / 2) : selectedIndex.value;
|
|
66
|
-
const steps = {
|
|
67
|
-
ArrowRight: selectedIndex.value < 0 ? current : current + 1,
|
|
68
|
-
ArrowUp: selectedIndex.value < 0 ? current : current + 1,
|
|
69
|
-
ArrowLeft: selectedIndex.value < 0 ? current : current - 1,
|
|
70
|
-
ArrowDown: selectedIndex.value < 0 ? current : current - 1,
|
|
71
|
-
Home: 0,
|
|
72
|
-
End: lastIndex
|
|
73
|
-
};
|
|
74
|
-
const next = steps[event.key];
|
|
75
|
-
if (next === void 0)
|
|
76
|
-
return;
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
select(next);
|
|
79
|
-
}
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<template>
|
|
83
|
-
<TelaPopover v-model:open="open">
|
|
84
|
-
<TelaPopoverTrigger as-child>
|
|
85
|
-
<button
|
|
86
|
-
type="button"
|
|
87
|
-
class="group pl-10px pr-8px py-7px rounded-8px flex items-center gap-6px duration-80 text-primary hover:bg-muted data-[state=open]:text-secondary data-[state=open]:bg-muted"
|
|
88
|
-
:disabled="disabled"
|
|
89
|
-
:aria-label="`Esfor\xE7o de racioc\xEDnio: ${selectedOption?.label ?? AGENT_DEFAULT_LABEL}`"
|
|
90
|
-
>
|
|
91
|
-
<span body-14-medium whitespace-nowrap>{{ triggerLabel }}</span>
|
|
92
|
-
<TelaIcon
|
|
93
|
-
name="i-ph-caret-down-bold"
|
|
94
|
-
size="15px"
|
|
95
|
-
color="icon-tertiary"
|
|
96
|
-
class="shrink-0 transition-transform ease-out duration-150 group-data-[state=open]:rotate-180"
|
|
97
|
-
/>
|
|
98
|
-
</button>
|
|
99
|
-
</TelaPopoverTrigger>
|
|
100
|
-
<TelaPopoverContent
|
|
101
|
-
side="top"
|
|
102
|
-
align="end"
|
|
103
|
-
:side-offset="3"
|
|
104
|
-
class="popover-enter-exit origin-[var(--reka-popover-content-transform-origin)] w-260px p-16px rounded-12px! bg border-0.5px! border! [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]!"
|
|
105
|
-
>
|
|
106
|
-
<div flex="~ col" gap-16px>
|
|
107
|
-
<div flex="~ col" items-center gap-2px text-center>
|
|
108
|
-
<span body-14-semibold text-primary>{{ selectedOption?.label ?? AGENT_DEFAULT_LABEL }}</span>
|
|
109
|
-
<span body-12-regular text-secondary>{{ selectedOption?.description ?? AGENT_DEFAULT_DESCRIPTION }}</span>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<div
|
|
113
|
-
ref="trackRef"
|
|
114
|
-
class="effort-track"
|
|
115
|
-
:class="{ 'effort-track--disabled': disabled }"
|
|
116
|
-
role="slider"
|
|
117
|
-
:tabindex="disabled ? -1 : 0"
|
|
118
|
-
aria-valuemin="0"
|
|
119
|
-
:aria-valuemax="lastIndex"
|
|
120
|
-
:aria-valuenow="selectedIndex < 0 ? void 0 : selectedIndex"
|
|
121
|
-
:aria-valuetext="selectedOption?.label ?? AGENT_DEFAULT_LABEL"
|
|
122
|
-
:aria-disabled="disabled || void 0"
|
|
123
|
-
@pointerdown="onPointerDown"
|
|
124
|
-
@pointermove="onPointerMove"
|
|
125
|
-
@pointerup="onPointerUp"
|
|
126
|
-
@pointercancel="onPointerUp"
|
|
127
|
-
@keydown="onKeydown"
|
|
128
|
-
>
|
|
129
|
-
<div class="effort-track-rail bg-muted">
|
|
130
|
-
<div class="effort-track-fill bg-neutral-800" :style="{ width: `${fillPercent}%` }" />
|
|
131
|
-
<span
|
|
132
|
-
v-for="(option, index) in options"
|
|
133
|
-
:key="option.value"
|
|
134
|
-
class="effort-stop"
|
|
135
|
-
:class="index <= selectedIndex ? 'bg-white' : 'bg-neutral-300'"
|
|
136
|
-
:style="{ left: `${stopPercent(index)}%` }"
|
|
137
|
-
:title="option.label"
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
<div
|
|
141
|
-
v-if="selectedIndex >= 0"
|
|
142
|
-
class="effort-thumb bg border-0.5px border-strong"
|
|
143
|
-
:class="{ 'effort-thumb--dragging': dragging }"
|
|
144
|
-
:style="{ left: `${fillPercent}%` }"
|
|
145
|
-
/>
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
<div flex items-center justify-between>
|
|
149
|
-
<span body-12-regular text-tertiary>{{ options[0].label }}</span>
|
|
150
|
-
<button
|
|
151
|
-
v-if="effort"
|
|
152
|
-
type="button"
|
|
153
|
-
class="effort-reset text-secondary hover:text-primary"
|
|
154
|
-
body-12-medium
|
|
155
|
-
@click="reset"
|
|
156
|
-
>
|
|
157
|
-
Usar padrão do agente
|
|
158
|
-
</button>
|
|
159
|
-
<span body-12-regular text-tertiary>{{ options[lastIndex].label }}</span>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</TelaPopoverContent>
|
|
163
|
-
</TelaPopover>
|
|
164
|
-
</template>
|
|
165
|
-
|
|
166
|
-
<style scoped>
|
|
167
|
-
.effort-trigger{align-items:center;background:transparent;border:none;border-radius:8px;cursor:pointer;display:inline-flex;gap:6px;height:32px;padding:0 8px 0 10px;transition:background-color 80ms ease}.effort-trigger:disabled{opacity:.5;pointer-events:none}.effort-trigger:focus-visible{outline:2px solid rgba(85,91,98,.35);outline-offset:1px}.effort-trigger-caret{height:12px;width:12px}.effort-track{cursor:pointer;height:28px;margin:0 10px;outline:none;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.effort-track--disabled{cursor:not-allowed;opacity:.5}.effort-track:focus-visible .effort-track-rail{box-shadow:0 0 0 2px rgba(85,91,98,.35)}.effort-track-rail{height:6px;left:0;right:0;top:50%;transform:translateY(-50%);transition:box-shadow .12s ease}.effort-track-fill,.effort-track-rail{border-radius:9999px;position:absolute}.effort-track-fill{inset:0 auto 0 0;transition:width .12s cubic-bezier(.2,.8,.2,1)}.effort-stop{height:4px;transition:background-color .12s ease;width:4px}.effort-stop,.effort-thumb{border-radius:9999px;position:absolute;top:50%;transform:translate(-50%,-50%)}.effort-thumb{box-shadow:0 1px 2px rgba(0,0,0,.12),0 2px 6px rgba(0,0,0,.08);height:20px;pointer-events:none;transition:left .12s cubic-bezier(.2,.8,.2,1),transform .12s ease;width:20px}.effort-thumb--dragging{transform:translate(-50%,-50%) scale(1.08)}.effort-reset{background:transparent;border:none;cursor:pointer;padding:0;transition:color .12s ease}
|
|
168
|
-
</style>
|
|
File without changes
|