- Update runRound() to dynamically select correct AI client based on session.aiProvider
- Modify POST /api/collaborate to accept and validate aiProvider parameter
- Add aiProvider field to session creation response
- Add AI provider selector dropdown to frontend (Mistral Large 2411 vs Claude 3.5 Sonnet)
- Update collaboration store to pass aiProvider parameter through API
Users can now choose between Mistral and Claude AI for their collaborative sessions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create claudeClient.js service for Claude API integration
- Add CLAUDE_API_KEY to .env configuration
- Claude uses identical prompt structure and section extraction logic
- Supports claude-3-5-sonnet-20241022 model
Next: Add provider selection to orchestrator and routes
- Import db module at top of file using ES6 import
- Remove dynamic require() call that was causing ReferenceError
- Database sessions now load correctly through GET /api/collaborate endpoint
Backend fixes:
- Improve AI prompt with CRITICAL RULES emphasizing single section only
- Add examples of CORRECT vs INCORRECT responses
- Fix extractSection() to validate extracted content
- Validate sections are < 5KB and start with markdown headers
- Return error indicator for invalid section formats
- This prevents IAs from returning entire document
Frontend fixes:
- Fix stop button: call ws.disconnect() to close WebSocket immediately
- Stop processing WebSocket messages when isStopping is true
- Clear messageInterval when stopping
- Add archive sessions section on home page for easy access
- Display all sessions in a searchable grid format
- Add session status indicators and date
- Scrollable grid for browsing all sessions
- Integrated with existing search functionality
User experience improvements:
- Sessions now accessible both at top (Quick Access) and bottom (Archive)
- Unified search works across all filtering
- Stop button now truly stops the session
- Better validation prevents document duplication bug
Backend improvements:
- Modify GET /api/collaborate/:id/document to return final_document for completed sessions
- Sessions archivées sont maintenant accessibles même si pas en mémoire active
Frontend improvements:
- Add search bar to filter sessions by ID or description
- Add search query state to allow real-time filtering
- Update session counts in filter buttons
- Enhance filteredSessions computed to include search query
- Add CSS styling for search input with focus effects
- Enable easy discovery and access to all archived sessions
- Sessions can now be searched, filtered by status, and browsed
- Fix convergence: use agentsInRound.length as fallback if agentCount is undefined
- This was causing infinite loops when agentCount wasn't properly initialized
- Simplify convergence check: only schedule next round if !hasConverged
- Add 'stopped' flag to sessions to prevent scheduled rounds from executing
- Modify runRound to check 'stopped' flag and exit early if set
- Modify completeSession to set 'stopped = true' to abort scheduled rounds
- This fixes the issue where stop button wasn't actually stopping the session
- Add better logging for convergence state
- Remove unused Readable import from mistralClient.js
- Remove unused generateAgentResponse streaming function
- Remove unused parseStreamResponse helper function
- Remove unused updateDocumentFromMessage from collaboration store
- Remove unused documentVersions state from store
- Remove unused getRandomName function from nameGenerator.js
- Clean up store exports and clearCurrentSession function
- Change default from mistral-small-latest to mistral-large-2411
- mistral-large-2411 is Mistral's flagship model (123B params)
- Optimized for complex agentic workflows with precise instruction following
- Supports 128k context window with robust function-calling and JSON outputs
- Better suited for multi-agent collaborative document editing
- Add deleteSection() method to collaborativeOrchestrator.js for removing sections by header
- Enable IAs to delete sections with 'DELETE: ## Section Name' format
- Modify mistralClient.js prompt to include deletion instructions
- Simplify working agent card UI: show only raised hand animation + agent name
- Remove thinking content display from working agent card for cleaner UX
Allows frontend to retrieve history of all past sessions for easy access
to previous discussions and documents.
GET /api/collaborate returns:
- List of last 50 sessions (ordered by most recent first)
- Each session includes: id, prompt, format, status, created/completed dates
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major improvements:
- SYSTEM creates base structure (not an AI agent) in startSession
- Round 1 begins with clean document v0
- Each AI receives the EXACT document version from previous agent
- Enhanced logging shows 'AGENT n/N' with version numbers
- Each AI sees full updated document before modifying
- Clear v0 → v1 → v2 → vN progression
- Better deduplication through explicit sequential flow
The collaboraion is now explicitly sequential: SYSTEM → IA1 (receives v0, creates v1) → IA2 (receives v1, creates v2) etc.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Features:
- IAs can now create NEW sections if they think they're needed
- Complete document content logging (before/after each modification)
- Detailed AI thinking and reasoning in logs
- Distinguish between 'MODIFIED' and 'CREATED NEW SECTION' actions
- Full round-by-round visibility in logs
This allows AI agents to be more creative and add new architectural
sections when they identify missing requirements or design gaps.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The generateAgentResponse function uses 'yield' to stream responses,
so it must be declared as an async generator function (async function*)
instead of a regular async function.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Backend changes:
- Refactor mistralClient to generic agent prompts (not role-based)
- Implement streaming responses with thinking extraction
- Create nameGenerator service for random AI names
- Refactor collaborativeOrchestrator for N agents
- Implement true convergence (N agents with no changes)
- Add section merging for partial document updates
- Each AI modifies only ONE section, not entire document
- Broadcast agent_working and agent_thinking events in real-time
- Update routes for new orchestrator API
Features:
- Support 3-50 AI agents instead of fixed 7 roles
- Real-time thinking/reasoning streaming
- Partial document updates (section-based)
- True convergence tracking
- Automatic round progression
- Section extraction and merging
Next: Frontend enhancements for visualization
- Install marked and highlight.js for better markdown rendering
- Create nameGenerator service with 50 unique names
- Update DocumentViewer to use marked instead of regex parsing
- Add syntax highlighting for code blocks
- Improve styling for code with proper colors
Update database schema and backend services to properly track session lifecycle:
- Sessions now start with 'created' status
- Frontend auto-start logic works when status is 'created'
- Status transitions to 'ongoing' when session actually starts
- Prevents issues with premature round execution
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add new iterative collaboration mode where Lead Architect creates initial document,
then 3-7 specialized agents review and refine it through sequential rounds until
convergence. Complete with WebSocket real-time updates, document versioning, and
timeline tracking.
Backend:
- New collaborativeOrchestrator service with round-based iteration logic
- Document versioning and diff tracking
- Three new DB tables: collaborative_sessions, document_versions, document_rounds
- New /api/collaborate routes for session management
- WebSocket support for sessionId in addition to debateId
Frontend:
- New collaboration store (Pinia) for session state management
- CollaborativeInput component for creating sessions with format/agent selection
- CollaborativeSession component with real-time document viewer and timeline
- DocumentViewer with basic Markdown rendering and text support
- App.vue refactored with mode selector (Classic Debate vs Collaborative Design)
- Enhanced useWebSocket composable supporting both debateId and sessionId
Features:
- 7 specialized agents: Lead Architect, Backend Engineer, Frontend Engineer, UI Designer, DevOps Engineer, Product Manager, Security Specialist
- Flexible document formats: Markdown (.md) and plain text (.txt)
- Automatic convergence detection when no changes in full round
- Complete modification history with who changed what and why
- Download final document in chosen format
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Change maxTokens to max_tokens for Mistral API compatibility
- Extract maxTokens from options before spreading to avoid parameter conflicts
- Tested successfully with live API calls
- Add Mistral AI integration for agent responses
- Create mistralClient service with agent-specific prompts
- Support for architect, backend engineer, frontend engineer, and designer roles
- Automatic JSON response parsing and validation
- Implement WebSocket real-time communication
- Update orchestrator with WebSocket broadcasting
- Add client subscription system for debate updates
- Real-time agent response streaming
- Add consensus and voting system
- Calculate weighted consensus with architect priority
- Confidence-based voting mechanism
- Auto-complete debates when consensus reached
- Integrate Mermaid diagram rendering
- Support for embedded diagrams in agent responses
- Client-side Mermaid.js integration
- Auto-render diagrams on response updates
- Update frontend for real-time experience
- WebSocket composable for reactive updates
- Live status messages and response streaming
- Loading states and consensus display
- Add MIT License
- Create frontend with Vue 3 + Vite + Pinia
- PromptInput component for project description
- DebateThread component for displaying AI discussions
- Debate store for state management
- Create backend with Express + WebSocket + SQLite
- REST API for debate management
- Database schema for debates and responses
- Orchestrator service for AI agent coordination
- Update .gitignore for environment files and dependencies