fluxy-bot 0.3.23 → 0.3.26

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.
@@ -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-D_vy8fea.js"></script>
7
+ <script type="module" crossorigin src="/fluxy/assets/fluxy-CzVya_c8.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.3.23",
3
+ "version": "0.3.26",
4
4
  "description": "Self-hosted AI bot — run your own AI assistant from anywhere",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -149,7 +149,9 @@ export default function InputBar({ onSend, onStop, streaming, whisperEnabled, on
149
149
  data = await res.json();
150
150
  }
151
151
  if (data.transcript?.trim()) {
152
- onSend(data.transcript.trim(), undefined, dataUrl);
152
+ const pendingAtts = attachments.length > 0 ? attachments : undefined;
153
+ onSend(data.transcript.trim(), pendingAtts, dataUrl);
154
+ if (pendingAtts) setAttachments([]);
153
155
  }
154
156
  } catch {
155
157
  // Transcription failed silently
@@ -164,7 +166,7 @@ export default function InputBar({ onSend, onStop, streaming, whisperEnabled, on
164
166
  setIsRecording(false);
165
167
  setRecordingTime(0);
166
168
  dragRef.current = 0;
167
- }, [onSend, onTranscribe]);
169
+ }, [onSend, onTranscribe, attachments]);
168
170
 
169
171
  // ── File handling ──
170
172
 
@@ -379,7 +381,7 @@ export default function InputBar({ onSend, onStop, streaming, whisperEnabled, on
379
381
  >
380
382
  <Square className="h-4 w-4" />
381
383
  </button>
382
- ) : hasContent ? (
384
+ ) : hasText ? (
383
385
  <button
384
386
  onClick={handleSend}
385
387
  className="flex items-center justify-center h-12 w-12 shrink-0 rounded-full bg-white text-gray-900 transition-colors hover:bg-gray-100"
@@ -362,6 +362,18 @@ export async function startSupervisor() {
362
362
  if (freshConfig.ai.provider === 'anthropic') {
363
363
  // Server-side persistence: create or reuse DB conversation, save user message
364
364
  (async () => {
365
+ // Save attachments to disk (before try so it's accessible in startFluxyAgentQuery below)
366
+ let savedFiles: SavedFile[] = [];
367
+ if (data.attachments?.length) {
368
+ for (const att of data.attachments) {
369
+ try {
370
+ savedFiles.push(saveAttachment(att));
371
+ } catch (err: any) {
372
+ log.warn(`[fluxy] File save error: ${err.message}`);
373
+ }
374
+ }
375
+ }
376
+
365
377
  try {
366
378
  // Check if we have an existing conversation for this client
367
379
  let dbConvId = clientConvs.get(ws);
@@ -384,24 +396,12 @@ export async function startSupervisor() {
384
396
  }
385
397
  convId = dbConvId!;
386
398
 
387
- // Save attachments to disk
388
- let savedFiles: SavedFile[] = [];
389
- if (data.attachments?.length) {
390
- for (const att of data.attachments) {
391
- try {
392
- savedFiles.push(saveAttachment(att));
393
- } catch (err: any) {
394
- log.warn(`[fluxy] File save error: ${err.message}`);
395
- }
396
- }
397
- }
398
-
399
- // Save user message to DB (include attachment metadata)
399
+ // Save user message to DB (include attachment metadata as JSON string)
400
400
  const meta: any = { model: freshConfig.ai.model };
401
401
  if (savedFiles.length) {
402
- meta.attachments = savedFiles.map((f) => ({
402
+ meta.attachments = JSON.stringify(savedFiles.map((f) => ({
403
403
  type: f.type, name: f.name, mediaType: f.mediaType, path: f.relPath,
404
- }));
404
+ })));
405
405
  }
406
406
  await workerApi(`/api/conversations/${convId}/messages`, 'POST', {
407
407
  role: 'user', content, meta,