fluxy-bot 0.2.44 → 0.3.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-fluxy/assets/{fluxy-B20BJakh.js → fluxy-tSkoe-BG.js} +20 -20
- package/dist-fluxy/assets/globals-CZf7hjQW.css +1 -0
- package/dist-fluxy/assets/{onboard-CdR_xRWS.js → onboard-B_QyBFoO.js} +1 -1
- package/dist-fluxy/fluxy.html +3 -3
- package/dist-fluxy/onboard.html +3 -3
- package/package.json +1 -3
- package/shared/config.ts +0 -1
- package/supervisor/chat/fluxy-main.tsx +103 -156
- package/supervisor/chat/src/components/LoginScreen.tsx +87 -0
- package/supervisor/chat/src/hooks/useFluxyChat.ts +3 -2
- package/supervisor/chat/src/lib/auth.ts +30 -0
- package/supervisor/chat/src/lib/ws-client.ts +12 -2
- package/supervisor/index.ts +84 -40
- package/worker/db.ts +19 -0
- package/worker/index.ts +25 -103
- package/workspace/client/src/App.tsx +4 -57
- package/workspace/client/src/main.tsx +1 -4
- package/dist-fluxy/assets/globals-DMXu7CFU.css +0 -1
- package/shared/auth.ts +0 -55
- package/workspace/client/src/components/Landing/LandingPage.tsx +0 -98
- /package/dist-fluxy/assets/{globals--DVlL_N5.js → globals-CnbiE5KJ.js} +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
export default function LandingPage() {
|
|
5
|
-
const navigate = useNavigate();
|
|
6
|
-
const [botName, setBotName] = useState('Fluxy');
|
|
7
|
-
const [isAuthed, setIsAuthed] = useState(false);
|
|
8
|
-
const [showOnboard, setShowOnboard] = useState(false);
|
|
9
|
-
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
Promise.all([
|
|
12
|
-
fetch('/api/settings').then((r) => r.json()).catch(() => null),
|
|
13
|
-
fetch('/api/auth/me').then((r) => r.json()).catch(() => null),
|
|
14
|
-
fetch('/api/auth/configured').then((r) => r.json()).catch(() => null),
|
|
15
|
-
]).then(([settings, me, cfg]) => {
|
|
16
|
-
if (settings?.agent_name) setBotName(settings.agent_name);
|
|
17
|
-
if (me?.authenticated) setIsAuthed(true);
|
|
18
|
-
// First run — show onboard overlay
|
|
19
|
-
if (cfg && !cfg.configured && !cfg.onboardComplete) setShowOnboard(true);
|
|
20
|
-
});
|
|
21
|
-
}, []);
|
|
22
|
-
|
|
23
|
-
// Hide/show bubble during onboarding
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const bubble = document.getElementById('fluxy-widget-bubble');
|
|
26
|
-
if (bubble) bubble.style.display = showOnboard ? 'none' : '';
|
|
27
|
-
}, [showOnboard]);
|
|
28
|
-
|
|
29
|
-
// Listen for onboard complete from fluxy iframe
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const handler = (e: MessageEvent) => {
|
|
32
|
-
if (e.data?.type === 'fluxy:onboard-complete') {
|
|
33
|
-
setShowOnboard(false);
|
|
34
|
-
// Re-check auth — onboard auto-issues a JWT cookie
|
|
35
|
-
fetch('/api/auth/me').then((r) => r.json())
|
|
36
|
-
.then((me) => { if (me?.authenticated) setIsAuthed(true); })
|
|
37
|
-
.catch(() => {});
|
|
38
|
-
// Re-fetch bot name
|
|
39
|
-
fetch('/api/settings').then((r) => r.json())
|
|
40
|
-
.then((s) => { if (s?.agent_name) setBotName(s.agent_name); })
|
|
41
|
-
.catch(() => {});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
window.addEventListener('message', handler);
|
|
45
|
-
return () => window.removeEventListener('message', handler);
|
|
46
|
-
}, []);
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<div className="min-h-dvh flex flex-col bg-background">
|
|
50
|
-
{/* Header */}
|
|
51
|
-
<header className="flex items-center justify-between px-6 py-4">
|
|
52
|
-
<div className="flex items-center gap-2">
|
|
53
|
-
<img src="/fluxy.png" alt={botName} className="h-6 w-auto" />
|
|
54
|
-
<span className="text-sm font-semibold">{botName}</span>
|
|
55
|
-
</div>
|
|
56
|
-
{isAuthed && (
|
|
57
|
-
<button
|
|
58
|
-
onClick={() => navigate('/dashboard')}
|
|
59
|
-
className="text-sm font-medium px-4 py-2 rounded-full border border-white/[0.08] hover:bg-white/[0.06] transition-colors"
|
|
60
|
-
>
|
|
61
|
-
Dashboard
|
|
62
|
-
</button>
|
|
63
|
-
)}
|
|
64
|
-
</header>
|
|
65
|
-
|
|
66
|
-
{/* Hero */}
|
|
67
|
-
<main className="flex-1 flex flex-col items-center justify-center px-6 text-center">
|
|
68
|
-
<video
|
|
69
|
-
src="/fluxy_say_hi.webm"
|
|
70
|
-
autoPlay
|
|
71
|
-
loop
|
|
72
|
-
muted
|
|
73
|
-
playsInline
|
|
74
|
-
className="h-28 w-28 rounded-full object-cover mb-8"
|
|
75
|
-
/>
|
|
76
|
-
<h1 className="text-3xl sm:text-4xl font-bold mb-3">
|
|
77
|
-
<span className="text-gradient">{botName}</span>
|
|
78
|
-
</h1>
|
|
79
|
-
<p className="text-muted-foreground text-base max-w-md">
|
|
80
|
-
Your personal AI assistant, always ready to help.
|
|
81
|
-
</p>
|
|
82
|
-
</main>
|
|
83
|
-
|
|
84
|
-
{/* Footer */}
|
|
85
|
-
<footer className="py-4 text-center">
|
|
86
|
-
<p className="text-xs text-muted-foreground/60">Powered by Fluxy</p>
|
|
87
|
-
</footer>
|
|
88
|
-
|
|
89
|
-
{/* Onboard overlay (first run) — served from dist-fluxy (supervisor territory) */}
|
|
90
|
-
{showOnboard && (
|
|
91
|
-
<iframe
|
|
92
|
-
src="/fluxy/onboard.html"
|
|
93
|
-
style={{ position: 'fixed', inset: 0, width: '100vw', height: '100dvh', border: 'none', zIndex: 200 }}
|
|
94
|
-
/>
|
|
95
|
-
)}
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
File without changes
|