Commit Graph

133 Commits

Author SHA1 Message Date
qzl 51ca78a37a feat(tokens): add semantic color tokens for high-frequency colors
Add design tokens for frequently used hardcoded colors:
- Surface colors: surfaceSecondary (11 uses), surfaceTertiary (9 uses), surfaceInfo (4 uses), surfaceInfoLight (3 uses)
- Border colors: borderSecondary (5 uses), borderTertiary (5 uses), borderQuaternary (5 uses)
- Status colors: success (4 uses), warning (4 uses), error (3 uses)
- Text colors: textSecondary (4 uses)

These tokens will enable migration of hardcoded Color() values in pages.
2026-03-02 16:22:25 +08:00
qzl 971ba30032 test: add unit tests for load_user_agent_catalog function
- test_user_agent_catalog_file_exists_and_has_required_fields: verifies catalog file exists with correct structure
- test_load_user_agent_catalog_raises_on_invalid_structure: verifies invalid YAML is properly rejected
2026-03-02 16:05:30 +08:00
qzl 4afc67b7a8 feat: extend init_data to load and sync user_agent_catalog
- Add UserAgentCatalogSeed and UserAgentCatalogYaml Pydantic models
- Add load_user_agent_catalog function to load from YAML
- Add _upsert_user_agent_catalog helper for upsert logic
- Add initialize_user_agent_catalog function for initialization
- Refactor initialize_data to call initialize_llm_catalog and initialize_user_agent_catalog
- Fix UserAgentCatalog.llm_id type from str to uuid.UUID
2026-03-02 15:58:13 +08:00
qzl fb8f4fdeeb fix(migration): allow multiple agents per user (one per agent_type)
- Drop single-column UNIQUE constraint on user_agents.user_id
- Add composite UNIQUE constraint on (user_id, agent_type)
- Enables trigger to insert 3 agents per user (INTENT_RECOGNITION, TASK_EXECUTION, RESULT_REPORTING)
- Maintain reversible downgrade path
2026-03-02 15:51:04 +08:00
qzl 27b09ce9c0 feat(migration): add user_agent_catalog table and update trigger 2026-03-02 15:36:25 +08:00
qzl 97626ec2c4 feat(models): add UserAgentCatalog model 2026-03-02 15:31:20 +08:00
qzl 06e9a25f57 feat(config): add user_agent_catalog.yaml with default agent configs 2026-03-02 15:27:24 +08:00
qzl bc40bc36c2 docs: add bug fix implementation plan 2026-03-02 15:19:22 +08:00
qzl 3528697302 docs: add bug fix design for TRIGGER-001 and TOKEN-001 2026-03-02 15:15:51 +08:00
qzl e161ca22c4 refactor(chat): 重构聊天模块并集成历史消息加载功能
- 删除冗余的 chat_history_repository 和 home_mock_data
- 简化 ag_ui_event fromJson 使用工厂映射表
- 提取 ChatBloc 事件处理方法,添加 loadHistory/loadMoreHistory
- HomeScreen 集成 ChatBloc 实现历史消息加载和下拉刷新
- 更新 AGENTS.md 文档约束
2026-03-02 15:05:10 +08:00
qzl 6b32990986 refactor: 重构 config 目录结构,按领域分类静态配置 2026-03-02 14:40:45 +08:00
qzl 87b8727ca4 docs: 添加 AG-UI 协议规则约束到 apps/AGENTS.md 2026-03-02 11:17:20 +08:00
qzl 99d540a18d refactor: 重命名 agent_chat 模块为 agent 2026-03-02 11:13:20 +08:00
qzl 2ac56e5084 docs: 整理 runtime 系列文档,修正 API 端点名称 2026-03-02 10:55:46 +08:00
qzl c3192a2431 feat(chat): add ChatBubble widget and mock data for home screen
- Add ChatBubble reusable widget for chat messages
- Add HomeMockData for chat list mock data
- Add HomeScreen widget tests
- Add AG-UI chat design and implementation plan docs
- Add friendship design docs
- Ignore backend/logs directory
2026-02-28 14:47:33 +08:00
qzl 534efd182b feat(chat): implement AG-UI protocol AI chat feature
- Add AG-UI event models with wire protocol mapping
- Implement ToolRegistry with create_calendar_event tool
- Create AiDecisionEngine for intent matching
- Add AgUiService with mock event stream support
- Implement ChatBloc for state management
- Create UiSchemaRenderer with design tokens
- Integrate ChatBloc into HomeScreen
- Add ChatHistoryRepository with shared_preferences
- Add comprehensive unit tests (97 tests)
- Fix ChatBloc event callback initialization
2026-02-28 14:44:16 +08:00
qzl d37677c533 fix(chat): fix ChatBloc event callback and test reliability
- Fix onEvent callback initialization in ChatBloc constructor
- Add MockAgUiService to isolate test from mock API behavior
- Remove unnecessary non-null assertions in tests
2026-02-28 14:41:21 +08:00
qzl 92781ddbbe test(chat): add comprehensive unit tests 2026-02-28 13:49:51 +08:00
qzl dd90f48c6f feat(chat): integrate ChatBloc into HomeScreen 2026-02-28 13:43:22 +08:00
qzl f82a8072a2 feat(chat): add ChatHistoryRepository with shared_preferences 2026-02-28 13:41:58 +08:00
qzl e1973a9868 feat(chat): add ChatBloc for state management 2026-02-28 13:40:46 +08:00
qzl d12f846cc0 feat(chat): add UiSchemaRenderer with design tokens 2026-02-28 13:38:58 +08:00
qzl 1fd33c57a7 feat(chat): add AgUiService with mock event stream 2026-02-28 13:38:26 +08:00
qzl 7e0e6457d7 feat(chat): add AiDecisionEngine with force trigger support 2026-02-28 13:36:59 +08:00
qzl f0ae3b31e2 feat(chat): add ToolRegistry with validation 2026-02-28 13:36:30 +08:00
qzl bc7bfa0692 feat(chat): add ChatListItem models in chat feature 2026-02-28 13:36:08 +08:00
qzl e20b5e0b4f feat(chat): add AG-UI event models with wire protocol mapping 2026-02-28 13:34:55 +08:00
qzl 4044b50cf9 feat(chat): add ToolResult and UiCard models 2026-02-28 13:33:08 +08:00
qzl b90d1587c5 chore(chat): add json_annotation and shared_preferences deps 2026-02-28 13:29:47 +08:00
qzl b417bc800a Merge branch 'feature-calendar-sharing' into dev 2026-02-28 13:28:49 +08:00
qzl 62500160ae fix: add type annotations to PermissionBits 2026-02-28 13:26:20 +08:00
qzl c22692ed1d refactor: simplify code - extract constants, reduce complexity 2026-02-28 12:48:01 +08:00
qzl ce8cd1d31f fix: address CRITICAL security issues - permission escalation and encoding inconsistency 2026-02-28 12:40:40 +08:00
qzl 173d91086f test: add calendar sharing tests and update API docs 2026-02-28 12:28:45 +08:00
qzl 330589f702 Merge remote-tracking branch 'origin/feature/friendship' into dev 2026-02-28 12:22:18 +08:00
qzl 2b40d08c78 docs: add Friends API documentation to runtime-route.md 2026-02-28 12:19:02 +08:00
qzl e0cd20f16e test: add integration tests for friendship routes 2026-02-28 12:16:06 +08:00
qzl 7a49783156 feat: add share calendar API 2026-02-28 12:15:59 +08:00
qzl 4c4f253c11 feat(friendships): implement dependencies and router with CRUD endpoints 2026-02-28 12:10:03 +08:00
qzl 709ae5ab73 feat: add inbox messages module for calendar invitations 2026-02-28 12:09:34 +08:00
qzl ea4a50d79c feat(friendships): add structured logging to FriendshipService 2026-02-28 12:08:01 +08:00
qzl b66a8499ed fix: change friendship status values from accepted/pending to active in tests 2026-02-28 12:04:26 +08:00
qzl 17551d662b feat(friendships): implement FriendshipService with TDD
- Add send_request(), accept_request(), decline_request(), cancel_request()
- Add get_inbox(), get_outgoing_requests(), get_friends_list(), remove_friend()
- Add unit tests for all service methods (14 tests)
- Update FriendRequestResponse schema to include 'canceled' status
- Follow async SQLAlchemy patterns and BaseService conventions
2026-02-28 12:01:57 +08:00
qzl 0dfc52cbf7 fix: improve friendships schemas type safety and consistency 2026-02-28 11:35:13 +08:00
qzl 9b48939de8 fix: address code review issues and improve code quality
- Add owner_id check in repository delete operation
- Fix time range validation for partial updates
- Wrap pre-query in try/except for consistent error handling
- Use default_factory instead of mutable defaults
- Add max_length constraint for timezone field
- Remove unused dependencies and empty validators
- Extract magic numbers to constants
- Simplify update logic with model_dump
2026-02-28 11:34:49 +08:00
qzl 50b38de488 feat: add schedule items CRUD API
- Add ScheduleItem Pydantic schemas with metadata support
- Add repository layer with CRUD operations
- Add service layer with authorization
- Add FastAPI router with all endpoints
- Add unit and integration tests
- Update API documentation
2026-02-28 11:34:49 +08:00
qzl 598c6c2ec5 feat(friendships): create module structure and schemas 2026-02-28 11:30:18 +08:00
qzl dbd3f68dd4 test: add invite code validation tests and fix migration rollback
- Add TestInviteCodeSignup integration tests for valid/invalid invite codes
- Fix migration downgrade: avoid dropping trigger dependency
- Add DB CHECK constraint for invite_codes.code format
- Update runtime-route.md with invite_code documentation
- Update runtime-runbook.md with change log
2026-02-28 10:56:09 +08:00
qzl 3d6ae7695f refactor: 优化日历状态管理与首页输入框,添加API客户端抽象 2026-02-27 18:36:21 +08:00
qzl 80d04688fc feat: add invite code feature (create, validate, referrer tracking) 2026-02-27 17:27:55 +08:00