@meistrari/chat-nuxt 3.4.0 → 3.6.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.d.mts +2 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/conversations/components/chat-conversation-list.d.vue.ts +1 -0
- package/dist/runtime/conversations/components/chat-conversation-list.vue +3 -2
- package/dist/runtime/conversations/components/chat-conversation-list.vue.d.ts +1 -0
- package/dist/runtime/conversations/composables/conversations.d.ts +2 -4
- package/dist/runtime/conversations/composables/conversations.js +5 -1
- package/dist/runtime/embed/components/chat-embed-inner.d.vue.ts +2 -0
- package/dist/runtime/embed/components/chat-embed-inner.vue +39 -9
- package/dist/runtime/embed/components/chat-embed-inner.vue.d.ts +2 -0
- package/dist/runtime/embed/components/chat-embed.d.vue.ts +3 -0
- package/dist/runtime/embed/components/chat-embed.vue +7 -1
- package/dist/runtime/embed/components/chat-embed.vue.d.ts +3 -0
- package/dist/runtime/embed/components/meistrari-chat-embed.d.vue.ts +7 -1
- package/dist/runtime/embed/components/meistrari-chat-embed.vue +6 -1
- package/dist/runtime/embed/components/meistrari-chat-embed.vue.d.ts +7 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.d.vue.ts +1 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue +2 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-drawer.vue.d.ts +1 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +4 -1
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue +6 -0
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +4 -1
- package/dist/runtime/embed/composables/tela-agent-metadata.d.ts +2 -2
- package/dist/runtime/embed/types.d.ts +2 -0
- package/dist/runtime/messages/components/chat-message-input.d.vue.ts +3 -1
- package/dist/runtime/messages/components/chat-message-input.vue +27 -0
- package/dist/runtime/messages/components/chat-message-input.vue.d.ts +3 -1
- package/dist/runtime/messages/composables/chat-message-terminal.d.ts +17 -0
- package/dist/runtime/messages/composables/chat-message-terminal.js +42 -0
- package/dist/runtime/messages/composables/chat.d.ts +3 -0
- package/dist/runtime/messages/composables/chat.js +9 -4
- package/dist/runtime/messages/composables/mention-autocomplete.js +8 -2
- package/dist/runtime/types/embed.d.ts +3 -0
- package/dist/runtime/types/embed.js +1 -0
- package/dist/runtime/types/schemas/chat/conversations.d.ts +27 -0
- package/dist/runtime/types/schemas/chat/conversations.js +7 -0
- package/dist/runtime/types/schemas/chat/files.d.ts +3 -3
- package/dist/runtime/types/schemas/chat/messages.d.ts +31 -0
- package/dist/runtime/types/schemas/chat/messages.js +24 -0
- package/dist/runtime/types/schemas/chat/ui.d.ts +11 -1
- package/dist/runtime/types/schemas/chat/ui.js +3 -0
- package/dist/runtime/types/schemas/chat/usage.d.ts +1 -1
- package/dist/runtime/types/schemas/chat/workspace-agent.d.ts +14 -0
- package/dist/runtime/types/schemas/chat/workspace-agent.js +7 -0
- package/dist/runtime/types/schemas/integrations/agent-api.d.ts +1 -1
- package/dist/runtime/types/schemas/integrations/tela-agent-api.d.ts +68 -6
- package/dist/runtime/types/schemas/integrations/tela-agent-api.js +18 -0
- package/dist/runtime/workspace/composables/workspace-agent-summary.d.ts +6 -0
- package/dist/runtime/workspace/composables/workspace-agent-summary.js +54 -0
- package/dist/types.d.mts +3 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import type { DeepReadonly } from 'vue';
|
|
|
2
2
|
import type { Message } from '../../types/schemas/chat/conversations.js';
|
|
3
3
|
import type { ConversationFile } from '../../types/schemas/chat/files.js';
|
|
4
4
|
import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../types/schemas/chat/workspace-settings.js';
|
|
5
|
-
import type { TelaAgentInputVariable } from '../../types/schemas/integrations/tela-agent-api.js';
|
|
5
|
+
import type { TelaAgentContextFile, TelaAgentInputVariable, TelaAgentSkill } from '../../types/schemas/integrations/tela-agent-api.js';
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
loading?: boolean;
|
|
@@ -16,6 +16,8 @@ type __VLS_Props = {
|
|
|
16
16
|
workspaceSettings?: DeepReadonly<WorkspaceSettings> | null;
|
|
17
17
|
agentInputSchema?: readonly TelaAgentInputVariable[] | null;
|
|
18
18
|
agentInputSchemaLoading?: boolean;
|
|
19
|
+
agentSkills?: readonly TelaAgentSkill[] | null;
|
|
20
|
+
agentContextFiles?: readonly TelaAgentContextFile[] | null;
|
|
19
21
|
showCancelButton?: boolean;
|
|
20
22
|
};
|
|
21
23
|
declare function addFiles(files: File[], inputName?: string): void;
|
|
@@ -19,6 +19,8 @@ const props = defineProps({
|
|
|
19
19
|
workspaceSettings: { type: null, required: false },
|
|
20
20
|
agentInputSchema: { type: [Array, null], required: false },
|
|
21
21
|
agentInputSchemaLoading: { type: Boolean, required: false },
|
|
22
|
+
agentSkills: { type: [Array, null], required: false },
|
|
23
|
+
agentContextFiles: { type: [Array, null], required: false },
|
|
22
24
|
showCancelButton: { type: Boolean, required: false }
|
|
23
25
|
});
|
|
24
26
|
const emit = defineEmits(["send", "cancel"]);
|
|
@@ -84,10 +86,35 @@ const fileItems = computed(() => {
|
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
89
|
+
if (props.agentContextFiles) {
|
|
90
|
+
for (const f of props.agentContextFiles) {
|
|
91
|
+
if (!items.some((i) => i.id === f.path)) {
|
|
92
|
+
items.push({
|
|
93
|
+
id: f.path,
|
|
94
|
+
label: f.name,
|
|
95
|
+
description: "Contexto do agente",
|
|
96
|
+
icon: getMimeIcon(),
|
|
97
|
+
category: "file",
|
|
98
|
+
idKind: "path"
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
87
103
|
return items;
|
|
88
104
|
});
|
|
89
105
|
const skillItems = computed(() => {
|
|
90
106
|
const items = [];
|
|
107
|
+
if (props.agentSkills) {
|
|
108
|
+
for (const s of props.agentSkills) {
|
|
109
|
+
items.push({
|
|
110
|
+
id: s.path,
|
|
111
|
+
label: s.name,
|
|
112
|
+
description: s.description,
|
|
113
|
+
icon: "i-ph-lightning",
|
|
114
|
+
category: "skill"
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
91
118
|
if (props.workspaceSettings?.externalSkills) {
|
|
92
119
|
for (const s of props.workspaceSettings.externalSkills) {
|
|
93
120
|
items.push({
|
|
@@ -2,7 +2,7 @@ import type { DeepReadonly } from 'vue';
|
|
|
2
2
|
import type { Message } from '../../types/schemas/chat/conversations.js';
|
|
3
3
|
import type { ConversationFile } from '../../types/schemas/chat/files.js';
|
|
4
4
|
import type { WorkspaceSettingsResponse as WorkspaceSettings } from '../../types/schemas/chat/workspace-settings.js';
|
|
5
|
-
import type { TelaAgentInputVariable } from '../../types/schemas/integrations/tela-agent-api.js';
|
|
5
|
+
import type { TelaAgentContextFile, TelaAgentInputVariable, TelaAgentSkill } from '../../types/schemas/integrations/tela-agent-api.js';
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
loading?: boolean;
|
|
@@ -16,6 +16,8 @@ type __VLS_Props = {
|
|
|
16
16
|
workspaceSettings?: DeepReadonly<WorkspaceSettings> | null;
|
|
17
17
|
agentInputSchema?: readonly TelaAgentInputVariable[] | null;
|
|
18
18
|
agentInputSchemaLoading?: boolean;
|
|
19
|
+
agentSkills?: readonly TelaAgentSkill[] | null;
|
|
20
|
+
agentContextFiles?: readonly TelaAgentContextFile[] | null;
|
|
19
21
|
showCancelButton?: boolean;
|
|
20
22
|
};
|
|
21
23
|
declare function addFiles(files: File[], inputName?: string): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Message } from '../../types/schemas/chat/conversations.js';
|
|
2
|
+
export declare enum ChatMessageStatus {
|
|
3
|
+
Pending = "pending",
|
|
4
|
+
Completed = "completed",
|
|
5
|
+
Failed = "failed"
|
|
6
|
+
}
|
|
7
|
+
export type ChatMessageTerminalPayload = {
|
|
8
|
+
conversationId: string;
|
|
9
|
+
messageId: string;
|
|
10
|
+
status: ChatMessageStatus.Completed | ChatMessageStatus.Failed;
|
|
11
|
+
};
|
|
12
|
+
export type ChatMessageTerminalHandler = (payload: ChatMessageTerminalPayload) => void;
|
|
13
|
+
export declare function terminalMessageTransitions(previousMessages: readonly Message[], nextMessages: readonly Message[]): ChatMessageTerminalPayload[];
|
|
14
|
+
export declare function provideChatMessageTerminal(handler: ChatMessageTerminalHandler): void;
|
|
15
|
+
export declare function useChatMessageTerminal(): {
|
|
16
|
+
emit(payload: ChatMessageTerminalPayload): void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
export var ChatMessageStatus = /* @__PURE__ */ ((ChatMessageStatus2) => {
|
|
3
|
+
ChatMessageStatus2["Pending"] = "pending";
|
|
4
|
+
ChatMessageStatus2["Completed"] = "completed";
|
|
5
|
+
ChatMessageStatus2["Failed"] = "failed";
|
|
6
|
+
return ChatMessageStatus2;
|
|
7
|
+
})(ChatMessageStatus || {});
|
|
8
|
+
const CHAT_MESSAGE_TERMINAL_KEY = Symbol("chat-nuxt:message-terminal");
|
|
9
|
+
export function terminalMessageTransitions(previousMessages, nextMessages) {
|
|
10
|
+
const previousById = new Map(previousMessages.map((message) => [message.id, message]));
|
|
11
|
+
const transitions = [];
|
|
12
|
+
for (const message of nextMessages) {
|
|
13
|
+
const previous = previousById.get(message.id);
|
|
14
|
+
if (message.role !== "assistant" || previous?.status !== "pending" /* Pending */)
|
|
15
|
+
continue;
|
|
16
|
+
if (message.status === "completed" /* Completed */) {
|
|
17
|
+
transitions.push({
|
|
18
|
+
conversationId: message.conversationId,
|
|
19
|
+
messageId: message.id,
|
|
20
|
+
status: "completed" /* Completed */
|
|
21
|
+
});
|
|
22
|
+
} else if (message.status === "failed" /* Failed */) {
|
|
23
|
+
transitions.push({
|
|
24
|
+
conversationId: message.conversationId,
|
|
25
|
+
messageId: message.id,
|
|
26
|
+
status: "failed" /* Failed */
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return transitions;
|
|
31
|
+
}
|
|
32
|
+
export function provideChatMessageTerminal(handler) {
|
|
33
|
+
provide(CHAT_MESSAGE_TERMINAL_KEY, handler);
|
|
34
|
+
}
|
|
35
|
+
export function useChatMessageTerminal() {
|
|
36
|
+
const handler = inject(CHAT_MESSAGE_TERMINAL_KEY, null);
|
|
37
|
+
return {
|
|
38
|
+
emit(payload) {
|
|
39
|
+
handler?.(payload);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { DeepReadonly } from 'vue';
|
|
1
2
|
import type { Conversation, ConversationWithMessages, Message } from '../../types/schemas/chat/conversations.js';
|
|
2
3
|
import type { FileUploadInput } from '../../types/schemas/chat/files.js';
|
|
4
|
+
import type { SendMessageBody } from '../../types/schemas/chat/messages.js';
|
|
3
5
|
import type { TelaAgentExecutionInput } from '../../types/schemas/integrations/tela-agent-api.js';
|
|
6
|
+
export declare function resolveTelaAgentInputs(messageInputs: TelaAgentExecutionInput[] | undefined, configuredInputs: DeepReadonly<TelaAgentExecutionInput[]> | null | undefined): SendMessageBody['agentInputs'];
|
|
4
7
|
export declare function useChat(): {
|
|
5
8
|
currentConversation: any;
|
|
6
9
|
messages: any;
|
|
@@ -21,13 +21,15 @@ import { useChatApi } from "../../shared/composables/chat-api.js";
|
|
|
21
21
|
import { useConversationFileActions } from "../../files/composables/conversation-files.js";
|
|
22
22
|
import { useEmbedConfig } from "../../embed/composables/embed-config.js";
|
|
23
23
|
import { usePolling } from "../../shared/composables/polling.js";
|
|
24
|
+
import { terminalMessageTransitions, useChatMessageTerminal } from "./chat-message-terminal.js";
|
|
24
25
|
const WORKSPACE_AGENT_NOT_READY_TEXT = "O agente deste workspace ainda n\xE3o foi configurado no Tela. Abra as configura\xE7\xF5es do workspace para criar o agente.";
|
|
25
|
-
function resolveTelaAgentInputs(messageInputs, configuredInputs) {
|
|
26
|
-
const inputs = messageInputs ?? configuredInputs
|
|
27
|
-
return inputs
|
|
26
|
+
export function resolveTelaAgentInputs(messageInputs, configuredInputs) {
|
|
27
|
+
const inputs = messageInputs ?? configuredInputs;
|
|
28
|
+
return inputs === void 0 || inputs === null ? void 0 : inputs.map((input) => ({ ...input }));
|
|
28
29
|
}
|
|
29
30
|
export function useChat() {
|
|
30
31
|
const chatApi = useChatApi();
|
|
32
|
+
const chatMessageTerminal = useChatMessageTerminal();
|
|
31
33
|
const embedConfig = useEmbedConfig();
|
|
32
34
|
const { user: authUser, activeOrganization } = useChatAuth();
|
|
33
35
|
const { addFilesToConversation } = useConversationFileActions();
|
|
@@ -80,7 +82,10 @@ export function useChat() {
|
|
|
80
82
|
);
|
|
81
83
|
if (generation !== pollGeneration)
|
|
82
84
|
return;
|
|
85
|
+
const terminalMessages = terminalMessageTransitions(messages.value, response.messages);
|
|
83
86
|
messages.value = response.messages;
|
|
87
|
+
for (const terminalMessage of terminalMessages)
|
|
88
|
+
chatMessageTerminal.emit(terminalMessage);
|
|
84
89
|
if (response.newFiles && response.newFiles.length > 0) {
|
|
85
90
|
const lastAssistantMessage = response.messages.findLast((m) => m.role === "assistant");
|
|
86
91
|
if (lastAssistantMessage) {
|
|
@@ -211,7 +216,7 @@ export function useChat() {
|
|
|
211
216
|
const body = {
|
|
212
217
|
content,
|
|
213
218
|
files,
|
|
214
|
-
...resolvedAgentInputs ? { agentInputs: resolvedAgentInputs } : {}
|
|
219
|
+
...resolvedAgentInputs !== void 0 ? { agentInputs: resolvedAgentInputs } : {}
|
|
215
220
|
};
|
|
216
221
|
const response = await $fetch(
|
|
217
222
|
chatApi.path(`/conversations/${currentConversation.value.id}/messages`),
|
|
@@ -167,6 +167,8 @@ export function useMentionAutocomplete(options) {
|
|
|
167
167
|
span.dataset.mentionId = item.id;
|
|
168
168
|
span.dataset.mentionCategory = item.category;
|
|
169
169
|
span.dataset.mentionLabel = item.label;
|
|
170
|
+
if (item.idKind)
|
|
171
|
+
span.dataset.mentionIdKind = item.idKind;
|
|
170
172
|
if (item.description)
|
|
171
173
|
span.dataset.mentionDescription = item.description;
|
|
172
174
|
if (item.variables)
|
|
@@ -213,10 +215,14 @@ export function useMentionAutocomplete(options) {
|
|
|
213
215
|
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
214
216
|
const el = node;
|
|
215
217
|
if (el.contentEditable === "false" && el.dataset.mentionCategory) {
|
|
216
|
-
const { mentionCategory, mentionId, mentionLabel, mentionDescription } = el.dataset;
|
|
218
|
+
const { mentionCategory, mentionId, mentionLabel, mentionDescription, mentionIdKind } = el.dataset;
|
|
217
219
|
if (mentionCategory === "file") {
|
|
218
|
-
const urlAttr = mentionId ? ` url="${escapeAttr(mentionId)}"` : "";
|
|
219
220
|
accumulated = true;
|
|
221
|
+
if (mentionIdKind === "path") {
|
|
222
|
+
const pathAttr = mentionId ? ` path="${escapeAttr(mentionId)}"` : "";
|
|
223
|
+
return `<file_mention name="${escapeAttr(mentionLabel ?? "")}"${pathAttr}>Este arquivo est\xE1 no seu reposit\xF3rio de trabalho. Leia-o pelo caminho e foque nele na sua resposta.</file_mention>`;
|
|
224
|
+
}
|
|
225
|
+
const urlAttr = mentionId ? ` url="${escapeAttr(mentionId)}"` : "";
|
|
220
226
|
return `<file_mention name="${escapeAttr(mentionLabel ?? "")}"${urlAttr}>Foque neste arquivo espec\xEDfico na sua resposta.</file_mention>`;
|
|
221
227
|
}
|
|
222
228
|
if (mentionCategory === "canvas") {
|
|
@@ -2,4 +2,7 @@ export type { ChatFeatureConfig } from '../embed/feature-config.js';
|
|
|
2
2
|
export type { ChatActor, ChatEmbedSharedProps, ChatSidebarConfig, DefaultChatEmbedProps, MeistrariChatEmbedProps, TelaAgentChatEmbedProps, } from '../embed/types.js';
|
|
3
3
|
export type { ChatActionPayload } from '../messages/composables/chat-action.js';
|
|
4
4
|
export type { MessageFeedbackConfig, MessageFeedbackPayload, MessageFeedbackRating, } from '../messages/composables/chat-feedback.js';
|
|
5
|
+
export { ChatMessageStatus } from '../messages/composables/chat-message-terminal.js';
|
|
6
|
+
export type { ChatMessageTerminalPayload } from '../messages/composables/chat-message-terminal.js';
|
|
7
|
+
export type { MessageOverviewResponse } from './schemas/chat/messages.js';
|
|
5
8
|
export type { TelaAgentExecutionInput } from './schemas/integrations/tela-agent-api.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ChatMessageStatus } from "../messages/composables/chat-message-terminal.js";
|
|
@@ -215,8 +215,35 @@ export declare const createConversationRequestSchema: z.ZodObject<{
|
|
|
215
215
|
"claude-sonnet-5": "claude-sonnet-5";
|
|
216
216
|
"claude-haiku-4-5": "claude-haiku-4-5";
|
|
217
217
|
}>>>;
|
|
218
|
+
agentInputs: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
|
+
type: z.ZodLiteral<"file">;
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
vaultRef: z.ZodString;
|
|
222
|
+
filename: z.ZodString;
|
|
223
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
224
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
225
|
+
type: z.ZodLiteral<"text">;
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
content: z.ZodString;
|
|
228
|
+
}, z.core.$strip>], "type">>>;
|
|
218
229
|
}, z.core.$strict>;
|
|
219
230
|
export type CreateConversationRequest = z.infer<typeof createConversationRequestSchema>;
|
|
231
|
+
export declare const conversationAgentInputsResponseSchema: z.ZodObject<{
|
|
232
|
+
agentInputs: z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"file">;
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
vaultRef: z.ZodString;
|
|
236
|
+
filename: z.ZodString;
|
|
237
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
type: z.ZodLiteral<"text">;
|
|
240
|
+
name: z.ZodString;
|
|
241
|
+
content: z.ZodString;
|
|
242
|
+
}, z.core.$strip>], "type">>>;
|
|
243
|
+
configuredAt: z.ZodNullable<z.ZodDate>;
|
|
244
|
+
appliedAt: z.ZodNullable<z.ZodDate>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
export type ConversationAgentInputsResponse = z.infer<typeof conversationAgentInputsResponseSchema>;
|
|
220
247
|
export declare const updateConversationRequestSchema: z.ZodObject<{
|
|
221
248
|
title: z.ZodOptional<z.ZodString>;
|
|
222
249
|
model: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { telaAgentExecutionInputSchema } from '../integrations/tela-agent-api';
|
|
2
3
|
import { messageFileSchema } from './files';
|
|
3
4
|
import { chatModelSchema } from './models';
|
|
4
5
|
import { conversationCreatorFilterSchema, messageRoleSchema, messageStatusSchema, } from './primitives';
|
|
@@ -52,6 +53,12 @@ export const conversationWithMessagesSchema = conversationSchema.extend({
|
|
|
52
53
|
});
|
|
53
54
|
export const createConversationRequestSchema = z.strictObject({
|
|
54
55
|
model: chatModelSchema.nullable().optional(),
|
|
56
|
+
agentInputs: z.array(telaAgentExecutionInputSchema).optional(),
|
|
57
|
+
});
|
|
58
|
+
export const conversationAgentInputsResponseSchema = z.object({
|
|
59
|
+
agentInputs: z.array(telaAgentExecutionInputSchema).nullable(),
|
|
60
|
+
configuredAt: z.date().nullable(),
|
|
61
|
+
appliedAt: z.date().nullable(),
|
|
55
62
|
});
|
|
56
63
|
export const updateConversationRequestSchema = z.strictObject({
|
|
57
64
|
title: z.string().optional(),
|
|
@@ -53,8 +53,8 @@ export declare const permalinkMetadataResponseSchema: z.ZodObject<{
|
|
|
53
53
|
export type PermalinkMetadataResponse = z.infer<typeof permalinkMetadataResponseSchema>;
|
|
54
54
|
export declare const conversationFileSources: readonly ["context", "message"];
|
|
55
55
|
export declare const conversationFileSourceSchema: z.ZodEnum<{
|
|
56
|
-
context: "context";
|
|
57
56
|
message: "message";
|
|
57
|
+
context: "context";
|
|
58
58
|
}>;
|
|
59
59
|
export type ConversationFileSource = z.infer<typeof conversationFileSourceSchema>;
|
|
60
60
|
export declare const conversationFileSchema: z.ZodObject<{
|
|
@@ -64,8 +64,8 @@ export declare const conversationFileSchema: z.ZodObject<{
|
|
|
64
64
|
mimeType: z.ZodString;
|
|
65
65
|
vaultReference: z.ZodOptional<z.ZodString>;
|
|
66
66
|
source: z.ZodEnum<{
|
|
67
|
-
context: "context";
|
|
68
67
|
message: "message";
|
|
68
|
+
context: "context";
|
|
69
69
|
}>;
|
|
70
70
|
messageId: z.ZodOptional<z.ZodString>;
|
|
71
71
|
messageRole: z.ZodOptional<z.ZodEnum<{
|
|
@@ -84,8 +84,8 @@ export declare const conversationFilesResponseSchema: z.ZodObject<{
|
|
|
84
84
|
mimeType: z.ZodString;
|
|
85
85
|
vaultReference: z.ZodOptional<z.ZodString>;
|
|
86
86
|
source: z.ZodEnum<{
|
|
87
|
-
context: "context";
|
|
88
87
|
message: "message";
|
|
88
|
+
context: "context";
|
|
89
89
|
}>;
|
|
90
90
|
messageId: z.ZodOptional<z.ZodString>;
|
|
91
91
|
messageRole: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const messageOverviewResponseSchema: z.ZodObject<{
|
|
3
|
+
conversation: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
model: z.ZodNullable<z.ZodString>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
message: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
conversationId: z.ZodString;
|
|
11
|
+
role: z.ZodEnum<{
|
|
12
|
+
user: "user";
|
|
13
|
+
assistant: "assistant";
|
|
14
|
+
}>;
|
|
15
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
pending: "pending";
|
|
17
|
+
completed: "completed";
|
|
18
|
+
failed: "failed";
|
|
19
|
+
}>>;
|
|
20
|
+
content: z.ZodString;
|
|
21
|
+
agentSessionId: z.ZodNullable<z.ZodString>;
|
|
22
|
+
agentSessionCursor: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
createdAt: z.ZodDate;
|
|
24
|
+
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
previousUserMessage: z.ZodNullable<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
content: z.ZodString;
|
|
29
|
+
createdAt: z.ZodDate;
|
|
30
|
+
}, z.core.$strict>>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type MessageOverviewResponse = z.infer<typeof messageOverviewResponseSchema>;
|
|
2
33
|
export declare const sendMessageBodySchema: z.ZodObject<{
|
|
3
34
|
content: z.ZodString;
|
|
4
35
|
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -2,6 +2,30 @@ import { z } from 'zod';
|
|
|
2
2
|
import { telaAgentExecutionInputSchema } from '../integrations/tela-agent-api';
|
|
3
3
|
import { messageSchema } from './conversations';
|
|
4
4
|
import { fileUploadInputSchema, messageFileSchema } from './files';
|
|
5
|
+
import { messageRoleSchema, messageStatusSchema } from './primitives';
|
|
6
|
+
export const messageOverviewResponseSchema = z.strictObject({
|
|
7
|
+
conversation: z.strictObject({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
userId: z.string(),
|
|
10
|
+
model: z.string().nullable(),
|
|
11
|
+
}),
|
|
12
|
+
message: z.strictObject({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
conversationId: z.string(),
|
|
15
|
+
role: messageRoleSchema,
|
|
16
|
+
status: messageStatusSchema.nullable(),
|
|
17
|
+
content: z.string(),
|
|
18
|
+
agentSessionId: z.string().nullable(),
|
|
19
|
+
agentSessionCursor: z.number().int().nullable(),
|
|
20
|
+
createdAt: z.date(),
|
|
21
|
+
updatedAt: z.date().nullable(),
|
|
22
|
+
}),
|
|
23
|
+
previousUserMessage: z.strictObject({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
content: z.string(),
|
|
26
|
+
createdAt: z.date(),
|
|
27
|
+
}).nullable(),
|
|
28
|
+
});
|
|
5
29
|
export const sendMessageBodySchema = z.strictObject({
|
|
6
30
|
content: z.string(),
|
|
7
31
|
files: z.array(fileUploadInputSchema).optional(),
|
|
@@ -52,8 +52,8 @@ export declare const chatModelOptions: readonly [{
|
|
|
52
52
|
}];
|
|
53
53
|
export declare const topbarTabs: readonly ["chat", "files", "usage"];
|
|
54
54
|
export declare const topbarTabSchema: z.ZodEnum<{
|
|
55
|
-
files: "files";
|
|
56
55
|
usage: "usage";
|
|
56
|
+
files: "files";
|
|
57
57
|
chat: "chat";
|
|
58
58
|
}>;
|
|
59
59
|
export type TopbarTab = z.infer<typeof topbarTabSchema>;
|
|
@@ -78,6 +78,12 @@ export declare const mentionItemVariableSchema: z.ZodObject<{
|
|
|
78
78
|
text: "text";
|
|
79
79
|
}>;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
|
+
export declare const mentionItemIdKinds: readonly ["url", "path"];
|
|
82
|
+
export declare const mentionItemIdKindSchema: z.ZodEnum<{
|
|
83
|
+
path: "path";
|
|
84
|
+
url: "url";
|
|
85
|
+
}>;
|
|
86
|
+
export type MentionItemIdKind = z.infer<typeof mentionItemIdKindSchema>;
|
|
81
87
|
export declare const mentionItemSchema: z.ZodObject<{
|
|
82
88
|
id: z.ZodString;
|
|
83
89
|
label: z.ZodString;
|
|
@@ -88,6 +94,10 @@ export declare const mentionItemSchema: z.ZodObject<{
|
|
|
88
94
|
skill: "skill";
|
|
89
95
|
canvas: "canvas";
|
|
90
96
|
}>;
|
|
97
|
+
idKind: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
path: "path";
|
|
99
|
+
url: "url";
|
|
100
|
+
}>>;
|
|
91
101
|
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
92
102
|
name: z.ZodString;
|
|
93
103
|
description: z.ZodString;
|
|
@@ -21,11 +21,14 @@ export const mentionItemVariableSchema = z.object({
|
|
|
21
21
|
description: z.string(),
|
|
22
22
|
type: mentionItemVariableTypeSchema,
|
|
23
23
|
});
|
|
24
|
+
export const mentionItemIdKinds = ['url', 'path'];
|
|
25
|
+
export const mentionItemIdKindSchema = z.enum(mentionItemIdKinds);
|
|
24
26
|
export const mentionItemSchema = z.object({
|
|
25
27
|
id: z.string(),
|
|
26
28
|
label: z.string(),
|
|
27
29
|
description: z.string().optional(),
|
|
28
30
|
icon: z.string(),
|
|
29
31
|
category: mentionItemCategorySchema,
|
|
32
|
+
idKind: mentionItemIdKindSchema.optional(),
|
|
30
33
|
variables: z.record(z.string(), mentionItemVariableSchema).optional(),
|
|
31
34
|
});
|
|
@@ -87,10 +87,10 @@ export type ConversationUsageResponse = z.infer<typeof conversationUsageResponse
|
|
|
87
87
|
export declare const workspaceUsageGroupByValues: readonly ["day", "week", "month", "user", "conversation"];
|
|
88
88
|
export declare const workspaceUsageGroupBySchema: z.ZodEnum<{
|
|
89
89
|
user: "user";
|
|
90
|
+
conversation: "conversation";
|
|
90
91
|
day: "day";
|
|
91
92
|
week: "week";
|
|
92
93
|
month: "month";
|
|
93
|
-
conversation: "conversation";
|
|
94
94
|
}>;
|
|
95
95
|
export type WorkspaceUsageGroupBy = z.infer<typeof workspaceUsageGroupBySchema>;
|
|
96
96
|
export declare const workspaceUsageRecordSchema: z.ZodObject<{
|
|
@@ -31,3 +31,17 @@ export declare const workspaceAgentStatusResponseSchema: z.ZodObject<{
|
|
|
31
31
|
}>>;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
export type WorkspaceAgentStatusResponse = z.infer<typeof workspaceAgentStatusResponseSchema>;
|
|
34
|
+
export declare const workspaceAgentSummaryResponseSchema: z.ZodObject<{
|
|
35
|
+
workspaceId: z.ZodString;
|
|
36
|
+
telaAgentId: z.ZodNullable<z.ZodString>;
|
|
37
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
description: z.ZodString;
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
contextFiles: z.ZodArray<z.ZodObject<{
|
|
43
|
+
path: z.ZodString;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type WorkspaceAgentSummaryResponse = z.infer<typeof workspaceAgentSummaryResponseSchema>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { telaAgentContextFileSchema, telaAgentSkillSchema } from '../integrations/tela-agent-api';
|
|
2
3
|
export const workspaceAgentModes = ['default', 'custom', 'setup_required'];
|
|
3
4
|
export const workspaceAgentModeSchema = z.enum(workspaceAgentModes);
|
|
4
5
|
export const workspaceAgentCustomizations = ['system_message', 'context_files', 'canvas_tools', 'external_skills'];
|
|
@@ -10,3 +11,9 @@ export const workspaceAgentStatusResponseSchema = z.object({
|
|
|
10
11
|
telaAgentUrl: z.string().nullable(),
|
|
11
12
|
pendingCustomizations: z.array(workspaceAgentCustomizationSchema),
|
|
12
13
|
});
|
|
14
|
+
export const workspaceAgentSummaryResponseSchema = z.object({
|
|
15
|
+
workspaceId: z.string().min(1),
|
|
16
|
+
telaAgentId: z.string().nullable(),
|
|
17
|
+
skills: z.array(telaAgentSkillSchema),
|
|
18
|
+
contextFiles: z.array(telaAgentContextFileSchema),
|
|
19
|
+
});
|
|
@@ -186,9 +186,9 @@ export type AgentApiSession = z.infer<typeof agentApiSessionSchema>;
|
|
|
186
186
|
export declare const agentSessionStatuses: readonly ["pending", "running", "completed", "failed"];
|
|
187
187
|
export declare const agentSessionStatusSchema: z.ZodEnum<{
|
|
188
188
|
pending: "pending";
|
|
189
|
+
running: "running";
|
|
189
190
|
completed: "completed";
|
|
190
191
|
failed: "failed";
|
|
191
|
-
running: "running";
|
|
192
192
|
}>;
|
|
193
193
|
export type AgentSessionStatus = z.infer<typeof agentSessionStatusSchema>;
|
|
194
194
|
export type AgentApiChatPayload = {
|
|
@@ -58,6 +58,17 @@ export declare const telaAgentRunPayloadSchema: z.ZodObject<{
|
|
|
58
58
|
}, z.core.$strip>>>;
|
|
59
59
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
60
60
|
export type TelaAgentRunPayload = z.infer<typeof telaAgentRunPayloadSchema>;
|
|
61
|
+
export declare const telaAgentSkillSchema: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
description: z.ZodString;
|
|
64
|
+
path: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type TelaAgentSkill = z.infer<typeof telaAgentSkillSchema>;
|
|
67
|
+
export declare const telaAgentContextFileSchema: z.ZodObject<{
|
|
68
|
+
path: z.ZodString;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type TelaAgentContextFile = z.infer<typeof telaAgentContextFileSchema>;
|
|
61
72
|
export declare const telaAgentSchema: z.ZodObject<{
|
|
62
73
|
id: z.ZodString;
|
|
63
74
|
organizationName: z.ZodOptional<z.ZodString>;
|
|
@@ -89,8 +100,41 @@ export declare const telaAgentSchema: z.ZodObject<{
|
|
|
89
100
|
description?: string | null | undefined;
|
|
90
101
|
}[] | null | undefined>>;
|
|
91
102
|
isMultiturn: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
103
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
description: z.ZodString;
|
|
106
|
+
path: z.ZodString;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
contextFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
path: z.ZodString;
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
}, z.core.$strip>>>;
|
|
92
112
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
93
113
|
export type TelaAgent = z.infer<typeof telaAgentSchema>;
|
|
114
|
+
export declare const telaAgentSummarySchema: z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
inputSchema: z.ZodArray<z.ZodObject<{
|
|
117
|
+
id: z.ZodOptional<z.ZodString>;
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
type: z.ZodEnum<{
|
|
120
|
+
file: "file";
|
|
121
|
+
text: "text";
|
|
122
|
+
}>;
|
|
123
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
126
|
+
isMultiturn: z.ZodNullable<z.ZodBoolean>;
|
|
127
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
description: z.ZodString;
|
|
130
|
+
path: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
contextFiles: z.ZodArray<z.ZodObject<{
|
|
133
|
+
path: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
export type TelaAgentSummary = z.infer<typeof telaAgentSummarySchema>;
|
|
94
138
|
export declare const telaAgentRunResponseSchema: z.ZodObject<{
|
|
95
139
|
sessionId: z.ZodString;
|
|
96
140
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
@@ -98,9 +142,9 @@ export type TelaAgentRunResponse = z.infer<typeof telaAgentRunResponseSchema>;
|
|
|
98
142
|
export declare const telaAgentSessionStatuses: readonly ["pending", "running", "completed", "failed", "waiting_messages", "cancelled"];
|
|
99
143
|
export declare const telaAgentSessionStatusSchema: z.ZodEnum<{
|
|
100
144
|
pending: "pending";
|
|
145
|
+
running: "running";
|
|
101
146
|
completed: "completed";
|
|
102
147
|
failed: "failed";
|
|
103
|
-
running: "running";
|
|
104
148
|
waiting_messages: "waiting_messages";
|
|
105
149
|
cancelled: "cancelled";
|
|
106
150
|
}>;
|
|
@@ -145,9 +189,9 @@ export declare const telaAgentSessionSchema: z.ZodObject<{
|
|
|
145
189
|
sessionId: z.ZodString;
|
|
146
190
|
status: z.ZodEnum<{
|
|
147
191
|
pending: "pending";
|
|
192
|
+
running: "running";
|
|
148
193
|
completed: "completed";
|
|
149
194
|
failed: "failed";
|
|
150
|
-
running: "running";
|
|
151
195
|
waiting_messages: "waiting_messages";
|
|
152
196
|
cancelled: "cancelled";
|
|
153
197
|
}>;
|
|
@@ -187,8 +231,8 @@ export declare const telaAgentV4SessionStatusEventSchema: z.ZodObject<{
|
|
|
187
231
|
sessionId: z.ZodString;
|
|
188
232
|
status: z.ZodEnum<{
|
|
189
233
|
pending: "pending";
|
|
190
|
-
failed: "failed";
|
|
191
234
|
running: "running";
|
|
235
|
+
failed: "failed";
|
|
192
236
|
cancelled: "cancelled";
|
|
193
237
|
}>;
|
|
194
238
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -200,9 +244,9 @@ export declare const telaAgentV4SessionStepsEventSchema: z.ZodObject<{
|
|
|
200
244
|
sessionId: z.ZodString;
|
|
201
245
|
status: z.ZodEnum<{
|
|
202
246
|
pending: "pending";
|
|
247
|
+
running: "running";
|
|
203
248
|
completed: "completed";
|
|
204
249
|
failed: "failed";
|
|
205
|
-
running: "running";
|
|
206
250
|
waiting_messages: "waiting_messages";
|
|
207
251
|
cancelled: "cancelled";
|
|
208
252
|
}>;
|
|
@@ -256,8 +300,8 @@ export declare const telaAgentV4SessionStreamEventSchema: z.ZodDiscriminatedUnio
|
|
|
256
300
|
sessionId: z.ZodString;
|
|
257
301
|
status: z.ZodEnum<{
|
|
258
302
|
pending: "pending";
|
|
259
|
-
failed: "failed";
|
|
260
303
|
running: "running";
|
|
304
|
+
failed: "failed";
|
|
261
305
|
cancelled: "cancelled";
|
|
262
306
|
}>;
|
|
263
307
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -268,9 +312,9 @@ export declare const telaAgentV4SessionStreamEventSchema: z.ZodDiscriminatedUnio
|
|
|
268
312
|
sessionId: z.ZodString;
|
|
269
313
|
status: z.ZodEnum<{
|
|
270
314
|
pending: "pending";
|
|
315
|
+
running: "running";
|
|
271
316
|
completed: "completed";
|
|
272
317
|
failed: "failed";
|
|
273
|
-
running: "running";
|
|
274
318
|
waiting_messages: "waiting_messages";
|
|
275
319
|
cancelled: "cancelled";
|
|
276
320
|
}>;
|
|
@@ -355,6 +399,15 @@ export declare const telaAgentApiResponseSchema: z.ZodObject<{
|
|
|
355
399
|
description?: string | null | undefined;
|
|
356
400
|
}[] | null | undefined>>;
|
|
357
401
|
isMultiturn: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
402
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
403
|
+
name: z.ZodString;
|
|
404
|
+
description: z.ZodString;
|
|
405
|
+
path: z.ZodString;
|
|
406
|
+
}, z.core.$strip>>>;
|
|
407
|
+
contextFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
|
+
path: z.ZodString;
|
|
409
|
+
name: z.ZodString;
|
|
410
|
+
}, z.core.$strip>>>;
|
|
358
411
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
359
412
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
360
413
|
export declare const telaAgentResolveApiResponseSchema: z.ZodObject<{
|
|
@@ -389,6 +442,15 @@ export declare const telaAgentResolveApiResponseSchema: z.ZodObject<{
|
|
|
389
442
|
description?: string | null | undefined;
|
|
390
443
|
}[] | null | undefined>>;
|
|
391
444
|
isMultiturn: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
445
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
446
|
+
name: z.ZodString;
|
|
447
|
+
description: z.ZodString;
|
|
448
|
+
path: z.ZodString;
|
|
449
|
+
}, z.core.$strip>>>;
|
|
450
|
+
contextFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
451
|
+
path: z.ZodString;
|
|
452
|
+
name: z.ZodString;
|
|
453
|
+
}, z.core.$strip>>>;
|
|
392
454
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
393
455
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
394
456
|
export declare const telaAgentEndSessionApiResponseSchema: z.ZodObject<{
|