The ADD CONSTRAINT for Note.notebookId was not wrapped in an exception
handler, causing P3009 on production when the constraint already existed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Production DB was missing autoLabeling and languageDetection on UserAISettings,
causing 500 errors on echo/connections endpoints. Also adds missing indexes
and fixes Note.notebookId FK to use ON DELETE SET NULL.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Empty notebook placeholder: "Carnet vide" → t('notes.emptyNotebook')
- No note selected: "Aucune note sélectionnée" → t('notes.noNoteSelected')
- Descriptions replaced with t('notes.emptyNotebookDesc'), t('notes.selectOrCreateNote')
- Removed French fallback on newNote button title
- Added 4 new i18n keys to all 15 locales
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The floating ai-chat.tsx was not sending the user's language to the
/api/chat endpoint, causing it to always use the English system prompt.
Now passes `language` from useLanguage() hook.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
TS doesn't narrow session.user inside async callback closures.
Extract userId before the dynamic import to satisfy type checking.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The error fallback and non-logged-in fallback in getAISettings were
missing languageDetection and autoLabeling fields, creating a union type
where these could be undefined — breaking the build.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add confirmPassword field to registration form with Zod validation
- Replace ~30 hardcoded French/English strings in admin-settings-form
with proper t() i18n calls (Ollama models, Custom models, search test)
- Extract SettingsHeader to client component for i18n support
- Add 15 i18n keys to all 15 locale files (auth + admin.ai + admin.tools)
- Remove debug "Config value" line from embeddings section
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy all models used by MCP tools with every field, relation, and
index from memento-note/prisma/schema.prisma. No more guessing
which relations are needed — it's an exact subset.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The pipeline only built memento-note, causing mcp-server to run with
stale code/schema after pushes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove `embedding` column from MCP Note model (dropped by migration 20260425120000)
- Add missing columns: trashedAt, dismissedFromRecent, contentUpdatedAt, cardSizeMode
- Add NoteEmbedding model and Label.notebook relation
- Use AsyncLocalStorage to pass authenticated userId from API key to tool handlers
- Enable SSE mode and auth in docker-compose for N8N integration
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add visibilitychange listener: refreshes agent data immediately when
user returns to the tab (more reliable than interval-only polling)
- Only show toast for actions created within last 5 minutes to avoid
false positives on page reload
- Hide "Prochaine exécution" line entirely if nextRun is in the past
instead of showing confusing "En attente de déclenchement"
- Add detailed logging to cron endpoint for debugging
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The getAgents() function was recalculating nextRun to future dates when
it found past values. This prevented the cron scheduler from ever
finding due agents (nextRun <= now was always false since getAgents
had already pushed it to the future).
Also fix toast polling: use null sentinel for agents without initial
actions so first execution is still detected. Limit cron to 3 agents
per cycle and add logging.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Replace wget with node http.request in entrypoint (guaranteed
available, better error handling)
- Add 30s polling in agents page to detect new agent executions
- Show toast notification when an agent finishes (success or failure)
- Add logging in scheduler for visibility in docker logs
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add background scheduler in entrypoint: calls /api/cron/agents every
5 minutes to trigger due agents automatically
- Recalculate stale nextRun (past dates) in getAgents() so the display
always shows a future time
- Agent card shows "En attente de déclenchement" instead of "il y a X"
when nextRun is in the past
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The en-US Intl format is MM/DD/YYYY but the regex parsing was assigning
capture group 1 (month) to day and capture group 2 (day) to month.
For day 26+ this created an invalid month value (26), causing
RangeError: Invalid time value when formatting the date.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previous migration (20260426130000) may be recorded as failed in
_prisma_migrations after a db push conflict. This new migration with
a different timestamp will be seen as pending and applied with
idempotent SQL that handles both cases.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Use DO blocks with EXCEPTION WHEN duplicate_column to safely handle
columns that may already exist from a previous db push.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Create migration 20260426130000_add_agent_schedule_fields with the 3 new
Agent columns (scheduledTime, scheduledDay, timezone). Reverts entrypoint
back to prisma migrate deploy. Removes redundant migration step from
deploy.yaml.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The app uses db push (no migration files), so migrate deploy was a no-op.
Also removes the redundant migration step from deploy.yaml since the
entrypoint now handles schema sync on every container start.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Run database migration after build and before container startup
so schema changes are always applied before the app goes live.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add scheduledTime, scheduledDay, timezone fields to Agent schema
- Create calculateNextRun() helper with timezone-aware scheduling
- Add POST /api/cron/agents endpoint for external scheduler
- Calculate nextRun on agent create, update, and after execution
- Add time/day picker in agent form (daily/weekly/monthly)
- Show "Next run" countdown in agent card
- Add i18n keys for schedule UI (FR + EN)
External scheduler (N8N, Vercel Cron) should call /api/cron/agents
every 5-15 min. Requires `prisma db push` to apply schema changes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add trashedAt: null filter to notebook note count queries in /api/notebooks
- Pass isTrashView, onRestore, onPermanentDelete from NoteCard to NoteActions
- Implement handleRestore and handlePermanentDelete in NoteCard
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add triggerRefresh() call after note creation in both masonry (home-client)
and tabs (notes-tabs-view) modes so NotebooksContext reloads notebook counts.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>