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.
@@ -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
- }