import express from 'express';
import sessionManager from '../sessionManager.js';
import { sessionNamesDb } from '../database/db.js';
const router = express.Router();
// Delete a Qwen Code session — mirrors the Gemini/Codex routes so the UI's
// unified delete flow works identically regardless of the active provider.
router.delete('/sessions/:sessionId', async (req, res) => {
    try {
        const { sessionId } = req.params;
        if (!sessionId || typeof sessionId !== 'string' || !/^[a-zA-Z0-9_.-]{1,100}$/.test(sessionId)) {
            return res.status(400).json({ success: false, error: 'Invalid session ID format' });
        }
        await sessionManager.deleteSession(sessionId);
        sessionNamesDb.deleteName(sessionId, 'qwen');
        res.json({ success: true });
    }
    catch (error) {
        console.error(`Error deleting Qwen session ${req.params.sessionId}:`, error);
        res.status(500).json({ success: false, error: error.message });
    }
});
export default router;
//# sourceMappingURL=qwen.js.map