Add Insights DevTools panel with pull-based architecture
Implements a new DevTools panel that displays application insights using an
on-demand pull model instead of HMR push. The panel shows security and
serialization issues with expert prompts that can be copied for AI analysis.
Key features:
- Generic /__nextjs_insights API endpoint for extensible insight types
- Pull-based architecture: panel fetches data on mount and via refresh button
- Flattened insight display: each issue shown as separate card (not grouped)
- Copy expert prompt button on each insight for AI assistance
- Compact file location display with full details
- Proper scrollability for multiple insights
- Generic UI design (no hardcoded categories)
Technical implementation:
- Added getInsightsMiddleware() for both Turbopack and Webpack
- Removed all HMR push complexity (message types, state, dispatcher)
- Flattened API response: one object per issue with expertPrompt field
- Pull model eliminates state synchronization issues
- Fully type-safe with proper error handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>