feat: wire daemon, agent, and telegram bot together
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user