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.
Files changed (106) hide show
  1. package/README.md +53 -84
  2. package/bin/cli.js +1717 -6
  3. package/components.json +18 -18
  4. package/package.json +98 -109
  5. package/postcss.config.js +3 -3
  6. package/scripts/install.ps1 +1 -1
  7. package/scripts/install.sh +1 -1
  8. package/scripts/postinstall.js +47 -58
  9. package/shared/ai.ts +118 -202
  10. package/shared/config.ts +37 -39
  11. package/shared/logger.ts +6 -14
  12. package/shared/paths.ts +10 -16
  13. package/shared/relay.ts +89 -98
  14. package/supervisor/backend.ts +77 -89
  15. package/supervisor/chat/ARCHITECTURE.md +13 -14
  16. package/supervisor/chat/OnboardWizard.tsx +2194 -3419
  17. package/supervisor/chat/fluxy-main.tsx +495 -633
  18. package/supervisor/chat/fluxy.html +24 -36
  19. package/supervisor/chat/onboard-main.tsx +8 -8
  20. package/supervisor/chat/onboard.html +10 -13
  21. package/supervisor/chat/src/components/Chat/AudioBubble.tsx +94 -108
  22. package/supervisor/chat/src/components/Chat/ChatView.tsx +14 -36
  23. package/supervisor/chat/src/components/Chat/ImageLightbox.tsx +71 -89
  24. package/supervisor/chat/src/components/Chat/InputBar.tsx +498 -728
  25. package/supervisor/chat/src/components/Chat/MessageBubble.tsx +154 -246
  26. package/supervisor/chat/src/components/Chat/MessageList.tsx +114 -138
  27. package/supervisor/chat/src/components/Chat/TypingIndicator.tsx +38 -50
  28. package/supervisor/chat/src/components/LoginScreen.tsx +245 -296
  29. package/supervisor/chat/src/hooks/useChat.ts +210 -259
  30. package/supervisor/chat/src/hooks/useFluxyChat.ts +232 -322
  31. package/supervisor/chat/src/hooks/useSpeechRecognition.ts +126 -148
  32. package/supervisor/chat/src/lib/auth.ts +20 -23
  33. package/supervisor/chat/src/lib/ws-client.ts +113 -125
  34. package/supervisor/chat/src/styles/globals.css +76 -85
  35. package/supervisor/file-saver.ts +39 -52
  36. package/supervisor/fluxy-agent.ts +213 -292
  37. package/supervisor/index.ts +895 -1263
  38. package/supervisor/scheduler.ts +237 -299
  39. package/supervisor/tunnel.ts +113 -167
  40. package/supervisor/vite-dev.ts +51 -61
  41. package/supervisor/widget.js +135 -147
  42. package/supervisor/worker.ts +45 -49
  43. package/tsconfig.json +18 -24
  44. package/vite.config.ts +48 -55
  45. package/vite.fluxy.config.ts +34 -34
  46. package/worker/claude-auth.ts +202 -265
  47. package/worker/codex-auth.ts +144 -181
  48. package/worker/db.ts +63 -191
  49. package/worker/index.ts +601 -842
  50. package/workspace/MYSELF.md +1 -1
  51. package/workspace/PULSE.json +6 -6
  52. package/workspace/backend/index.ts +16 -19
  53. package/workspace/client/index.html +47 -60
  54. package/workspace/client/public/manifest.json +21 -21
  55. package/workspace/client/public/sw.js +29 -31
  56. package/workspace/client/src/App.tsx +91 -136
  57. package/workspace/client/src/components/Dashboard/DashboardPage.tsx +68 -72
  58. package/workspace/client/src/components/ErrorBoundary.tsx +11 -11
  59. package/workspace/client/src/components/Layout/DashboardLayout.tsx +35 -35
  60. package/workspace/client/src/components/Layout/Footer.tsx +12 -12
  61. package/workspace/client/src/components/Layout/MobileNav.tsx +23 -23
  62. package/workspace/client/src/components/Layout/Sidebar.tsx +81 -81
  63. package/workspace/client/src/components/ui/avatar.tsx +85 -85
  64. package/workspace/client/src/components/ui/badge.tsx +40 -41
  65. package/workspace/client/src/components/ui/button.tsx +56 -57
  66. package/workspace/client/src/components/ui/card.tsx +75 -75
  67. package/workspace/client/src/components/ui/dialog.tsx +114 -117
  68. package/workspace/client/src/components/ui/dropdown-menu.tsx +191 -199
  69. package/workspace/client/src/components/ui/input.tsx +17 -17
  70. package/workspace/client/src/components/ui/scroll-area.tsx +47 -47
  71. package/workspace/client/src/components/ui/select.tsx +145 -151
  72. package/workspace/client/src/components/ui/separator.tsx +21 -21
  73. package/workspace/client/src/components/ui/sheet.tsx +102 -102
  74. package/workspace/client/src/components/ui/skeleton.tsx +10 -10
  75. package/workspace/client/src/components/ui/switch.tsx +26 -26
  76. package/workspace/client/src/components/ui/tabs.tsx +69 -69
  77. package/workspace/client/src/components/ui/textarea.tsx +14 -14
  78. package/workspace/client/src/components/ui/tooltip.tsx +37 -37
  79. package/workspace/client/src/lib/utils.ts +1 -1
  80. package/workspace/client/src/main.tsx +3 -3
  81. package/workspace/client/src/styles/globals.css +76 -85
  82. package/workspace/skills/code-reviewer/.claude-plugin/plugin.json +3 -3
  83. package/workspace/skills/code-reviewer/skills/code-reviewer/SKILL.md +0 -6
  84. package/workspace/skills/daily-standup/.claude-plugin/plugin.json +3 -3
  85. package/workspace/skills/daily-standup/skills/daily-standup/SKILL.md +0 -7
  86. package/workspace/skills/workspace-helper/.claude-plugin/plugin.json +3 -3
  87. package/workspace/skills/workspace-helper/skills/workspace-helper/SKILL.md +0 -2
  88. package/bin/cli.backup.js +0 -2138
  89. package/cli/commands/daemon.ts +0 -42
  90. package/cli/commands/init.ts +0 -32
  91. package/cli/commands/start.ts +0 -113
  92. package/cli/commands/tunnel.temp.ts +0 -206
  93. package/cli/commands/tunnel.ts +0 -227
  94. package/cli/commands/update.ts +0 -163
  95. package/cli/core/base-adapter.ts +0 -156
  96. package/cli/core/cloudflared.ts +0 -113
  97. package/cli/core/config.ts +0 -73
  98. package/cli/core/os-detector.ts +0 -43
  99. package/cli/core/server.ts +0 -109
  100. package/cli/core/types.ts +0 -15
  101. package/cli/index.ts +0 -72
  102. package/cli/platforms/darwin.ts +0 -146
  103. package/cli/platforms/index.ts +0 -21
  104. package/cli/platforms/linux.ts +0 -156
  105. package/cli/platforms/win32.ts +0 -34
  106. package/cli/utils/ui.ts +0 -37
@@ -1,154 +1,142 @@
1
1
  (function () {
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:' +
17
- PANEL_WIDTH +
18
- ';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}',
19
- '#fluxy-widget-panel.open{transform:translateX(0)}',
20
- '#fluxy-widget-panel iframe{width:100%;height:100%;border:none;background:#212121}',
21
- '@media(max-width:480px){#fluxy-widget-panel{width:100vw}}'
22
- ].join('\n');
23
- document.head.appendChild(style);
24
-
25
- // ── Backdrop ──
26
- var backdrop = document.createElement('div');
27
- backdrop.id = 'fluxy-widget-backdrop';
28
- document.body.appendChild(backdrop);
29
-
30
- // ── Panel ──
31
- var panel = document.createElement('div');
32
- panel.id = 'fluxy-widget-panel';
33
- document.body.appendChild(panel);
34
-
35
- var iframe = document.createElement('iframe');
36
- iframe.src = '/fluxy/';
37
- iframe.setAttribute('loading', 'lazy');
38
- panel.appendChild(iframe);
39
-
40
- // ── Bubble ──
41
- var bubble = document.createElement('div');
42
- bubble.id = 'fluxy-widget-bubble';
43
- bubble.setAttribute('role', 'button');
44
- bubble.setAttribute('aria-label', 'Open Fluxy chat');
45
-
46
- // Safari doesn't support WebM alpha — fall back to poster image
47
- var isSafari =
48
- /^((?!chrome|android).)*safari/i.test(navigator.userAgent) ||
49
- (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream);
50
-
51
- if (isSafari) {
52
- var img = document.createElement('img');
53
- img.src = '/fluxy_frame1.png';
54
- img.alt = 'Fluxy';
55
- img.draggable = false;
56
- bubble.appendChild(img);
57
- } else {
58
- var video = document.createElement('video');
59
- video.src = '/fluxy_tilts.webm';
60
- video.poster = '/fluxy_frame1.png';
61
- video.autoplay = true;
62
- video.loop = true;
63
- video.muted = true;
64
- video.playsInline = true;
65
- video.setAttribute('playsinline', '');
66
- video.draggable = false;
67
- bubble.appendChild(video);
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
- // Mark widget present
71
- bubble.dataset.fluxyWidget = '1';
72
- document.body.appendChild(bubble);
73
-
74
- // ── Toggle ──
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
- bubble.addEventListener('click', toggle);
85
- backdrop.addEventListener('click', toggle);
86
-
87
- // Close on Escape
88
- document.addEventListener('keydown', function (e) {
89
- if (e.key === 'Escape' && isOpen) toggle();
90
- });
91
-
92
- // ── PWA Install ──
93
- var deferredInstallPrompt = null;
94
- window.addEventListener('beforeinstallprompt', function (e) {
95
- e.preventDefault();
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
- // Restore open state after HMR reload (so chat isn't disrupted)
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
  })();
@@ -8,7 +8,7 @@ let restarts = 0;
8
8
  const MAX_RESTARTS = 3;
9
9
 
10
10
  export function getWorkerPort(basePort: number): number {
11
- return basePort + 1;
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
- const workerPath = path.join(PKG_DIR, 'worker', 'index.ts');
20
- lastSpawnTime = Date.now();
21
- intentionallyStopped = false;
19
+ const workerPath = path.join(PKG_DIR, 'worker', 'index.ts');
20
+ lastSpawnTime = Date.now();
21
+ intentionallyStopped = false;
22
22
 
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');
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
- child = spawn(
35
- process.execPath,
36
- ['--import', 'tsx/esm', '--input-type=module', '-e', wrapper],
37
- {
38
- cwd: PKG_DIR,
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
- child.stdout?.on('data', d => {
45
- process.stdout.write(d);
46
- });
40
+ child.stdout?.on('data', (d) => {
41
+ process.stdout.write(d);
42
+ });
47
43
 
48
- child.stderr?.on('data', d => {
49
- process.stderr.write(d);
50
- });
44
+ child.stderr?.on('data', (d) => {
45
+ process.stderr.write(d);
46
+ });
51
47
 
52
- child.on('exit', code => {
53
- if (intentionallyStopped) return;
48
+ child.on('exit', (code) => {
49
+ if (intentionallyStopped) return;
54
50
 
55
- log.warn(`Worker exited unexpectedly (code ${code})`);
56
- if (Date.now() - lastSpawnTime > STABLE_THRESHOLD) {
57
- restarts = 0;
58
- }
59
- if (restarts < MAX_RESTARTS) {
60
- restarts++;
61
- log.info(`Restarting worker (${restarts}/${MAX_RESTARTS})...`);
62
- setTimeout(() => spawnWorker(port), 1000 * restarts);
63
- } else {
64
- log.error('Worker failed too many times. Use Fluxy chat to debug.');
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
- log.ok(`Worker spawned on port ${port}`);
69
- return child;
64
+ log.ok(`Worker spawned on port ${port}`);
65
+ return child;
70
66
  }
71
67
 
72
68
  export function stopWorker(): void {
73
- intentionallyStopped = true;
74
- child?.kill();
75
- child = null;
69
+ intentionallyStopped = true;
70
+ child?.kill();
71
+ child = null;
76
72
  }
77
73
 
78
74
  export function isWorkerAlive(): boolean {
79
- return child !== null && child.exitCode === null;
75
+ return child !== null && child.exitCode === null;
80
76
  }
package/tsconfig.json CHANGED
@@ -1,26 +1,20 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "ES2023",
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
- "@/*": ["./workspace/client/src/*"]
17
- }
18
- },
19
- "include": [
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
- root: process.env.FLUXY_WORKSPACE
8
- ? path.join(process.env.FLUXY_WORKSPACE, 'client')
9
- : 'workspace/client',
10
- resolve: {
11
- alias: {
12
- '@': process.env.FLUXY_WORKSPACE
13
- ? path.join(process.env.FLUXY_WORKSPACE, 'client/src')
14
- : path.resolve(__dirname, 'workspace/client/src')
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
- build: {
18
- outDir: '../../dist',
19
- emptyOutDir: true
24
+ warmup: {
25
+ clientFiles: ['./src/main.tsx'],
20
26
  },
21
- server: {
22
- port: 5173,
23
- proxy: {
24
- '/app/api': {
25
- target: 'http://localhost:3004',
26
- rewrite: path => path.replace(/^\/app\/api/, '') || '/'
27
- },
28
- '/api': 'http://localhost:3000'
29
- },
30
- warmup: {
31
- clientFiles: ['./src/main.tsx']
32
- },
33
- watch: {
34
- ignored: [
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
- optimizeDeps: {
50
- include: [
51
- 'react',
52
- 'react-dom/client',
53
- 'react/jsx-runtime',
54
- 'react-router',
55
- 'lucide-react',
56
- 'framer-motion',
57
- 'recharts',
58
- 'zustand',
59
- 'sonner',
60
- 'use-sync-external-store',
61
- 'use-sync-external-store/shim'
62
- ]
63
- },
64
- plugins: [react(), tailwindcss()]
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
  });
@@ -4,40 +4,40 @@ import tailwindcss from '@tailwindcss/vite';
4
4
  import path from 'path';
5
5
 
6
6
  export default defineConfig({
7
- root: 'supervisor/chat',
8
- base: '/fluxy/',
9
- resolve: {
10
- alias: { '@': path.resolve(__dirname, 'supervisor/chat/src') }
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
- 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
- }
20
- }
21
+ },
22
+ server: {
23
+ warmup: {
24
+ clientFiles: ['./fluxy-main.tsx', './onboard-main.tsx'],
21
25
  },
22
- server: {
23
- warmup: {
24
- clientFiles: ['./fluxy-main.tsx', './onboard-main.tsx']
25
- }
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()]
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
  });