Initial commit: QwenClaw persistent daemon for Qwen Code
This commit is contained in:
20
src/statusline.ts
Normal file
20
src/statusline.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { join } from "path";
|
||||
|
||||
const HEARTBEAT_DIR = join(process.cwd(), ".qwen", "qwenclaw");
|
||||
|
||||
// Write state.json so the statusline script can read fresh data
|
||||
export interface StateData {
|
||||
heartbeat?: { nextAt: number };
|
||||
jobs: { name: string; nextAt: number }[];
|
||||
security: string;
|
||||
telegram: boolean;
|
||||
startedAt: number;
|
||||
web?: { enabled: boolean; host: string; port: number };
|
||||
}
|
||||
|
||||
export async function writeState(state: StateData) {
|
||||
await Bun.write(
|
||||
join(HEARTBEAT_DIR, "state.json"),
|
||||
JSON.stringify(state) + "\n"
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user