extend chat model with CRUD actions for event changes
- Add ProposedEventChange type with create/update/delete actions - Replace proposedEvent with proposedChange in ChatMessage - Add currentDate to AIContext for time-aware AI responses - Add AI test endpoint for development (/api/ai/test) - Fix MongoUserRepository type safety with explicit toUser mapping - Update CLAUDE.md documentation
This commit is contained in:
@@ -45,6 +45,27 @@ app.get('/health', (_, res) => {
|
||||
res.json({ status: 'ok' });
|
||||
});
|
||||
|
||||
// AI Test endpoint (for development only)
|
||||
app.post('/api/ai/test', async (req, res) => {
|
||||
try {
|
||||
const { message } = req.body;
|
||||
if (!message) {
|
||||
res.status(400).json({ error: 'message is required' });
|
||||
return;
|
||||
}
|
||||
const result = await aiProvider.processMessage(message, {
|
||||
userId: 'test-user',
|
||||
conversationHistory: [],
|
||||
existingEvents: [],
|
||||
currentDate: new Date(),
|
||||
});
|
||||
res.json(result);
|
||||
} catch (error) {
|
||||
console.error('AI test error:', error);
|
||||
res.status(500).json({ error: String(error) });
|
||||
}
|
||||
});
|
||||
|
||||
// Start server
|
||||
async function start() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user