fluxy-bot 0.3.26 → 0.3.27
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-fluxy/fluxy.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content" />
|
|
6
6
|
<title>Fluxy Chat</title>
|
|
7
|
-
<script type="module" crossorigin src="/fluxy/assets/fluxy-
|
|
7
|
+
<script type="module" crossorigin src="/fluxy/assets/fluxy-BXld9bgF.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/fluxy/assets/globals-BmcQJ_1f.js">
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/fluxy/assets/globals-BdY9BJIP.css">
|
|
10
10
|
</head>
|
package/package.json
CHANGED
|
@@ -34,9 +34,11 @@ export default function MessageBubble({ role, content, timestamp, hasAttachments
|
|
|
34
34
|
const docAtts = attachments?.filter((a) => !a.mediaType?.startsWith('image/')) || [];
|
|
35
35
|
|
|
36
36
|
// Resolve image URLs
|
|
37
|
-
const imageUrls = imageAtts
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const imageUrls = imageAtts
|
|
38
|
+
.filter((a) => a.filePath)
|
|
39
|
+
.map((a) =>
|
|
40
|
+
a.filePath.startsWith('data:') ? a.filePath : `/api/files/${a.filePath}`
|
|
41
|
+
);
|
|
40
42
|
|
|
41
43
|
if (isUser) {
|
|
42
44
|
// Voice message: audio-only, no transcript text
|
package/supervisor/index.ts
CHANGED
|
@@ -400,7 +400,7 @@ export async function startSupervisor() {
|
|
|
400
400
|
const meta: any = { model: freshConfig.ai.model };
|
|
401
401
|
if (savedFiles.length) {
|
|
402
402
|
meta.attachments = JSON.stringify(savedFiles.map((f) => ({
|
|
403
|
-
type: f.type, name: f.name, mediaType: f.mediaType,
|
|
403
|
+
type: f.type, name: f.name, mediaType: f.mediaType, filePath: f.relPath,
|
|
404
404
|
})));
|
|
405
405
|
}
|
|
406
406
|
await workerApi(`/api/conversations/${convId}/messages`, 'POST', {
|
|
@@ -431,27 +431,21 @@ export async function startSupervisor() {
|
|
|
431
431
|
return; // don't forward bot:done to client
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
// Save assistant response to DB
|
|
434
|
+
// Save assistant response to DB
|
|
435
435
|
if (type === 'bot:response') {
|
|
436
436
|
(async () => {
|
|
437
437
|
try {
|
|
438
438
|
await workerApi(`/api/conversations/${convId}/messages`, 'POST', {
|
|
439
439
|
role: 'assistant', content: eventData.content, meta: { model: freshConfig.ai.model },
|
|
440
440
|
});
|
|
441
|
-
broadcastFluxyExcept(ws, 'chat:sync', {
|
|
442
|
-
conversationId: convId,
|
|
443
|
-
message: { role: 'assistant', content: eventData.content, timestamp: new Date().toISOString() },
|
|
444
|
-
});
|
|
445
441
|
} catch (err: any) {
|
|
446
442
|
log.warn(`[fluxy] DB persist bot response error: ${err.message}`);
|
|
447
443
|
}
|
|
448
444
|
})();
|
|
449
445
|
}
|
|
450
446
|
|
|
451
|
-
//
|
|
452
|
-
|
|
453
|
-
ws.send(JSON.stringify({ type, data: eventData }));
|
|
454
|
-
}
|
|
447
|
+
// Stream all events to every connected client
|
|
448
|
+
broadcastFluxy(type, eventData);
|
|
455
449
|
}, data.attachments, savedFiles);
|
|
456
450
|
})();
|
|
457
451
|
return;
|