fluxy-bot 0.1.39 → 0.1.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "Self-hosted AI bot — run your own AI assistant from anywhere",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,13 +41,6 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@anthropic-ai/claude-agent-sdk": "^0.2.50",
44
- "better-sqlite3": "^12.6.2",
45
- "express": "^5.2.1",
46
- "radix-ui": "^1.4.3",
47
- "tsx": "^4.21.0",
48
- "ws": "^8.19.0"
49
- },
50
- "devDependencies": {
51
44
  "@react-three/drei": "^10.7.7",
52
45
  "@react-three/fiber": "^9.5.0",
53
46
  "@tailwindcss/postcss": "^4.2.0",
@@ -60,13 +53,16 @@
60
53
  "@types/react-syntax-highlighter": "^15.5.13",
61
54
  "@types/ws": "^8.18.1",
62
55
  "@vitejs/plugin-react": "^5.1.4",
56
+ "better-sqlite3": "^12.6.2",
63
57
  "class-variance-authority": "^0.7.1",
64
58
  "clsx": "^2.1.1",
65
59
  "concurrently": "^9.2.1",
66
60
  "date-fns": "^4.1.0",
61
+ "express": "^5.2.1",
67
62
  "framer-motion": "^12.34.3",
68
63
  "lucide-react": "^0.575.0",
69
64
  "postcss": "^8.5.6",
65
+ "radix-ui": "^1.4.3",
70
66
  "react": "^19.2.4",
71
67
  "react-dom": "^19.2.4",
72
68
  "react-markdown": "^10.1.0",
@@ -77,9 +73,11 @@
77
73
  "tailwind-merge": "^3.5.0",
78
74
  "tailwindcss": "^4.2.0",
79
75
  "three": "^0.183.1",
76
+ "tsx": "^4.21.0",
80
77
  "typescript": "^5.9.3",
81
78
  "vite": "^7.3.1",
82
79
  "vite-plugin-pwa": "^1.2.0",
80
+ "ws": "^8.19.0",
83
81
  "zustand": "^5.0.11"
84
82
  }
85
83
  }
@@ -48,9 +48,8 @@ const DEFAULT_INSTRUCTIONS = `# INSTRUCTIONS.md — Operating Rules (LOCKED)
48
48
  ## Codebase editing
49
49
  - The full app source lives at ~/.fluxy/app/. You have full freedom to edit worker/ and client/ files.
50
50
  - Backend changes (worker/) auto-reload via watch mode. No restart needed.
51
- - Frontend changes (client/src/) auto-reload via Vite HMR. No build step, no refresh needed.
51
+ - Frontend changes (client/src/) are built and committed automatically after your turn ends. Tell the user to refresh to see changes.
52
52
  - Environment variables go in ~/.fluxy/.env (one KEY=value per line). They are loaded on worker startup and available via process.env.
53
- - Everything is live. Just edit the files and the user sees the result immediately.
54
53
  - **SACRED FILES — never delete or break these:**
55
54
  - supervisor/ — the kernel process. Never edit these files.
56
55
  - shared/ — infrastructure modules. Never edit these files.
@@ -1,9 +1,10 @@
1
1
  import http from 'http';
2
2
  import net from 'net';
3
+ import { exec } from 'child_process';
3
4
  import { WebSocketServer, WebSocket } from 'ws';
4
5
  import { loadConfig, saveConfig } from '../shared/config.js';
5
6
  import { createProvider, type AiProvider, type ChatMessage } from '../shared/ai.js';
6
- import { paths } from '../shared/paths.js';
7
+ import { paths, PKG_DIR } from '../shared/paths.js';
7
8
  import { log } from '../shared/logger.js';
8
9
  import { initDb, closeDb, createConversation, addMessage, getMessages, getSetting } from '../shared/db.js';
9
10
  import { initWorkspace } from '../shared/workspace.js';
@@ -19,6 +20,21 @@ div{text-align:center}h1{font-size:18px;margin-bottom:8px;color:#e2e8f0}p{font-s
19
20
  <body><div><h1>Dashboard is restarting...</h1><p>Refreshing automatically.</p></div>
20
21
  <script>setTimeout(()=>location.reload(),3000)</script></body></html>`;
21
22
 
23
+ /** Build frontend + git commit after every agent turn */
24
+ function runPostIteration(): void {
25
+ log.info('[post-iteration] Building & committing...');
26
+
27
+ exec('npx vite build', { cwd: PKG_DIR, timeout: 60_000 }, (buildErr) => {
28
+ if (buildErr) {
29
+ log.warn(`[post-iteration] Build failed: ${buildErr.message}`);
30
+ } else {
31
+ log.ok('[post-iteration] Build complete');
32
+ }
33
+
34
+ // TODO: git add -A && git commit — checkpoint for rollback
35
+ });
36
+ }
37
+
22
38
  export async function startSupervisor() {
23
39
  const config = loadConfig();
24
40
  const workerPort = getWorkerPort(config.port);
@@ -119,7 +135,7 @@ export async function startSupervisor() {
119
135
  addMessage(convId, 'assistant', data.content, { model: freshConfig.ai.model });
120
136
  }
121
137
  ws.send(JSON.stringify({ type, data: { ...data, conversationId: convId } }));
122
- }, attachments);
138
+ }, attachments).then(() => runPostIteration());
123
139
  return;
124
140
  }
125
141
 
@@ -153,6 +169,7 @@ export async function startSupervisor() {
153
169
  const m = addMessage(convId, 'assistant', full, { tokens_in: usage?.tokensIn, tokens_out: usage?.tokensOut, model: freshConfig.ai.model });
154
170
  ws.send(JSON.stringify({ type: 'bot:response', data: { conversationId: convId, messageId: (m as any).id, content: full } }));
155
171
  activeStreams.delete(convId);
172
+ runPostIteration();
156
173
  },
157
174
  (err) => {
158
175
  ws.send(JSON.stringify({ type: 'bot:error', data: { conversationId: convId, error: err.message } }));