Fix: Daemon startup and Qwen CLI path for Windows

This commit is contained in:
admin
2026-02-26 02:28:06 +04:00
Unverified
parent 80cdad994c
commit c9799c1eac
6 changed files with 358 additions and 180 deletions

View File

@@ -7,20 +7,38 @@ import { send } from "./commands/send";
const args = process.argv.slice(2);
const command = args[0];
if (command === "--stop-all") {
stopAll();
} else if (command === "--stop") {
stop();
} else if (command === "--clear") {
clear();
} else if (command === "start") {
start(args.slice(1));
} else if (command === "status") {
status();
} else if (command === "telegram") {
telegram();
} else if (command === "send") {
send(args.slice(1));
} else {
start();
async function main() {
console.log("[QwenClaw] Index.ts - Command:", command);
if (command === "--stop-all") {
await stopAll();
} else if (command === "--stop") {
await stop();
} else if (command === "--clear") {
await clear();
} else if (command === "start") {
console.log("[QwenClaw] Calling start function...");
await start(args.slice(1));
console.log("[QwenClaw] Start function returned");
} else if (command === "status") {
await status();
} else if (command === "telegram") {
await telegram();
} else if (command === "send") {
await send(args.slice(1));
} else {
console.log("[QwenClaw] No command, starting default...");
await start();
}
}
main().catch((err) => {
console.error("[QwenClaw] Fatal error:", err);
process.exit(1);
});
// Keep process alive
process.on('SIGINT', () => {
console.log('[QwenClaw] Received SIGINT, shutting down...');
process.exit(0);
});