### Major Changes: - **Rust Migration**: Move api-rs to root directory, rename binary to 'aicard' - **MCP Integration**: Add card tools to ai.gpt MCP server (get_user_cards, draw_card, get_draw_status) - **Daily Limit System**: Implement 2-day interval card drawing limits in API and iOS - **iOS Enhancements**: Add DrawStatusView, backup functionality, and limit integration ### Technical Details: - ai.gpt MCP now has 20 tools including 3 card-related tools - ServiceClient enhanced with missing card API methods - iOS app includes daily limit UI and atproto OAuth backup features - Database migration for last_draw_date field - Complete feature parity between web and iOS implementations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
62 lines
1.7 KiB
Python
62 lines
1.7 KiB
Python
"""Application configuration"""
|
|
import os
|
|
from pathlib import Path
|
|
from typing import Optional
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Application
|
|
app_name: str = "ai.card"
|
|
app_version: str = "0.1.0"
|
|
debug: bool = False
|
|
|
|
# API
|
|
api_v1_prefix: str = "/api/v1"
|
|
|
|
# Database
|
|
database_url: str = "sqlite+aiosqlite:///~/.config/syui/ai/card/aicard.db"
|
|
database_url_supabase: Optional[str] = None
|
|
use_supabase: bool = False
|
|
|
|
# atproto
|
|
atproto_pds_url: Optional[str] = None
|
|
atproto_handle: Optional[str] = None
|
|
atproto_password: Optional[str] = None
|
|
|
|
# Card probabilities (in percentage)
|
|
prob_normal: float = 99.789
|
|
prob_rare: float = 0.1
|
|
prob_super_rare: float = 0.01
|
|
prob_kira: float = 0.1
|
|
prob_unique: float = 0.0001
|
|
|
|
# Unique card settings
|
|
max_unique_cards: int = 1000 # Maximum number of unique cards
|
|
|
|
# Draw limit settings
|
|
draw_limit_days: int = 2 # Number of days between allowed draws (every other day)
|
|
|
|
# CORS
|
|
cors_origins: list[str] = [
|
|
"http://localhost:3000",
|
|
"http://localhost:5173",
|
|
"http://localhost:4173",
|
|
"https://card.syui.ai",
|
|
"https://xxxcard.syui.ai"
|
|
]
|
|
|
|
# Security
|
|
secret_key: str = "your-secret-key-change-this-in-production"
|
|
|
|
class Config:
|
|
# 設定ファイルの優先順位: 1) 環境変数, 2) ~/.config/syui/ai/card/.env, 3) .env
|
|
config_dir = Path.home() / ".config" / "syui" / "ai" / "card"
|
|
env_file = [
|
|
str(config_dir / ".env"), # ~/.config/syui/ai/card/.env
|
|
".env" # カレントディレクトリの.env
|
|
]
|
|
env_file_encoding = "utf-8"
|
|
|
|
|
|
settings = Settings() |