fluxy-bot 0.3.18 → 0.3.20
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/assets/{fluxy-DDgCW8m4.js → fluxy-sbmFOV3Z.js} +6 -6
- package/dist-fluxy/assets/globals-BmcQJ_1f.js +17 -0
- package/dist-fluxy/assets/{onboard-BnNwYTId.js → onboard-Cp7fEIFC.js} +1 -1
- package/dist-fluxy/fluxy.html +2 -2
- package/dist-fluxy/onboard.html +2 -2
- package/package.json +1 -1
- package/supervisor/chat/OnboardWizard.tsx +13 -10
- package/supervisor/chat/fluxy-main.tsx +21 -0
- package/supervisor/index.ts +18 -0
- package/dist-fluxy/assets/globals-CYritkLr.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,j as e,R as n,O as r}from"./globals-
|
|
1
|
+
import{b as o,j as e,R as n,O as r}from"./globals-BmcQJ_1f.js";function a(){const t=()=>{window.parent?.postMessage({type:"fluxy:onboard-complete"},"*")};return e.jsx(r,{onComplete:t,isInitialSetup:!0})}o.createRoot(document.getElementById("root")).render(e.jsx(n.StrictMode,{children:e.jsx(a,{})}));
|
package/dist-fluxy/fluxy.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
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-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/fluxy/assets/globals-
|
|
7
|
+
<script type="module" crossorigin src="/fluxy/assets/fluxy-sbmFOV3Z.js"></script>
|
|
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>
|
|
11
11
|
<body class="bg-background text-foreground">
|
package/dist-fluxy/onboard.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
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 Setup</title>
|
|
7
|
-
<script type="module" crossorigin src="/fluxy/assets/onboard-
|
|
8
|
-
<link rel="modulepreload" crossorigin href="/fluxy/assets/globals-
|
|
7
|
+
<script type="module" crossorigin src="/fluxy/assets/onboard-Cp7fEIFC.js"></script>
|
|
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>
|
|
11
11
|
<body class="bg-background text-foreground">
|
package/package.json
CHANGED
|
@@ -87,9 +87,10 @@ function ModelDropdown({ models, value, onChange }: { models: { id: string; labe
|
|
|
87
87
|
interface Props {
|
|
88
88
|
onComplete: () => void;
|
|
89
89
|
isInitialSetup?: boolean;
|
|
90
|
+
onSave?: (payload: any) => Promise<any>;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
export default function OnboardWizard({ onComplete, isInitialSetup = false }: Props) {
|
|
93
|
+
export default function OnboardWizard({ onComplete, isInitialSetup = false, onSave }: Props) {
|
|
93
94
|
const TOTAL_STEPS = isInitialSetup ? 7 : 6; // 0..5 normal, +step 6 "All Set" for initial
|
|
94
95
|
|
|
95
96
|
const [step, setStep] = useState(0);
|
|
@@ -472,16 +473,18 @@ export default function OnboardWizard({ onComplete, isInitialSetup = false }: Pr
|
|
|
472
473
|
portalUser: portalUser.trim(),
|
|
473
474
|
portalPass,
|
|
474
475
|
};
|
|
475
|
-
console.log('[OnboardWizard] handleComplete called, payload:', JSON.stringify(payload, null, 2));
|
|
476
476
|
try {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
477
|
+
if (onSave) {
|
|
478
|
+
// Chat context: save via WebSocket (bypasses relay POST issues)
|
|
479
|
+
await onSave(payload);
|
|
480
|
+
} else {
|
|
481
|
+
// Initial onboard: direct POST
|
|
482
|
+
await fetch('/api/onboard', {
|
|
483
|
+
method: 'POST',
|
|
484
|
+
headers: { 'Content-Type': 'application/json' },
|
|
485
|
+
body: JSON.stringify(payload),
|
|
486
|
+
});
|
|
487
|
+
}
|
|
485
488
|
if (isInitialSetup) {
|
|
486
489
|
setSaving(false);
|
|
487
490
|
setStep(6);
|
|
@@ -252,6 +252,27 @@ function FluxyApp() {
|
|
|
252
252
|
{/* Setup Wizard overlay */}
|
|
253
253
|
{showWizard && (
|
|
254
254
|
<OnboardWizard
|
|
255
|
+
onSave={(payload) => {
|
|
256
|
+
return new Promise((resolve, reject) => {
|
|
257
|
+
const client = clientRef.current;
|
|
258
|
+
if (!client?.connected) {
|
|
259
|
+
reject(new Error('WebSocket not connected'));
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const unsub = client.on('settings:saved', (data) => {
|
|
263
|
+
unsub();
|
|
264
|
+
clearTimeout(timer);
|
|
265
|
+
resolve(data);
|
|
266
|
+
});
|
|
267
|
+
const unsubErr = client.on('settings:save-error', (data) => {
|
|
268
|
+
unsubErr();
|
|
269
|
+
clearTimeout(timer);
|
|
270
|
+
reject(new Error(data.error || 'Save failed'));
|
|
271
|
+
});
|
|
272
|
+
const timer = setTimeout(() => { unsub(); unsubErr(); reject(new Error('Save timeout')); }, 10000);
|
|
273
|
+
client.send('settings:save', payload);
|
|
274
|
+
});
|
|
275
|
+
}}
|
|
255
276
|
onComplete={() => {
|
|
256
277
|
setShowWizard(false);
|
|
257
278
|
// Reload settings (bot name, whisper, etc.)
|
package/supervisor/index.ts
CHANGED
|
@@ -305,6 +305,24 @@ export async function startSupervisor() {
|
|
|
305
305
|
|
|
306
306
|
const msg = JSON.parse(rawStr);
|
|
307
307
|
|
|
308
|
+
// Save settings via WebSocket (bypasses relay POST issues)
|
|
309
|
+
if (msg.type === 'settings:save') {
|
|
310
|
+
(async () => {
|
|
311
|
+
try {
|
|
312
|
+
const result = await workerApi('/api/onboard', 'POST', msg.data);
|
|
313
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
314
|
+
ws.send(JSON.stringify({ type: 'settings:saved', data: result }));
|
|
315
|
+
}
|
|
316
|
+
} catch (err: any) {
|
|
317
|
+
log.error(`[fluxy] settings:save failed: ${err.message}`);
|
|
318
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
319
|
+
ws.send(JSON.stringify({ type: 'settings:save-error', data: { error: err.message } }));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
})();
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
|
|
308
326
|
// New protocol: { type: 'user:message', data: { content, conversationId? } }
|
|
309
327
|
if (msg.type === 'user:message') {
|
|
310
328
|
const data = msg.data || {};
|