@meistrari/chat-nuxt 1.2.0 → 1.2.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/module.mjs +17 -9
- package/dist/runtime/composables/useConversations.d.ts +3 -1
- package/dist/runtime/composables/useConversations.js +15 -1
- package/dist/runtime/composables/useWorkspaceSettings.js +0 -4
- package/dist/runtime/embed/components/ChatEmbedInner.vue +4 -3
- package/dist/runtime/embed/components/configuration/ChatConfigurationExternalSkillsTab.vue +1 -1
- package/package.json +1 -1
- /package/dist/runtime/public/{github.svg → assets/github.svg} +0 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -220,10 +220,12 @@ const module$1 = defineNuxtModule({
|
|
|
220
220
|
}
|
|
221
221
|
ensureIconifyPackages(nuxt.options.rootDir);
|
|
222
222
|
const resolver = createResolver(import.meta.url);
|
|
223
|
-
const
|
|
223
|
+
const builtRuntimeDir = resolver.resolve("./runtime");
|
|
224
|
+
const sourceRuntimeDir = resolver.resolve("../src/runtime");
|
|
225
|
+
const runtimeDir = nuxt.options.dev && existsSync(sourceRuntimeDir) ? sourceRuntimeDir : builtRuntimeDir;
|
|
224
226
|
const workspaceSettingsResolverEntry = resolveWorkspaceSettingsResolverEntry(
|
|
225
227
|
nuxt.options.srcDir,
|
|
226
|
-
|
|
228
|
+
join(runtimeDir, "internal/workspace-settings-resolver.stub")
|
|
227
229
|
);
|
|
228
230
|
const telaBuildPath = resolveTelaBuildLayer();
|
|
229
231
|
const runtimeAliases = resolveRuntimeAliases(telaBuildPath);
|
|
@@ -258,18 +260,18 @@ const module$1 = defineNuxtModule({
|
|
|
258
260
|
rc.public = rc.public || {};
|
|
259
261
|
rc.public.agentApiUrl = rc.public.agentApiUrl || process.env.AGENT_API_URL || "";
|
|
260
262
|
validateRuntimeConfig(rc, options.validateConfig ?? false);
|
|
261
|
-
addImportsDir(
|
|
262
|
-
addImportsDir(
|
|
263
|
+
addImportsDir(join(runtimeDir, "composables"));
|
|
264
|
+
addImportsDir(join(runtimeDir, "utils"));
|
|
263
265
|
addComponent({
|
|
264
266
|
name: "MeistrariChatEmbed",
|
|
265
|
-
filePath:
|
|
267
|
+
filePath: join(runtimeDir, "components/MeistrariChatEmbed.vue"),
|
|
266
268
|
priority: 1e3
|
|
267
269
|
});
|
|
268
270
|
addComponentsDir({
|
|
269
|
-
path:
|
|
271
|
+
path: join(runtimeDir, "components")
|
|
270
272
|
});
|
|
271
273
|
addComponentsDir({
|
|
272
|
-
path:
|
|
274
|
+
path: join(runtimeDir, "embed/components"),
|
|
273
275
|
pathPrefix: false
|
|
274
276
|
});
|
|
275
277
|
nuxt.hook("vite:extendConfig", (config, { isServer }) => {
|
|
@@ -310,8 +312,9 @@ export default globalThis.ELK;
|
|
|
310
312
|
}
|
|
311
313
|
});
|
|
312
314
|
});
|
|
313
|
-
const serverDir =
|
|
314
|
-
const
|
|
315
|
+
const serverDir = join(runtimeDir, "server");
|
|
316
|
+
const publicAssetsDir = join(runtimeDir, "public/assets");
|
|
317
|
+
const publicFilesDir = join(runtimeDir, "public/files");
|
|
315
318
|
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
316
319
|
nitroConfig.scanDirs = nitroConfig.scanDirs || [];
|
|
317
320
|
nitroConfig.scanDirs.push(serverDir);
|
|
@@ -321,6 +324,11 @@ export default globalThis.ELK;
|
|
|
321
324
|
"#chat-workspace-settings-resolver": workspaceSettingsResolverEntry
|
|
322
325
|
};
|
|
323
326
|
nitroConfig.publicAssets = nitroConfig.publicAssets || [];
|
|
327
|
+
nitroConfig.publicAssets.push({
|
|
328
|
+
dir: publicAssetsDir,
|
|
329
|
+
baseURL: "/chat-assets",
|
|
330
|
+
maxAge: 60 * 60 * 24 * 7
|
|
331
|
+
});
|
|
324
332
|
nitroConfig.publicAssets.push({
|
|
325
333
|
dir: publicFilesDir,
|
|
326
334
|
baseURL: "/chat-files",
|
|
@@ -5,7 +5,9 @@ export declare function useConversations(): {
|
|
|
5
5
|
conversations: any;
|
|
6
6
|
loading: any;
|
|
7
7
|
error: any;
|
|
8
|
-
fetchConversations: (
|
|
8
|
+
fetchConversations: (options?: {
|
|
9
|
+
force?: boolean;
|
|
10
|
+
}) => Promise<void>;
|
|
9
11
|
createConversation: (options?: {
|
|
10
12
|
model?: ModelOption | null;
|
|
11
13
|
}) => Promise<Conversation | null>;
|
|
@@ -29,6 +29,7 @@ export function useConversations() {
|
|
|
29
29
|
const conversationBuckets = useState("conversations", () => ({}));
|
|
30
30
|
const loadingBuckets = useState("conversations-loading", () => ({}));
|
|
31
31
|
const errorBuckets = useState("conversations-error", () => ({}));
|
|
32
|
+
const fetchedBuckets = useState("conversations-fetched", () => ({}));
|
|
32
33
|
const mutationVersionBuckets = useState("conversations-mutation-version", () => ({}));
|
|
33
34
|
const deletedIdBuckets = useState("conversations-deleted-ids", () => ({}));
|
|
34
35
|
const mutatedIdBuckets = useState("conversations-mutated-ids", () => ({}));
|
|
@@ -87,6 +88,15 @@ export function useConversations() {
|
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
});
|
|
91
|
+
const hasFetched = computed({
|
|
92
|
+
get: () => fetchedBuckets.value[workspaceScope.value] ?? false,
|
|
93
|
+
set: (value) => {
|
|
94
|
+
fetchedBuckets.value = {
|
|
95
|
+
...fetchedBuckets.value,
|
|
96
|
+
[workspaceScope.value]: value
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
90
100
|
function markMutated(id) {
|
|
91
101
|
mutationVersion.value = mutationVersion.value + 1;
|
|
92
102
|
if (id) {
|
|
@@ -114,7 +124,10 @@ export function useConversations() {
|
|
|
114
124
|
return null;
|
|
115
125
|
return JSON.parse(JSON.stringify(snapshot));
|
|
116
126
|
}
|
|
117
|
-
const fetchConversations = async () => {
|
|
127
|
+
const fetchConversations = async (options = {}) => {
|
|
128
|
+
if (loading.value || hasFetched.value && !options.force) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
118
131
|
loading.value = true;
|
|
119
132
|
error.value = null;
|
|
120
133
|
const mutationVersionAtStart = mutationVersion.value;
|
|
@@ -137,6 +150,7 @@ export function useConversations() {
|
|
|
137
150
|
mutatedConversationIds.value = [];
|
|
138
151
|
}
|
|
139
152
|
pruneDeletedConversationIds(data);
|
|
153
|
+
hasFetched.value = true;
|
|
140
154
|
} catch (err) {
|
|
141
155
|
const message = err instanceof Error ? err.message : "Erro ao carregar conversas";
|
|
142
156
|
error.value = message;
|
|
@@ -48,15 +48,11 @@ export function useWorkspaceSettings() {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function openModal(tab) {
|
|
51
|
-
if (embedConfig !== null)
|
|
52
|
-
return;
|
|
53
51
|
if (tab)
|
|
54
52
|
initialTab.value = tab;
|
|
55
53
|
isModalOpen.value = true;
|
|
56
54
|
}
|
|
57
55
|
function closeModal() {
|
|
58
|
-
if (embedConfig !== null)
|
|
59
|
-
return;
|
|
60
56
|
isModalOpen.value = false;
|
|
61
57
|
initialTab.value = null;
|
|
62
58
|
}
|
|
@@ -140,14 +140,15 @@ watch(() => props.conversationId, async (nextConversationId) => {
|
|
|
140
140
|
await ensureConversationLoaded(normalizedConversationId);
|
|
141
141
|
});
|
|
142
142
|
onMounted(async () => {
|
|
143
|
-
|
|
143
|
+
void fetchConversations();
|
|
144
144
|
if (!effectiveWorkspaceSettings.value) {
|
|
145
|
-
|
|
145
|
+
void fetchSettings();
|
|
146
146
|
}
|
|
147
|
-
await Promise.allSettled(pendingTasks);
|
|
148
147
|
isReady.value = true;
|
|
149
148
|
if (activeConversationId.value) {
|
|
150
149
|
await ensureConversationLoaded(activeConversationId.value);
|
|
150
|
+
} else {
|
|
151
|
+
resetConversation(false);
|
|
151
152
|
}
|
|
152
153
|
});
|
|
153
154
|
const MAX_DISMISSED_CHAT_IDS = 100;
|
|
@@ -12,7 +12,7 @@ defineProps({
|
|
|
12
12
|
gitHubButtonText: { type: String, required: true }
|
|
13
13
|
});
|
|
14
14
|
const emit = defineEmits(["update:searchQuery", "update:skillModalOpen", "update:skillRefInput", "removeSkill", "closeSkillModal", "handleAddSkillAndClose", "connectGitHub"]);
|
|
15
|
-
const githubIconUrl = "/github.svg";
|
|
15
|
+
const githubIconUrl = "/chat-assets/github.svg";
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
package/package.json
CHANGED
|
File without changes
|