feat: wire daemon, agent, and telegram bot together

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-02 21:02:50 -08:00
parent d0fe4c5b35
commit b6b85f07d0
2 changed files with 49 additions and 3 deletions
+8 -2
View File
@@ -2,6 +2,7 @@ import { loadConfig } from './config/index.js';
import { startDaemon } from './daemon/index.js';
import { resolve } from 'path';
import { homedir } from 'os';
import { existsSync } from 'fs';
const CONFIG_PATH = process.env.FLYNN_CONFIG
?? resolve(homedir(), '.config/flynn/config.yaml');
@@ -10,12 +11,17 @@ async function main() {
console.log('Flynn starting...');
console.log(`Loading config from: ${CONFIG_PATH}`);
if (!existsSync(CONFIG_PATH)) {
console.error(`Config file not found: ${CONFIG_PATH}`);
console.error('Copy config/default.yaml to ~/.config/flynn/config.yaml and configure it.');
process.exit(1);
}
try {
const config = loadConfig(CONFIG_PATH);
const daemon = await startDaemon(config);
console.log(`Telegram bot configured for chat IDs: ${config.telegram.allowed_chat_ids.join(', ')}`);
console.log(`Server port: ${config.server.port}`);
console.log(`Allowed Telegram chat IDs: ${config.telegram.allowed_chat_ids.join(', ')}`);
// Keep process alive
await new Promise<void>((resolve) => {