@meistrari/chat-nuxt 3.11.0 → 3.11.1
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/embed/components/chat-embed-inner.vue +3 -22
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.d.vue.ts +2 -2
- package/dist/runtime/embed/components/mobile/chat-mobile-shell.vue.d.ts +2 -2
- package/dist/runtime/embed/composables/use-agent-wake.d.ts +1 -2
- package/dist/runtime/embed/composables/use-agent-wake.js +5 -9
- package/dist/runtime/embed/loading-messages.d.ts +1 -1
- package/dist/runtime/embed/loading-messages.js +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -199,11 +199,6 @@ const selectedModel = computed({
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
|
-
watch(selectedModel, (model, previousModel) => {
|
|
203
|
-
if (!isReady.value || model === previousModel || currentConversation.value?.threadSessionId)
|
|
204
|
-
return;
|
|
205
|
-
void agentWake.wake(model);
|
|
206
|
-
});
|
|
207
202
|
const filesCount = computed(() => total.value);
|
|
208
203
|
const hasMessages = computed(() => messages.value.length > 0);
|
|
209
204
|
const mobilePreviewFile = computed(() => {
|
|
@@ -244,7 +239,6 @@ function updateConversationId(nextConversationId) {
|
|
|
244
239
|
async function ensureConversationLoaded(conversationId) {
|
|
245
240
|
if (currentConversation.value?.id === conversationId) {
|
|
246
241
|
void agentWake.wake(
|
|
247
|
-
currentConversation.value.model,
|
|
248
242
|
currentConversation.value.threadSessionId ?? void 0
|
|
249
243
|
);
|
|
250
244
|
startPolling();
|
|
@@ -265,7 +259,6 @@ async function ensureConversationLoaded(conversationId) {
|
|
|
265
259
|
return;
|
|
266
260
|
}
|
|
267
261
|
void agentWake.wake(
|
|
268
|
-
currentConversation.value.model,
|
|
269
262
|
currentConversation.value.threadSessionId ?? void 0
|
|
270
263
|
);
|
|
271
264
|
startPolling();
|
|
@@ -277,7 +270,7 @@ async function ensureConversationLoaded(conversationId) {
|
|
|
277
270
|
}
|
|
278
271
|
function resetConversation(shouldEmit = true) {
|
|
279
272
|
clearConversation();
|
|
280
|
-
void agentWake.wake(
|
|
273
|
+
void agentWake.wake();
|
|
281
274
|
activeTab.value = "chat";
|
|
282
275
|
closeFilesPanel();
|
|
283
276
|
closePreview();
|
|
@@ -460,14 +453,8 @@ async function handleSend(content, files, agentInputs) {
|
|
|
460
453
|
const conversation = currentConversation.value;
|
|
461
454
|
if (!conversation)
|
|
462
455
|
throw new Error("Erro ao preparar conversa");
|
|
463
|
-
if (conversation.threadSessionId)
|
|
464
|
-
await agentWake.wake(
|
|
465
|
-
conversation.model,
|
|
466
|
-
conversation.threadSessionId
|
|
467
|
-
);
|
|
468
|
-
} else {
|
|
456
|
+
if (!conversation.threadSessionId)
|
|
469
457
|
await agentWake.waitUntilSettled(signal);
|
|
470
|
-
}
|
|
471
458
|
claimedWakeSessionId = claimableWakeSessionId();
|
|
472
459
|
return claimedWakeSessionId ? { wakeSessionId: claimedWakeSessionId } : {};
|
|
473
460
|
});
|
|
@@ -475,14 +462,8 @@ async function handleSend(content, files, agentInputs) {
|
|
|
475
462
|
agentWake.consume();
|
|
476
463
|
}
|
|
477
464
|
async function handleRetry(messageId) {
|
|
478
|
-
if (currentConversation.value?.threadSessionId)
|
|
479
|
-
await agentWake.wake(
|
|
480
|
-
currentConversation.value.model,
|
|
481
|
-
currentConversation.value.threadSessionId
|
|
482
|
-
);
|
|
483
|
-
} else {
|
|
465
|
+
if (!currentConversation.value?.threadSessionId)
|
|
484
466
|
await agentWake.waitUntilSettled();
|
|
485
|
-
}
|
|
486
467
|
await retryMessage(messageId, claimableWakeSessionId());
|
|
487
468
|
}
|
|
488
469
|
async function handleNewConversation(groupId) {
|
|
@@ -57,12 +57,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
57
57
|
"update:selectedModel": (value: string | null) => any;
|
|
58
58
|
} & {
|
|
59
59
|
delete: () => any;
|
|
60
|
-
cancel: () => any;
|
|
61
60
|
rename: () => any;
|
|
62
61
|
duplicate: () => any;
|
|
63
62
|
export: () => any;
|
|
64
63
|
copyLink: () => any;
|
|
65
64
|
selectConversation: (id: string) => any;
|
|
65
|
+
cancel: () => any;
|
|
66
66
|
settings: () => any;
|
|
67
67
|
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
68
68
|
debug: () => any;
|
|
@@ -78,12 +78,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
78
78
|
"update:workspaceSheetOpen": (value: boolean) => any;
|
|
79
79
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
80
80
|
onDelete?: (() => any) | undefined;
|
|
81
|
-
onCancel?: (() => any) | undefined;
|
|
82
81
|
onRename?: (() => any) | undefined;
|
|
83
82
|
onDuplicate?: (() => any) | undefined;
|
|
84
83
|
onExport?: (() => any) | undefined;
|
|
85
84
|
onCopyLink?: (() => any) | undefined;
|
|
86
85
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
86
|
+
onCancel?: (() => any) | undefined;
|
|
87
87
|
onSettings?: (() => any) | undefined;
|
|
88
88
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
89
89
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
@@ -57,12 +57,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
57
57
|
"update:selectedModel": (value: string | null) => any;
|
|
58
58
|
} & {
|
|
59
59
|
delete: () => any;
|
|
60
|
-
cancel: () => any;
|
|
61
60
|
rename: () => any;
|
|
62
61
|
duplicate: () => any;
|
|
63
62
|
export: () => any;
|
|
64
63
|
copyLink: () => any;
|
|
65
64
|
selectConversation: (id: string) => any;
|
|
65
|
+
cancel: () => any;
|
|
66
66
|
settings: () => any;
|
|
67
67
|
send: (content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any;
|
|
68
68
|
debug: () => any;
|
|
@@ -78,12 +78,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
78
78
|
"update:workspaceSheetOpen": (value: boolean) => any;
|
|
79
79
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
80
80
|
onDelete?: (() => any) | undefined;
|
|
81
|
-
onCancel?: (() => any) | undefined;
|
|
82
81
|
onRename?: (() => any) | undefined;
|
|
83
82
|
onDuplicate?: (() => any) | undefined;
|
|
84
83
|
onExport?: (() => any) | undefined;
|
|
85
84
|
onCopyLink?: (() => any) | undefined;
|
|
86
85
|
onSelectConversation?: ((id: string) => any) | undefined;
|
|
86
|
+
onCancel?: (() => any) | undefined;
|
|
87
87
|
onSettings?: (() => any) | undefined;
|
|
88
88
|
onSend?: ((content: string, files: FileUploadInput[], agentInputs?: TelaAgentExecutionInput[] | undefined) => any) | undefined;
|
|
89
89
|
"onUpdate:selectedModel"?: ((value: string | null) => any) | undefined;
|
|
@@ -2,7 +2,6 @@ import type { TelaAgentWakeResponse } from '../../types/schemas/integrations/tel
|
|
|
2
2
|
export type AgentWakeSnapshot = {
|
|
3
3
|
state: TelaAgentWakeResponse['status'] | 'idle';
|
|
4
4
|
sessionId?: string;
|
|
5
|
-
model?: string;
|
|
6
5
|
};
|
|
7
6
|
export declare function pollAgentWake(options: {
|
|
8
7
|
request: () => Promise<TelaAgentWakeResponse>;
|
|
@@ -16,7 +15,7 @@ export declare function pollAgentWake(options: {
|
|
|
16
15
|
export declare function useAgentWake(): {
|
|
17
16
|
state: any;
|
|
18
17
|
sessionId: any;
|
|
19
|
-
wake: (
|
|
18
|
+
wake: (requestedSessionId?: string) => Promise<TelaAgentWakeResponse>;
|
|
20
19
|
skip: () => void;
|
|
21
20
|
consume: () => void;
|
|
22
21
|
waitUntilSettled: (signal?: AbortSignal) => Promise<AgentWakeSnapshot>;
|
|
@@ -67,7 +67,7 @@ export function useAgentWake() {
|
|
|
67
67
|
activeWake = null;
|
|
68
68
|
setSnapshot({ state: "idle" });
|
|
69
69
|
}
|
|
70
|
-
async function wake(
|
|
70
|
+
async function wake(requestedSessionId) {
|
|
71
71
|
generation++;
|
|
72
72
|
const currentGeneration = generation;
|
|
73
73
|
abortController?.abort();
|
|
@@ -76,8 +76,7 @@ export function useAgentWake() {
|
|
|
76
76
|
let wakeSessionId = requestedSessionId ?? snapshot.value.sessionId;
|
|
77
77
|
setSnapshot({
|
|
78
78
|
state: "waking",
|
|
79
|
-
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
80
|
-
...model ? { model } : {}
|
|
79
|
+
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
81
80
|
});
|
|
82
81
|
if (import.meta.server) {
|
|
83
82
|
const unavailable = { status: "unavailable" };
|
|
@@ -94,8 +93,7 @@ export function useAgentWake() {
|
|
|
94
93
|
method: "POST",
|
|
95
94
|
signal: controller.signal,
|
|
96
95
|
body: {
|
|
97
|
-
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
98
|
-
...model ? { model } : {}
|
|
96
|
+
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
99
97
|
}
|
|
100
98
|
})
|
|
101
99
|
),
|
|
@@ -105,16 +103,14 @@ export function useAgentWake() {
|
|
|
105
103
|
wakeSessionId = response.sessionId ?? wakeSessionId;
|
|
106
104
|
setSnapshot({
|
|
107
105
|
state: response.status,
|
|
108
|
-
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
109
|
-
...model ? { model } : {}
|
|
106
|
+
...wakeSessionId ? { sessionId: wakeSessionId } : {}
|
|
110
107
|
});
|
|
111
108
|
}
|
|
112
109
|
});
|
|
113
110
|
if (currentGeneration === generation) {
|
|
114
111
|
setSnapshot({
|
|
115
112
|
state: result.status,
|
|
116
|
-
...result.sessionId ? { sessionId: result.sessionId } : {}
|
|
117
|
-
...model ? { model } : {}
|
|
113
|
+
...result.sessionId ? { sessionId: result.sessionId } : {}
|
|
118
114
|
});
|
|
119
115
|
}
|
|
120
116
|
return result;
|
|
@@ -5,7 +5,7 @@ export declare const DEFAULT_CHAT_LOADING_MESSAGES: readonly ["Analisando sua pe
|
|
|
5
5
|
* than as a loading placeholder. The user message is already delivered at this
|
|
6
6
|
* point, so the wait belongs to the answer.
|
|
7
7
|
*/
|
|
8
|
-
export declare const CHAT_PREPARING_STEPS: readonly ["Preparando
|
|
8
|
+
export declare const CHAT_PREPARING_STEPS: readonly ["Preparando a resposta", "Analisando a mensagem"];
|
|
9
9
|
/**
|
|
10
10
|
* The first delay is measured from the send, every later one from the step
|
|
11
11
|
* before it — so the sequence paces itself instead of racing a shared clock.
|
|
@@ -13,7 +13,7 @@ export const DEFAULT_CHAT_LOADING_MESSAGES = [
|
|
|
13
13
|
"Estruturando resposta"
|
|
14
14
|
];
|
|
15
15
|
export const CHAT_PREPARING_STEPS = [
|
|
16
|
-
"Preparando
|
|
16
|
+
"Preparando a resposta",
|
|
17
17
|
"Analisando a mensagem"
|
|
18
18
|
];
|
|
19
19
|
export const CHAT_PREPARING_STEP_DELAYS_MS = [2500, 4e3];
|