Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7915102
Replace landing page with basic chat app
mentatbot[bot] Oct 7, 2025
0463b2c
Add reactions feature and snake game
mentatbot[bot] Oct 7, 2025
41db876
Fix message persistence and adjust snake speed
mentatbot[bot] Oct 7, 2025
0307e7e
Fix CI tests for chat app
mentatbot[bot] Oct 7, 2025
43e43e6
Fix CI build error and add cache-busting headers
mentatbot[bot] Oct 7, 2025
b120632
Fix message fetching with useCallback
mentatbot[bot] Oct 7, 2025
a3fcfab
Add progressive acceleration to snake game
mentatbot[bot] Oct 7, 2025
f41ba8d
Add request logging to server
mentatbot[bot] Oct 7, 2025
525553c
Add fire and rocket reaction emojis
mentatbot[bot] Oct 7, 2025
87558d4
Add leaderboard to snake game
mentatbot[bot] Oct 7, 2025
a905748
Fix keyboard input in snake game name field
mentatbot[bot] Oct 7, 2025
e1e1602
Implement shared snake leaderboard and display scores in chat
mentatbot[bot] Oct 7, 2025
6a3ab3c
Fix snake game API URLs to point to main server
mentatbot[bot] Oct 7, 2025
d236176
Add API proxy to snake game server
mentatbot[bot] Oct 7, 2025
246e31f
Add version number display to snake game
mentatbot[bot] Oct 7, 2025
d9819ae
Add debug logging to snake game
mentatbot[bot] Oct 7, 2025
f4703b3
Fix snake game API proxy to work correctly
mentatbot[bot] Oct 7, 2025
154fffa
Make snake game easier with slower speed
mentatbot[bot] Oct 7, 2025
432dcb3
Add difficulty slider to snake game
mentatbot[bot] Oct 7, 2025
e8e7faf
Fix snake game lag and 180-degree turn bug
mentatbot[bot] Oct 7, 2025
dd1f29f
Add Code Typeracer game with shared leaderboard
mentatbot[bot] Oct 7, 2025
6d77724
Fix typeracer input handling for multi-line code
mentatbot[bot] Oct 7, 2025
7ee38b1
Make Enter key work for newlines in typeracer
mentatbot[bot] Oct 7, 2025
53f85af
Fix JavaScript syntax error in typeracer
mentatbot[bot] Oct 8, 2025
675bf9b
Add @techfren credit and manually add biobootloader's score
mentatbot[bot] Oct 8, 2025
4a681fe
Add Tab key support to typeracer game
mentatbot[bot] Oct 8, 2025
152e407
Add toggle button and responsive layout to both games
mentatbot[bot] Oct 8, 2025
0f12457
Add poll API endpoints to server
mentatbot[bot] Oct 8, 2025
0fdc395
Add poll feature to chat interface
mentatbot[bot] Oct 8, 2025
6f54d2a
Fix ESLint error: remove unused variable in destructuring
mentatbot[bot] Oct 8, 2025
5b3b8e0
Fix null safety for poll.votes in client
mentatbot[bot] Oct 8, 2025
3774d53
Add safety checks for incomplete poll data
mentatbot[bot] Oct 8, 2025
e573244
Add stock data API endpoint
mentatbot[bot] Oct 8, 2025
669bb0f
Add TSLA stock chart to chat interface
mentatbot[bot] Oct 8, 2025
12f1583
Fix Tab key handling in typeracer
mentatbot[bot] Oct 8, 2025
a0478c7
Add delay before username prompt in typeracer
mentatbot[bot] Oct 8, 2025
164fbaf
Make chat interface full width/height
mentatbot[bot] Oct 8, 2025
cf220b4
Fix scroll bars - prevent outer container overflow
mentatbot[bot] Oct 8, 2025
655f6c3
Display polls inline with messages chronologically
mentatbot[bot] Oct 8, 2025
6e7de9b
Fix auto-scroll - only scroll if user is near bottom
mentatbot[bot] Oct 8, 2025
b4ef152
Fix typeracer cursor - use thin border instead of block
mentatbot[bot] Oct 8, 2025
e993ee5
Add error handlers to snake server to prevent crashes
mentatbot[bot] Oct 8, 2025
0cd1e07
Add error handlers to typeracer server to prevent crashes
mentatbot[bot] Oct 8, 2025
2079a65
Remove difficulty slider and add apple/banana fruits to snake
mentatbot[bot] Oct 8, 2025
d044910
Snake: Remove Hard/Easy labels and add both fruits on screen
mentatbot[bot] Oct 8, 2025
feaa701
Add death roasts to snake game
mentatbot[bot] Oct 8, 2025
d03c7bb
Add modern gradient CSS styling to snake game
mentatbot[bot] Oct 8, 2025
4f4a7f3
Merge 100+ JavaScript features into snake game
mentatbot[bot] Oct 8, 2025
775b92b
Add auto-run scripts for automatic server startup
mentatbot[bot] Oct 9, 2025
2f7f37e
Integrate snake game into main React app
mentatbot[bot] Oct 9, 2025
ce284a8
Add agent guardrails and documentation
mentatbot[bot] Oct 9, 2025
390de26
Create Slop Board dashboard with app grid
mentatbot[bot] Oct 9, 2025
5990706
Fix ESLint errors in Dashboard, Polls, and Stock components
mentatbot[bot] Oct 9, 2025
5fc2edf
Fix Stock ticker and Snake game rendering issues
mentatbot[bot] Oct 9, 2025
1fb6375
Fix Snake game iframe to use server-side path
mentatbot[bot] Oct 9, 2025
fd0e5fe
Add proxy for snake game to forward port 5174 through 5000
mentatbot[bot] Oct 9, 2025
f2e98e0
Serve snake game directly from Express, remove iframe
mentatbot[bot] Oct 9, 2025
d1a3d2f
Update dashboard stats and add contributors section
mentatbot[bot] Oct 9, 2025
191c54c
Add enemy snake, power-ups, and visual effects to snake game
mentatbot[bot] Oct 9, 2025
fca705a
Install socket.io for future multiplayer feature
mentatbot[bot] Oct 9, 2025
d73519d
Add Socket.io server and multiplayer game engine
mentatbot[bot] Oct 9, 2025
70c52f9
Fix ESLint error - replace any type with PlayerState interface
mentatbot[bot] Oct 9, 2025
862bc7d
Add multiplayer client-side implementation
mentatbot[bot] Oct 9, 2025
388c059
Make single-player use requestAnimationFrame for smooth rendering
mentatbot[bot] Oct 9, 2025
e7a8316
Add spectator mode and AI bots to multiplayer (server-side)
mentatbot[bot] Oct 9, 2025
9a72669
Add spectator mode and bot indicators to multiplayer (client-side)
mentatbot[bot] Oct 9, 2025
f725351
Add lobby system with persistent room configurations (server-side)
mentatbot[bot] Oct 9, 2025
215564b
Fix TypeScript error in multiplayer.ts
mentatbot[bot] Oct 9, 2025
6506bb7
Add lobby list UI and join functionality (client-side)
mentatbot[bot] Oct 9, 2025
60e9b6b
Add pause button, multiple enemies, and tail-cutting to single-player
mentatbot[bot] Oct 9, 2025
e72a7d1
Fix blank canvas on page load
mentatbot[bot] Oct 9, 2025
15ef3ec
Fix critical bug: call drawEnemySnakes() instead of drawEnemySnake()
mentatbot[bot] Oct 9, 2025
9f85735
Fix Socket.io to use relative URLs instead of localhost
mentatbot[bot] Oct 9, 2025
ebf936a
Make enemies aggressive: spawn spread out, chase snakes, cut tails
mentatbot[bot] Oct 9, 2025
e138a7f
Add error handling to prevent game crashes and blank screen
mentatbot[bot] Oct 9, 2025
54560dc
Add OpenWebUI integration with Docker Compose
mentatbot[bot] Oct 9, 2025
bdbd799
Create AI chat interface with Pollinations API
mentatbot[bot] Oct 9, 2025
a69f39b
Integrate AI Chat into app navigation
mentatbot[bot] Oct 9, 2025
35f8791
Fix ESLint error: prefix unused catch variable with underscore
mentatbot[bot] Oct 9, 2025
7913b38
Fix ESLint error: remove unused catch parameter
mentatbot[bot] Oct 9, 2025
b4e1d78
Add navigation menu with AI Chat link
mentatbot[bot] Oct 9, 2025
e4db7b1
Fix Vite to bind to all interfaces for port forwarding
mentatbot[bot] Oct 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Dependencies
node_modules
**/node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build outputs
dist
**/dist
build
.next

# Development
.git
.gitignore
.env
.env.local
.env.*.local

# IDE
.vscode
.idea
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs
logs
*.log
.mentat/logs

# Testing
coverage
.nyc_output

# Misc
*.md
!README.md
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenWebUI Configuration
OLLAMA_BASE_URL=https://text.pollinations.ai
WEBUI_AUTH=false
WEBUI_NAME=Mentat Party Chat
WEBUI_URL=http://localhost:3000
DEFAULT_MODELS=openai
ENABLE_SIGNUP=true
ENABLE_LOGIN=false

# Pollinations API Configuration
# Note: Pollinations is free and doesn't require an API key
# But you can configure other providers here if needed
# OPENAI_API_KEY=your_key_here
# ANTHROPIC_API_KEY=your_key_here
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/dist
.mentat/logs
**/package-lock.json
data/
57 changes: 57 additions & 0 deletions .mentat/health-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

echo "πŸ₯ Running Mentat Party Health Check..."
echo ""

# Check branch
BRANCH=$(git branch --show-current)
echo "πŸ“ Current branch: $BRANCH"
if [ "$BRANCH" != "mentat-1" ]; then
echo "⚠️ WARNING: You're not on the mentat-1 branch!"
echo " Run: git checkout mentat-1"
fi
echo ""

# Check if client is built
if [ -d "client/dist" ]; then
echo "βœ… Client is built (client/dist exists)"
else
echo "❌ Client is NOT built!"
echo " Run: cd client && npm run build"
fi
echo ""

# Check if node_modules exist
if [ -d "node_modules" ] && [ -d "client/node_modules" ] && [ -d "server/node_modules" ]; then
echo "βœ… Dependencies are installed"
else
echo "❌ Dependencies are NOT fully installed!"
echo " Run: npm install"
fi
echo ""

# Check if servers are running
if lsof -i :5000 > /dev/null 2>&1; then
echo "βœ… Server is running on port 5000"
else
echo "⚠️ Server is NOT running on port 5000"
echo " Run: cd server && npm run dev"
fi

if lsof -i :5173 > /dev/null 2>&1; then
echo "βœ… Client dev server is running on port 5173"
else
echo "⚠️ Client dev server is NOT running on port 5173"
echo " Run: cd client && npm run dev"
fi
echo ""

# Test API endpoint
if curl -s http://localhost:5000/api/messages > /dev/null 2>&1; then
echo "βœ… API is responding"
else
echo "❌ API is NOT responding"
fi
echo ""

echo "πŸ₯ Health check complete!"
6 changes: 6 additions & 0 deletions .mentat/preview/2-snake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Start the snake game server
cd snake
npm install --silent
npm start
5 changes: 5 additions & 0 deletions .mentat/run/auto/0-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Start the Express server in development mode
cd server
npm run dev
5 changes: 5 additions & 0 deletions .mentat/run/auto/1-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# Start the React client in development mode
cd client
npm run dev
6 changes: 6 additions & 0 deletions .mentat/run/auto/2-snake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Start the snake game server
cd snake
npm install --silent
npm start
8 changes: 8 additions & 0 deletions .mentat/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
# Install dependencies for both client and server
# The root package.json has an install script that handles this
npm install

# Build the client so port 5000 works immediately
echo "Building client for production..."
cd client
npm run build
cd ..

echo "βœ… Setup complete! Client is built and ready."
212 changes: 212 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# Agent Guide for Mentat Party

This document provides essential information for AI agents working on this repository.

## Repository Overview

This is the **Mentat Party** repository - a public experiment where anyone can chat with AI agents and collaboratively build features. The repo contains:

- **Client**: React 19 + TypeScript + Vite (chat interface, snake game, polls, stock ticker)
- **Server**: Express + TypeScript (REST API for messages, polls, leaderboards)
- **Snake Game**: Standalone game with 100+ features (particles, trails, achievements)

## Critical Setup Steps

### 1. Branch Awareness

⚠️ **IMPORTANT**: The `main` branch contains only the template. All features are on the `mentat-1` branch!

```bash
# Always check which branch you're on
git branch

# If on main, switch to mentat-1
git checkout mentat-1
```

### 2. Install Dependencies

```bash
# Install all dependencies (runs for both client and server)
npm install
```

### 3. Build the Client

⚠️ **CRITICAL**: The client MUST be built for port 5000 to work!

```bash
cd client
npm run build
```

This creates the `client/dist` directory that the Express server serves.

### 4. Start Development Servers

```bash
# Option 1: Start both servers (from root)
npm run dev

# Option 2: Start individually
cd server && npm run dev # Port 5000
cd client && npm run dev # Port 5173
```

## Port Configuration

- **Port 5173**: Vite dev server (hot reload, development)
- **Port 5000**: Express server (serves built client + API)
- **Port 5174**: Snake game standalone server

**For users to see the app**: They need to access port 5000 (which serves the built client).

## Common Issues

### Issue: "Mentat Template JS" on Port 5000

**Cause**: Client hasn't been built
**Solution**: Run `cd client && npm run build`

### Issue: Blank Page on Port 5173

**Cause**: Port forwarding issues or missing dependencies
**Solution**:

1. Check dependencies: `cd client && npm install`
2. Use port 5000 instead (more reliable)

### Issue: "Module not found" errors

**Cause**: Dependencies not installed or wrong branch
**Solution**:

1. Verify you're on `mentat-1` branch
2. Run `npm install` in root, client, and server directories

## Development Workflow

### Making Changes

1. **Always work on `mentat-1` branch**
2. Make your changes
3. Test locally
4. **Rebuild client if you changed client code**: `cd client && npm run build`
5. Commit and push

### Testing Changes

```bash
# Run tests
npm test

# Run linter
npm run lint

# Format code
npm run format
```

## Key Files and Directories

```
.
β”œβ”€β”€ client/ # React frontend
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ App.tsx # Main chat interface
β”‚ β”‚ β”œβ”€β”€ Router.tsx # Routing (/, /snake)
β”‚ β”‚ └── Snake.tsx # Snake game component
β”‚ └── dist/ # Built client (MUST exist for port 5000!)
β”œβ”€β”€ server/ # Express backend
β”‚ └── src/
β”‚ β”œβ”€β”€ app.ts # Express app setup
β”‚ └── server.ts # Server entry point
β”œβ”€β”€ snake/ # Standalone snake game
β”‚ └── index.html # Snake game with 100+ features
└── .mentat/
β”œβ”€β”€ setup.sh # Run on agent start
β”œβ”€β”€ format.sh # Run before commits
└── preview/ # Auto-start scripts
```

## Features Overview

### Chat Interface (Main App)

- Real-time messaging
- Emoji reactions
- Polls with voting
- Stock ticker (AAPL, TSLA, etc.)
- User profiles with localStorage

### Snake Game

- 100+ feature variables
- Particle effects on food collection
- Snake trails with fade
- Dynamic background (changes with score)
- 10 achievements
- Custom snake skins (rainbow, fire, ocean, forest)
- Animated food
- Game statistics tracking
- Leaderboard integration

## API Endpoints

- `GET /api/messages` - Get all messages
- `POST /api/messages` - Send a message
- `POST /api/messages/:id/react` - Add reaction
- `GET /api/polls` - Get all polls
- `POST /api/polls` - Create a poll
- `POST /api/polls/:id/vote` - Vote on a poll
- `GET /api/stock/:symbol` - Get stock data
- `GET /api/snake/scores` - Get snake leaderboard
- `POST /api/snake/scores` - Submit snake score

## Mentat Scripts

### .mentat/setup.sh

Runs automatically when agents start. Installs dependencies for both client and server.

### .mentat/format.sh

Runs automatically before commits. Formats code with Prettier and fixes linting issues.

### .mentat/preview/ scripts

Auto-start scripts for development servers:

- `0-server.sh` - Starts Express server (port 5000)
- `1-client.sh` - Starts Vite dev server (port 5173)
- `2-snake.sh` - Starts snake game server (port 5174)

## Tips for Agents

1. **Always verify the branch** before making changes
2. **Build the client** after making frontend changes
3. **Test on port 5000** - it's more reliable for users
4. **Check logs** if something isn't working: `../logs/shell/`
5. **Use diagnostic tools**: TypeScript, ESLint, tests
6. **Document your changes** in commit messages
7. **Preserve existing features** when adding new ones

## Getting Help

If you encounter issues:

1. Check this document first
2. Run diagnostics: `npm test`, `npm run lint`
3. Check if dependencies are installed: `npm install`
4. Verify you're on the right branch: `git branch`
5. Check if client is built: `ls client/dist`

## Credits

- Snake game features by @mcgdj (GitHub)
- Chat interface and infrastructure by various contributors
- Mentat system by AbanteAI

---

**Remember**: This is a public experiment. Be helpful, be creative, and have fun! πŸŽ‰
Loading