fluxy-bot 0.4.17 → 0.4.18
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/package.json +1 -1
- package/supervisor/index.ts +3 -3
- package/supervisor/vite-dev.ts +7 -0
package/package.json
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { spawnBackend, stopBackend, getBackendPort, isBackendAlive, resetBackend
|
|
|
14
14
|
import { updateTunnelUrl, startHeartbeat, stopHeartbeat, disconnect } from '../shared/relay.js';
|
|
15
15
|
import { startFluxyAgentQuery, stopFluxyAgentQuery, clearFluxySession } from './fluxy-agent.js';
|
|
16
16
|
import { ensureFileDirs, saveAttachment, type SavedFile } from './file-saver.js';
|
|
17
|
-
import { startViteDevServers, stopViteDevServers } from './vite-dev.js';
|
|
17
|
+
import { startViteDevServers, stopViteDevServers, reloadDashboard } from './vite-dev.js';
|
|
18
18
|
import { execSync } from 'child_process';
|
|
19
19
|
|
|
20
20
|
const DIST_FLUXY = path.join(PKG_DIR, 'dist-fluxy');
|
|
@@ -421,11 +421,11 @@ export async function startSupervisor() {
|
|
|
421
421
|
// Intercept bot:done — Vite HMR handles file changes automatically
|
|
422
422
|
if (type === 'bot:done') {
|
|
423
423
|
if (eventData.usedFileTools) {
|
|
424
|
-
console.log('[supervisor] File tools used —
|
|
425
|
-
console.log('[supervisor] Restarting backend...');
|
|
424
|
+
console.log('[supervisor] File tools used — reloading dashboard + restarting backend');
|
|
426
425
|
resetBackendRestarts();
|
|
427
426
|
stopBackend();
|
|
428
427
|
spawnBackend(backendPort);
|
|
428
|
+
reloadDashboard();
|
|
429
429
|
}
|
|
430
430
|
return; // don't forward bot:done to client
|
|
431
431
|
}
|
package/supervisor/vite-dev.ts
CHANGED
|
@@ -51,6 +51,13 @@ export async function startViteDevServers(supervisorPort: number): Promise<{ das
|
|
|
51
51
|
return ports;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/** Tell connected browsers to full-reload via Vite's HMR WebSocket */
|
|
55
|
+
export function reloadDashboard(): void {
|
|
56
|
+
if (!dashboardVite) return;
|
|
57
|
+
console.log('[vite-dev] Sending full-reload to dashboard clients');
|
|
58
|
+
dashboardVite.hot.send({ type: 'full-reload', path: '*' });
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
export async function stopViteDevServers(): Promise<void> {
|
|
55
62
|
console.log('[vite-dev] Stopping Vite dev servers...');
|
|
56
63
|
if (dashboardVite) {
|