export function chatApiRoutes(app, getChatHandler) {
    app.post('/api/chat/send', async (request, reply) => {
        const handler = getChatHandler();
        if (!handler) {
            return reply.code(503).send({ success: false, error: 'Chat handler not ready' });
        }
        const { squadName, message, files } = request.body ?? {};
        if (!squadName || !message) {
            return reply.code(400).send({ success: false, error: 'squadName and message are required' });
        }
        handler.handleChatSend(squadName, message, files);
        return reply.send({ success: true });
    });
    app.post('/api/chat/stop', async (request, reply) => {
        const { squadName } = request.body ?? {};
        if (!squadName) {
            return reply.code(400).send({ success: false, error: 'squadName is required' });
        }
        const handler = getChatHandler();
        if (!handler) {
            return reply.code(503).send({ success: false, error: 'Chat handler not ready' });
        }
        // Expose stop method on ChatHandler
        handler.stop(squadName);
        return reply.send({ success: true });
    });
}
//# sourceMappingURL=chat-api-routes.js.map