fluxy-bot 0.11.3 → 0.11.5
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/bin/cli.js +37 -0
- package/package.json +1 -1
- package/worker/prompts/fluxy-system-prompt.txt +12 -3
package/bin/cli.js
CHANGED
|
@@ -1735,6 +1735,42 @@ async function tunnel(sub) {
|
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
1737
|
|
|
1738
|
+
// ── Password Reset ──
|
|
1739
|
+
|
|
1740
|
+
async function passwordReset() {
|
|
1741
|
+
const DB_PATH = path.join(DATA_DIR, 'memory.db');
|
|
1742
|
+
|
|
1743
|
+
if (!fs.existsSync(DB_PATH)) {
|
|
1744
|
+
console.log(`\n ${c.red}✗${c.reset} No database found. Run ${c.pink}fluxy init${c.reset} and complete setup first.\n`);
|
|
1745
|
+
process.exit(1);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
const Database = (await import('better-sqlite3')).default;
|
|
1749
|
+
const db = new Database(DB_PATH);
|
|
1750
|
+
|
|
1751
|
+
// Clear password and TOTP credentials
|
|
1752
|
+
db.prepare("DELETE FROM settings WHERE key IN ('portal_pass', 'totp_enabled', 'totp_secret', 'totp_recovery_codes')").run();
|
|
1753
|
+
|
|
1754
|
+
// Reset onboard flag so the wizard appears on next visit
|
|
1755
|
+
db.prepare("INSERT INTO settings (key, value) VALUES ('onboard_complete', 'false') ON CONFLICT(key) DO UPDATE SET value = 'false', updated_at = CURRENT_TIMESTAMP").run();
|
|
1756
|
+
|
|
1757
|
+
// Invalidate all active sessions and trusted devices
|
|
1758
|
+
db.prepare('DELETE FROM sessions').run();
|
|
1759
|
+
db.prepare('DELETE FROM trusted_devices').run();
|
|
1760
|
+
|
|
1761
|
+
db.close();
|
|
1762
|
+
|
|
1763
|
+
console.log(`\n ${c.blue}✔${c.reset} Password reset successful.\n`);
|
|
1764
|
+
console.log(` ${c.dim}The onboard wizard will appear on your next visit`);
|
|
1765
|
+
console.log(` so you can create a new password.${c.reset}\n`);
|
|
1766
|
+
|
|
1767
|
+
// Auto-restart daemon if it's running
|
|
1768
|
+
if (isDaemonInstalled() && isDaemonActive()) {
|
|
1769
|
+
console.log(` ${c.dim}Restarting Fluxy daemon...${c.reset}`);
|
|
1770
|
+
daemon('restart');
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1738
1774
|
// ── Route ──
|
|
1739
1775
|
|
|
1740
1776
|
switch (command) {
|
|
@@ -1746,6 +1782,7 @@ switch (command) {
|
|
|
1746
1782
|
case 'update': update(); break;
|
|
1747
1783
|
case 'daemon': daemon(subcommand); break;
|
|
1748
1784
|
case 'tunnel': tunnel(subcommand); break;
|
|
1785
|
+
case 'password-reset': passwordReset(); break;
|
|
1749
1786
|
default:
|
|
1750
1787
|
fs.existsSync(CONFIG_PATH) ? start() : init();
|
|
1751
1788
|
}
|
package/package.json
CHANGED
|
@@ -277,11 +277,20 @@ Browser: GET /app/api/tasks → Supervisor strips prefix → Backend receives: G
|
|
|
277
277
|
NEVER run `npm run build`, `vite build`, or any build commands. Vite HMR handles frontend changes automatically. The backend auto-restarts when you edit files. Never look in `dist/` or `dist-fluxy/`.
|
|
278
278
|
|
|
279
279
|
## Installing Packages
|
|
280
|
-
|
|
280
|
+
Your workspace has its own `package.json` and `node_modules/`. You can freely install npm packages — they are fully isolated from the system. Nothing you install can break the supervisor, worker, or chat.
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
```bash
|
|
283
|
+
npm install <package> # run from your cwd (workspace root)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
This works for both backend and frontend packages. After installing:
|
|
287
|
+
- Backend picks up new imports on the next auto-restart
|
|
288
|
+
- Vite resolves new frontend imports via HMR
|
|
289
|
+
- No build step needed
|
|
290
|
+
|
|
291
|
+
Before installing, check if a suitable package is already in `node_modules/`. Prefer well-known, maintained packages.
|
|
283
292
|
|
|
284
|
-
|
|
293
|
+
**Never** run `npm install` from the parent directory or modify the parent's `package.json`. Your dependencies are sandboxed to workspace — this boundary is enforced at the runtime level.
|
|
285
294
|
|
|
286
295
|
## Backend Lifecycle (Critical)
|
|
287
296
|
|