refactor(shared): centralize configuration and types

Migrate configuration validation and core moderation types from individual services to the `@bete/shared` package to ensure consistency across the monorepo.

- Move `AppConfig` and moderation-related interfaces to `packages/shared`.
- Replace service-specific Zod schemas with the centralized shared configuration.
- Refactor `services/backend` and `services/discord-gateway` to consume shared config and types.
- Remove redundant type definitions and local configuration logic in services.
- Update `packages/shared` exports to include new `config` and `moderation-types` modules.
- Clean up unused files and deprecated utility functions in `packages/shared`.
This commit is contained in:
MythEclipse
2026-06-09 11:56:03 +07:00
parent f84b380f4f
commit 67d66bb5dd
26 changed files with 1193 additions and 1503 deletions
+3 -10
View File
@@ -49,8 +49,8 @@ BACKLOG_SYNC_BATCH_SIZE=100
# AI Analysis Configuration
AI_ANALYSIS_ENABLED=false
AI_LLM_API_KEY=your_9router_key_here
AI_LLM_BASE_URL=https://9router.asepharyana.tech/v1
AI_LLM_MODEL=free
AI_LLM_BASE_URL=https://9router.asepharyana.my.id/v1
AI_LLM_MODEL=text
# Vision model for image/video moderation (falls back to AI_LLM_MODEL if unset)
AI_LLM_VISION_MODEL=multimodal
# Max concurrent LLM API calls (default: 5)
@@ -110,7 +110,7 @@ AUTO_DELETE_FLAGGED_ENABLED=true
AUTO_DELETE_FLAGGED_DRY_RUN=true
AUTO_DELETE_FLAGGED_DELAY_MS=0
AUTO_DELETE_MIN_CONFIDENCE=0.50
AUTO_DELETE_ALLOWED_SEVERITIES=critical,high,medium
AUTO_DELETE_ALLOWED_SEVERITIES=critical,high,medium,low
AUTO_DELETE_NOTIFY_USER=false
# Optional: comma-separated channel/user IDs to exclude
# AUTO_DELETE_EXCLUDED_CHANNEL_IDS=
@@ -134,10 +134,3 @@ AUTO_MIGRATE_ON_STARTUP=true
# Worker Pool Configuration
# PISCINA_MAX_THREADS=4
# Cache Model Versioning
# Bump this version when the vision/LLM model prompt changes significantly.
# Old cache entries with mismatched versions are automatically ignored, forcing fresh analysis.
# Format: "v<N>" or "v<N>-<date>-<description>"
# Example progression: v1 → v2-2026-06-02-terminal-fix → v3-2026-06-15-new-model
# CACHE_MODEL_VERSION=v2-2026-06-02