feat(bridge): Watcher, Parser, Bot, Main 핵심 컴포넌트 구현 #task-215 #task-216 #task-217 #task-218
This commit is contained in:
48
config.py
Normal file
48
config.py
Normal file
@@ -0,0 +1,48 @@
|
||||
"""Configuration module — loads settings from .env file or environment variables."""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load .env from project root
|
||||
load_dotenv(Path(__file__).parent / ".env")
|
||||
|
||||
|
||||
class Config:
|
||||
"""Bridge configuration."""
|
||||
|
||||
# Discord
|
||||
DISCORD_TOKEN: str = os.getenv("DISCORD_TOKEN", "")
|
||||
DISCORD_CHANNEL_ID: int = int(os.getenv("DISCORD_CHANNEL_ID", "0"))
|
||||
|
||||
# Antigravity Brain path
|
||||
BRAIN_PATH: Path = Path(os.getenv(
|
||||
"BRAIN_PATH",
|
||||
os.path.expanduser("~/.gemini/antigravity/brain")
|
||||
))
|
||||
|
||||
# Watcher settings
|
||||
DEBOUNCE_SECONDS: float = float(os.getenv("DEBOUNCE_SECONDS", "2"))
|
||||
|
||||
# Files to monitor within each conversation directory
|
||||
WATCHED_FILES: set = {
|
||||
"task.md",
|
||||
"implementation_plan.md",
|
||||
"walkthrough.md",
|
||||
}
|
||||
|
||||
# Discord message limits
|
||||
DISCORD_MSG_LIMIT: int = 2000
|
||||
DISCORD_EMBED_DESC_LIMIT: int = 4096
|
||||
|
||||
@classmethod
|
||||
def validate(cls) -> list[str]:
|
||||
"""Return list of configuration errors."""
|
||||
errors = []
|
||||
if not cls.DISCORD_TOKEN:
|
||||
errors.append("DISCORD_TOKEN is not set")
|
||||
if not cls.DISCORD_CHANNEL_ID:
|
||||
errors.append("DISCORD_CHANNEL_ID is not set")
|
||||
if not cls.BRAIN_PATH.exists():
|
||||
errors.append(f"BRAIN_PATH does not exist: {cls.BRAIN_PATH}")
|
||||
return errors
|
||||
Reference in New Issue
Block a user