fluxy-bot 0.8.9 → 0.9.0
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/README.md +53 -84
- package/bin/cli.js +1717 -6
- package/components.json +18 -18
- package/package.json +98 -109
- package/postcss.config.js +3 -3
- package/scripts/install.ps1 +1 -1
- package/scripts/install.sh +1 -1
- package/scripts/postinstall.js +47 -58
- package/shared/ai.ts +118 -202
- package/shared/config.ts +37 -39
- package/shared/logger.ts +6 -14
- package/shared/paths.ts +10 -16
- package/shared/relay.ts +89 -98
- package/supervisor/backend.ts +77 -89
- package/supervisor/chat/ARCHITECTURE.md +13 -14
- package/supervisor/chat/OnboardWizard.tsx +2194 -3419
- package/supervisor/chat/fluxy-main.tsx +495 -633
- package/supervisor/chat/fluxy.html +24 -36
- package/supervisor/chat/onboard-main.tsx +8 -8
- package/supervisor/chat/onboard.html +10 -13
- package/supervisor/chat/src/components/Chat/AudioBubble.tsx +94 -108
- package/supervisor/chat/src/components/Chat/ChatView.tsx +14 -36
- package/supervisor/chat/src/components/Chat/ImageLightbox.tsx +71 -89
- package/supervisor/chat/src/components/Chat/InputBar.tsx +498 -728
- package/supervisor/chat/src/components/Chat/MessageBubble.tsx +154 -246
- package/supervisor/chat/src/components/Chat/MessageList.tsx +114 -138
- package/supervisor/chat/src/components/Chat/TypingIndicator.tsx +38 -50
- package/supervisor/chat/src/components/LoginScreen.tsx +245 -296
- package/supervisor/chat/src/hooks/useChat.ts +210 -259
- package/supervisor/chat/src/hooks/useFluxyChat.ts +232 -322
- package/supervisor/chat/src/hooks/useSpeechRecognition.ts +126 -148
- package/supervisor/chat/src/lib/auth.ts +20 -23
- package/supervisor/chat/src/lib/ws-client.ts +113 -125
- package/supervisor/chat/src/styles/globals.css +76 -85
- package/supervisor/file-saver.ts +39 -52
- package/supervisor/fluxy-agent.ts +213 -292
- package/supervisor/index.ts +895 -1263
- package/supervisor/scheduler.ts +237 -299
- package/supervisor/tunnel.ts +113 -167
- package/supervisor/vite-dev.ts +51 -61
- package/supervisor/widget.js +135 -147
- package/supervisor/worker.ts +45 -49
- package/tsconfig.json +18 -24
- package/vite.config.ts +48 -55
- package/vite.fluxy.config.ts +34 -34
- package/worker/claude-auth.ts +202 -265
- package/worker/codex-auth.ts +144 -181
- package/worker/db.ts +63 -191
- package/worker/index.ts +601 -842
- package/workspace/MYSELF.md +1 -1
- package/workspace/PULSE.json +6 -6
- package/workspace/backend/index.ts +16 -19
- package/workspace/client/index.html +47 -60
- package/workspace/client/public/manifest.json +21 -21
- package/workspace/client/public/sw.js +29 -31
- package/workspace/client/src/App.tsx +91 -136
- package/workspace/client/src/components/Dashboard/DashboardPage.tsx +68 -72
- package/workspace/client/src/components/ErrorBoundary.tsx +11 -11
- package/workspace/client/src/components/Layout/DashboardLayout.tsx +35 -35
- package/workspace/client/src/components/Layout/Footer.tsx +12 -12
- package/workspace/client/src/components/Layout/MobileNav.tsx +23 -23
- package/workspace/client/src/components/Layout/Sidebar.tsx +81 -81
- package/workspace/client/src/components/ui/avatar.tsx +85 -85
- package/workspace/client/src/components/ui/badge.tsx +40 -41
- package/workspace/client/src/components/ui/button.tsx +56 -57
- package/workspace/client/src/components/ui/card.tsx +75 -75
- package/workspace/client/src/components/ui/dialog.tsx +114 -117
- package/workspace/client/src/components/ui/dropdown-menu.tsx +191 -199
- package/workspace/client/src/components/ui/input.tsx +17 -17
- package/workspace/client/src/components/ui/scroll-area.tsx +47 -47
- package/workspace/client/src/components/ui/select.tsx +145 -151
- package/workspace/client/src/components/ui/separator.tsx +21 -21
- package/workspace/client/src/components/ui/sheet.tsx +102 -102
- package/workspace/client/src/components/ui/skeleton.tsx +10 -10
- package/workspace/client/src/components/ui/switch.tsx +26 -26
- package/workspace/client/src/components/ui/tabs.tsx +69 -69
- package/workspace/client/src/components/ui/textarea.tsx +14 -14
- package/workspace/client/src/components/ui/tooltip.tsx +37 -37
- package/workspace/client/src/lib/utils.ts +1 -1
- package/workspace/client/src/main.tsx +3 -3
- package/workspace/client/src/styles/globals.css +76 -85
- package/workspace/skills/code-reviewer/.claude-plugin/plugin.json +3 -3
- package/workspace/skills/code-reviewer/skills/code-reviewer/SKILL.md +0 -6
- package/workspace/skills/daily-standup/.claude-plugin/plugin.json +3 -3
- package/workspace/skills/daily-standup/skills/daily-standup/SKILL.md +0 -7
- package/workspace/skills/workspace-helper/.claude-plugin/plugin.json +3 -3
- package/workspace/skills/workspace-helper/skills/workspace-helper/SKILL.md +0 -2
- package/bin/cli.backup.js +0 -2138
- package/cli/commands/daemon.ts +0 -42
- package/cli/commands/init.ts +0 -32
- package/cli/commands/start.ts +0 -113
- package/cli/commands/tunnel.temp.ts +0 -206
- package/cli/commands/tunnel.ts +0 -227
- package/cli/commands/update.ts +0 -163
- package/cli/core/base-adapter.ts +0 -156
- package/cli/core/cloudflared.ts +0 -113
- package/cli/core/config.ts +0 -73
- package/cli/core/os-detector.ts +0 -43
- package/cli/core/server.ts +0 -109
- package/cli/core/types.ts +0 -15
- package/cli/index.ts +0 -72
- package/cli/platforms/darwin.ts +0 -146
- package/cli/platforms/index.ts +0 -21
- package/cli/platforms/linux.ts +0 -156
- package/cli/platforms/win32.ts +0 -34
- package/cli/utils/ui.ts +0 -37
package/supervisor/widget.js
CHANGED
|
@@ -1,154 +1,142 @@
|
|
|
1
1
|
(function () {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
2
|
+
if (document.getElementById('fluxy-widget')) return;
|
|
3
|
+
|
|
4
|
+
var PANEL_WIDTH = '480px';
|
|
5
|
+
|
|
6
|
+
// ── Styles ──
|
|
7
|
+
var style = document.createElement('style');
|
|
8
|
+
style.textContent = [
|
|
9
|
+
'#fluxy-widget-bubble{position:fixed;bottom:24px;right:24px;z-index:99998;cursor:pointer;width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:transform .15s ease;-webkit-tap-highlight-color:transparent}',
|
|
10
|
+
'#fluxy-widget-bubble:hover{transform:scale(1.1)}',
|
|
11
|
+
'#fluxy-widget-bubble:active{transform:scale(0.95)}',
|
|
12
|
+
'#fluxy-widget-bubble video{height:60px;width:auto;pointer-events:none;-webkit-user-drag:none}',
|
|
13
|
+
'#fluxy-widget-bubble img{width:60px;height:60px;object-fit:contain;pointer-events:none;-webkit-user-drag:none}',
|
|
14
|
+
'#fluxy-widget-backdrop{position:fixed;inset:0;z-index:99998;background:rgba(0,0,0,0.4);opacity:0;transition:opacity .2s ease;pointer-events:none}',
|
|
15
|
+
'#fluxy-widget-backdrop.open{opacity:1;pointer-events:auto}',
|
|
16
|
+
'#fluxy-widget-panel{position:fixed;top:0;right:0;bottom:0;z-index:99999;width:' + PANEL_WIDTH + ';max-width:100vw;transform:translateX(100%);transition:transform .25s cubic-bezier(.4,0,.2,1);box-shadow:-4px 0 24px rgba(0,0,0,0.3);border-left:1px solid #3a3a3a;overflow:hidden}',
|
|
17
|
+
'#fluxy-widget-panel.open{transform:translateX(0)}',
|
|
18
|
+
'#fluxy-widget-panel iframe{width:100%;height:100%;border:none;background:#212121}',
|
|
19
|
+
'@media(max-width:480px){#fluxy-widget-panel{width:100vw}}',
|
|
20
|
+
].join('\n');
|
|
21
|
+
document.head.appendChild(style);
|
|
22
|
+
|
|
23
|
+
// ── Backdrop ──
|
|
24
|
+
var backdrop = document.createElement('div');
|
|
25
|
+
backdrop.id = 'fluxy-widget-backdrop';
|
|
26
|
+
document.body.appendChild(backdrop);
|
|
27
|
+
|
|
28
|
+
// ── Panel ──
|
|
29
|
+
var panel = document.createElement('div');
|
|
30
|
+
panel.id = 'fluxy-widget-panel';
|
|
31
|
+
document.body.appendChild(panel);
|
|
32
|
+
|
|
33
|
+
var iframe = document.createElement('iframe');
|
|
34
|
+
iframe.src = '/fluxy/';
|
|
35
|
+
iframe.setAttribute('loading', 'lazy');
|
|
36
|
+
panel.appendChild(iframe);
|
|
37
|
+
|
|
38
|
+
// ── Bubble ──
|
|
39
|
+
var bubble = document.createElement('div');
|
|
40
|
+
bubble.id = 'fluxy-widget-bubble';
|
|
41
|
+
bubble.setAttribute('role', 'button');
|
|
42
|
+
bubble.setAttribute('aria-label', 'Open Fluxy chat');
|
|
43
|
+
|
|
44
|
+
// Safari doesn't support WebM alpha — fall back to poster image
|
|
45
|
+
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
|
|
46
|
+
|| (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream);
|
|
47
|
+
|
|
48
|
+
if (isSafari) {
|
|
49
|
+
var img = document.createElement('img');
|
|
50
|
+
img.src = '/fluxy_frame1.png';
|
|
51
|
+
img.alt = 'Fluxy';
|
|
52
|
+
img.draggable = false;
|
|
53
|
+
bubble.appendChild(img);
|
|
54
|
+
} else {
|
|
55
|
+
var video = document.createElement('video');
|
|
56
|
+
video.src = '/fluxy_tilts.webm';
|
|
57
|
+
video.poster = '/fluxy_frame1.png';
|
|
58
|
+
video.autoplay = true;
|
|
59
|
+
video.loop = true;
|
|
60
|
+
video.muted = true;
|
|
61
|
+
video.playsInline = true;
|
|
62
|
+
video.setAttribute('playsinline', '');
|
|
63
|
+
video.draggable = false;
|
|
64
|
+
bubble.appendChild(video);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Mark widget present
|
|
68
|
+
bubble.dataset.fluxyWidget = '1';
|
|
69
|
+
document.body.appendChild(bubble);
|
|
70
|
+
|
|
71
|
+
// ── Toggle ──
|
|
72
|
+
var isOpen = false;
|
|
73
|
+
|
|
74
|
+
function toggle() {
|
|
75
|
+
isOpen = !isOpen;
|
|
76
|
+
panel.classList.toggle('open', isOpen);
|
|
77
|
+
backdrop.classList.toggle('open', isOpen);
|
|
78
|
+
bubble.style.display = isOpen ? 'none' : 'flex';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
bubble.addEventListener('click', toggle);
|
|
82
|
+
backdrop.addEventListener('click', toggle);
|
|
83
|
+
|
|
84
|
+
// Close on Escape
|
|
85
|
+
document.addEventListener('keydown', function (e) {
|
|
86
|
+
if (e.key === 'Escape' && isOpen) toggle();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// ── PWA Install ──
|
|
90
|
+
var deferredInstallPrompt = null;
|
|
91
|
+
window.addEventListener('beforeinstallprompt', function (e) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
deferredInstallPrompt = e;
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Handle messages from iframe
|
|
97
|
+
window.addEventListener('message', function (e) {
|
|
98
|
+
if (!e.data || !e.data.type) return;
|
|
99
|
+
|
|
100
|
+
// Close chat panel
|
|
101
|
+
if (e.data.type === 'fluxy:close' && isOpen) toggle();
|
|
102
|
+
|
|
103
|
+
// Install App request from chat iframe
|
|
104
|
+
if (e.data.type === 'fluxy:install-app') {
|
|
105
|
+
if (deferredInstallPrompt) {
|
|
106
|
+
deferredInstallPrompt.prompt();
|
|
107
|
+
deferredInstallPrompt.userChoice.then(function (result) {
|
|
108
|
+
if (result.outcome === 'accepted') deferredInstallPrompt = null;
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
// No native prompt available — tell chat to show instructions modal
|
|
112
|
+
iframe.contentWindow.postMessage({ type: 'fluxy:show-ios-install' }, '*');
|
|
113
|
+
}
|
|
68
114
|
}
|
|
115
|
+
});
|
|
69
116
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var isOpen = false;
|
|
76
|
-
|
|
77
|
-
function toggle() {
|
|
78
|
-
isOpen = !isOpen;
|
|
79
|
-
panel.classList.toggle('open', isOpen);
|
|
80
|
-
backdrop.classList.toggle('open', isOpen);
|
|
81
|
-
bubble.style.display = isOpen ? 'none' : 'flex';
|
|
117
|
+
// Restore open state after HMR reload (so chat isn't disrupted)
|
|
118
|
+
try {
|
|
119
|
+
if (sessionStorage.getItem('fluxy_widget_open') === '1') {
|
|
120
|
+
sessionStorage.removeItem('fluxy_widget_open');
|
|
121
|
+
toggle();
|
|
82
122
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
deferredInstallPrompt = e;
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// Handle messages from iframe
|
|
100
|
-
window.addEventListener('message', function (e) {
|
|
101
|
-
if (!e.data || !e.data.type) return;
|
|
102
|
-
|
|
103
|
-
// Close chat panel
|
|
104
|
-
if (e.data.type === 'fluxy:close' && isOpen) toggle();
|
|
105
|
-
|
|
106
|
-
// Install App request from chat iframe
|
|
107
|
-
if (e.data.type === 'fluxy:install-app') {
|
|
108
|
-
if (deferredInstallPrompt) {
|
|
109
|
-
deferredInstallPrompt.prompt();
|
|
110
|
-
deferredInstallPrompt.userChoice.then(function (result) {
|
|
111
|
-
if (result.outcome === 'accepted')
|
|
112
|
-
deferredInstallPrompt = null;
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
// No native prompt available — tell chat to show instructions modal
|
|
116
|
-
iframe.contentWindow.postMessage(
|
|
117
|
-
{ type: 'fluxy:show-ios-install' },
|
|
118
|
-
'*'
|
|
119
|
-
);
|
|
123
|
+
} catch (e) {}
|
|
124
|
+
|
|
125
|
+
// Hide widget during initial onboard
|
|
126
|
+
try {
|
|
127
|
+
fetch('/api/settings')
|
|
128
|
+
.then(function (r) { return r.json(); })
|
|
129
|
+
.then(function (s) {
|
|
130
|
+
if (s.onboard_complete !== 'true') {
|
|
131
|
+
bubble.style.display = 'none';
|
|
132
|
+
window.addEventListener('message', function onMsg(e) {
|
|
133
|
+
if (e.data && e.data.type === 'fluxy:onboard-complete') {
|
|
134
|
+
bubble.style.display = 'flex';
|
|
135
|
+
window.removeEventListener('message', onMsg);
|
|
120
136
|
}
|
|
137
|
+
});
|
|
121
138
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
try {
|
|
126
|
-
if (sessionStorage.getItem('fluxy_widget_open') === '1') {
|
|
127
|
-
sessionStorage.removeItem('fluxy_widget_open');
|
|
128
|
-
toggle();
|
|
129
|
-
}
|
|
130
|
-
} catch (_e) {}
|
|
131
|
-
|
|
132
|
-
// Hide widget during initial onboard
|
|
133
|
-
try {
|
|
134
|
-
fetch('/api/settings')
|
|
135
|
-
.then(function (r) {
|
|
136
|
-
return r.json();
|
|
137
|
-
})
|
|
138
|
-
.then(function (s) {
|
|
139
|
-
if (s.onboard_complete !== 'true') {
|
|
140
|
-
bubble.style.display = 'none';
|
|
141
|
-
window.addEventListener('message', function onMsg(e) {
|
|
142
|
-
if (
|
|
143
|
-
e.data &&
|
|
144
|
-
e.data.type === 'fluxy:onboard-complete'
|
|
145
|
-
) {
|
|
146
|
-
bubble.style.display = 'flex';
|
|
147
|
-
window.removeEventListener('message', onMsg);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
.catch(function () {});
|
|
153
|
-
} catch (_e) {}
|
|
139
|
+
})
|
|
140
|
+
.catch(function () {});
|
|
141
|
+
} catch (e) {}
|
|
154
142
|
})();
|
package/supervisor/worker.ts
CHANGED
|
@@ -8,7 +8,7 @@ let restarts = 0;
|
|
|
8
8
|
const MAX_RESTARTS = 3;
|
|
9
9
|
|
|
10
10
|
export function getWorkerPort(basePort: number): number {
|
|
11
|
-
|
|
11
|
+
return basePort + 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
let lastSpawnTime = 0;
|
|
@@ -16,65 +16,61 @@ let intentionallyStopped = false;
|
|
|
16
16
|
const STABLE_THRESHOLD = 30_000;
|
|
17
17
|
|
|
18
18
|
export function spawnWorker(port: number): ChildProcess {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const workerPath = path.join(PKG_DIR, 'worker', 'index.ts');
|
|
20
|
+
lastSpawnTime = Date.now();
|
|
21
|
+
intentionallyStopped = false;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
// Wrap the worker in an inline loader that:
|
|
24
|
+
// 1. Dynamically imports the worker (tsx handles .ts compilation)
|
|
25
|
+
// 2. Adds a keepalive timer so the event loop never drains (fixes exit code 0 under systemd)
|
|
26
|
+
// 3. Catches and logs import errors instead of silently exiting
|
|
27
|
+
const workerUrl = 'file://' + workerPath.replace(/\\/g, '/');
|
|
28
|
+
const wrapper = [
|
|
29
|
+
`import('${workerUrl}')`,
|
|
30
|
+
` .catch(e => { console.error('[worker] Fatal:', e); process.exit(1); });`,
|
|
31
|
+
`setInterval(() => {}, 60000);`,
|
|
32
|
+
].join('\n');
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
40
|
-
env: { ...process.env, WORKER_PORT: String(port) }
|
|
41
|
-
}
|
|
42
|
-
);
|
|
34
|
+
child = spawn(process.execPath, ['--import', 'tsx/esm', '--input-type=module', '-e', wrapper], {
|
|
35
|
+
cwd: PKG_DIR,
|
|
36
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
37
|
+
env: { ...process.env, WORKER_PORT: String(port) },
|
|
38
|
+
});
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
child.stdout?.on('data', (d) => {
|
|
41
|
+
process.stdout.write(d);
|
|
42
|
+
});
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
child.stderr?.on('data', (d) => {
|
|
45
|
+
process.stderr.write(d);
|
|
46
|
+
});
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
child.on('exit', (code) => {
|
|
49
|
+
if (intentionallyStopped) return;
|
|
54
50
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
log.warn(`Worker exited unexpectedly (code ${code})`);
|
|
52
|
+
if (Date.now() - lastSpawnTime > STABLE_THRESHOLD) {
|
|
53
|
+
restarts = 0;
|
|
54
|
+
}
|
|
55
|
+
if (restarts < MAX_RESTARTS) {
|
|
56
|
+
restarts++;
|
|
57
|
+
log.info(`Restarting worker (${restarts}/${MAX_RESTARTS})...`);
|
|
58
|
+
setTimeout(() => spawnWorker(port), 1000 * restarts);
|
|
59
|
+
} else {
|
|
60
|
+
log.error('Worker failed too many times. Use Fluxy chat to debug.');
|
|
61
|
+
}
|
|
62
|
+
});
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
log.ok(`Worker spawned on port ${port}`);
|
|
65
|
+
return child;
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
export function stopWorker(): void {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
intentionallyStopped = true;
|
|
70
|
+
child?.kill();
|
|
71
|
+
child = null;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
export function isWorkerAlive(): boolean {
|
|
79
|
-
|
|
75
|
+
return child !== null && child.exitCode === null;
|
|
80
76
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"server/**/*",
|
|
21
|
-
"workspace/client/src/**/*",
|
|
22
|
-
"workspace/backend/**/*",
|
|
23
|
-
"vite.config.ts"
|
|
24
|
-
],
|
|
25
|
-
"exclude": ["node_modules", "dist", "data"]
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": ".",
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"types": [],
|
|
13
|
+
"paths": {
|
|
14
|
+
"@server/*": ["./server/*"],
|
|
15
|
+
"@client/*": ["./workspace/client/src/*"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"include": ["server/**/*", "workspace/client/src/**/*", "workspace/backend/**/*", "vite.config.ts"],
|
|
19
|
+
"exclude": ["node_modules", "dist", "data"]
|
|
26
20
|
}
|
package/vite.config.ts
CHANGED
|
@@ -4,62 +4,55 @@ import tailwindcss from '@tailwindcss/vite';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
root: 'workspace/client',
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: { '@': path.resolve(__dirname, 'workspace/client/src') },
|
|
10
|
+
},
|
|
11
|
+
build: {
|
|
12
|
+
outDir: '../../dist',
|
|
13
|
+
emptyOutDir: true,
|
|
14
|
+
},
|
|
15
|
+
server: {
|
|
16
|
+
port: 5173,
|
|
17
|
+
proxy: {
|
|
18
|
+
'/app/api': {
|
|
19
|
+
target: 'http://localhost:3004',
|
|
20
|
+
rewrite: (path) => path.replace(/^\/app\/api/, '') || '/',
|
|
21
|
+
},
|
|
22
|
+
'/api': 'http://localhost:3000',
|
|
16
23
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
emptyOutDir: true
|
|
24
|
+
warmup: {
|
|
25
|
+
clientFiles: ['./src/main.tsx'],
|
|
20
26
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'**/app.db*',
|
|
36
|
-
'**/.backend.log',
|
|
37
|
-
'**/files/**',
|
|
38
|
-
'**/.env',
|
|
39
|
-
'**/backend/**',
|
|
40
|
-
'**/*.db',
|
|
41
|
-
'**/*.db-journal',
|
|
42
|
-
'**/*.db-wal',
|
|
43
|
-
'**/*.db-shm',
|
|
44
|
-
'**/*.sqlite',
|
|
45
|
-
'**/*.log'
|
|
46
|
-
]
|
|
47
|
-
}
|
|
27
|
+
watch: {
|
|
28
|
+
ignored: [
|
|
29
|
+
'**/app.db*',
|
|
30
|
+
'**/.backend.log',
|
|
31
|
+
'**/files/**',
|
|
32
|
+
'**/.env',
|
|
33
|
+
'**/backend/**',
|
|
34
|
+
'**/*.db',
|
|
35
|
+
'**/*.db-journal',
|
|
36
|
+
'**/*.db-wal',
|
|
37
|
+
'**/*.db-shm',
|
|
38
|
+
'**/*.sqlite',
|
|
39
|
+
'**/*.log',
|
|
40
|
+
],
|
|
48
41
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
42
|
+
},
|
|
43
|
+
optimizeDeps: {
|
|
44
|
+
include: [
|
|
45
|
+
'react',
|
|
46
|
+
'react-dom/client',
|
|
47
|
+
'react/jsx-runtime',
|
|
48
|
+
'lucide-react',
|
|
49
|
+
'framer-motion',
|
|
50
|
+
'recharts',
|
|
51
|
+
'zustand',
|
|
52
|
+
'sonner',
|
|
53
|
+
'use-sync-external-store',
|
|
54
|
+
'use-sync-external-store/shim',
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
plugins: [react(), tailwindcss()],
|
|
65
58
|
});
|
package/vite.fluxy.config.ts
CHANGED
|
@@ -4,40 +4,40 @@ import tailwindcss from '@tailwindcss/vite';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
6
|
export default defineConfig({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
root: 'supervisor/chat',
|
|
8
|
+
base: '/fluxy/',
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: { '@': path.resolve(__dirname, 'supervisor/chat/src') },
|
|
11
|
+
},
|
|
12
|
+
build: {
|
|
13
|
+
outDir: '../../dist-fluxy',
|
|
14
|
+
emptyOutDir: true,
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
input: {
|
|
17
|
+
fluxy: path.resolve(__dirname, 'supervisor/chat/fluxy.html'),
|
|
18
|
+
onboard: path.resolve(__dirname, 'supervisor/chat/onboard.html'),
|
|
19
|
+
},
|
|
11
20
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
input: {
|
|
17
|
-
fluxy: path.resolve(__dirname, 'supervisor/chat/fluxy.html'),
|
|
18
|
-
onboard: path.resolve(__dirname, 'supervisor/chat/onboard.html')
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
+
},
|
|
22
|
+
server: {
|
|
23
|
+
warmup: {
|
|
24
|
+
clientFiles: ['./fluxy-main.tsx', './onboard-main.tsx'],
|
|
21
25
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'use-sync-external-store/shim'
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
plugins: [react(), tailwindcss()]
|
|
26
|
+
},
|
|
27
|
+
optimizeDeps: {
|
|
28
|
+
include: [
|
|
29
|
+
'react',
|
|
30
|
+
'react-dom/client',
|
|
31
|
+
'react/jsx-runtime',
|
|
32
|
+
'lucide-react',
|
|
33
|
+
'framer-motion',
|
|
34
|
+
'react-markdown',
|
|
35
|
+
'remark-gfm',
|
|
36
|
+
'react-syntax-highlighter',
|
|
37
|
+
'react-syntax-highlighter/dist/esm/styles/prism/one-dark',
|
|
38
|
+
'use-sync-external-store',
|
|
39
|
+
'use-sync-external-store/shim',
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
plugins: [react(), tailwindcss()],
|
|
43
43
|
});
|