mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-18 14:27:20 +00:00
- ModuleManager: Central tracking for installed marketplace modules - DataAnalyzerWidget: Real-time CPU/RAM/Battery/Storage widget (unlocked by Data Analyzer module) - BottomNavBar: Navigation bar for Projects/Chat/Marketplace/Settings - RootShell: Real root command execution utility - TerminalActivity: Full root shell with neofetch, sysinfo, real Linux commands - Terminal Pro module: Adds aliases (ll, la, h), command history - ArcadeActivity + SnakeGame: Pixel Arcade module unlocks retro games - fade_in/fade_out animations for smooth transitions
36 lines
916 B
JavaScript
36 lines
916 B
JavaScript
import chokidar from "chokidar";
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { scrubPII } from "./pii-scrub.js";
|
|
|
|
let watcher = null;
|
|
|
|
export async function startWatcher(dir) {
|
|
if (watcher) await watcher.close();
|
|
watcher = chokidar.watch(["**/*.lua", "**/*.cs", "**/*.ts", "**/*.tsx"], {
|
|
cwd: dir,
|
|
ignoreInitial: true,
|
|
});
|
|
|
|
watcher.on("change", (filePath) => {
|
|
const full = path.join(dir, filePath);
|
|
try {
|
|
const content = fs.readFileSync(full, "utf-8");
|
|
const safe = scrubPII(content);
|
|
console.log(`[watcher] ${filePath} changed`);
|
|
// TODO: route safe content to renderer or local analysis pipeline
|
|
console.log(safe.slice(0, 400));
|
|
} catch (err) {
|
|
console.error("watcher read error", err);
|
|
}
|
|
});
|
|
|
|
return true;
|
|
}
|
|
|
|
export async function stopWatcher() {
|
|
if (watcher) await watcher.close();
|
|
watcher = null;
|
|
return true;
|
|
}
|
|
|