Commit graph

45 commits

Author SHA1 Message Date
821b419271 feat(04-02): integrate AI client into bot lifecycle
Import init_ai_client and call it during post_init callback alongside
database initialization. Logs the configured AI router at startup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:07:45 +00:00
f1a001f923 docs(04-01): complete AI client abstraction plan
- Add 04-01-SUMMARY.md with plan completion details
- Update STATE.md with Phase 4 progress and decisions
- Update ROADMAP.md with plan count and status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:05:45 +00:00
e04ce4eeeb feat(04-01): create AI client abstraction layer
- Add AIClient class wrapping AsyncOpenAI for model routing
- Support Requesty and OpenRouter as backend routers
- Add MODEL_MAP with claude, gpt, gemini short names
- Add init_ai_client/get_ai_client module functions
- Include HTTP-Referer header support for OpenRouter

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:03:49 +00:00
3740691dac feat(04-01): add openai dependency and AI config
- Add openai package to dependencies in pyproject.toml
- Extend BotConfig with ai_router, ai_api_key, ai_referer attributes
- Load AI settings from environment with sensible defaults

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:02:59 +00:00
4ea13efe8f docs(04): create phase plans for single model Q&A
Phase 04: Single Model Q&A
- 2 plans created
- 5 total tasks defined
- Ready for execution

Plans:
- 04-01: AI client abstraction (openai dep, config, AIClient class)
- 04-02: /ask handler and bot integration (M3 milestone)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 19:00:50 +00:00
6ec3d069d8 docs(03-03): add summary and update state for phase completion
- Created 03-03-SUMMARY.md documenting M2 milestone completion
- Updated STATE.md: Phase 3 complete, 8 plans total
- Updated ROADMAP.md: Phase 3 marked complete
2026-01-16 18:57:37 +00:00
afab4f84e2 docs(03-03): complete project models/delete plan
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:55:52 +00:00
bb3eab7bb4 feat(03-03): implement /project models and /project delete handlers
- /project models [list] - show/set AI models for current project
- /project delete <id> - delete project by ID with confirmation
- Clear user selection if deleted project was selected

M2 milestone complete: full project CRUD via Telegram.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:55:30 +00:00
e2e10d9b2e feat(03-03): add update_models and delete_project to service
Add update_project_models(project_id, models) and delete_project(project_id)
functions to complete the project service CRUD operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:54:39 +00:00
8791398b02 docs(03-02): complete project select/info plan
Tasks completed: 2/2
- Add get_project_by_name to service
- Implement /project select and /project info handlers

SUMMARY: .planning/phases/03-project-crud/03-02-SUMMARY.md
2026-01-16 18:44:57 +00:00
9922c333cb feat(03-02): implement /project select and /project info handlers
Add project selection and info display:
- /project select <id|name> stores selection in user_data
- /project info displays selected project details
- get_selected_project helper retrieves current project

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:43:16 +00:00
70dd517e6a feat(03-02): add get_project_by_name to project service
Add case-insensitive project lookup by name using ilike query.
Supports /project select command finding projects by name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:42:04 +00:00
4d8c66ee07 docs(03-01): complete project service & list/create plan
Tasks completed: 2/2
- Create project service module
- Implement /projects and /project new handlers

SUMMARY: .planning/phases/03-project-crud/03-01-SUMMARY.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:39:29 +00:00
3f3b5ce28f feat(03-01): implement /projects and /project new handlers
- /projects lists all projects with name, ID, models
- /project new "Name" creates project with confirmation
- Registered handlers in __init__.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:38:06 +00:00
718dcea7dc feat(03-01): create project service module
- list_projects() returns all projects ordered by created_at desc
- create_project() creates project with default models
- get_project() retrieves project by ID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:37:21 +00:00
e3d72dab60 docs(03): create phase 3 plans for project CRUD
Phase 03: Project CRUD
- 3 plans created
- 6 total tasks defined
- Covers M2 milestone (full project management)

Plan breakdown:
- 03-01: Project service + /projects, /project new
- 03-02: /project select, /project info
- 03-03: /project models, /project delete

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:33:06 +00:00
dfdadc62f0 chore: add python-dotenv for .env loading 2026-01-16 18:27:22 +00:00
1908f5f61d chore: add .env.example template for bot configuration 2026-01-16 18:20:58 +00:00
15307d7c85 docs(02-02): complete help/status commands plan
Tasks completed: 3/3
- Create commands.py with /help and /start handlers
- Create status.py with /status handler
- Register handlers in __init__.py

M1 milestone complete: Bot responds to /help, /status
Phase 2 (Bot Core) complete

SUMMARY: .planning/phases/02-bot-core/02-02-SUMMARY.md
2026-01-16 18:19:23 +00:00
2a563efce0 feat(02-02): register handlers in __init__.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:17:05 +00:00
cb185e139c feat(02-02): create status.py with /status handler
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:16:49 +00:00
98b71829cc feat(02-02): create commands.py with /help and /start handlers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 18:16:33 +00:00
712024eb10 docs(02-01): complete bot infrastructure plan
Tasks completed: 3/3
- Create bot configuration module
- Create bot main.py with Application setup
- Create handlers package structure

SUMMARY: .planning/phases/02-bot-core/02-01-SUMMARY.md
2026-01-16 15:38:34 +00:00
0a818551a5 feat(02-01): create handlers package with register_handlers
- register_handlers function takes Application
- Empty placeholder for handler registration
- Ready for 02-02 to add actual handlers
2026-01-16 15:37:04 +00:00
c3a849b2b3 feat(02-01): create bot main.py with Application setup
- ApplicationBuilder with post_init/post_shutdown hooks
- Database lifecycle (init_db, create_tables, close_db)
- Config stored in bot_data for handler access
- Calls register_handlers before run_polling
2026-01-16 15:36:48 +00:00
4381e12609 feat(02-01): create bot configuration module
- BotConfig dataclass with from_env() classmethod
- Loads BOT_TOKEN (required), ALLOWED_USERS, DATABASE_URL, LOG_LEVEL
- Raises ValueError if BOT_TOKEN is missing
2026-01-16 15:35:44 +00:00
4d6768e55c docs(02): create phase plan for bot core
Phase 02: Bot Core
- 2 plans created (02-01 infrastructure, 02-02 handlers)
- 6 total tasks defined
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:33:31 +00:00
ad396eca0e docs(01-03): complete database & tests plan
Tasks completed: 3/3
- Create database module with async session management
- Create model tests with in-memory database
- Verify gitignore and full test suite

SUMMARY: .planning/phases/01-foundation/01-03-SUMMARY.md

Phase 1: Foundation complete (3/3 plans)
2026-01-16 15:18:28 +00:00
fb81feaa3e test(01-03): add model tests with in-memory database
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:15:44 +00:00
bb932e68d3 feat(01-03): create database module with async session management
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:14:56 +00:00
4bc59d796c docs(01-02): complete database models plan
Tasks completed: 3/3
- Create base model and enums
- Create Project and Discussion models
- Create Round, Message, and Consensus models

SUMMARY: .planning/phases/01-foundation/01-02-SUMMARY.md
2026-01-16 15:10:50 +00:00
a0de94141b feat(01-02): create Project, Discussion, Round, Message, Consensus models
- Add Project model: id, name, created/updated_at, models (JSON), settings (JSON)
- Add Discussion model: id, project_id (FK), question, type, status, created_at
- Add Round model: id, discussion_id (FK), round_number, type
- Add Message model: id, round_id (FK), model, content, timestamp, is_direct
- Add Consensus model: id, discussion_id (FK unique), agreements, disagreements, generated_at/by
- Configure bidirectional relationships with cascade delete-orphan
- All FKs reference correct tables, all type hints present
2026-01-16 15:09:32 +00:00
61da27c7d5 feat(01-02): create base model and enums
- Add Base class using SQLAlchemy 2.0 DeclarativeBase
- Add DiscussionType enum (OPEN, DISCUSS)
- Add DiscussionStatus enum (ACTIVE, COMPLETED)
- Add RoundType enum (PARALLEL, SEQUENTIAL)
- Use str-based enums for database portability
2026-01-16 15:07:47 +00:00
3e90f9cf21 docs(01-01): complete project scaffolding plan
- Create 01-01-SUMMARY.md documenting plan execution
- Update STATE.md with current position and velocity metrics
- Update ROADMAP.md progress table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:01:46 +00:00
44e23226b1 feat(01-01): create src layout and package structure
- Create src/moai/ package with __version__ = "0.1.0"
- Create src/moai/bot/ subpackage for Telegram handlers
- Create src/moai/bot/handlers/ for command handlers
- Create src/moai/core/ for business logic and models
- Create tests/ package for test suite
- Add module docstrings per SPEC.md requirements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:00:30 +00:00
5856e6b2aa chore(01-01): create pre-commit configuration
- Add ruff hooks for linting (with --fix) and formatting
- Add standard hooks: trailing-whitespace, end-of-file-fixer, check-yaml
- Use ruff-pre-commit v0.14.13

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:00:14 +00:00
39b1781f19 build(01-01): create pyproject.toml with dependencies and tool config
- Add project metadata with Python 3.11+ requirement
- Configure dependencies: python-telegram-bot, sqlalchemy, httpx, aiosqlite
- Add dev dependencies: pytest, pytest-cov, pytest-asyncio, ruff, pre-commit
- Configure ruff with line-length 100, py311 target
- Configure pytest with asyncio_mode auto
- Use hatchling build backend with src layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:59:40 +00:00
c48eb1cea7 docs(01): create phase 1 foundation plans
Phase 1: Foundation
- 3 plans created
- 9 total tasks defined
- Ready for execution

Plan 01: Project scaffolding (pyproject.toml, pre-commit, src layout)
Plan 02: SQLAlchemy models (Project, Discussion, Round, Message, Consensus)
Plan 03: Database setup and model tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:57:27 +00:00
048278e46b docs: initialize MoAI roadmap (6 phases)
Multi-AI collaborative brainstorming platform - Telegram POC

Phases:
1. Foundation: Project scaffolding, tooling, database models
2. Bot Core: Telegram bot setup, /help, /status
3. Project CRUD: Project management commands
4. Single Model Q&A: AI client abstraction, basic queries
5. Multi-Model Discussions: Open mode, discuss mode, @mentions
6. Consensus & Export: Consensus generation, markdown export

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:54:30 +00:00
1686f90467 docs: initialize MoAI
Multi-AI collaborative brainstorming platform - Telegram bot Phase 1.

Creates PROJECT.md with requirements and constraints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:53:11 +00:00
1b55df508c Add README.md with project overview
Visual documentation optimized for Forgejo with ASCII diagrams,
feature table, command reference, architecture overview, and roadmap.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:42:47 +00:00
9651bd4166 Add CLAUDE.md and .gitignore
- CLAUDE.md provides guidance for Claude Code with build commands,
  architecture overview, and coding standards from SPEC.md
- .gitignore covers Python, virtual envs, testing, IDE files, and env files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:41:47 +00:00
444e2adc40 Add dependency versioning preference to coding standards 2026-01-16 14:39:33 +00:00
6357b3499b Add coding standards and update project structure 2026-01-16 14:39:07 +00:00
d2fa0f920c Initial spec for MoAI - Master of AIs 2026-01-16 14:32:23 +00:00