mirror of
https://github.com/alsk1992/CloddsBot.git
synced 2026-10-02 02:54:40 +08:00
- Add Claude-style sidebar with 4 tabs (Chats, Projects, Artifacts, Code) - Add messages table (migration 15) for append-only unlimited chat history - Replace JSON blob storage with per-row INSERTs and paginated reads - Add thinking indicator with elapsed timer (replaces bouncing dots) - Add context compacting: older messages summarized so AI never forgets - Add session REST API with pagination (GET/POST/PATCH/DELETE) - Update README, docs, and architecture with WebChat features Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
234 lines
7.2 KiB
Bash
234 lines
7.2 KiB
Bash
# Clodds Configuration
|
|
# Copy to .env and fill in your values
|
|
#
|
|
# Quick Start: Only ANTHROPIC_API_KEY is required to run.
|
|
# Add ONE messaging channel (Telegram recommended) to interact.
|
|
|
|
# =============================================================================
|
|
# REQUIRED (Must have this to run)
|
|
# =============================================================================
|
|
|
|
# Anthropic API Key - Get from: https://console.anthropic.com
|
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
|
|
# =============================================================================
|
|
# PICK ONE MESSAGING CHANNEL (At least one recommended)
|
|
# =============================================================================
|
|
|
|
# Telegram (Recommended - easiest setup)
|
|
# Get token from: https://t.me/BotFather (send /newbot)
|
|
TELEGRAM_BOT_TOKEN=
|
|
|
|
# Discord
|
|
# Get token from: https://discord.com/developers/applications
|
|
DISCORD_BOT_TOKEN=
|
|
DISCORD_APP_ID=
|
|
|
|
# Slack
|
|
# Get tokens from: https://api.slack.com/apps
|
|
SLACK_BOT_TOKEN=
|
|
SLACK_APP_TOKEN=
|
|
|
|
# WebChat (built-in, works immediately at http://localhost:18789/webchat)
|
|
WEBCHAT_TOKEN=
|
|
|
|
# =============================================================================
|
|
# TRADING CREDENTIALS (Optional - for executing trades)
|
|
# =============================================================================
|
|
|
|
# Polymarket - Get from: https://polymarket.com/settings/api
|
|
POLY_API_KEY=
|
|
POLY_API_SECRET=
|
|
POLY_API_PASSPHRASE=
|
|
POLY_PRIVATE_KEY=0x...
|
|
# POLY_FUNDER_ADDRESS= # Required for trading, your wallet address
|
|
|
|
# Kalshi - Get from: https://kalshi.com/account/api
|
|
KALSHI_API_KEY=
|
|
KALSHI_API_SECRET=
|
|
# Legacy auth (use API keys instead):
|
|
# KALSHI_EMAIL=
|
|
# KALSHI_PASSWORD=
|
|
|
|
# Manifold - Get from: https://manifold.markets/account
|
|
MANIFOLD_API_KEY=
|
|
|
|
# Metaculus - Get from: https://www.metaculus.com/accounts/profile/
|
|
METACULUS_TOKEN=
|
|
|
|
# =============================================================================
|
|
# ADDITIONAL CHANNELS (Optional)
|
|
# =============================================================================
|
|
|
|
# Matrix
|
|
MATRIX_HOMESERVER_URL=https://matrix.org
|
|
MATRIX_ACCESS_TOKEN=
|
|
MATRIX_USER_ID=@bot:matrix.org
|
|
|
|
# Signal (requires signal-cli linked to phone)
|
|
# SIGNAL_PHONE_NUMBER=
|
|
# SIGNAL_CLI_PATH=signal-cli
|
|
|
|
# iMessage (macOS only, uses Messages.app)
|
|
IMESSAGE_ENABLED=0
|
|
|
|
# LINE - Get from: https://developers.line.biz/console/
|
|
LINE_CHANNEL_ACCESS_TOKEN=
|
|
LINE_CHANNEL_SECRET=
|
|
|
|
# Google Chat - Requires service account
|
|
GOOGLECHAT_CREDENTIALS_PATH=
|
|
# Or use individual values:
|
|
# GOOGLECHAT_CLIENT_EMAIL=
|
|
# GOOGLECHAT_PRIVATE_KEY=
|
|
# GOOGLECHAT_PROJECT_ID=
|
|
|
|
# Microsoft Teams
|
|
TEAMS_APP_ID=
|
|
TEAMS_APP_PASSWORD=
|
|
|
|
# =============================================================================
|
|
# EXTERNAL SERVICES (Optional - enables extra features)
|
|
# =============================================================================
|
|
|
|
# OpenAI (for embeddings if preferred over local)
|
|
OPENAI_API_KEY=
|
|
|
|
# Twitter/X (for news feeds)
|
|
TWITTER_BEARER_TOKEN=
|
|
|
|
# SMTP (for email alerts)
|
|
SMTP_HOST=
|
|
SMTP_PORT=587
|
|
SMTP_USER=
|
|
SMTP_PASS=
|
|
|
|
# =============================================================================
|
|
# GATEWAY & SECURITY
|
|
# =============================================================================
|
|
|
|
# Gateway auth token (for API access)
|
|
CLODDS_TOKEN=
|
|
|
|
# Public URL for webhooks (if behind proxy/tunnel)
|
|
CLODDS_PUBLIC_HOST=localhost
|
|
CLODDS_PUBLIC_SCHEME=http
|
|
|
|
# Logging level: debug, info, warn, error
|
|
LOG_LEVEL=info
|
|
|
|
# =============================================================================
|
|
# LOCALIZATION
|
|
# =============================================================================
|
|
|
|
# Language: en, zh, es, ja, ko, de, fr, pt, ru, ar
|
|
# If not set, auto-detects from system LANG environment variable
|
|
CLODDS_LOCALE=en
|
|
|
|
# =============================================================================
|
|
# ADVANCED (Usually don't need to change)
|
|
# =============================================================================
|
|
|
|
# Streaming responses
|
|
CLODDS_STREAM_RESPONSES=true
|
|
CLODDS_STREAM_RESPONSE_INTERVAL_MS=500
|
|
|
|
# Database backups (minutes, 0 to disable)
|
|
CLODDS_DB_BACKUP_INTERVAL_MINUTES=60
|
|
CLODDS_DB_BACKUP_MAX=10
|
|
|
|
# Market index settings
|
|
MARKET_INDEX_ENABLED=true
|
|
MARKET_INDEX_PLATFORMS=polymarket,kalshi,manifold,metaculus
|
|
|
|
# Memory auto-capture
|
|
MEMORY_AUTO_ENABLED=true
|
|
|
|
# Session cleanup
|
|
SESSION_CLEANUP_ENABLED=true
|
|
SESSION_CLEANUP_MAX_AGE_DAYS=30
|
|
|
|
# Position tracking
|
|
POSITIONS_PRICE_UPDATE_ENABLED=true
|
|
POSITIONS_PNL_SNAPSHOTS_ENABLED=true
|
|
|
|
# =============================================================================
|
|
# MCP SERVER SECURITY (Optional - for MCP tool access control)
|
|
# =============================================================================
|
|
|
|
# Tool allowlist/blocklist (comma-separated tool names)
|
|
# CLODDS_MCP_ALLOWED_TOOLS=clodds_feeds_polymarket,clodds_markets_search
|
|
# CLODDS_MCP_BLOCKED_TOOLS=clodds_trading_polymarket
|
|
|
|
# Tool profile: read-only, trading, full (default: full)
|
|
# CLODDS_MCP_TOOL_PROFILE=full
|
|
|
|
# Rate limit: max MCP calls per minute per client (default: 60)
|
|
# CLODDS_MCP_RATE_LIMIT=60
|
|
|
|
# Audit logging to stderr (default: true, set to false to disable)
|
|
# CLODDS_MCP_AUDIT=true
|
|
|
|
# =============================================================================
|
|
# SECURITY (Production Settings)
|
|
# =============================================================================
|
|
|
|
# Credential encryption key (required for storing credentials securely)
|
|
# Generate with: openssl rand -hex 32
|
|
CLODDS_CREDENTIAL_KEY=
|
|
|
|
# Escrow keypair encryption key (falls back to CLODDS_CREDENTIAL_KEY if not set)
|
|
# Required for ACP escrow - stores Solana keypairs encrypted in database
|
|
# Generate with: openssl rand -hex 32
|
|
CLODDS_ESCROW_KEY=
|
|
|
|
# Canvas JavaScript evaluation (disabled by default for security)
|
|
# Only enable if you need agent-driven UI with dynamic JS
|
|
CANVAS_ALLOW_JS_EVAL=false
|
|
|
|
# IP-based rate limiting (requests per minute per IP)
|
|
CLODDS_IP_RATE_LIMIT=100
|
|
|
|
# HTTPS enforcement
|
|
CLODDS_FORCE_HTTPS=false
|
|
CLODDS_HSTS_ENABLED=false
|
|
|
|
# =============================================================================
|
|
# BITTENSOR MINING (Optional - for TAO subnet mining)
|
|
# =============================================================================
|
|
|
|
# Enable Bittensor subnet mining
|
|
BITTENSOR_ENABLED=false
|
|
|
|
# Network: mainnet, testnet, local
|
|
BITTENSOR_NETWORK=mainnet
|
|
|
|
# Custom subtensor WebSocket URL (optional - defaults to Finney endpoint)
|
|
# BITTENSOR_SUBTENSOR_URL=wss://entrypoint-finney.opentensor.ai:443
|
|
|
|
# Wallet paths (optional - for on-chain operations)
|
|
# BITTENSOR_COLDKEY_PATH=~/.bittensor/wallets/default/coldkey
|
|
# BITTENSOR_COLDKEY_PASSWORD=
|
|
|
|
# Python path for btcli commands (optional - defaults to python3)
|
|
# BITTENSOR_PYTHON_PATH=/usr/bin/python3
|
|
|
|
# Earnings poll interval in ms (optional - defaults to 300000 / 5 min)
|
|
# BITTENSOR_EARNINGS_POLL_INTERVAL_MS=300000
|
|
|
|
# ============================================================================
|
|
# API / Compute Marketplace (Revenue Collection)
|
|
# ============================================================================
|
|
|
|
# Treasury wallet - ALL payments go here (required for paid API)
|
|
# This is YOUR wallet address on Base network
|
|
CLODDS_TREASURY_WALLET=
|
|
|
|
# Webhook signature secret for callbacks
|
|
CLODDS_WEBHOOK_SECRET=
|
|
|
|
# LLM API keys for compute marketplace
|
|
ANTHROPIC_API_KEY=
|
|
OPENAI_API_KEY=
|
|
TOGETHER_API_KEY=
|