Reworked the AI panel from a one-shot "ask + apply actions" tool into a space assistant: it scans the current space, briefs you on it, then answers questions.
Added
- OpenRouter backend (
app/api/ai/route.ts, rewritten). OpenAI-compatible chat completions; configure withOPENROUTER_API_KEY(+ optionalOPENROUTER_MODEL, defaultanthropic/claude-sonnet-4.5). Two modes:brief(opening briefing) andchat(Q&A with conversation history). The system prompt is purpose-agnostic — it infers what the space is about — and describes every card kind plus the connections. - Connections as context.
Canvasnow exposesgetConnections()(the React Flow edges drawn between cards) throughCanvasHandle; the panel feeds them to the model so it can reason over how cards relate. - Briefing + chat UI (
components/AIPanel.tsx, rewritten). On open it scans the space and drops an auto-briefing as the first message, then a chat thread for follow-ups, with broad starter prompts.
Changed
- AI now opens as a compact popover anchored above the Ask AI button — no more full-screen dim/blur backdrop or full-screen scan animation. Click outside or Esc to close.
- Dropped the "proposed changes / Apply all" action flow from the panel (the model no
longer mutates the canvas;
Canvas.applyAIActionsremains available for reuse).