iconsulting/scripts
hailin 8e4bd95dda feat(agents): add Collection Expert specialist + admin directive system
## Part A: Collection Expert Specialist Agent (7th specialist)
- New specialist: CollectionExpertService (Haiku 4.5, maxTurns 2)
  - Analyzes user info completeness against 12-item weighted checklist
  - Identifies missing fields, recommends next questions
  - Category-specific priority adjustments (QMAS/GEP/IANG/TTPS/CIES/TechTAS)
  - Tools: search_knowledge, get_user_context
  - Admin directive injection: loads active directives from DB before each run
- Prompt: collection-expert-prompt.ts (completeness calc, validation rules, JSON output)
- Coordinator integration: invoke_collection_expert tool + case in executeAgentTool
- System prompt: section 2.6 usage guide, section 4.3 optional invocation reference

## Part B: Admin Directive System (parallel to assessment directives)
- ORM: CollectionDirectiveORM (collection_directives table)
  - Types: general, priority, category, validation
  - Multi-tenant with tenant_id + enabled indexes
- SQL: CREATE TABLE collection_directives in init-db.sql
- Controller: /conversations/admin/collection-directives (10 REST endpoints)
  - CRUD + toggle + reset + preview + AI chat
- Chat Service: CollectionDirectiveChatService (Haiku 4.5 tool loop)
  - 5 tools: list/create/update/delete/reset directives
  - mutated flag for frontend cache invalidation

## Part C: Frontend Admin-Client
- Feature module: features/collection-config/ (5 files)
  - API client, React Query hooks, Config page, Chat drawer
  - Directive types: 通用指令/优先级调整/类别配置/验证规则
- Route: /collection-config in App.tsx
- Sidebar: FormOutlined icon, label '收集指令' in MainLayout.tsx

Files: 11 new, 9 modified | Backend + frontend compile clean

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:07:33 -08:00
..
migrations fix(db): drop files_user_id_fkey — anonymous users may not exist in users table 2026-02-07 08:11:37 -08:00
deploy.sh feat(scripts): add unified deployment management script 2026-01-09 19:45:47 -08:00
docker-entrypoint.sh feat(multi-tenant): add super admin module and user profile pages 2026-01-26 06:41:11 -08:00
init-db.sql feat(agents): add Collection Expert specialist + admin directive system 2026-02-08 20:07:33 -08:00
package.json feat(multi-tenant): add super admin module and user profile pages 2026-01-26 06:41:11 -08:00
seed.ts feat(multi-tenant): add super admin module and user profile pages 2026-01-26 06:41:11 -08:00
setup-kong.sh Initial commit: iConsulting 香港移民咨询智能客服系统 2026-01-09 00:01:12 -08:00
setup-network.sh Initial commit: iConsulting 香港移民咨询智能客服系统 2026-01-09 00:01:12 -08:00
tsconfig.json feat(multi-tenant): add super admin module and user profile pages 2026-01-26 06:41:11 -08:00